Closed stoeffel closed 4 years ago
I went back and forth on this. I decided it would be safer to have there in case it becomes more important at some point for encoding literals (e.g., version difference), but if this is important for your use case I suppose I'm fine getting rid of it. I could also imagine having a undefinedConnection :: PGConnection
for use with it, though that does feel a bit messy. @jwoudenberg any thoughts, since you requested this?
I guess we could also just make it take a PGTypeEnv
and then it's up to you what to pass. Maybe that's the best option.
Full disclosure: Stoeffel and I work on the same team :). Your original change was super useful, and having a simple function to turn a query into a string prompted further use cases, that made us wonder if we could do without the connection string. It's not exactly a blocker because, as you said, we could pass in undefined
, but yeah, feels messy.
I guess we could also just make it take a
PGTypeEnv
and then it's up to you what to pass. Maybe that's the best option.
I really like this!
I guess we could also just make it take a PGTypeEnv and then it's up to you what to pass. Maybe that's the best option.
Yes, I was actually thinking about that initially as well, but thought that it's not really used. I can make that change to the PR if you'd like me to.
Sure, thanks, I'll happily merge the PGTypeEnv
version if you want to do that.
@dylex I've made the change. Thanks for your responsiveness!
Thanks! I'll try to get a new release out in the next few days. (Trying to decide on some unrelated switches to vector first.)
@dylex In case your interested, this is why we wanted this change. https://dev.to/noredink/type-safe-mysql-queries-via-postgres-5cnk
@stoeffel Cool, thanks for the link. I think I saw a talk from you guys at the Compose conference earlier this year. I know I owe you a release, too -- hopefully that's not blocking anything.
nope not blocking at all. we just use the commit hash. that was probably Richard Feldman :-) maybe we'll see us at some conf as well.
We have a need for using
getQueryString
, but we don't have access to aPGConnection
. I don't have full context on how the internals of postgresql-typed works, but I think it's actually not necessary for the function. This would be awesome for our usecase, though. Does this change make sense to you? Is there something you'd like me to adjust?