@venizia/ignis-connectors 0.4.8-16 → 0.4.8-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/dist/esm/relational/postgres/models/common/types/enrichers.d.ts +4 -1
- package/dist/esm/relational/postgres/models/common/types/enrichers.js.map +1 -1
- package/dist/esm/relational/postgres/models/enrichers/data-type.enricher.d.ts +3 -2
- package/dist/esm/relational/postgres/models/enrichers/data-type.enricher.js.map +1 -1
- package/dist/esm/relational/sqlite/models/common/types/enrichers.d.ts +4 -1
- package/dist/esm/relational/sqlite/models/common/types/enrichers.js.map +1 -1
- package/dist/esm/relational/sqlite/models/enrichers/data-type.enricher.d.ts +3 -2
- package/dist/esm/relational/sqlite/models/enrichers/data-type.enricher.js +1 -3
- package/dist/esm/relational/sqlite/models/enrichers/data-type.enricher.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TIdSchemaType } from '@venizia/ignis-kernel';
|
|
2
|
+
import type { TJsonValue } from '@venizia/ignis-helpers/common';
|
|
2
3
|
import type { PgSequenceOptions } from 'drizzle-orm/pg-core';
|
|
3
4
|
import type { TBigIntMode } from '../constants.js';
|
|
4
5
|
/** Options of `PostgresDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */
|
|
@@ -8,7 +9,9 @@ export type TDataTypeEnricherOptions = {
|
|
|
8
9
|
nValue: number;
|
|
9
10
|
tValue: string;
|
|
10
11
|
bValue: Buffer;
|
|
11
|
-
jValue:
|
|
12
|
+
jValue: TJsonValue[] | {
|
|
13
|
+
[key: string]: TJsonValue;
|
|
14
|
+
};
|
|
12
15
|
boValue: boolean;
|
|
13
16
|
}>;
|
|
14
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichers.js","sourceRoot":"","sources":["../../../../../../../src/relational/postgres/models/common/types/enrichers.ts"],"names":[],"mappings":"","sourcesContent":["import type { TIdSchemaType } from '@venizia/ignis-kernel';\nimport type { PgSequenceOptions } from 'drizzle-orm/pg-core';\nimport type { TBigIntMode } from '../constants';\n\n/** Options of `PostgresDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */\nexport type TDataTypeEnricherOptions = {\n defaultValue: Partial<{\n dataType: string;\n nValue: number;\n tValue: string;\n bValue: Buffer;\n jValue:
|
|
1
|
+
{"version":3,"file":"enrichers.js","sourceRoot":"","sources":["../../../../../../../src/relational/postgres/models/common/types/enrichers.ts"],"names":[],"mappings":"","sourcesContent":["import type { TIdSchemaType } from '@venizia/ignis-kernel';\nimport type { TJsonValue } from '@venizia/ignis-helpers/common';\nimport type { PgSequenceOptions } from 'drizzle-orm/pg-core';\nimport type { TBigIntMode } from '../constants';\n\n/** Options of `PostgresDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */\nexport type TDataTypeEnricherOptions = {\n defaultValue: Partial<{\n dataType: string;\n nValue: number;\n tValue: string;\n bValue: Buffer;\n jValue: TJsonValue[] | { [key: string]: TJsonValue };\n boValue: boolean;\n }>;\n};\n\n/** Options for the `id` primary-key column: `string` (generated text id), `number` (identity) or `big-number` (identity, `numberMode` picks the JS type). */\nexport type TIdEnricherOptions = {\n /** @default { dataType: 'number' } */\n id?: { columnName?: string } & (\n | { dataType: 'string'; generator?: () => string }\n | {\n dataType: 'number';\n sequenceOptions?: PgSequenceOptions;\n }\n | {\n dataType: 'big-number';\n numberMode: TBigIntMode;\n sequenceOptions?: PgSequenceOptions;\n }\n );\n};\n\n/** Options of `PostgresPrincipalEnricher`: the discriminator name, the id column type `polymorphicIdType` (required), and whether the id and the type column are nullable. */\nexport type TPrincipalEnricherOptions<\n Discriminator extends string = string,\n PolymorphicIdType extends TIdSchemaType = TIdSchemaType,\n Nullable extends boolean = false,\n NullableDiscriminator extends boolean = true,\n> = {\n /**\n * The prefix of the `{discriminator}Type` and `{discriminator}Id` columns.\n *\n * @default 'principal'\n */\n discriminator?: Discriminator;\n defaultPolymorphic?: string;\n polymorphicIdType: PolymorphicIdType;\n /**\n * Whether the `{discriminator}Id` column allows NULL.\n *\n * @default false\n */\n isNullableId?: Nullable;\n /**\n * `true` leaves the `{discriminator}Type` column nullable with a `''` default. `false`\n * makes it `NOT NULL` with no default, so an insert must give the type; a `defaultPolymorphic`\n * keeps that default.\n *\n * @default true\n */\n isNullableDiscriminator?: NullableDiscriminator;\n};\n\n/** Options for the timestamp columns. `created` is always present. */\nexport type TTzEnricherOptions = {\n /** @default { columnName: 'created_at', withTimezone: true } */\n created?: { columnName: string; withTimezone: boolean };\n /** @default { enable: true, columnName: 'modified_at', withTimezone: true } */\n modified?: { enable: false } | { enable?: true; columnName: string; withTimezone: boolean };\n /** @default { enable: false } */\n deleted?: { enable: false } | { enable?: true; columnName: string; withTimezone: boolean };\n};\n\n/** One audit column of `PostgresUserAuditEnricher`: its id type (`number` or `string`), its column name, and whether a missing user is allowed. */\nexport type TUserAuditColumnOpts = {\n dataType: TIdSchemaType;\n columnName: string;\n /** @default true */\n allowAnonymous?: boolean;\n};\n\n/** Options of `PostgresUserAuditEnricher`: the `created` and `modified` user columns. */\nexport type TUserAuditEnricherOptions = {\n /** @default { dataType: 'number', columnName: 'created_by', allowAnonymous: true } */\n created?: TUserAuditColumnOpts;\n /** @default { dataType: 'number', columnName: 'modified_by', allowAnonymous: true } */\n modified?: TUserAuditColumnOpts;\n};\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TJsonValue } from '@venizia/ignis-helpers/common';
|
|
1
2
|
import type { TColumnDefinitions, TDataTypeEnricherOptions } from '../common/types/index.js';
|
|
2
3
|
/** Adds the typed value columns `data_type`, `n_value`, `t_value`, `b_value`, `j_value` and `bo_value`; `defaultValue` sets a column default only when the key is present. */
|
|
3
4
|
export declare class PostgresDataTypeEnricher {
|
|
@@ -13,7 +14,7 @@ export declare class PostgresDataTypeEnricher {
|
|
|
13
14
|
driverParam: unknown;
|
|
14
15
|
enumValues: undefined;
|
|
15
16
|
}>;
|
|
16
|
-
jValue: import("drizzle-orm").$Type<import("drizzle-orm/pg-core").PgJsonbBuilderInitial<"j_value">,
|
|
17
|
+
jValue: import("drizzle-orm").$Type<import("drizzle-orm/pg-core").PgJsonbBuilderInitial<"j_value">, TJsonValue>;
|
|
17
18
|
boValue: import("drizzle-orm/pg-core").PgBooleanBuilderInitial<"bo_value">;
|
|
18
19
|
};
|
|
19
20
|
static enrich(opts: {
|
|
@@ -31,7 +32,7 @@ export declare class PostgresDataTypeEnricher {
|
|
|
31
32
|
driverParam: unknown;
|
|
32
33
|
enumValues: undefined;
|
|
33
34
|
}>;
|
|
34
|
-
jValue: import("drizzle-orm").$Type<import("drizzle-orm/pg-core").PgJsonbBuilderInitial<"j_value">,
|
|
35
|
+
jValue: import("drizzle-orm").$Type<import("drizzle-orm/pg-core").PgJsonbBuilderInitial<"j_value">, TJsonValue>;
|
|
35
36
|
boValue: import("drizzle-orm/pg-core").PgBooleanBuilderInitial<"bo_value">;
|
|
36
37
|
};
|
|
37
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-type.enricher.js","sourceRoot":"","sources":["../../../../../../src/relational/postgres/models/enrichers/data-type.enricher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-type.enricher.js","sourceRoot":"","sources":["../../../../../../src/relational/postgres/models/enrichers/data-type.enricher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAIxF,MAAM,SAAS,GAAG,UAAU,CAAmB;IAC7C,QAAQ;QACN,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CA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AAC;gBACnD,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;SAC1B,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,IAAyE;QACrF,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAChD,MAAM,IAAI,GAAG,wBAAwB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAEvE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { boolean, customType, doublePrecision, jsonb, text } from 'drizzle-orm/pg-core';\nimport type { TJsonValue } from '@venizia/ignis-helpers/common';\nimport type { TColumnDefinitions, TDataTypeEnricherOptions } from '../common/types';\n\nconst byteaType = customType<{ data: Buffer }>({\n dataType() {\n return 'bytea';\n },\n});\n\n/** Adds the typed value columns `data_type`, `n_value`, `t_value`, `b_value`, `j_value` and `bo_value`; `defaultValue` sets a column default only when the key is present. */\nexport class PostgresDataTypeEnricher {\n static generateColumnDefs(opts?: TDataTypeEnricherOptions) {\n const { defaultValue } = opts ?? {};\n\n // Gate on presence, not truthiness - `0`, `''` and `false` are legitimate defaults.\n return {\n dataType:\n defaultValue?.dataType !== undefined\n ? text('data_type').default(defaultValue.dataType)\n : text('data_type'),\n nValue:\n defaultValue?.nValue !== undefined\n ? doublePrecision('n_value').default(defaultValue.nValue)\n : doublePrecision('n_value'),\n tValue:\n defaultValue?.tValue !== undefined\n ? text('t_value').default(defaultValue.tValue)\n : text('t_value'),\n bValue:\n defaultValue?.bValue !== undefined\n ? byteaType('b_value').default(defaultValue.bValue)\n : byteaType('b_value'),\n jValue:\n defaultValue?.jValue !== undefined\n ? jsonb('j_value').default(defaultValue.jValue).$type<TJsonValue>()\n : jsonb('j_value').$type<TJsonValue>(),\n boValue:\n defaultValue?.boValue !== undefined\n ? boolean('bo_value').default(defaultValue.boValue)\n : boolean('bo_value'),\n };\n }\n\n static enrich(opts: { baseSchema: TColumnDefinitions; opts?: TDataTypeEnricherOptions }) {\n const { baseSchema, opts: enricherOpts } = opts;\n const defs = PostgresDataTypeEnricher.generateColumnDefs(enricherOpts);\n\n return { ...baseSchema, ...defs };\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TIdSchemaType } from '@venizia/ignis-kernel';
|
|
2
|
+
import type { TJsonValue } from '@venizia/ignis-helpers/common';
|
|
2
3
|
/** Options of `SqliteDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */
|
|
3
4
|
export type TDataTypeEnricherOptions = {
|
|
4
5
|
defaultValue: Partial<{
|
|
@@ -6,7 +7,9 @@ export type TDataTypeEnricherOptions = {
|
|
|
6
7
|
nValue: number;
|
|
7
8
|
tValue: string;
|
|
8
9
|
bValue: Buffer;
|
|
9
|
-
jValue:
|
|
10
|
+
jValue: TJsonValue[] | {
|
|
11
|
+
[key: string]: TJsonValue;
|
|
12
|
+
};
|
|
10
13
|
boValue: boolean;
|
|
11
14
|
}>;
|
|
12
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichers.js","sourceRoot":"","sources":["../../../../../../../src/relational/sqlite/models/common/types/enrichers.ts"],"names":[],"mappings":"","sourcesContent":["import type { TIdSchemaType } from '@venizia/ignis-kernel';\n\n/** Options of `SqliteDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */\nexport type TDataTypeEnricherOptions = {\n defaultValue: Partial<{\n dataType: string;\n nValue: number;\n tValue: string;\n bValue: Buffer;\n jValue:
|
|
1
|
+
{"version":3,"file":"enrichers.js","sourceRoot":"","sources":["../../../../../../../src/relational/sqlite/models/common/types/enrichers.ts"],"names":[],"mappings":"","sourcesContent":["import type { TIdSchemaType } from '@venizia/ignis-kernel';\nimport type { TJsonValue } from '@venizia/ignis-helpers/common';\n\n/** Options of `SqliteDataTypeEnricher`: per-column defaults for the generic typed-value columns. A default is applied when its key is present, so `0`, `''` and `false` count. */\nexport type TDataTypeEnricherOptions = {\n defaultValue: Partial<{\n dataType: string;\n nValue: number;\n tValue: string;\n bValue: Buffer;\n jValue: TJsonValue[] | { [key: string]: TJsonValue };\n boValue: boolean;\n }>;\n};\n\n/**\n * SQLite has no sequences or identity columns - an integer primary key is the table's rowid, which\n * the engine assigns. `autoIncrement` maps to `AUTOINCREMENT`, which additionally forbids reusing a\n * deleted row's id, matching Postgres `generatedAlwaysAsIdentity`.\n */\nexport type TIdEnricherOptions = {\n /** @default { dataType: 'number' } */\n id?:\n | {\n dataType: 'string';\n /**\n * Builds each new id.\n *\n * @default a UUID v7\n */\n generator?: () => string;\n }\n | {\n dataType: 'number';\n /** @default true */\n autoIncrement?: boolean;\n };\n};\n\n/** Options of `SqlitePrincipalEnricher`: the discriminator name, the id column type, and whether the id and the type column are nullable. */\nexport type TPrincipalEnricherOptions<\n Discriminator extends string = string,\n PolymorphicIdType extends TIdSchemaType = TIdSchemaType,\n Nullable extends boolean = false,\n NullableDiscriminator extends boolean = true,\n> = {\n /** @default 'principal' */\n discriminator?: Discriminator;\n defaultPolymorphic?: string;\n polymorphicIdType: PolymorphicIdType;\n /** @default false */\n isNullableId?: Nullable;\n /**\n * `true` leaves the `{discriminator}Type` column nullable with a `''` default. `false`\n * makes it `NOT NULL` with no default, so an insert must give the type; a `defaultPolymorphic`\n * keeps that default.\n *\n * @default true\n */\n isNullableDiscriminator?: NullableDiscriminator;\n};\n\n/**\n * No `withTimezone` twin of the Postgres options: with no `timestamptz`, every timestamp is an ISO\n * 8601 UTC string carrying its own offset. Omitting `enable` opts the column IN - only\n * `enable: false` drops it.\n */\nexport type TTzEnricherOptions = {\n /** @default { columnName: 'created_at' } */\n created?: { columnName: string };\n /** @default { enable: true, columnName: 'modified_at' } */\n modified?: { enable: false } | { enable?: true; columnName: string };\n /** @default { enable: false } */\n deleted?: { enable: false } | { enable?: true; columnName: string };\n};\n\n/** One audit column of `SqliteUserAuditEnricher`: its id type (`number` or `string`), its column name, and whether a missing user is allowed (`allowAnonymous`). */\nexport type TUserAuditColumnOpts = {\n dataType: TIdSchemaType;\n columnName: string;\n /** @default true */\n allowAnonymous?: boolean;\n};\n\n/** Options of `SqliteUserAuditEnricher`: the `created` and `modified` user columns. */\nexport type TUserAuditEnricherOptions = {\n /** @default { dataType: 'number', columnName: 'created_by', allowAnonymous: true } */\n created?: TUserAuditColumnOpts;\n /** @default { dataType: 'number', columnName: 'modified_by', allowAnonymous: true } */\n modified?: TUserAuditColumnOpts;\n};\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TJsonValue } from '@venizia/ignis-helpers/common';
|
|
1
2
|
import type { TColumnDefinitions, TDataTypeEnricherOptions } from '../common/types/index.js';
|
|
2
3
|
/** Adds the generic typed-value columns (`data_type`, `n_value`, `t_value`, `b_value`, `j_value`, `bo_value`) to a table's column definitions. */
|
|
3
4
|
export declare class SqliteDataTypeEnricher {
|
|
@@ -10,7 +11,7 @@ export declare class SqliteDataTypeEnricher {
|
|
|
10
11
|
nValue: import("drizzle-orm/sqlite-core").SQLiteRealBuilderInitial<"n_value">;
|
|
11
12
|
tValue: import("drizzle-orm/sqlite-core").SQLiteTextBuilderInitial<"t_value", [string, ...string[]], number | undefined>;
|
|
12
13
|
bValue: import("drizzle-orm/sqlite-core").SQLiteBlobBufferBuilderInitial<"b_value">;
|
|
13
|
-
jValue: import("drizzle-orm").$Type<import("drizzle-orm/sqlite-core").SQLiteTextJsonBuilderInitial<"j_value">,
|
|
14
|
+
jValue: import("drizzle-orm").$Type<import("drizzle-orm/sqlite-core").SQLiteTextJsonBuilderInitial<"j_value">, TJsonValue>;
|
|
14
15
|
boValue: import("drizzle-orm/sqlite-core").SQLiteBooleanBuilderInitial<"bo_value">;
|
|
15
16
|
};
|
|
16
17
|
static enrich(opts: {
|
|
@@ -21,7 +22,7 @@ export declare class SqliteDataTypeEnricher {
|
|
|
21
22
|
nValue: import("drizzle-orm/sqlite-core").SQLiteRealBuilderInitial<"n_value">;
|
|
22
23
|
tValue: import("drizzle-orm/sqlite-core").SQLiteTextBuilderInitial<"t_value", [string, ...string[]], number | undefined>;
|
|
23
24
|
bValue: import("drizzle-orm/sqlite-core").SQLiteBlobBufferBuilderInitial<"b_value">;
|
|
24
|
-
jValue: import("drizzle-orm").$Type<import("drizzle-orm/sqlite-core").SQLiteTextJsonBuilderInitial<"j_value">,
|
|
25
|
+
jValue: import("drizzle-orm").$Type<import("drizzle-orm/sqlite-core").SQLiteTextJsonBuilderInitial<"j_value">, TJsonValue>;
|
|
25
26
|
boValue: import("drizzle-orm/sqlite-core").SQLiteBooleanBuilderInitial<"bo_value">;
|
|
26
27
|
};
|
|
27
28
|
}
|
|
@@ -22,9 +22,7 @@ export class SqliteDataTypeEnricher {
|
|
|
22
22
|
? blob('b_value', { mode: 'buffer' }).default(defaultValue.bValue)
|
|
23
23
|
: blob('b_value', { mode: 'buffer' }),
|
|
24
24
|
jValue: defaultValue?.jValue !== undefined
|
|
25
|
-
? text('j_value', { mode: 'json' })
|
|
26
|
-
.default(defaultValue.jValue)
|
|
27
|
-
.$type()
|
|
25
|
+
? text('j_value', { mode: 'json' }).default(defaultValue.jValue).$type()
|
|
28
26
|
: text('j_value', { mode: 'json' }).$type(),
|
|
29
27
|
boValue: defaultValue?.boValue !== undefined
|
|
30
28
|
? integer('bo_value', { mode: 'boolean' }).default(defaultValue.boValue)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-type.enricher.js","sourceRoot":"","sources":["../../../../../../src/relational/sqlite/models/enrichers/data-type.enricher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"data-type.enricher.js","sourceRoot":"","sources":["../../../../../../src/relational/sqlite/models/enrichers/data-type.enricher.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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ACpF,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,EAAc;YAC3D,OAAO,EACL,YAAY,EAAE,OAAO,KAAK,SAAS;gBACjC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC;gBACxE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;SAC/C,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,IAAyE;QACrF,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;QAChD,MAAM,IAAI,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAErE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,IAAI,EAAE,CAAC;IACpC,CAAC;CACF","sourcesContent":["import { blob, integer, real, text } from 'drizzle-orm/sqlite-core';\nimport type { TJsonValue } from '@venizia/ignis-helpers/common';\nimport type { TColumnDefinitions, TDataTypeEnricherOptions } from '../common/types';\n\n/** Adds the generic typed-value columns (`data_type`, `n_value`, `t_value`, `b_value`, `j_value`, `bo_value`) to a table's column definitions. */\nexport class SqliteDataTypeEnricher {\n /**\n * Storage-class mapping of the Postgres twin: `double precision` -> `real`, `bytea` -> `blob`,\n * `boolean` -> `integer` 0/1, `jsonb` -> text-mode json so `json_extract` / `->>` can read it.\n */\n static generateColumnDefs(opts?: TDataTypeEnricherOptions) {\n const { defaultValue } = opts ?? {};\n\n // Gate on presence, not truthiness - `0`, `''` and `false` are legitimate defaults.\n return {\n dataType:\n defaultValue?.dataType !== undefined\n ? text('data_type').default(defaultValue.dataType)\n : text('data_type'),\n nValue:\n defaultValue?.nValue !== undefined\n ? real('n_value').default(defaultValue.nValue)\n : real('n_value'),\n tValue:\n defaultValue?.tValue !== undefined\n ? text('t_value').default(defaultValue.tValue)\n : text('t_value'),\n bValue:\n defaultValue?.bValue !== undefined\n ? blob('b_value', { mode: 'buffer' }).default(defaultValue.bValue)\n : blob('b_value', { mode: 'buffer' }),\n jValue:\n defaultValue?.jValue !== undefined\n ? text('j_value', { mode: 'json' }).default(defaultValue.jValue).$type<TJsonValue>()\n : text('j_value', { mode: 'json' }).$type<TJsonValue>(),\n boValue:\n defaultValue?.boValue !== undefined\n ? integer('bo_value', { mode: 'boolean' }).default(defaultValue.boValue)\n : integer('bo_value', { mode: 'boolean' }),\n };\n }\n\n static enrich(opts: { baseSchema: TColumnDefinitions; opts?: TDataTypeEnricherOptions }) {\n const { baseSchema, opts: enricherOpts } = opts;\n const defs = SqliteDataTypeEnricher.generateColumnDefs(enricherOpts);\n\n return { ...baseSchema, ...defs };\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-connectors",
|
|
3
|
-
"version": "0.4.8-
|
|
3
|
+
"version": "0.4.8-17",
|
|
4
4
|
"description": "Datasource and repository connectors for the IGNIS framework: the engine-neutral relational and search tiers, plus Postgres, SQLite, PGlite, Typesense and Meilisearch behind sub-paths.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -97,16 +97,16 @@
|
|
|
97
97
|
"force-update": "sh ../../scripts/build/force-update.sh"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
|
-
"@venizia/ignis-filter": "0.4.7-
|
|
101
|
-
"@venizia/ignis-helpers": "0.4.8-
|
|
100
|
+
"@venizia/ignis-filter": "0.4.7-7",
|
|
101
|
+
"@venizia/ignis-helpers": "0.4.8-15",
|
|
102
102
|
"@venizia/ignis-inversion": "0.4.7-5",
|
|
103
|
-
"@venizia/ignis-kernel": "0.4.8-
|
|
103
|
+
"@venizia/ignis-kernel": "0.4.8-17",
|
|
104
104
|
"zod": "^4.6.7"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@types/bun": "^1.4.3",
|
|
108
108
|
"@types/pg": "^8.23.1",
|
|
109
|
-
"@venizia/dev-configs": "0.4.8-
|
|
109
|
+
"@venizia/dev-configs": "0.4.8-11",
|
|
110
110
|
"eslint": "^10.13.0",
|
|
111
111
|
"oxlint": "1.89.0",
|
|
112
112
|
"oxlint-tsgolint": "7.0.2004",
|