@c9up/eon 0.2.2 → 0.2.3
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/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +4 -0
- package/dist/configure.js.map +1 -1
- package/dist/connection/ensureDatabase.d.ts +15 -0
- package/dist/connection/ensureDatabase.d.ts.map +1 -1
- package/dist/connection/ensureDatabase.js +15 -0
- package/dist/connection/ensureDatabase.js.map +1 -1
- package/dist/schema/CreateStableSpec.d.ts +8 -1
- package/dist/schema/CreateStableSpec.d.ts.map +1 -1
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +1 -1
- package/src/configure.ts +4 -0
- package/src/connection/ensureDatabase.ts +15 -0
- package/src/schema/CreateStableSpec.ts +8 -1
package/dist/configure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,UAAU,QAAQ;IACjB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,SAAS,CACR,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,UAAU,QAAQ;IACjB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,SAAS,CACR,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BjE"}
|
package/dist/configure.js
CHANGED
|
@@ -18,6 +18,10 @@ export default defineConfig({
|
|
|
18
18
|
// creates this database — and a connection naming a missing one is refused,
|
|
19
19
|
// before any migration could create it. Precision is create-only, so set it
|
|
20
20
|
// here rather than repairing it later.
|
|
21
|
+
//
|
|
22
|
+
// Add \`keep\` if you store history older than the server default of 3650
|
|
23
|
+
// days: rows before the KEEP window are refused one by one with
|
|
24
|
+
// \`Timestamp data out of range\`, which reads like a data problem and is not.
|
|
21
25
|
createDatabase: { precision: 'ms' },
|
|
22
26
|
})
|
|
23
27
|
`);
|
package/dist/configure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAkB;IACjD,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,CAAC,UAAU,CAAC;QACzB,YAAY,EAAE,qBAAqB;QACnC,aAAa,EAAE,MAAM;QACrB,iBAAiB,EAAE,UAAU;QAC7B,iBAAiB,EAAE,MAAM;KACzB,CAAC,CAAC;IACH,MAAM,QAAQ,CAAC,SAAS,CACvB,sBAAsB,EACtB
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAkB;IACjD,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,QAAQ,CAAC,UAAU,CAAC;QACzB,YAAY,EAAE,qBAAqB;QACnC,aAAa,EAAE,MAAM;QACrB,iBAAiB,EAAE,UAAU;QAC7B,iBAAiB,EAAE,MAAM;KACzB,CAAC,CAAC;IACH,MAAM,QAAQ,CAAC,SAAS,CACvB,sBAAsB,EACtB;;;;;;;;;;;;;;;;;;CAkBD,CACC,CAAC;AACH,CAAC"}
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
* at the wrong precision cannot be repaired with `ALTER`. So the side that owns
|
|
14
14
|
* the schema is the side that should create it.
|
|
15
15
|
*
|
|
16
|
+
* ── `keep` is not optional for historical data ─────────────────────────────
|
|
17
|
+
* TDengine drops rows older than the database's KEEP window, and the server
|
|
18
|
+
* default is 3650 days. A row stamped before that window is refused with
|
|
19
|
+
* `Timestamp data out of range` — per row, at write time, long after the
|
|
20
|
+
* database was created and with nothing pointing back to KEEP. Backfilling
|
|
21
|
+
* more than ten years of history therefore has to say so up front:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* createDatabase: { precision: 'ms', keep: '36500d', duration: '30d' }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* KEEP must be at least three times DURATION; the Rust compiler enforces that
|
|
28
|
+
* and names it (`E_EON_KEEP_TOO_SMALL`) rather than letting the server refuse
|
|
29
|
+
* the statement.
|
|
30
|
+
*
|
|
16
31
|
* Opt-in through `createDatabase` — unset, eon behaves exactly like atlas and
|
|
17
32
|
* expects the database to be there.
|
|
18
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureDatabase.d.ts","sourceRoot":"","sources":["../../src/connection/ensureDatabase.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ensureDatabase.d.ts","sourceRoot":"","sources":["../../src/connection/ensureDatabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,CAC1B,MAAM,EAAE,mBAAmB,KACvB,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B;;;;;;;GAOG;AACH,wBAAsB,cAAc,CACnC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAoCf"}
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
* at the wrong precision cannot be repaired with `ALTER`. So the side that owns
|
|
14
14
|
* the schema is the side that should create it.
|
|
15
15
|
*
|
|
16
|
+
* ── `keep` is not optional for historical data ─────────────────────────────
|
|
17
|
+
* TDengine drops rows older than the database's KEEP window, and the server
|
|
18
|
+
* default is 3650 days. A row stamped before that window is refused with
|
|
19
|
+
* `Timestamp data out of range` — per row, at write time, long after the
|
|
20
|
+
* database was created and with nothing pointing back to KEEP. Backfilling
|
|
21
|
+
* more than ten years of history therefore has to say so up front:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* createDatabase: { precision: 'ms', keep: '36500d', duration: '30d' }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* KEEP must be at least three times DURATION; the Rust compiler enforces that
|
|
28
|
+
* and names it (`E_EON_KEEP_TOO_SMALL`) rather than letting the server refuse
|
|
29
|
+
* the statement.
|
|
30
|
+
*
|
|
16
31
|
* Opt-in through `createDatabase` — unset, eon behaves exactly like atlas and
|
|
17
32
|
* expects the database to be there.
|
|
18
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensureDatabase.js","sourceRoot":"","sources":["../../src/connection/ensureDatabase.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ensureDatabase.js","sourceRoot":"","sources":["../../src/connection/ensureDatabase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AASnD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,MAA2B,EAC3B,OAAqB;IAErB,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;IACxC,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,KAAK;QAAE,OAAO;IAE3D,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CACd,6FAA6F,CAC7F,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;IAC/B,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;IAElC,4EAA4E;IAC5E,8EAA8E;IAC9E,iDAAiD;IACjD,MAAM,KAAK,GAAwB;QAClC,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;KACzC,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,CAAC;QACJ,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC;IACF,CAAC;YAAS,CAAC;QACV,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;AACF,CAAC"}
|
|
@@ -87,7 +87,14 @@ export type EonCacheModel = "none" | "last_row" | "last_value" | "both";
|
|
|
87
87
|
* DURATION`). Options are emitted only when present, in a fixed order.
|
|
88
88
|
*/
|
|
89
89
|
export interface EonDatabaseOptions {
|
|
90
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Retention window (e.g. `"90d"`). Must be `>= 3 x DURATION` when both are
|
|
92
|
+
* set with the same unit.
|
|
93
|
+
*
|
|
94
|
+
* Left unset, the SERVER default applies — 3650 days. Rows stamped before
|
|
95
|
+
* that window are refused row by row with `Timestamp data out of range`, so
|
|
96
|
+
* a database meant to hold older history has to widen KEEP at creation.
|
|
97
|
+
*/
|
|
91
98
|
keep?: string;
|
|
92
99
|
/** Per-file time span (e.g. `"10d"`). Create-only — cannot be altered. */
|
|
93
100
|
duration?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateStableSpec.d.ts","sourceRoot":"","sources":["../../src/schema/CreateStableSpec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sFAAsF;AACtF,MAAM,MAAM,cAAc,GACvB,WAAW,GACX,KAAK,GACL,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,WAAW,GACX,MAAM,GACN,SAAS,CAAC;AAgCb,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAqB,CAAC;AAEvE,uFAAuF;AACvF,MAAM,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AAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,wFAAwF;IACxF,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,uCAAuC;AACvC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC
|
|
1
|
+
{"version":3,"file":"CreateStableSpec.d.ts","sourceRoot":"","sources":["../../src/schema/CreateStableSpec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,sFAAsF;AACtF,MAAM,MAAM,cAAc,GACvB,WAAW,GACX,KAAK,GACL,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,OAAO,GACP,QAAQ,GACR,MAAM,GACN,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,QAAQ,GACR,WAAW,GACX,MAAM,GACN,SAAS,CAAC;AAgCb,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAqB,CAAC;AAEvE,uFAA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ACb,WAAW,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,oFAAoF;AACpF,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CAClB"}
|
|
Binary file
|
package/package.json
CHANGED
package/src/configure.ts
CHANGED
|
@@ -37,6 +37,10 @@ export default defineConfig({
|
|
|
37
37
|
// creates this database — and a connection naming a missing one is refused,
|
|
38
38
|
// before any migration could create it. Precision is create-only, so set it
|
|
39
39
|
// here rather than repairing it later.
|
|
40
|
+
//
|
|
41
|
+
// Add \`keep\` if you store history older than the server default of 3650
|
|
42
|
+
// days: rows before the KEEP window are refused one by one with
|
|
43
|
+
// \`Timestamp data out of range\`, which reads like a data problem and is not.
|
|
40
44
|
createDatabase: { precision: 'ms' },
|
|
41
45
|
})
|
|
42
46
|
`,
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
* at the wrong precision cannot be repaired with `ALTER`. So the side that owns
|
|
14
14
|
* the schema is the side that should create it.
|
|
15
15
|
*
|
|
16
|
+
* ── `keep` is not optional for historical data ─────────────────────────────
|
|
17
|
+
* TDengine drops rows older than the database's KEEP window, and the server
|
|
18
|
+
* default is 3650 days. A row stamped before that window is refused with
|
|
19
|
+
* `Timestamp data out of range` — per row, at write time, long after the
|
|
20
|
+
* database was created and with nothing pointing back to KEEP. Backfilling
|
|
21
|
+
* more than ten years of history therefore has to say so up front:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* createDatabase: { precision: 'ms', keep: '36500d', duration: '30d' }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* KEEP must be at least three times DURATION; the Rust compiler enforces that
|
|
28
|
+
* and names it (`E_EON_KEEP_TOO_SMALL`) rather than letting the server refuse
|
|
29
|
+
* the statement.
|
|
30
|
+
*
|
|
16
31
|
* Opt-in through `createDatabase` — unset, eon behaves exactly like atlas and
|
|
17
32
|
* expects the database to be there.
|
|
18
33
|
*/
|
|
@@ -127,7 +127,14 @@ export type EonCacheModel = "none" | "last_row" | "last_value" | "both";
|
|
|
127
127
|
* DURATION`). Options are emitted only when present, in a fixed order.
|
|
128
128
|
*/
|
|
129
129
|
export interface EonDatabaseOptions {
|
|
130
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Retention window (e.g. `"90d"`). Must be `>= 3 x DURATION` when both are
|
|
132
|
+
* set with the same unit.
|
|
133
|
+
*
|
|
134
|
+
* Left unset, the SERVER default applies — 3650 days. Rows stamped before
|
|
135
|
+
* that window are refused row by row with `Timestamp data out of range`, so
|
|
136
|
+
* a database meant to hold older history has to widen KEEP at creation.
|
|
137
|
+
*/
|
|
131
138
|
keep?: string;
|
|
132
139
|
/** Per-file time span (e.g. `"10d"`). Create-only — cannot be altered. */
|
|
133
140
|
duration?: string;
|