prisma / quaint

SQL Query AST and Visitor for Rust
Apache License 2.0
583 stars 61 forks source link

Do not override default search path on postgres #298

Closed tomhoule closed 3 years ago

tomhoule commented 3 years ago

Before this commit, when there is no schema parameter in a postgres database URL, we will act as if public was explicitly provided, and issue a SET search_path = "public"; when we initialize a connection.

The problem is that users may want to use the default search path for the user. In this case, we should not explicitly set the search path. See this issue for a motivating example: https://github.com/prisma/prisma/issues/7370

With this commit, when no schema is specified in the database URL, we do not set the search path anymore.

PS: couldn't figure out a way to easily test this off the top of my head, but I can try harder.