Divy Srivastava
ff2354be0b
fix(ext/node): Fix Database#exec
should return undefined ( #29368 )
2025-05-19 19:20:49 -07:00
Divy Srivastava
5044f2f355
fix(ext/node): hold weak reference to sqlite database in instances ( #29210 )
...
Deterministic close and releases file lock on Windows.
Fixes https://github.com/denoland/deno/issues/29033
2025-05-10 09:21:53 +05:30
snek
5c6c52d132
fix: update deno_core ( #29166 )
...
for https://github.com/denoland/deno_core/pull/1111
2025-05-05 13:58:34 -05:00
Divy Srivastava
81a4f9e502
fix(ext/node): implement DatabaseSync#loadExtension ( #29050 )
...
Requires full `--allow-ffi`
Fixes https://github.com/denoland/deno/issues/29030
2025-04-29 12:30:21 +00:00
c00kie17
208992ad53
fix(ext/node): sqlite error details ( #28431 )
...
Improves SQLite error reporting by including `err_code`, `err_str`,
matching Node.js behavior.
Fixes #28289
2025-03-22 07:52:22 +05:30
Divy Srivastava
fb3df15fc8
fix(ext/node): restrict ATTACH DATABASE statement ( #28513 )
...
Disable `ATTACH DATABASE` statement in `node:sqlite` since it is not
supervised by Deno's permission system
2025-03-18 22:03:35 +05:30
Divy Srivastava
c1276d8fa0
fix(ext/node): rewrite SQLite named parameter handing ( #28197 )
...
Allow bare named params and handle invalid param name. Also adds
`StatementSync#setAllowBareNamedParameters`
Fixes https://github.com/denoland/deno/issues/28183
2025-02-20 18:34:34 +05:30
Divy Srivastava
4ab380e0a7
fix(ext/node): implement StatementSync#iterate ( #28168 )
...
Fixes https://github.com/denoland/deno/issues/28130
2025-02-18 21:26:17 +05:30
Divy Srivastava
196ceb76bb
fix(ext/node): DatabaseSync#exec
should execute batch statements ( #28053 )
...
Fixes https://github.com/denoland/deno/issues/28050
2025-02-11 19:52:33 +05:30
Divy Srivastava
28faaee772
fix(ext/node): throw Session methods when database is closed ( #27968 )
2025-02-06 08:52:49 +05:30
Divy Srivastava
ece384c094
fix(ext/node): implement DatabaseSync#applyChangeset()
( #27967 )
...
https://nodejs.org/api/sqlite.html#databaseapplychangesetchangeset-options
```js
const sourceDb = new DatabaseSync(':memory:');
const targetDb = new DatabaseSync(':memory:');
sourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
targetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');
const session = sourceDb.createSession();
const insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');
insert.run(1, 'hello');
insert.run(2, 'world');
const changeset = session.changeset();
targetDb.applyChangeset(changeset);
// Now that the changeset has been applied, targetDb contains the same data as sourceDb.
```
2025-02-06 08:52:39 +05:30
Divy Srivastava
28834a89bb
fix(ext/node): implement SQLite Session API ( #27909 )
...
https://nodejs.org/api/sqlite.html#class-session
---------
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-02-04 21:59:13 +05:30
Divy Srivastava
b5c3f4f782
fix(ext/node): support read-only database in node:sqlite
( #27930 )
...
Implements the `readOnly` option for `DatabaseSync`.
Permissions:
`--allow-read=test.db --allow-write=test.db` => all works
`--allow-read=test.db` => only `readOnly` dbs work, cannot create new db
2025-02-03 16:41:45 +05:30
Divy Srivastava
3c56e6c7cd
fix(ext/node): enforce -RW perms on node:sqlite
( #27928 )
...
require RW permission on the database path except when using in-memory
mode.
2025-02-02 15:49:39 +05:30
Divy Srivastava
aeac5a6338
feat(ext/node): implement node:sqlite
( #27308 )
...
Depends on:
- https://github.com/denoland/deno_core/pull/994
- https://github.com/denoland/deno_core/pull/993
- https://github.com/denoland/deno_core/issues/999
- https://github.com/denoland/deno_core/pull/1000
- https://github.com/denoland/deno_core/pull/1001
Closes https://github.com/denoland/deno/issues/24828

---------
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-01-28 19:30:03 +05:30