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
Document how to use TypeORM #112
Comments
Seems to work in typeorm if you use the extra block: const connector = new Connector();
const clientOpts = await connector.getOptions({
instanceConnectionName: '<connection_name>',
ipType: IpAddressTypes.PRIVATE,
authType: AuthTypes.IAM,
});
return {
type: 'postgres',
username: '<username>',
database: '<database>',
extra: {
...clientOpts,
max: 5,
},
synchronize: true,
autoLoadEntities: true,
}; |
That's great news. In that case, this is just a docs issue. |
FYI: TypeORM actually also supports automatic IAM authentication without the need for the use of this Connector library at all. typeorm/typeorm#4724 You can leverage passing a function to the |
seems to me the connector option with the configuration shared by @tjhiggins is lower maintenance and better supported. |
Both are feasible options. It depends on a person's appetite for adopting a Connector vs a generic Postgres interface. |
@jackwotherspoon, @chadxz, @enocom, @tjhiggins
new DataSource({
type: 'mssql',
host: '0.0.0.0', // dummy due to tedious bug
username: 'my-user',
password: 'my-password',
database: 'my-database',
extra: {
options: {
...clientOpts,
},
},
}) However, I see that upgrade of |
Ah, of course, this was released in a new major version of However, Before |
Created PR in cc: @jackwotherspoon, @chadxz, @enocom, @tjhiggins |
Wow! Thanks so much @edosrecki we really appreciate the contributions you are making 😄 |
Happy to contribute. I discovered a bug in |
That sounds good 👍 we'll keep a close eye on that PR 👀 |
@tjhiggins Is working for you with Typeorm? We are using mysql2 with Typeorm v2, but not working at all after deploying to Cloud Run.
|
I can only confirm it worked with postgres. It seems like it's still an issue with MySQL based on: |
It works with ALL drivers, however, not officially with SQL Server ( |
This is working for me only when using the pg package. If pg-native is installed then TypeORM will automatically use that instead and this config doesn't work. |
Adds TypeORM samples along with a new CI target to run tests against the provided samples, making sure they're always valid usage. Fixes: #112
Adds TypeORM samples along with a new CI target to run tests against the provided samples, making sure they're always valid usage. Fixes: #112
@ruyadorno shall we open an issue for pg-native support? Since it uses libpq under the hood, I wouldn't expect the connector to work with it. |
Adds TypeORM samples along with a new CI target to run tests against the provided samples, making sure they're always valid usage. Fixes: #112
Adds TypeORM samples along with a new CI target to run tests against the provided samples, making sure they're always valid usage. Fixes: #112
Adds TypeORM samples along with a new CI target to run tests against the provided samples, making sure they're always valid usage. Fixes: #112 Co-authored-by: Jack Wotherspoon <jackwoth@google.com>
it might also be an opportunity to wait and see if the community will ask for it instead |
Issue to track interest in support for TypeORM with the Cloud SQL Node.js Connector.
Upvoting this issue 👍 will help us prioritize support.
The text was updated successfully, but these errors were encountered: