prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
582 stars 62 forks source link

feat(pg): optimize search_path network roundtrip #448

Closed Weakky closed 1 year ago

Weakky commented 1 year ago

Overview

Avoids a network roundtrip at connection to set the search path when possible.

We decide whether we do that roundtrip based on the Postgres flavour set with the URL. In the QE, that flavour is set based on the provider used in the schema.

The different behaviours are:

Note: This is a breaking change for CRDB users that use Postgres as a provider in their schema and who have a schema named that requires to be escaped quoted.

pimeys commented 1 year ago

Not sure what to do about @pimeys 's comment about reserved keywords. It's an edge case but it's a very valid point.

user is even a very common name on the databases...