Render SQL statements in a single line.#103
Render SQL statements in a single line.#103k0001 wants to merge 1 commit intotomjaguarpaw:masterfrom
Conversation
This change makes it easier to grep for queries in PostgreSQL's log, as well as copy-pasting said queries.
There was a problem hiding this comment.
Minor test to check whether newlines are preserved in strings. They are.
|
I'm not opposed to this but I'd prefer to hear from others what they think first. On the other hand I would happily merge a flag to choose SQL formatting style. |
|
Sure, let's discuss it. A couple of more comments/opinion about this:
|
|
It would be great if there were a flag of some sort, like Tom mentioned. Exposing a higher-order function might be a good way to implement this. I like the one-line format should be the default for postgresql consumption, like @k0001 said. I definitely use the pretty printing functions for debugging, and I really like having the indentation for those purposes. |
|
I could see the ability to choose being useful for us. We'd just stick this in our Config so our library's interface wouldn't change regardless of opaleye's implementation. |
|
I've been super busy, so got behind with PRs. Renzo, ultimately I like your idea that what is sent over the wire should be on a single line. We should have two separate functions |
|
Sorry this has been languishing. I've remained super busy. I'm happy for the SQL that goes over the wire to be on a single line. I think we should preseve the existing behaviour of functions in Could you make those changes and rebase to HEAD? Then I'll be happy to merge. |
This change makes it easier to grep for queries in PostgreSQL's log, as well as copy-pasting said queries.