@gjsify/sqlite 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/database-sync.js +2 -2
- package/lib/esm/param-binding.js +1 -1
- package/lib/esm/parameter-syntax.js +1 -0
- package/lib/esm/parse-sql.js +1 -0
- package/lib/esm/statement-sync.js +1 -1
- package/lib/types/database-sync.d.ts +1 -6
- package/lib/types/param-binding.d.ts +12 -5
- package/lib/types/param-binding.spec.d.ts +2 -0
- package/lib/types/parameter-syntax.d.ts +22 -0
- package/lib/types/parse-sql.d.ts +26 -0
- package/lib/types/statement-sync.d.ts +3 -3
- package/package.json +3 -3
package/lib/esm/database-sync.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{ConstructCallRequiredError as e,InvalidArgTypeError as t,InvalidStateError as n,InvalidUrlSchemeError as r,SqliteError as i}from"./errors.js";import{
|
|
2
|
-
`;)t++;i=t;continue}if(t===`/`&&a===`*`){let t=i+2;for(;t<r&&!(e[t]===`*`&&e[t+1]===`/`);)t++;i=t<r?t+2:r,n+=` `;continue}if(t===`'`||t===`"`||t==="`"||t===`[`){let a=t===`[`?`]`:t,o=t!==`[`,s=i+1;for(n+=t;s<r;){if(e[s]===a){if(o&&e[s+1]===a){n+=a+a,s+=2;continue}n+=a,s++;break}n+=e[s],s++}i=s;continue}if(t===`;`){flush(),i++;continue}n+=t,i++}return flush(),t}#u(e){let t=e.trim().toUpperCase();/\bBEGIN\b/.test(t)&&(this.#
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{ConstructCallRequiredError as e,InvalidArgTypeError as t,InvalidStateError as n,InvalidUrlSchemeError as r,SqliteError as i}from"./errors.js";import{convertParameterSyntax as a}from"./parameter-syntax.js";import{parseSql as o}from"./parse-sql.js";import{StatementSync as s}from"./statement-sync.js";import c from"@girs/gda-6.0";const l=Symbol.for(`sqlite-type`);function parsePath(e){if(typeof e==`string`){if(e.includes(`\0`))throw new t(`The "path" argument must be a string, Uint8Array, or URL without null bytes.`);return e}if(e instanceof URL){if(e.protocol!==`file:`)throw new r;let n=e.pathname;if(n.includes(`\0`))throw new t(`The "path" argument must be a string, Uint8Array, or URL without null bytes.`);return n}if(e instanceof Uint8Array){for(let n=0;n<e.length;n++)if(e[n]===0)throw new t(`The "path" argument must be a string, Uint8Array, or URL without null bytes.`);return new TextDecoder().decode(e)}throw new t(`The "path" argument must be a string, Uint8Array, or URL without null bytes.`)}function validateOptions(e){if(e===void 0)return{};if(typeof e!=`object`||!e)throw new t(`The "options" argument must be an object.`);let n=e,r={};if(n.open!==void 0){if(typeof n.open!=`boolean`)throw new t(`The "options.open" argument must be a boolean.`);r.open=n.open}if(n.readOnly!==void 0){if(typeof n.readOnly!=`boolean`)throw new t(`The "options.readOnly" argument must be a boolean.`);r.readOnly=n.readOnly}if(n.timeout!==void 0){if(typeof n.timeout!=`number`||!Number.isInteger(n.timeout))throw new t(`The "options.timeout" argument must be an integer.`);r.timeout=n.timeout}if(n.enableForeignKeyConstraints!==void 0){if(typeof n.enableForeignKeyConstraints!=`boolean`)throw new t(`The "options.enableForeignKeyConstraints" argument must be a boolean.`);r.enableForeignKeyConstraints=n.enableForeignKeyConstraints}if(n.enableDoubleQuotedStringLiterals!==void 0){if(typeof n.enableDoubleQuotedStringLiterals!=`boolean`)throw new t(`The "options.enableDoubleQuotedStringLiterals" argument must be a boolean.`);r.enableDoubleQuotedStringLiterals=n.enableDoubleQuotedStringLiterals}if(n.readBigInts!==void 0){if(typeof n.readBigInts!=`boolean`)throw new t(`The "options.readBigInts" argument must be a boolean.`);r.readBigInts=n.readBigInts}if(n.returnArrays!==void 0){if(typeof n.returnArrays!=`boolean`)throw new t(`The "options.returnArrays" argument must be a boolean.`);r.returnArrays=n.returnArrays}if(n.allowBareNamedParameters!==void 0){if(typeof n.allowBareNamedParameters!=`boolean`)throw new t(`The "options.allowBareNamedParameters" argument must be a boolean.`);r.allowBareNamedParameters=n.allowBareNamedParameters}if(n.allowUnknownNamedParameters!==void 0){if(typeof n.allowUnknownNamedParameters!=`boolean`)throw new t(`The "options.allowUnknownNamedParameters" argument must be a boolean.`);r.allowUnknownNamedParameters=n.allowUnknownNamedParameters}if(n.defensive!==void 0){if(typeof n.defensive!=`boolean`)throw new t(`The "options.defensive" argument must be a boolean.`);r.defensive=n.defensive}if(n.allowExtension!==void 0){if(typeof n.allowExtension!=`boolean`)throw new t(`The "options.allowExtension" argument must be a boolean.`);r.allowExtension=n.allowExtension}return r}var DatabaseSync=class{#e=null;#t;#n;#r;#i=!1;constructor(t,n){if(!new.target)throw new e(`DatabaseSync`);this.#t=parsePath(t),this.#n=validateOptions(n),this.#r=this.#t===`:memory:`,this.#n.open!==!1&&this.open()}get[l](){return`node:sqlite`}get isOpen(){return this.#e!==null&&this.#e.is_opened()}get isTransaction(){return this.#a(),this.#i}open(){if(this.isOpen)throw new n(`database is already open`);try{if(this.#r)this.#e=c.Connection.new_from_string(`SQLite`,`DB_DIR=;DB_NAME=:memory:`,null,c.ConnectionOptions.NONE);else{let e=this.#t.lastIndexOf(`/`),t=e>=0?this.#t.substring(0,e):`.`,n=e>=0?this.#t.substring(e+1):this.#t,r=`DB_DIR=${t};DB_NAME=${n.endsWith(`.db`)?n.slice(0,-3):n}`,i=this.#n.readOnly?c.ConnectionOptions.READ_ONLY:c.ConnectionOptions.NONE;this.#e=c.Connection.new_from_string(`SQLite`,r,null,i)}this.#e.open()}catch(e){throw this.#e=null,new i(e instanceof Error?e.message:String(e))}this.#s()}close(){if(!this.isOpen)throw new n(`database is not open`);this.#e.close(),this.#e=null,this.#i=!1}sqlExec(e){if(this.#a(),typeof e!=`string`)throw new t(`The "sql" argument must be a string.`);try{let t=this.#l(e);for(let e of t){let[t]=this.#o(e);this.#c(t)}}catch(e){throw e instanceof i||e instanceof n||e instanceof t?e:new i(e instanceof Error?e.message:String(e))}this.#u(e)}prepare(e,n){if(this.#a(),typeof e!=`string`)throw new t(`The "sql" argument must be a string.`);let[r,o]=a(e);try{this.#o(r)}catch(e){throw e instanceof i||e instanceof t?e:new i(e instanceof Error?e.message:String(e))}let c={readBigInts:this.#n.readBigInts??!1,returnArrays:this.#n.returnArrays??!1,allowBareNamedParameters:this.#n.allowBareNamedParameters??!0,allowUnknownNamedParameters:this.#n.allowUnknownNamedParameters??!1};return s._create(this.#e,e,c,o)}location(e){if(this.#a(),e!==void 0&&typeof e!=`string`)throw new t(`The "dbName" argument must be a string.`);return this.#r?null:this.#t}[Symbol.dispose](){if(this.isOpen)try{this.close()}catch{}}#a(){if(!this.isOpen)throw new n(`database is not open`)}#o(e){return o(this.#e,e)}#s(){let e=this.#e,runPragma=t=>{let[n]=this.#o(t);e.statement_execute_select(n,null)};this.#n.enableForeignKeyConstraints===!1?runPragma(`PRAGMA foreign_keys = OFF`):runPragma(`PRAGMA foreign_keys = ON`),this.#n.timeout!==void 0&&this.#n.timeout>0&&runPragma(`PRAGMA busy_timeout = ${this.#n.timeout}`)}#c(e){if(e.get_statement_type()===c.SqlStatementType.SELECT)this.#e.statement_execute_select(e,null);else try{this.#e.statement_execute_non_select(e,null)}catch{this.#e.statement_execute_select(e,null)}}#l(e){let t=[],n=``,r=e.length,i=0,flush=()=>{let e=n.trim();e.length>0&&t.push(e),n=``};for(;i<r;){let t=e[i],a=e[i+1];if(t===`-`&&a===`-`){let t=i+2;for(;t<r&&e[t]!==`
|
|
2
|
+
`;)t++;i=t;continue}if(t===`/`&&a===`*`){let t=i+2;for(;t<r&&!(e[t]===`*`&&e[t+1]===`/`);)t++;i=t<r?t+2:r,n+=` `;continue}if(t===`'`||t===`"`||t==="`"||t===`[`){let a=t===`[`?`]`:t,o=t!==`[`,s=i+1;for(n+=t;s<r;){if(e[s]===a){if(o&&e[s+1]===a){n+=a+a,s+=2;continue}n+=a,s++;break}n+=e[s],s++}i=s;continue}if(t===`;`){flush(),i++;continue}n+=t,i++}return flush(),t}#u(e){let t=e.trim().toUpperCase();/\bBEGIN\b/.test(t)&&(this.#i=!0),(/\bCOMMIT\b/.test(t)||/\bROLLBACK\b/.test(t))&&(this.#i=!1)}};DatabaseSync.prototype.exec=DatabaseSync.prototype.sqlExec;export{DatabaseSync};
|
package/lib/esm/param-binding.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{SqliteError as e}from"./errors.js";function setHolderString(e,t){return e.set_value(t)}function bindStringHolders(t,n){if(n.size!==0){if(!t)throw new e(`Failed to bind parameters: statement has no parameter set`);for(let[r,i]of n){let n=t.get_holder(r);if(!n)throw new e(`Failed to bind parameter '${r}'`);setHolderString(n,i)}}}export{bindStringHolders};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const asStringHolder=e=>`##${e.gdaId}::string`;function convertParameterSyntax(e,t=asStringHolder){let n=[],r=0,i=``,a=0;for(;a<e.length;){if(e[a]===`'`){let t=a;for(a++;a<e.length&&e[a]!==`'`;){if(e[a]===`'`&&e[a+1]===`'`){a+=2;continue}a++}a<e.length&&a++,i+=e.substring(t,a);continue}if(e[a]===`?`){a++;let o=``;for(;a<e.length&&e[a]>=`0`&&e[a]<=`9`;)o+=e[a],a++;let s=o?parseInt(o,10)-1:r;r=o?r:r+1;let c={gdaId:`p${s}`,originalName:o?`?${o}`:`?`,position:s};n.push(c),i+=t(c);continue}if((e[a]===`$`||e[a]===`:`||e[a]===`@`)&&a+1<e.length&&/[a-zA-Z_]/.test(e[a+1])){let r=e[a];a++;let o=``;for(;a<e.length&&/[a-zA-Z0-9_]/.test(e[a]);)o+=e[a],a++;let s={gdaId:o,originalName:`${r}${o}`,position:-1};n.push(s),i+=t(s);continue}i+=e[a],a++}return[i,n]}export{asStringHolder,convertParameterSyntax};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{SqliteError as e}from"./errors.js";function parseSql(t,n){let[r,i]=t.parse_sql_string(n);if(!r)throw new e(`Failed to parse SQL statement`);return[r,i]}export{parseSql};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{IllegalConstructorError as e,InvalidArgTypeError as t,InvalidArgValueError as n,SqliteError as r}from"./errors.js";import{readAllRows as i,readFirstRow as a}from"./data-model-reader.js";import o from"@girs/gda-6.0";const
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{IllegalConstructorError as e,InvalidArgTypeError as t,InvalidArgValueError as n,SqliteError as r}from"./errors.js";import{readAllRows as i,readFirstRow as a}from"./data-model-reader.js";import{convertParameterSyntax as o}from"./parameter-syntax.js";import{parseSql as s}from"./parse-sql.js";import{bindStringHolders as c}from"./param-binding.js";import l from"@girs/gda-6.0";const u=Symbol(`StatementSync.internal`);function isNamedArgObject(e){return typeof e==`object`&&!!e&&!(e instanceof Uint8Array)&&!ArrayBuffer.isView(e)}function validateBindValue(e,n){if(e===null)return;let r=typeof e;if(!(r===`number`||r===`bigint`||r===`string`||r===`boolean`)&&!(e instanceof Uint8Array||e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new t(`Provided value cannot be bound to SQLite parameter ${n}.`)}function sqlLiteral(e){if(e==null)return`NULL`;if(typeof e==`number`){if(Number.isNaN(e))return`NULL`;if(e===1/0)return`9e999`;if(e===-1/0)return`-9e999`;let t=String(e);return Number.isInteger(e)&&!t.includes(`e`)&&!t.includes(`E`)?`${t}.0`:t}if(typeof e==`boolean`)return e?`1`:`0`;if(typeof e==`bigint`){if(e>9223372036854775807n||e<-9223372036854775808n)throw new n(`BigInt value is too large to bind.`);return String(e)}if(e instanceof Uint8Array){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return`X'`+t+`'`}return ArrayBuffer.isView(e)?sqlLiteral(new Uint8Array(e.buffer)):`NULL`}var d=class StatementSync{#e;#t;#n;#r;#i;#a;#o;constructor(t,n,r,i,a){if(t!==u)throw new e;this.#e=n,this.#t=r,this.#n=a,this.#r=i.readBigInts??!1,this.#i=i.returnArrays??!1,this.#a=i.allowBareNamedParameters??!0,this.#o=i.allowUnknownNamedParameters??!1}static _create(e,t,n,r){return new StatementSync(u,e,t,n,r)}get sourceSQL(){return this.#t}get expandedSQL(){return this.#t}#s(){return{readBigInts:this.#r,returnArrays:this.#i}}#c(){let e=-1;for(let t of this.#n)t.position>e&&(e=t.position);return e}#l(e){let t=new Map;if(this.#n.length===0){if(e.length>0&&!isNamedArgObject(e[0]))throw new r(`column index out of range`,25,`column index out of range`);return{sql:this.#t,strings:t}}let n=null,i=e;e.length>0&&isNamedArgObject(e[0])&&(n=e[0],i=e.slice(1));let a=new Map;if(n){for(let e of this.#n){if(e.position>=0)continue;let t=e.originalName,i,o=!1;if(t in n&&(i=n[t],o=!0),!o&&this.#a){let e=t.replace(/^[$:@]/,``);e in n&&(i=n[e],o=!0)}if(!o&&!this.#a){let e=t.replace(/^[$:@]/,``);if(e in n)throw new r(`Unknown named parameter '${e}'`,0,`Unknown named parameter '${e}'`)}o&&(validateBindValue(i,this.#n.indexOf(e)+1),a.set(e.gdaId,i))}if(!this.#o){let e=new Set;for(let t of this.#n)t.position>=0||(e.add(t.originalName),e.add(t.originalName.replace(/^[$:@]/,``)));for(let t of Object.keys(n))if(!e.has(t)&&!e.has(t.replace(/^[$:@]/,``)))throw new r(`Unknown named parameter '${t}'`,0,`Unknown named parameter '${t}'`)}for(let e=0;e<i.length;e++){if(e>this.#c())throw new r(`column index out of range`,25,`column index out of range`);validateBindValue(i[e],e+1),a.set(`p${e}`,i[e])}}else{let e=this.#c()+1;if(i.length>e&&e>0)throw new r(`column index out of range`,25,`column index out of range`);for(let t=0;t<Math.min(i.length,e);t++)validateBindValue(i[t],t+1),a.set(`p${t}`,i[t])}let[s]=o(this.#t,e=>{let n=a.get(e.gdaId);return typeof n==`string`?(t.set(e.gdaId,n),`##${e.gdaId}::string`):sqlLiteral(n)});return{sql:s,strings:t}}#u(e){let{sql:t,strings:n}=this.#l(e),[r,i]=s(this.#e,t);if(c(i,n),r.get_statement_type()===l.SqlStatementType.SELECT)return{model:this.#e.statement_execute_select(r,i),isSelect:!0};try{return this.#e.statement_execute_non_select(r,i),{model:null,isSelect:!1}}catch{return{model:this.#e.statement_execute_select(r,i),isSelect:!0}}}run(...e){this.#u(e);let t=0,n=0;try{let e=this.#e.execute_select_command(`SELECT changes()`);e&&e.get_n_rows()>0&&(t=e.get_value_at(0,0))}catch{}try{let e=this.#e.execute_select_command(`SELECT last_insert_rowid()`);e&&e.get_n_rows()>0&&(n=e.get_value_at(0,0))}catch{}return this.#r&&(t=BigInt(t),n=BigInt(n)),{changes:t,lastInsertRowid:n}}get(...e){try{let{model:t}=this.#u(e);return!t||t.get_n_rows()===0?void 0:a(t,this.#s())}catch{return}}all(...e){try{let{model:t}=this.#u(e);return t?i(t,this.#s()):[]}catch{return[]}}setReadBigInts(e){if(typeof e!=`boolean`)throw new t(`The "readBigInts" argument must be a boolean.`);this.#r=e}setReturnArrays(e){if(typeof e!=`boolean`)throw new t(`The "returnArrays" argument must be a boolean.`);this.#i=e}setAllowBareNamedParameters(e){if(typeof e!=`boolean`)throw new t(`The "allowBareNamedParameters" argument must be a boolean.`);this.#a=e}setAllowUnknownNamedParameters(e){if(typeof e!=`boolean`)throw new t(`The "allowUnknownNamedParameters" argument must be a boolean.`);this.#o=e}};export{d as StatementSync};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { StatementSync } from './statement-sync.ts';
|
|
2
2
|
declare const sqliteTypeSymbol: unique symbol;
|
|
3
|
-
interface ParamInfo {
|
|
4
|
-
gdaId: string;
|
|
5
|
-
originalName: string;
|
|
6
|
-
position: number;
|
|
7
|
-
}
|
|
8
3
|
export declare class DatabaseSync {
|
|
9
4
|
#private;
|
|
10
5
|
constructor(path: unknown, options?: unknown);
|
|
@@ -22,4 +17,4 @@ export declare class DatabaseSync {
|
|
|
22
17
|
location(dbName?: unknown): string | null;
|
|
23
18
|
[Symbol.dispose](): void;
|
|
24
19
|
}
|
|
25
|
-
export
|
|
20
|
+
export {};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type Gda from '@girs/gda-6.0';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Bind the string parameters of one execution to the holders libgda created for them.
|
|
4
|
+
*
|
|
5
|
+
* Only strings are bound. Every other type is rendered as a SQL literal by
|
|
6
|
+
* `sqlLiteral()`, because those alphabets cannot break out of the statement — whereas a
|
|
7
|
+
* string can, and did: libgda reads `\` as an escape inside `'…'` where SQLite does not.
|
|
8
|
+
*
|
|
9
|
+
* A missing holder is a bug in this package (the SQL and the holder set come from the
|
|
10
|
+
* same `convertParameterSyntax` pass), so it raises rather than binding nothing and
|
|
11
|
+
* silently writing NULL.
|
|
12
|
+
*/
|
|
13
|
+
export declare function bindStringHolders(paramSet: Gda.Set | null, strings: Map<string, string>): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** One placeholder found in the SQL. `position` is -1 for named parameters. */
|
|
2
|
+
export interface ParamInfo {
|
|
3
|
+
gdaId: string;
|
|
4
|
+
originalName: string;
|
|
5
|
+
position: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Decides what a placeholder becomes in the SQL handed to libgda.
|
|
9
|
+
*
|
|
10
|
+
* `StatementSync` substitutes this per execution, because the choice depends on the value:
|
|
11
|
+
* a string becomes a `##id::string` holder so its text never enters the SQL, everything
|
|
12
|
+
* else becomes a literal drawn from an alphabet that cannot end a quoted region. Callers
|
|
13
|
+
* that only need to VALIDATE the SQL, where no values exist yet, take the default.
|
|
14
|
+
*/
|
|
15
|
+
export type PlaceholderRenderer = (param: ParamInfo) => string;
|
|
16
|
+
export declare const asStringHolder: PlaceholderRenderer;
|
|
17
|
+
/**
|
|
18
|
+
* Rewrite `sql` with every parameter rendered by `render`, and report the parameters in
|
|
19
|
+
* source order. String literals are copied verbatim so a `?` or `:name` inside one is not
|
|
20
|
+
* mistaken for a placeholder.
|
|
21
|
+
*/
|
|
22
|
+
export declare function convertParameterSyntax(sql: string, render?: PlaceholderRenderer): [string, ParamInfo[]];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type Gda from '@girs/gda-6.0';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a single SQL statement and return it with its parameter set.
|
|
4
|
+
*
|
|
5
|
+
* **Never call `Gda.SqlParser.parse_string()` in this package.** Its `remain`
|
|
6
|
+
* out-parameter points INTO the SQL string that was passed in — it is the unparsed tail,
|
|
7
|
+
* not an allocation — but `Gda-6.0.gir` declares it `transfer-ownership="full"`:
|
|
8
|
+
*
|
|
9
|
+
* ```xml
|
|
10
|
+
* <parameter name="remain" direction="out" transfer-ownership="full" nullable="1">
|
|
11
|
+
* <type name="utf8" c:type="const gchar**"/>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* So whenever libgda stops before the end of the string, GJS calls `g_free()` on an
|
|
15
|
+
* interior pointer at call teardown and glibc aborts the process: `free(): invalid
|
|
16
|
+
* pointer`, SIGABRT, no JS exception, no return value. Nothing can catch it and nothing
|
|
17
|
+
* can be checked first — asking for the parse IS the crash. A block comment does it; so
|
|
18
|
+
* does a statement whose string literal libgda thinks ends elsewhere than SQLite does
|
|
19
|
+
* (libgda honours `\` as an escape inside `'…'`, SQLite does not — which is how a mail
|
|
20
|
+
* body ending in a backslash killed a consumer mid-import).
|
|
21
|
+
*
|
|
22
|
+
* `gda_connection_parse_sql_string()` takes no `remain` at all, so the same input raises
|
|
23
|
+
* an ordinary catchable error. It also hands back the `Gda.Set` of parameter holders,
|
|
24
|
+
* which is what lets values be BOUND instead of spliced into the SQL text.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseSql(connection: Gda.Connection, sql: string): [Gda.Statement, Gda.Set | null];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Gda from '@girs/gda-6.0';
|
|
2
|
+
import { type ParamInfo } from './parameter-syntax.ts';
|
|
2
3
|
import type { RunResult, StatementSyncOptions } from './types.ts';
|
|
3
|
-
import type { ParamInfo } from './database-sync.ts';
|
|
4
4
|
export declare class StatementSync {
|
|
5
5
|
#private;
|
|
6
|
-
constructor(sentinel: symbol, connection: Gda.Connection, sql: string, options: StatementSyncOptions, paramMap: ParamInfo[]
|
|
6
|
+
constructor(sentinel: symbol, connection: Gda.Connection, sql: string, options: StatementSyncOptions, paramMap: ParamInfo[]);
|
|
7
7
|
/** @internal */
|
|
8
|
-
static _create(connection: Gda.Connection, sql: string, options: StatementSyncOptions, paramMap: ParamInfo[]
|
|
8
|
+
static _create(connection: Gda.Connection, sql: string, options: StatementSyncOptions, paramMap: ParamInfo[]): StatementSync;
|
|
9
9
|
get sourceSQL(): string;
|
|
10
10
|
get expandedSQL(): string;
|
|
11
11
|
run(...args: unknown[]): RunResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Node.js sqlite module for Gjs using libgda",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"libgda"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@gjsify/cli": "^0.
|
|
43
|
+
"@gjsify/cli": "^0.32.0",
|
|
44
44
|
"@gjsify/node-gi": "file:../../../packages/node-gi/node-gi",
|
|
45
|
-
"@gjsify/unit": "^0.
|
|
45
|
+
"@gjsify/unit": "^0.32.0",
|
|
46
46
|
"@types/node": "^25.9.2",
|
|
47
47
|
"typescript": "^6.0.3"
|
|
48
48
|
},
|