-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Is there no way to create a connection pool using a database URI? #1669
Comments
What makes you think it doesnt work ? they both work :
|
PoolConfig does accept string argument: Line 22 in 21b13a0
node-mysql2/lib/pool_config.js Line 8 in 21b13a0
|
@rafipiccolo @sidorares You're right it does work. But according to the typescript types in the promise package, https://github.com/sidorares/node-mysql2/blob/master/promise.d.ts#L144-L148 export function createConnection(connectionUri: string): Promise<Connection>;
export function createConnection(
config: ConnectionOptions
): Promise<Connection>;
export function createPool(config: PoolOptions): Pool; So you get a typescript error if you pass it a connection string: |
I'm using planetscale which injects a
DATABASE_URL
env variable.createConnection
accepts a connection string, butcreatePool
does not. Is there any way to create a connection pool with a database url?The text was updated successfully, but these errors were encountered: