@zukhruf/sqlite-federation 0.8.16 → 0.8.18

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/README.md CHANGED
@@ -78,6 +78,19 @@ federation.exec(`
78
78
  const result = federation.query('SELECT * FROM conversations');
79
79
  ```
80
80
 
81
+ `function(name, options?, fn)` registers a function of SQL on the connection of the handle. It is `function` of `DatabaseSync` in `node:sqlite`, with the same arguments, options and errors. Like a temporary view, the function is connection-local and stays until the handle closes. A statement or a temporary view can call it. When `fn` throws, the statement fails with that error, and the databases that the statement attached are detached. For example, a host stops a read of temporary views when the data they show expires:
82
+
83
+ ```ts
84
+ federation.function('current', () => {
85
+ if (expired()) throw new Error('The position expired. Read again.');
86
+ return null;
87
+ });
88
+ federation.exec(`
89
+ CREATE TEMP VIEW recent AS
90
+ SELECT text FROM messages.messages WHERE current() IS NULL;
91
+ `);
92
+ ```
93
+
81
94
  Qualified tables and PRAGMAs discover additional databases through `locate`. Both `PRAGMA contacts.table_info(contacts)` and `SELECT * FROM pragma_table_info('contacts', 'contacts')` locate Contacts, including when the schema is a bound parameter in a tagged query. Quoted schema names such as `"call-history"` work too. Every attachment made for the statement is detached afterwards, including on failure; `main` and temporary views remain on the connection. The additional databases count toward the attachment limit.
82
95
 
83
96
  The constructor accepts Node's `timeout` option for waiting on a writer's lock, in milliseconds. Without it, the handle waits 5000 ms, the busy timeout of `@zukhruf/sqlite-open`. It also accepts Node's `readBigInts` option. An `INTEGER` of SQLite holds 64 bits, and a number holds an integer exactly only up to 2^53, so a plain handle throws `ERR_OUT_OF_RANGE` for a larger one. With `readBigInts: true`, `query` and `sql` give each integer as a `bigint`. A host that reads databases it does not know, such as an agent's SQL over the imports of Context Compiler, sets it. Hosts that need crash recovery perform it before supplying the paths, including inside `locate` for a named primary or additional database; Federation opens those files read-only.
@@ -108,17 +121,17 @@ const result = database.query(
108
121
 
109
122
  ## Errors
110
123
 
111
- | Error | When |
112
- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
113
- | `TooManyDatabasesError` | A statement names more databases than the limit. `names` has at least one name more than the limit. The message tells you to split the statement. |
114
- | `Unknown main database <name>` | The constructor cannot locate the named primary database. |
115
- | `no such table: <name>.<table>` | The error of SQLite, when `locate` returns `undefined` for the name, or when the database does not have the table. |
116
- | `UnavailableError` | The constructor cannot open the primary database: the file is missing, or the system denies access. `path` is the path. `cause` is the error of SQLite. It is the class of `@zukhruf/sqlite-open`. |
117
- | `unable to open database file` | The error of SQLite, when `locate` returns a path with no file for a database that a statement attaches. |
118
- | `attempt to write a readonly database` | The error of SQLite, when a statement writes. |
119
- | The error of `locate` | The constructor or statement fails with that error. The databases that the statement attached before are detached. |
120
- | `unknown database <name>` | The error of SQLite, when a PRAGMA names a database that `locate` cannot find. Quoting follows the statement or the table-valued PRAGMA argument. |
121
- | `Run one SQL statement at a time` | A raw query contains a second statement. |
124
+ | Error | When |
125
+ | -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
126
+ | `TooManyDatabasesError` | A statement names more databases than the limit. `names` has at least one name more than the limit. The message tells you to split the statement. |
127
+ | `Unknown main database <name>` | The constructor cannot locate the named primary database. |
128
+ | `no such table: <name>.<table>` | The error of SQLite, when `locate` returns `undefined` for the name, or when the database does not have the table. |
129
+ | `UnavailableError` | The constructor cannot open the primary database: the file is missing, or the system denies access. `path` is the path. `cause` is the error of SQLite. It is the class of `@zukhruf/sqlite-open`. It is a `MissingError` when the file or a folder on its path is not there, and a `DeniedError` when the system denies access. The package exports both, and both are an `UnavailableError`. |
130
+ | `unable to open database file` | The error of SQLite, when `locate` returns a path with no file for a database that a statement attaches. |
131
+ | `attempt to write a readonly database` | The error of SQLite, when a statement writes. |
132
+ | The error of `locate` | The constructor or statement fails with that error. The databases that the statement attached before are detached. |
133
+ | `unknown database <name>` | The error of SQLite, when a PRAGMA names a database that `locate` cannot find. Quoting follows the statement or the table-valued PRAGMA argument. |
134
+ | `Run one SQL statement at a time` | A raw query contains a second statement. |
122
135
 
123
136
  ## The same concepts in other systems
124
137
 
@@ -1,4 +1,4 @@
1
- import type { DatabaseSyncOptions, SQLOutputValue, SQLTagStore } from 'node:sqlite';
1
+ import type { DatabaseSync, DatabaseSyncOptions, SQLOutputValue, SQLTagStore } from 'node:sqlite';
2
2
  export type Query = Pick<SQLTagStore, 'all' | 'get'>;
3
3
  export type QueryResult = {
4
4
  readonly columns: readonly string[];
@@ -14,6 +14,7 @@ export type FederationOptions = Pick<DatabaseSyncOptions, 'timeout' | 'readBigIn
14
14
  export declare class Federation implements Disposable {
15
15
  #private;
16
16
  readonly sql: Query;
17
+ readonly function: DatabaseSync['function'];
17
18
  constructor({ main, locate, ...options }: FederationOptions);
18
19
  exec(sql: string): void;
19
20
  query(sql: string): QueryResult;
@@ -1 +1 @@
1
- {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../src/federation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,cAAc,EACd,WAAW,EACZ,MAAM,aAAa,CAAC;AAQrB,MAAM,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC;AAGrD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;CACpE,CAAC;AAIF,MAAM,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAI1D,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,mBAAmB,EACnB,SAAS,GAAG,aAAa,CAC1B,GAAG;IACF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,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,CAAC,GAAG,EAAE,KAAK,CAAC;IAIpB,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;gBAIhC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB;IAwB3D,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAOvB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAwD/B,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
@@ -5,6 +5,10 @@ import { TooManyDatabasesError } from "./too-many-databases-error.js";
5
5
  // open; each statement attaches and detaches the additional databases it names.
6
6
  export class Federation {
7
7
  sql;
8
+ // Registers a function of SQL on the connection, as the function method of
9
+ // node:sqlite does. It is connection-local SQL, as a temporary view is, and
10
+ // stays until the handle closes. An error it throws fails the statement.
11
+ function;
8
12
  #connection;
9
13
  #locate;
10
14
  constructor({ main, locate, ...options }) {
@@ -19,6 +23,7 @@ export class Federation {
19
23
  ...options,
20
24
  readOnly: true,
21
25
  });
26
+ this.function = this.#connection.function.bind(this.#connection);
22
27
  const store = this.#connection.createTagStore();
23
28
  this.sql = {
24
29
  all: (strings, ...values) => this.#statement(() => store.all(strings, ...values)),
@@ -1 +1 @@
1
- {"version":3,"file":"federation.js","sourceRoot":"","sources":["../src/federation.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AA0BtE,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,MAAM,OAAO,UAAU;IACZ,GAAG,CAAQ;IACX,WAAW,CAAe;IAC1B,OAAO,CAAS;IAEzB,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAqB;QACzD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE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G,CAAC;AAC3C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Federation, type FederationOptions, type Locate, type Query, type QueryResult, } from './federation.ts';
2
2
  export { TooManyDatabasesError } from './too-many-databases-error.ts';
3
- export { UnavailableError } from '@zukhruf/sqlite-open';
3
+ export { DeniedError, MissingError, UnavailableError, } from '@zukhruf/sqlite-open';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,KAAK,EACV,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Federation, } from "./federation.js";
2
2
  export { TooManyDatabasesError } from "./too-many-databases-error.js";
3
- export { UnavailableError } from '@zukhruf/sqlite-open';
3
+ export { DeniedError, MissingError, UnavailableError, } from '@zukhruf/sqlite-open';
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAKX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAKX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,WAAW,EACX,YAAY,EACZ,gBAAgB,GACjB,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zukhruf/sqlite-federation",
3
- "version": "0.8.16",
3
+ "version": "0.8.18",
4
4
  "description": "One read-only handle over many SQLite databases. Each statement attaches the databases it names and detaches them when it ends. So a host can keep more databases than the SQLite attach limit, and one statement can read 10 plus the primary database.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,9 +41,9 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@zukhruf/sqlite-open": "^0.8.16"
44
+ "@zukhruf/sqlite-open": "^0.8.18"
45
45
  },
46
46
  "devDependencies": {
47
- "@zukhruf/testing": "^0.8.16"
47
+ "@zukhruf/testing": "^0.8.18"
48
48
  }
49
49
  }