drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: Cannot connect to Goolge Cloud SQL for PostgreSQL
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
Cannot connect to Goolge Cloud SQL for PostgreSQL. I'm still exploring the way.
below code is my code:
```
import { drizzle } from 'drizzle-orm/node-postgres'
import pg from 'pg'
import { Connector } from '@google-cloud/cloud-sql-connector';
const {Pool} = pg;
const connector = new Connector();
const clientOpts = await connector.getOptions({
instanceConnectionName: 'my-project:region:my-instance',
ipType: 'PUBLIC',
});
const pool = new Pool({
...clientOpts,
user: 'my-user',
password: 'my-password',
database: 'db-name',
max: 5,
});
const db = drizzle({ client: pool });
const result = await db.execute('select NOW()');
console.log('yes!',result)
```
Contributor guide
Assessment
This issue has not been assessed yet.