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
664d50fab8
fix(ext/node): Fix handling of sqlite large integers ( #28193 )
...
Use `v8::Number` instead of `v8::Integer` to handle > i32::MAX.
Fixes https://github.com/denoland/deno/issues/28187
2025-02-20 16:32:46 +05:30
Gowtham K
9b9eeabcc8
fix(node/sqlite): sqlite named parameters ( #28154 )
...
This PR introduces support for named parameters in SQLite queries, as
outlined in #28134
2025-02-18 22:03:39 +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
4a2b8fc22d
fix(ext/node): expose sqlite changeset constants ( #27992 )
...
https://nodejs.org/api/sqlite.html#sqliteconstants
2025-02-06 13:08:40 +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
c2832d70a1
fix(ext/sqlite): add sourceSQL
and expandedSQL
getters ( #27921 )
2025-02-04 17:38:41 +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
7d19668255
fix(ext/node): throw RangeError when sqlite INTEGER is too large ( #27907 )
...
Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-02-01 13:19:53 +05:30
Divy Srivastava
1cbaee9f52
fix(ext/node): sqlite bind support bigint values ( #27890 )
2025-01-31 18:31:05 +05:30
Divy Srivastava
057f257052
fix(ext/node): represent sqlite blob as Uint8Array ( #27889 )
2025-01-31 17:53:48 +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