drizzle-team / drizzle-team/drizzle-orm

[DOCS]: `import { Pool } from 'pg'` is a wrong statement, you should not use it in the docs

Open
#4,340 2 comments 2 reactions 0 assignees View on GitHub
db/postgres docs docs/incorrect priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Enhancement hasn't been filed before.

- [x] I have verified this enhancement I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

Your docs use the statement `import { Pool } from 'pg'`

https://orm.drizzle.team/docs/get-started-postgresql#step-2---initialize-the-driver-and-make-a-query

It is wrong. `node-postgres` does not support esm import. The author has confirmed that.

https://github.com/brianc/node-postgres/pull/3191

```
import { Pool } from 'pg'
^^^^
SyntaxError: Named export 'Pool' not found. The requested module 'pg' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'pg';
const { Pool } = pkg;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.