-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting connection runtime options #14
Comments
Just to make sure I'm understanding the question - these are options that need to be set just after connection on each individual connection in the pool (before the connection is added to the pool) correct? |
Yep, that's the way PostgreSQL runtime opts work: http://www.postgresql.org/docs/9.2/static/sql-set.html |
@moll - I added an option to specify a
Since this is the actual connection - you'll need to use it like you would in the pg module. Let me know if this works alright, or if there's anything that could be improved here. |
Nice work. Though, one thing, I think the naming for |
Oh and why not pass the error given to the callback by |
Yeah, I'm going to take a closer look at cleaning up the pool error handling in general, related to #4... but are you thinking that it should be something along the lines of:
|
If you agree with |
By passing the error on, I meant instead of: this.beforeCreate(conn, function() {
callback(null, conn);
}); do this.beforeCreate(conn, function(err) {
callback(err, conn);
}); |
@moll - 0.1.6 is out... with both of the changes you suggested :) |
Superb. |
Add custom migration stub documentation
Hey,
I need to
SET
a few PostgreSQL options right after connecting. Where have you envisioned such settings to take place?I see
getRawConnection
inpostgres.js
is reponsible for creating a new connection — that could be a place for a temporary injection, but what are your thoughts for long term?The text was updated successfully, but these errors were encountered: