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

Improved connection configuration #185

Open erimatnor opened 8 years ago

erimatnor commented 8 years ago
evanbennett commented 8 years ago

Would statementTimeout be better as an Option[Duration] defaulting to None, and then the SET statement_timeout query only gets sent if it is Some(...)?

Also, the Configuration ScalaDoc was not updated for the new arguments.

erimatnor commented 8 years ago

@evanbennett Yes,the Option approach might be better since it means using the default database setting in case of None. I will fix that and the ScalaDocs.

erimatnor commented 8 years ago

@evanbennett PR updated. One other thing is that I didn't put the new configuration options in the Configuration class at the end of the parameter list. Instead I opted to put them in their logical places (Netty-stuff together, timeouts together). This might be bad for compatibility in case someone creates a Configuration without named parameters. Opinions?

mauricio commented 8 years ago

@erimatnor do you mind including this for MySQL as well? http://mysqlserverteam.com/server-side-select-statement-timeouts/

Also, the option should come at the end since both of them use the same type and could get mixed if named parameters are not in use.