@noego/sqlego 0.1.2-dev.3 → 0.1.2-dev.4
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 +8 -6
- package/dist/client.d.ts +6 -5
- package/dist/index.js +9 -9
- package/package.json +6 -6
- package/src/client.ts +6 -5
package/README.md
CHANGED
|
@@ -116,12 +116,14 @@ An owner is a Bun process (tens of MB), so one serves many files. A file
|
|
|
116
116
|
with no owner is adopted by the running owner (of the client's build, under
|
|
117
117
|
the same runtime directory) that serves the fewest files; a new process is
|
|
118
118
|
spawned only while fewer than `maxOwners` exist (`SQLEGO_MAX_OWNERS` or the
|
|
119
|
-
`maxOwners` client option). Default `
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
`maxOwners` client option). Default `4`: files are spread over up to four
|
|
120
|
+
processes — SQL for files sharing a process runs on one thread, so a long
|
|
121
|
+
statement on one file delays only the files that share its process, while an
|
|
122
|
+
app holding tens of databases open still costs a handful of processes, not
|
|
123
|
+
tens. `1` puts every file in one process; `0` means one process per file, as
|
|
124
|
+
before owners could adopt. The limit counts every owner of the client's
|
|
125
|
+
build under the runtime directory, whichever app started it. Nothing is ever
|
|
126
|
+
refused for lack of a process.
|
|
125
127
|
|
|
126
128
|
Each file keeps its own socket, database connection, leased transaction and
|
|
127
129
|
idle timer. `sqlego <file> stop` and the idle timeout release that one file;
|
package/dist/client.d.ts
CHANGED
|
@@ -31,10 +31,11 @@ export type ClientOptions = Readonly<{
|
|
|
31
31
|
* How many owner processes (of this client's build, under this runtime
|
|
32
32
|
* directory) may exist. A file with no owner is adopted by the running
|
|
33
33
|
* owner serving the fewest files; a new process is spawned only while
|
|
34
|
-
* there are fewer than this many.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* there are fewer than this many. N spreads files over up to N processes
|
|
35
|
+
* (SQL for files sharing a process runs on one thread, so a busy file only
|
|
36
|
+
* delays the files that share its process); 1 means one process serves
|
|
37
|
+
* every file; 0 means one process per file, as before owners could adopt.
|
|
38
|
+
* Default `SQLEGO_MAX_OWNERS`, else 4. Never refuses.
|
|
38
39
|
*/
|
|
39
40
|
maxOwners?: number;
|
|
40
41
|
/** Total time to obtain a connection, including spawn. Default 10 000. */
|
|
@@ -42,7 +43,7 @@ export type ClientOptions = Readonly<{
|
|
|
42
43
|
/** Per-request timeout. Default 60 000. */
|
|
43
44
|
requestTimeoutMs?: number;
|
|
44
45
|
}>;
|
|
45
|
-
export declare const DEFAULT_MAX_OWNERS =
|
|
46
|
+
export declare const DEFAULT_MAX_OWNERS = 4;
|
|
46
47
|
export type BeginOptions = Readonly<{
|
|
47
48
|
/** `immediate` takes the write lock at `begin`; `deferred` (default) on the first write. */
|
|
48
49
|
mode?: TransactionMode;
|
package/dist/index.js
CHANGED
|
@@ -638,7 +638,7 @@ import { fileURLToPath } from "node:url";
|
|
|
638
638
|
// package.json
|
|
639
639
|
var package_default = {
|
|
640
640
|
name: "@noego/sqlego",
|
|
641
|
-
version: "0.1.2-dev.
|
|
641
|
+
version: "0.1.2-dev.4",
|
|
642
642
|
description: "One owner per SQLite file, many files per owner process. Clients (CLI, Node, Bun) pass SQL over a local socket (Unix) or named pipe (Windows); the owner starts on demand and exits when idle.",
|
|
643
643
|
type: "module",
|
|
644
644
|
license: "ISC",
|
|
@@ -689,11 +689,11 @@ var package_default = {
|
|
|
689
689
|
"@noego/trust": "0.5.0-dev.0"
|
|
690
690
|
},
|
|
691
691
|
optionalDependencies: {
|
|
692
|
-
"@noego/sqlego-darwin-arm64": "0.1.2-dev.
|
|
693
|
-
"@noego/sqlego-darwin-x64": "0.1.2-dev.
|
|
694
|
-
"@noego/sqlego-linux-x64": "0.1.2-dev.
|
|
695
|
-
"@noego/sqlego-linux-arm64": "0.1.2-dev.
|
|
696
|
-
"@noego/sqlego-win32-x64": "0.1.2-dev.
|
|
692
|
+
"@noego/sqlego-darwin-arm64": "0.1.2-dev.4",
|
|
693
|
+
"@noego/sqlego-darwin-x64": "0.1.2-dev.4",
|
|
694
|
+
"@noego/sqlego-linux-x64": "0.1.2-dev.4",
|
|
695
|
+
"@noego/sqlego-linux-arm64": "0.1.2-dev.4",
|
|
696
|
+
"@noego/sqlego-win32-x64": "0.1.2-dev.4"
|
|
697
697
|
}
|
|
698
698
|
};
|
|
699
699
|
|
|
@@ -711,8 +711,8 @@ function sourceBuildId(sourceDirectory) {
|
|
|
711
711
|
}, (cause) => ({ kind: "source-unreadable", message: `cannot hash sources in ${sourceDirectory}: ${errorMessage(cause)}` }));
|
|
712
712
|
}
|
|
713
713
|
function resolveBuildId() {
|
|
714
|
-
if ("
|
|
715
|
-
return "
|
|
714
|
+
if ("e5711cce187d".length > 0)
|
|
715
|
+
return "e5711cce187d";
|
|
716
716
|
const directory = Trust.try(() => path3.dirname(fileURLToPath(import.meta.url)), (cause) => ({ kind: "module-path", message: errorMessage(cause) }));
|
|
717
717
|
if (!directory.ok)
|
|
718
718
|
return decideUnknownBuild(directory.error.kind);
|
|
@@ -737,7 +737,7 @@ var BUILD_ID = resolveBuildId();
|
|
|
737
737
|
var VERSION = process.env.SQLEGO_VERSION_OVERRIDE || `${package_default.version}+${BUILD_ID}`;
|
|
738
738
|
|
|
739
739
|
// src/client.ts
|
|
740
|
-
var DEFAULT_MAX_OWNERS =
|
|
740
|
+
var DEFAULT_MAX_OWNERS = 4;
|
|
741
741
|
var ADOPT_TIMEOUT_MS = 5000;
|
|
742
742
|
var SAVEPOINT_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
743
743
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noego/sqlego",
|
|
3
|
-
"version": "0.1.2-dev.
|
|
3
|
+
"version": "0.1.2-dev.4",
|
|
4
4
|
"description": "One owner per SQLite file, many files per owner process. Clients (CLI, Node, Bun) pass SQL over a local socket (Unix) or named pipe (Windows); the owner starts on demand and exits when idle.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@noego/trust": "0.5.0-dev.0"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
|
-
"@noego/sqlego-darwin-arm64": "0.1.2-dev.
|
|
55
|
-
"@noego/sqlego-darwin-x64": "0.1.2-dev.
|
|
56
|
-
"@noego/sqlego-linux-x64": "0.1.2-dev.
|
|
57
|
-
"@noego/sqlego-linux-arm64": "0.1.2-dev.
|
|
58
|
-
"@noego/sqlego-win32-x64": "0.1.2-dev.
|
|
54
|
+
"@noego/sqlego-darwin-arm64": "0.1.2-dev.4",
|
|
55
|
+
"@noego/sqlego-darwin-x64": "0.1.2-dev.4",
|
|
56
|
+
"@noego/sqlego-linux-x64": "0.1.2-dev.4",
|
|
57
|
+
"@noego/sqlego-linux-arm64": "0.1.2-dev.4",
|
|
58
|
+
"@noego/sqlego-win32-x64": "0.1.2-dev.4"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/src/client.ts
CHANGED
|
@@ -72,10 +72,11 @@ export type ClientOptions = Readonly<{
|
|
|
72
72
|
* How many owner processes (of this client's build, under this runtime
|
|
73
73
|
* directory) may exist. A file with no owner is adopted by the running
|
|
74
74
|
* owner serving the fewest files; a new process is spawned only while
|
|
75
|
-
* there are fewer than this many.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
75
|
+
* there are fewer than this many. N spreads files over up to N processes
|
|
76
|
+
* (SQL for files sharing a process runs on one thread, so a busy file only
|
|
77
|
+
* delays the files that share its process); 1 means one process serves
|
|
78
|
+
* every file; 0 means one process per file, as before owners could adopt.
|
|
79
|
+
* Default `SQLEGO_MAX_OWNERS`, else 4. Never refuses.
|
|
79
80
|
*/
|
|
80
81
|
maxOwners?: number;
|
|
81
82
|
/** Total time to obtain a connection, including spawn. Default 10 000. */
|
|
@@ -84,7 +85,7 @@ export type ClientOptions = Readonly<{
|
|
|
84
85
|
requestTimeoutMs?: number;
|
|
85
86
|
}>;
|
|
86
87
|
|
|
87
|
-
export const DEFAULT_MAX_OWNERS =
|
|
88
|
+
export const DEFAULT_MAX_OWNERS = 4;
|
|
88
89
|
|
|
89
90
|
/** One live owner process of this build, as the meta files of the files it serves report it. */
|
|
90
91
|
type OwnerProcess = Readonly<{ pid: number; socket: string; files: number; startedAt: number }>;
|