Skip to content

[BUG]: better-sqlite3 example at https://orm.drizzle.team/docs/get-started-sqlite doesn't work: db.execute is not a function #5070

@The-Alchemist

Description

@The-Alchemist

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.44.7

What version of drizzle-kit are you using?

0.31.7

Other packages

[email protected]

Describe the Bug

> cat test.js
import { drizzle } from 'drizzle-orm/better-sqlite3';
import Database from 'better-sqlite3';

const sqlite = new Database('sqlite.db');
const db = drizzle({ client: sqlite });

const result = await db.execute('select 1');
> node test.js

file:///private/tmp/test/test.js:7
const result = await db.execute('select 1');
                        ^

TypeError: db.execute is not a function
    at file:///private/tmp/test/test.js:7:25
    at ModuleJob.run (node:internal/modules/esm/module_job:377:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:691:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)

Node.js v24.11.0

package.json

{
  "dependencies": {
    "better-sqlite3": "^12.4.6",
    "drizzle-orm": "^0.44.7"
  },
  "devDependencies": {
    "@types/better-sqlite3": "^7.6.13",
    "drizzle-kit": "^0.31.7"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions