mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

How to set the "current schema" ? #236

Open guizmaii opened 6 years ago

guizmaii commented 6 years ago

Hi,

I have a DB partitioned in multiple schemas (because it's what Flyway advises for multi-modules project: https://github.com/flyway/flyway/issues/852#issuecomment-58181326) and I don't find how to specify the schema used by the connection.

the currentSchema connection parameter from JDBC Postgres (https://jdbc.postgresql.org/documentation/head/connect.html) seems no to be supported. I have the following error withthis kind of connection url jdbc:postgresql://localhost:5432/mydb?currentSchema=myschema:

[info]   java.nio.channels.UnresolvedAddressException:
[info]   at sun.nio.ch.Net.checkAddress(Net.java:101)
[info]   at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:622)
[info]   at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:83)
[info]   at io.netty.util.internal.SocketUtils$3.run(SocketUtils.java:80)
[info]   at java.security.AccessController.doPrivileged(Native Method)
[info]   at io.netty.util.internal.SocketUtils.connect(SocketUtils.java:80)
[info]   at io.netty.channel.socket.nio.NioSocketChannel.doConnect(NioSocketChannel.java:244)
[info]   at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.connect(AbstractNioChannel.java:205)
[info]   at io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1234)
[info]   at io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:539)
[info]   …

Is there a way to specify this parameter ?

Thanks, Jules