Skip to content
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

node:sqlite can not executing more SQL statements #28050

Closed
linbingquan opened this issue Feb 11, 2025 · 0 comments · Fixed by #28053
Closed

node:sqlite can not executing more SQL statements #28050

linbingquan opened this issue Feb 11, 2025 · 0 comments · Fixed by #28053
Labels
node compat node:sqlite Issues related to the `node:sqlite` module

Comments

@linbingquan
Copy link
Contributor

Deno can not work, Node can work

import { rmSync } from 'node:fs'
import { DatabaseSync } from 'node:sqlite'

rmSync('./sqlite.db', { force: true })

const database = new DatabaseSync('./sqlite.db')

database.exec(`CREATE TABLE one(id int PRIMARY KEY) STRICT;
CREATE TABLE two(id int PRIMARY KEY) STRICT;`)

const table = database.prepare(`SELECT name FROM sqlite_master WHERE type='table'`).all()

// Deno log { name: 'one' }
// Node log { name: 'one' }, { name: 'two' }
console.log(table)

Deno and Node can work

import { rmSync } from 'node:fs'
import { DatabaseSync } from 'node:sqlite'

rmSync('./sqlite.db', { force: true })

const database = new DatabaseSync('./sqlite.db')

database.exec(`CREATE TABLE one(id int PRIMARY KEY) STRICT;`)
database.exec(`CREATE TABLE two(id int PRIMARY KEY) STRICT;`)

const table = database.prepare(`SELECT name FROM sqlite_master WHERE type='table'`).all()

// log { name: 'one' }, { name: 'two' }
console.log(table)
deno --version
deno 2.1.9+e94581d (canary, release, x86_64-pc-windows-msvc)
v8 13.0.245.12-rusty
typescript 5.7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node compat node:sqlite Issues related to the `node:sqlite` module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants