Skip to content

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

Open
@chmod777john

Description

@chmod777john

Enhancement hasn't been filed before.

  • 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.

brianc/node-postgres#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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions