@junejs/juno 0.0.29 → 0.0.30-dev.1
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/package.json +4 -4
- package/src/index.ts +14 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junejs/juno",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30-dev.1",
|
|
4
4
|
"description": "Juno — June's ergonomic data layer over the JuneDb contract. The default that ships with the agent-native magic (Tier 3).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"typecheck": "tsc --noEmit"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@junejs/core": ">=0.
|
|
20
|
-
"@junejs/db": ">=0.0.
|
|
19
|
+
"@junejs/core": ">=0.1.0-dev.1",
|
|
20
|
+
"@junejs/db": ">=0.0.33-dev.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@junejs/server": "^0.0.
|
|
23
|
+
"@junejs/server": "^0.0.47",
|
|
24
24
|
"@types/pg": "^8.20.0",
|
|
25
25
|
"mysql2": "^3.22.5",
|
|
26
26
|
"pg": "^8.21.0"
|
package/src/index.ts
CHANGED
|
@@ -67,15 +67,20 @@ function isOperators(v: unknown): v is Operators {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export class Table<T extends Row = Row> {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
70
|
+
// Explicit fields, not parameter properties — parameter properties aren't
|
|
71
|
+
// erasable, and June ships raw .ts that consumers type-strip (erasableSyntaxOnly).
|
|
72
|
+
private readonly db: JuneDb;
|
|
73
|
+
private readonly name: string;
|
|
74
|
+
// Per-request ambient-loader registry, shared across the juno() handle's
|
|
75
|
+
// .table() calls so concurrent findBy/all coalesce. Holds both point and list
|
|
76
|
+
// loaders (keyed apart). Optional/defaulted so a standalone `new Table(db,
|
|
77
|
+
// name)` still works (it just batches alone).
|
|
78
|
+
private readonly loaders: Map<string, unknown>;
|
|
79
|
+
constructor(db: JuneDb, name: string, loaders: Map<string, unknown> = new Map()) {
|
|
80
|
+
this.db = db;
|
|
81
|
+
this.name = name;
|
|
82
|
+
this.loaders = loaders;
|
|
83
|
+
}
|
|
79
84
|
|
|
80
85
|
// The compiler for THIS table's db — picked from the handle's dialect tag (sqlite
|
|
81
86
|
// by default). So `table()` emits the right SQL whether db is sqlite/D1, Postgres,
|