Skip to content

export PostgresTextEncoder #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

export PostgresTextEncoder #4

wants to merge 1 commit into from

Conversation

schultek
Copy link
Contributor

Can we do this please? I need to use the .convert() method directly in my project.

Can we do this please? I need to use the `.convert()` method directly in my project.
@isoos
Copy link
Owner

isoos commented Apr 13, 2021

@schultek: Can you please shed some light on the use case?

@schultek
Copy link
Contributor Author

Sure. I need to build a rather complex sql query as a string. The generation of the query string is distributed across multiple classes and methods up to a point, where it is simply not feasible anymore to use substitutionValues in the .query call at the very end. So I need a way to properly encode my values in the query.
Currently I have my own text encoding function, but I was realizing that I shouldn't need to do this since it already exists.

@schultek
Copy link
Contributor Author

Wait I just was totally stupid. I just can directly do import 'package:postgres/src/text_codec.dart'; 🙄

@schultek
Copy link
Contributor Author

Sorry for bothering you. 😅✌️

@schultek schultek closed this Apr 13, 2021
@schultek schultek deleted the patch-1 branch April 13, 2021 20:53
@isoos
Copy link
Owner

isoos commented Apr 13, 2021

No worries, however, this may be still a good idea to export, although not as part of the postgres.dart library, maybe as another query_builder.dart or similar lib. Another thing to consider: this is a single-method class, which could be a top-level method instead.

So, if you are still interested, I'd happily consider it as part of a library as a top-level method (which internally could just create an instance and call convert on it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants