yggio-prisma 0.0.16 → 0.0.17
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/index.cjs +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -7
- package/dist/index.d.ts +16 -7
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/landing.ts +1 -1
- package/src/mysql.ts +21 -10
- package/src/pushdown.ts +3 -1
package/README.md
CHANGED
|
@@ -185,10 +185,9 @@ Under every other provider, or none, a MySQL native spelling is read as the
|
|
|
185
185
|
Prisma type's own default (`@db.TinyInt` is `int32`, `@db.Date` an instant).
|
|
186
186
|
`mysql/schema.prisma` is generated by `npm run mysql:schema` - `fieldModels`
|
|
187
187
|
over the crate's fields as the addon states them (`fix.MarketMessage.field()`,
|
|
188
|
-
`fix.underlyingField()`, ...) and `yggio-market/
|
|
188
|
+
`fix.underlyingField()`, ...) and `kindTables(yggio)` of `yggio-market/node` for the
|
|
189
189
|
enums - never edited by hand; `scripts/mysql-schema.mjs --check` and the
|
|
190
|
-
`arrow` suite hold it current
|
|
191
|
-
to the same fields. Each column is read off its `DataType` - family,
|
|
190
|
+
`arrow` suite hold it current. Each column is read off its `DataType` - family,
|
|
192
191
|
precision, scale, unit, widths - never off its text. Each model is keyed by
|
|
193
192
|
the one column its field's `SORT:by` names (`rowKey`: `underlying` by `code`,
|
|
194
193
|
`mic` by `mic`, `legalentity` by `lei`), else by `STATED_KEYS` with their
|
|
@@ -201,7 +200,9 @@ field declares (`rowIndexes`): one `@@index` over the columns its
|
|
|
201
200
|
`crosscode, markettimestamp` - none where that is the key itself (`underlying`
|
|
202
201
|
by `code`, `fixdefinition` by `category, tag, name`); a message declares no layout, so
|
|
203
202
|
`STATED_INDEXES` gives `fixmsg` the three the message search reads,
|
|
204
|
-
`(underlyingcategory, markettimestamp)`, `(underlyingcode, markettimestamp)` and `(crosscode, markettimestamp)
|
|
203
|
+
`(underlyingcategory, markettimestamp)`, `(underlyingcode, markettimestamp)` and `(crosscode, markettimestamp)`,
|
|
204
|
+
and the venue an audit finds an element by, `(mic, markettimestamp)`; and every row holding `crossuuid` - `fixmsg`, `textline`, `fxrate`, `underlying` - gains `(crossuuid)`,
|
|
205
|
+
the element's one secondary key, which InnoDB reads as `(crossuuid, uuid)` and the message search reads a UUID's element by.
|
|
205
206
|
MySQL indexes no `TEXT`, so an indexed text column is `VARCHAR(191)`, as a
|
|
206
207
|
key is; an index over a `JSON` or `BLOB` column is refused by name.
|
|
207
208
|
`mysql/prisma.config.ts` reads the server from `MYSQL_URL`.
|
|
@@ -211,8 +212,9 @@ key is; an index over a `JSON` or `BLOB` column is refused by name.
|
|
|
211
212
|
`searchWhere(text, underlyings, model, options)` is the core's one message
|
|
212
213
|
search - `fix.Underlyings.messageSearch(text, modelField(model), { registry,
|
|
213
214
|
limit, since, until })` - compiled by `compilePlan`, which takes the core's
|
|
214
|
-
`Plan` as it takes a text. A text the `uuid` column reads is
|
|
215
|
-
|
|
215
|
+
`Plan` as it takes a text. A text the `uuid` column reads is the version it
|
|
216
|
+
names, or on a root holding `crossuuid` every version of the element it keys,
|
|
217
|
+
ordered by `markettimestamp, sequencenumber`; else the branches OR-ed, each carrying its own pruning: the
|
|
216
218
|
underlying rows the text names, `underlyingcode in [...]` within their categories
|
|
217
219
|
`underlyingcategory in [...]`; the plugins `registry` names, `plugincode` or
|
|
218
220
|
`lastplugincode in [...]`; for a text with no blank, `crosscode` and
|
package/dist/index.cjs
CHANGED
|
@@ -146,16 +146,19 @@ var STATED_INDEXES = {
|
|
|
146
146
|
fixmsg: [
|
|
147
147
|
["underlyingcategory", "markettimestamp"],
|
|
148
148
|
["underlyingcode", "markettimestamp"],
|
|
149
|
-
["crosscode", "markettimestamp"]
|
|
150
|
-
|
|
149
|
+
["crosscode", "markettimestamp"],
|
|
150
|
+
["mic", "markettimestamp"]
|
|
151
|
+
],
|
|
152
|
+
fxrate: [["fxsource", "frequency", "underlyingcategory", "crosscode", "markettimestamp", "technicaltimestamp"]]
|
|
151
153
|
};
|
|
152
154
|
function rowIndexes(field, key = rowKey(field)) {
|
|
155
|
+
const element = field.getField("crossuuid") !== null ? [["crossuuid"]] : [];
|
|
153
156
|
const stated = STATED_INDEXES[field.name];
|
|
154
|
-
if (stated !== void 0) return stated.map((index) => [...index]);
|
|
157
|
+
if (stated !== void 0) return [...stated.map((index) => [...index]), ...element];
|
|
155
158
|
const columns = [.../* @__PURE__ */ new Set([...field.partitionFieldNames(), ...field.sort.by ?? []])];
|
|
156
159
|
const keys = key === null ? [] : typeof key === "string" ? [key] : key;
|
|
157
160
|
const keyed = columns.length === keys.length && columns.every((column, at) => column === keys[at]);
|
|
158
|
-
return columns.length === 0 || keyed ? [] : [columns];
|
|
161
|
+
return [...columns.length === 0 || keyed ? [] : [columns], ...element];
|
|
159
162
|
}
|
|
160
163
|
function fractionUnit(digits) {
|
|
161
164
|
return digits <= 0 ? "s" : digits <= 3 ? "ms" : "us";
|
|
@@ -206,7 +209,7 @@ function mysqlNative(column) {
|
|
|
206
209
|
return `decimal(${precision},${Number(args[1] ?? 0)})`;
|
|
207
210
|
}
|
|
208
211
|
case "DateTime":
|
|
209
|
-
if (native === "DateTime" || native === "Timestamp") return `datetime64(${fractionUnit(digits ?? 0)}, UTC)`;
|
|
212
|
+
if (native === "DateTime" || native === "Timestamp") return `datetime64(${fractionUnit(digits ?? 0)}, "Etc/UTC")`;
|
|
210
213
|
if (native === "Date") return "date32";
|
|
211
214
|
if (native === "Time") return `time(${fractionUnit(digits ?? 0)})`;
|
|
212
215
|
return null;
|
|
@@ -242,7 +245,7 @@ function mysqlDatatype(column, isMember) {
|
|
|
242
245
|
case "Boolean":
|
|
243
246
|
return "boolean";
|
|
244
247
|
case "DateTime":
|
|
245
|
-
return
|
|
248
|
+
return 'datetime64(ms, "Etc/UTC")';
|
|
246
249
|
case "Bytes":
|
|
247
250
|
return "binary";
|
|
248
251
|
default:
|
|
@@ -460,7 +463,7 @@ function itemDatatype(column) {
|
|
|
460
463
|
case "Boolean":
|
|
461
464
|
return "boolean";
|
|
462
465
|
case "DateTime":
|
|
463
|
-
return Number(args[0]) > 3 ?
|
|
466
|
+
return Number(args[0]) > 3 ? 'datetime64(us, "Etc/UTC")' : 'datetime64(ms, "Etc/UTC")';
|
|
464
467
|
case "Json":
|
|
465
468
|
return "utf8";
|
|
466
469
|
case "Bytes":
|