@mikro-orm/knex 6.4.6-dev.8 → 7.0.0-dev.0
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/AbstractSqlConnection.d.ts +15 -25
- package/AbstractSqlConnection.js +98 -126
- package/AbstractSqlDriver.d.ts +20 -13
- package/AbstractSqlDriver.js +73 -54
- package/AbstractSqlPlatform.d.ts +15 -3
- package/AbstractSqlPlatform.js +32 -11
- package/README.md +0 -2
- package/SqlEntityManager.d.ts +5 -6
- package/SqlEntityManager.js +5 -5
- package/SqlEntityRepository.d.ts +1 -6
- package/SqlEntityRepository.js +0 -6
- package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -0
- package/dialects/mssql/MsSqlNativeQueryBuilder.js +161 -0
- package/dialects/mssql/index.d.ts +1 -1
- package/dialects/mssql/index.js +1 -1
- package/dialects/mysql/MySqlExceptionConverter.js +1 -0
- package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +7 -0
- package/dialects/mysql/MySqlNativeQueryBuilder.js +81 -0
- package/dialects/mysql/MySqlPlatform.d.ts +5 -1
- package/dialects/mysql/MySqlPlatform.js +9 -1
- package/dialects/mysql/MySqlSchemaHelper.d.ts +6 -12
- package/dialects/mysql/MySqlSchemaHelper.js +42 -75
- package/dialects/mysql/index.d.ts +1 -3
- package/dialects/mysql/index.js +1 -3
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +5 -0
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +12 -0
- package/dialects/postgresql/index.d.ts +1 -1
- package/dialects/postgresql/index.js +1 -1
- package/dialects/sqlite/BaseSqliteConnection.d.ts +0 -5
- package/dialects/sqlite/BaseSqliteConnection.js +4 -42
- package/dialects/sqlite/BaseSqlitePlatform.d.ts +15 -3
- package/dialects/sqlite/BaseSqlitePlatform.js +20 -4
- package/dialects/sqlite/SqliteExceptionConverter.d.ts +9 -0
- package/dialects/sqlite/SqliteExceptionConverter.js +55 -0
- package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +6 -0
- package/dialects/sqlite/SqliteNativeQueryBuilder.js +15 -0
- package/dialects/sqlite/SqliteSchemaHelper.d.ts +38 -0
- package/dialects/sqlite/SqliteSchemaHelper.js +384 -0
- package/dialects/sqlite/index.d.ts +3 -5
- package/dialects/sqlite/index.js +3 -5
- package/index.d.ts +1 -2
- package/index.js +3 -5
- package/index.mjs +10 -13
- package/package.json +4 -18
- package/query/CriteriaNodeFactory.js +5 -5
- package/query/NativeQueryBuilder.d.ts +108 -0
- package/query/NativeQueryBuilder.js +429 -0
- package/query/ObjectCriteriaNode.js +3 -3
- package/query/QueryBuilder.d.ts +30 -34
- package/query/QueryBuilder.js +112 -123
- package/query/QueryBuilderHelper.d.ts +27 -23
- package/query/QueryBuilderHelper.js +174 -168
- package/query/ScalarCriteriaNode.js +4 -0
- package/query/index.d.ts +1 -0
- package/query/index.js +1 -0
- package/schema/DatabaseSchema.js +9 -6
- package/schema/DatabaseTable.d.ts +2 -1
- package/schema/DatabaseTable.js +9 -5
- package/schema/SchemaComparator.d.ts +1 -2
- package/schema/SchemaComparator.js +31 -18
- package/schema/SchemaHelper.d.ts +27 -33
- package/schema/SchemaHelper.js +294 -184
- package/schema/SqlSchemaGenerator.d.ts +3 -9
- package/schema/SqlSchemaGenerator.js +105 -229
- package/typings.d.ts +7 -17
- package/MonkeyPatchable.d.ts +0 -18
- package/MonkeyPatchable.js +0 -60
- package/dialects/mssql/MsSqlColumnCompiler.d.ts +0 -4
- package/dialects/mssql/MsSqlColumnCompiler.js +0 -10
- package/dialects/mssql/MsSqlKnexDialect.d.ts +0 -6
- package/dialects/mssql/MsSqlKnexDialect.js +0 -22
- package/dialects/mssql/MsSqlQueryCompiler.d.ts +0 -12
- package/dialects/mssql/MsSqlQueryCompiler.js +0 -94
- package/dialects/mssql/MsSqlTableCompiler.d.ts +0 -9
- package/dialects/mssql/MsSqlTableCompiler.js +0 -40
- package/dialects/mysql/MariaDbKnexDialect.d.ts +0 -6
- package/dialects/mysql/MariaDbKnexDialect.js +0 -16
- package/dialects/mysql/MySqlColumnCompiler.d.ts +0 -7
- package/dialects/mysql/MySqlColumnCompiler.js +0 -26
- package/dialects/mysql/MySqlConnection.d.ts +0 -8
- package/dialects/mysql/MySqlConnection.js +0 -43
- package/dialects/mysql/MySqlKnexDialect.d.ts +0 -5
- package/dialects/mysql/MySqlKnexDialect.js +0 -17
- package/dialects/mysql/MySqlQueryCompiler.d.ts +0 -5
- package/dialects/mysql/MySqlQueryCompiler.js +0 -23
- package/dialects/postgresql/PostgreSqlKnexDialect.d.ts +0 -7
- package/dialects/postgresql/PostgreSqlKnexDialect.js +0 -20
- package/dialects/postgresql/PostgreSqlQueryCompiler.d.ts +0 -4
- package/dialects/postgresql/PostgreSqlQueryCompiler.js +0 -13
- package/dialects/postgresql/PostgreSqlTableCompiler.d.ts +0 -11
- package/dialects/postgresql/PostgreSqlTableCompiler.js +0 -89
- package/dialects/sqlite/BaseSqliteSchemaHelper.d.ts +0 -28
- package/dialects/sqlite/BaseSqliteSchemaHelper.js +0 -200
- package/dialects/sqlite/BetterSqliteKnexDialect.d.ts +0 -5
- package/dialects/sqlite/BetterSqliteKnexDialect.js +0 -15
- package/dialects/sqlite/LibSqlKnexDialect.d.ts +0 -11
- package/dialects/sqlite/LibSqlKnexDialect.js +0 -85
- package/dialects/sqlite/SqliteKnexDialect.d.ts +0 -8
- package/dialects/sqlite/SqliteKnexDialect.js +0 -67
- package/dialects/sqlite/SqliteTableCompiler.d.ts +0 -6
- package/dialects/sqlite/SqliteTableCompiler.js +0 -71
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SqliteExceptionConverter = void 0;
|
|
4
|
+
const core_1 = require("@mikro-orm/core");
|
|
5
|
+
class SqliteExceptionConverter extends core_1.ExceptionConverter {
|
|
6
|
+
/* istanbul ignore next */
|
|
7
|
+
/**
|
|
8
|
+
* @inheritDoc
|
|
9
|
+
* @link http://www.sqlite.org/c3ref/c_abort.html
|
|
10
|
+
* @link https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractSQLiteDriver.php
|
|
11
|
+
*/
|
|
12
|
+
convertException(exception) {
|
|
13
|
+
if (exception.message.includes('database is locked')) {
|
|
14
|
+
return new core_1.LockWaitTimeoutException(exception);
|
|
15
|
+
}
|
|
16
|
+
if (exception.message.includes('must be unique') ||
|
|
17
|
+
exception.message.includes('is not unique') ||
|
|
18
|
+
exception.message.includes('are not unique') ||
|
|
19
|
+
exception.message.includes('UNIQUE constraint failed')) {
|
|
20
|
+
return new core_1.UniqueConstraintViolationException(exception);
|
|
21
|
+
}
|
|
22
|
+
if (exception.message.includes('may not be NULL') || exception.message.includes('NOT NULL constraint failed')) {
|
|
23
|
+
return new core_1.NotNullConstraintViolationException(exception);
|
|
24
|
+
}
|
|
25
|
+
if (exception.message.includes('CHECK constraint failed')) {
|
|
26
|
+
return new core_1.CheckConstraintViolationException(exception);
|
|
27
|
+
}
|
|
28
|
+
if (exception.message.includes('no such table:')) {
|
|
29
|
+
return new core_1.TableNotFoundException(exception);
|
|
30
|
+
}
|
|
31
|
+
if (exception.message.includes('already exists')) {
|
|
32
|
+
return new core_1.TableExistsException(exception);
|
|
33
|
+
}
|
|
34
|
+
if (exception.message.includes('no such column:')) {
|
|
35
|
+
return new core_1.InvalidFieldNameException(exception);
|
|
36
|
+
}
|
|
37
|
+
if (exception.message.includes('ambiguous column name')) {
|
|
38
|
+
return new core_1.NonUniqueFieldNameException(exception);
|
|
39
|
+
}
|
|
40
|
+
if (exception.message.includes('syntax error')) {
|
|
41
|
+
return new core_1.SyntaxErrorException(exception);
|
|
42
|
+
}
|
|
43
|
+
if (exception.message.includes('attempt to write a readonly database')) {
|
|
44
|
+
return new core_1.ReadOnlyException(exception);
|
|
45
|
+
}
|
|
46
|
+
if (exception.message.includes('unable to open database file')) {
|
|
47
|
+
return new core_1.ConnectionException(exception);
|
|
48
|
+
}
|
|
49
|
+
if (exception.message.includes('FOREIGN KEY constraint failed')) {
|
|
50
|
+
return new core_1.ForeignKeyConstraintViolationException(exception);
|
|
51
|
+
}
|
|
52
|
+
return super.convertException(exception);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.SqliteExceptionConverter = SqliteExceptionConverter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SqliteNativeQueryBuilder = void 0;
|
|
4
|
+
const NativeQueryBuilder_1 = require("../../query/NativeQueryBuilder");
|
|
5
|
+
/** @internal */
|
|
6
|
+
class SqliteNativeQueryBuilder extends NativeQueryBuilder_1.NativeQueryBuilder {
|
|
7
|
+
compileTruncate() {
|
|
8
|
+
const sql = `delete from ${this.getTableName()}`;
|
|
9
|
+
this.parts.push(sql);
|
|
10
|
+
}
|
|
11
|
+
addLockClause() {
|
|
12
|
+
return; // not supported
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.SqliteNativeQueryBuilder = SqliteNativeQueryBuilder;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Connection } from '@mikro-orm/core';
|
|
2
|
+
import type { AbstractSqlConnection } from '../../AbstractSqlConnection';
|
|
3
|
+
import { SchemaHelper } from '../../schema/SchemaHelper';
|
|
4
|
+
import type { Column, IndexDef, Table, TableDifference } from '../../typings';
|
|
5
|
+
import type { DatabaseTable } from '../../schema/DatabaseTable';
|
|
6
|
+
import type { DatabaseSchema } from '../../schema/DatabaseSchema';
|
|
7
|
+
export declare class SqliteSchemaHelper extends SchemaHelper {
|
|
8
|
+
disableForeignKeysSQL(): string;
|
|
9
|
+
enableForeignKeysSQL(): string;
|
|
10
|
+
supportsSchemaConstraints(): boolean;
|
|
11
|
+
getListTablesSQL(): string;
|
|
12
|
+
getDropDatabaseSQL(name: string): string;
|
|
13
|
+
loadInformationSchema(schema: DatabaseSchema, connection: AbstractSqlConnection, tables: Table[], schemas?: string[]): Promise<void>;
|
|
14
|
+
createTable(table: DatabaseTable, alter?: boolean): string[];
|
|
15
|
+
createTableColumn(column: Column, table: DatabaseTable, _changedProperties?: Set<string>): string | undefined;
|
|
16
|
+
getAddColumnsSQL(table: DatabaseTable, columns: Column[], diff?: TableDifference): string[];
|
|
17
|
+
dropForeignKey(tableName: string, constraintName: string): string;
|
|
18
|
+
getDropColumnsSQL(tableName: string, columns: Column[], schemaName?: string): string;
|
|
19
|
+
getCreateIndexSQL(tableName: string, index: IndexDef): string;
|
|
20
|
+
private parseTableDefinition;
|
|
21
|
+
private getColumns;
|
|
22
|
+
private getEnumDefinitions;
|
|
23
|
+
getPrimaryKeys(connection: AbstractSqlConnection, indexes: IndexDef[], tableName: string, schemaName?: string): Promise<string[]>;
|
|
24
|
+
private getIndexes;
|
|
25
|
+
private getChecks;
|
|
26
|
+
private getColumnDefinitions;
|
|
27
|
+
private getForeignKeys;
|
|
28
|
+
getManagementDbName(): string;
|
|
29
|
+
getCreateDatabaseSQL(name: string): string;
|
|
30
|
+
databaseExists(connection: Connection, name: string): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Implicit indexes will be ignored when diffing
|
|
33
|
+
*/
|
|
34
|
+
isImplicitIndex(name: string): boolean;
|
|
35
|
+
dropIndex(table: string, index: IndexDef, oldIndexName?: string): string;
|
|
36
|
+
alterTable(diff: TableDifference, safe?: boolean): string[];
|
|
37
|
+
private getAlterTempTableSQL;
|
|
38
|
+
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SqliteSchemaHelper = void 0;
|
|
4
|
+
const core_1 = require("@mikro-orm/core");
|
|
5
|
+
const SchemaHelper_1 = require("../../schema/SchemaHelper");
|
|
6
|
+
class SqliteSchemaHelper extends SchemaHelper_1.SchemaHelper {
|
|
7
|
+
disableForeignKeysSQL() {
|
|
8
|
+
return 'pragma foreign_keys = off;';
|
|
9
|
+
}
|
|
10
|
+
enableForeignKeysSQL() {
|
|
11
|
+
return 'pragma foreign_keys = on;';
|
|
12
|
+
}
|
|
13
|
+
supportsSchemaConstraints() {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
getListTablesSQL() {
|
|
17
|
+
return `select name as table_name from sqlite_master where type = 'table' and name != 'sqlite_sequence' and name != 'geometry_columns' and name != 'spatial_ref_sys' `
|
|
18
|
+
+ `union all select name as table_name from sqlite_temp_master where type = 'table' order by name`;
|
|
19
|
+
}
|
|
20
|
+
getDropDatabaseSQL(name) {
|
|
21
|
+
if (name === ':memory:') {
|
|
22
|
+
return '';
|
|
23
|
+
}
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
return `drop database if exists ${this.quote(name)}`;
|
|
26
|
+
}
|
|
27
|
+
async loadInformationSchema(schema, connection, tables, schemas) {
|
|
28
|
+
for (const t of tables) {
|
|
29
|
+
const table = schema.addTable(t.table_name, t.schema_name, t.table_comment);
|
|
30
|
+
const cols = await this.getColumns(connection, table.name, table.schema);
|
|
31
|
+
const indexes = await this.getIndexes(connection, table.name, table.schema);
|
|
32
|
+
const checks = await this.getChecks(connection, table.name, table.schema);
|
|
33
|
+
const pks = await this.getPrimaryKeys(connection, indexes, table.name, table.schema);
|
|
34
|
+
const fks = await this.getForeignKeys(connection, table.name, table.schema);
|
|
35
|
+
const enums = await this.getEnumDefinitions(connection, table.name);
|
|
36
|
+
table.init(cols, indexes, checks, pks, fks, enums);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
createTable(table, alter) {
|
|
40
|
+
let sql = `create table ${table.getQuotedName()} (`;
|
|
41
|
+
const columns = table.getColumns();
|
|
42
|
+
const lastColumn = columns[columns.length - 1].name;
|
|
43
|
+
for (const column of columns) {
|
|
44
|
+
const col = this.createTableColumn(column, table);
|
|
45
|
+
if (col) {
|
|
46
|
+
const comma = column.name === lastColumn ? '' : ', ';
|
|
47
|
+
sql += col + comma;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const primaryKey = table.getPrimaryKey();
|
|
51
|
+
const createPrimary = primaryKey?.composite;
|
|
52
|
+
if (createPrimary && primaryKey) {
|
|
53
|
+
sql += `, primary key (${primaryKey.columnNames.map(c => this.quote(c)).join(', ')})`;
|
|
54
|
+
}
|
|
55
|
+
const parts = [];
|
|
56
|
+
for (const fk of Object.values(table.getForeignKeys())) {
|
|
57
|
+
parts.push(this.createForeignKey(table, fk, false));
|
|
58
|
+
}
|
|
59
|
+
for (const check of table.getChecks()) {
|
|
60
|
+
const sql = `constraint ${this.quote(check.name)} check (${check.expression})`;
|
|
61
|
+
parts.push(sql);
|
|
62
|
+
}
|
|
63
|
+
if (parts.length > 0) {
|
|
64
|
+
sql += ', ' + parts.join(', ');
|
|
65
|
+
}
|
|
66
|
+
sql += ')';
|
|
67
|
+
const ret = [];
|
|
68
|
+
this.append(ret, sql);
|
|
69
|
+
for (const index of table.getIndexes()) {
|
|
70
|
+
this.append(ret, this.createIndex(index, table));
|
|
71
|
+
}
|
|
72
|
+
return ret;
|
|
73
|
+
}
|
|
74
|
+
createTableColumn(column, table, _changedProperties) {
|
|
75
|
+
const col = [this.quote(column.name)];
|
|
76
|
+
const checks = table.getChecks();
|
|
77
|
+
const check = checks.findIndex(check => check.columnName === column.name);
|
|
78
|
+
const useDefault = column.default != null && column.default !== 'null';
|
|
79
|
+
let columnType = column.type;
|
|
80
|
+
if (column.autoincrement) {
|
|
81
|
+
columnType = 'integer';
|
|
82
|
+
}
|
|
83
|
+
if (column.generated) {
|
|
84
|
+
columnType += ` generated always as ${column.generated}`;
|
|
85
|
+
}
|
|
86
|
+
col.push(columnType);
|
|
87
|
+
if (check !== -1) {
|
|
88
|
+
col.push(`check (${checks[check].expression})`);
|
|
89
|
+
checks.splice(check, 1);
|
|
90
|
+
}
|
|
91
|
+
core_1.Utils.runIfNotEmpty(() => col.push('null'), column.nullable);
|
|
92
|
+
core_1.Utils.runIfNotEmpty(() => col.push('not null'), !column.nullable && !column.generated);
|
|
93
|
+
core_1.Utils.runIfNotEmpty(() => col.push('primary key'), column.primary);
|
|
94
|
+
core_1.Utils.runIfNotEmpty(() => col.push('autoincrement'), column.autoincrement);
|
|
95
|
+
core_1.Utils.runIfNotEmpty(() => col.push(`default ${column.default}`), useDefault);
|
|
96
|
+
return col.join(' ');
|
|
97
|
+
}
|
|
98
|
+
getAddColumnsSQL(table, columns, diff) {
|
|
99
|
+
return columns.map(column => {
|
|
100
|
+
let sql = `alter table ${table.getQuotedName()} add column ${this.createTableColumn(column, table)}`;
|
|
101
|
+
const foreignKey = Object.values(diff.addedForeignKeys).find(fk => fk.columnNames.length === 1 && fk.columnNames[0] === column.name);
|
|
102
|
+
if (foreignKey && this.options.createForeignKeyConstraints) {
|
|
103
|
+
delete diff.addedForeignKeys[foreignKey.constraintName];
|
|
104
|
+
sql += ' ' + this.createForeignKey(diff.toTable, foreignKey, false, true);
|
|
105
|
+
}
|
|
106
|
+
return sql;
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
dropForeignKey(tableName, constraintName) {
|
|
110
|
+
return '';
|
|
111
|
+
}
|
|
112
|
+
getDropColumnsSQL(tableName, columns, schemaName) {
|
|
113
|
+
/* istanbul ignore next */
|
|
114
|
+
const name = this.quote((schemaName && schemaName !== this.platform.getDefaultSchemaName() ? schemaName + '.' : '') + tableName);
|
|
115
|
+
return columns.map(column => {
|
|
116
|
+
return `alter table ${name} drop column ${this.quote(column.name)}`;
|
|
117
|
+
}).join(';\n');
|
|
118
|
+
}
|
|
119
|
+
getCreateIndexSQL(tableName, index) {
|
|
120
|
+
/* istanbul ignore next */
|
|
121
|
+
if (index.expression) {
|
|
122
|
+
return index.expression;
|
|
123
|
+
}
|
|
124
|
+
tableName = this.quote(tableName);
|
|
125
|
+
const keyName = this.quote(index.keyName);
|
|
126
|
+
const sql = `create ${index.unique ? 'unique ' : ''}index ${keyName} on ${tableName} `;
|
|
127
|
+
if (index.columnNames.some(column => column.includes('.'))) {
|
|
128
|
+
// JSON columns can have unique index but not unique constraint, and we need to distinguish those, so we can properly drop them
|
|
129
|
+
const sql = `create ${index.unique ? 'unique ' : ''}index ${keyName} on ${tableName} `;
|
|
130
|
+
const columns = this.platform.getJsonIndexDefinition(index);
|
|
131
|
+
return `${sql}(${columns.join(', ')})`;
|
|
132
|
+
}
|
|
133
|
+
return `${sql}(${index.columnNames.map(c => this.quote(c)).join(', ')})`;
|
|
134
|
+
}
|
|
135
|
+
parseTableDefinition(sql, cols) {
|
|
136
|
+
const columns = {};
|
|
137
|
+
const constraints = [];
|
|
138
|
+
// extract all columns definitions
|
|
139
|
+
let columnsDef = sql.replaceAll('\n', '').match(new RegExp(`create table [\`"']?.*?[\`"']? \\((.*)\\)`, 'i'))?.[1];
|
|
140
|
+
/* istanbul ignore else */
|
|
141
|
+
if (columnsDef) {
|
|
142
|
+
if (columnsDef.includes(', constraint ')) {
|
|
143
|
+
constraints.push(...columnsDef.substring(columnsDef.indexOf(', constraint') + 2).split(', '));
|
|
144
|
+
columnsDef = columnsDef.substring(0, columnsDef.indexOf(', constraint'));
|
|
145
|
+
}
|
|
146
|
+
for (let i = cols.length - 1; i >= 0; i--) {
|
|
147
|
+
const col = cols[i];
|
|
148
|
+
const re = ` *, *[\`"']?${col.name}[\`"']? (.*)`;
|
|
149
|
+
const columnDef = columnsDef.match(new RegExp(re, 'i'));
|
|
150
|
+
/* istanbul ignore else */
|
|
151
|
+
if (columnDef) {
|
|
152
|
+
columns[col.name] = { name: col.name, definition: columnDef[1] };
|
|
153
|
+
columnsDef = columnsDef.substring(0, columnDef.index);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return { columns, constraints };
|
|
158
|
+
}
|
|
159
|
+
async getColumns(connection, tableName, schemaName) {
|
|
160
|
+
const columns = await connection.execute(`pragma table_xinfo('${tableName}')`);
|
|
161
|
+
const sql = `select sql from sqlite_master where type = ? and name = ?`;
|
|
162
|
+
const tableDefinition = await connection.execute(sql, ['table', tableName], 'get');
|
|
163
|
+
const composite = columns.reduce((count, col) => count + (col.pk ? 1 : 0), 0) > 1;
|
|
164
|
+
// there can be only one, so naive check like this should be enough
|
|
165
|
+
const hasAutoincrement = tableDefinition.sql.toLowerCase().includes('autoincrement');
|
|
166
|
+
const { columns: columnDefinitions } = this.parseTableDefinition(tableDefinition.sql, columns);
|
|
167
|
+
return columns.map(col => {
|
|
168
|
+
const mappedType = connection.getPlatform().getMappedType(col.type);
|
|
169
|
+
let generated;
|
|
170
|
+
if (col.hidden > 1) {
|
|
171
|
+
/* istanbul ignore next */
|
|
172
|
+
const storage = col.hidden === 2 ? 'virtual' : 'stored';
|
|
173
|
+
const re = `(generated always)? as \\((.*)\\)( ${storage})?$`;
|
|
174
|
+
const match = columnDefinitions[col.name].definition.match(re);
|
|
175
|
+
if (match) {
|
|
176
|
+
generated = `${match[2]} ${storage}`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
name: col.name,
|
|
181
|
+
type: col.type,
|
|
182
|
+
default: col.dflt_value,
|
|
183
|
+
nullable: !col.notnull,
|
|
184
|
+
primary: !!col.pk,
|
|
185
|
+
mappedType,
|
|
186
|
+
unsigned: false,
|
|
187
|
+
autoincrement: !composite && col.pk && this.platform.isNumericColumn(mappedType) && hasAutoincrement,
|
|
188
|
+
generated,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
async getEnumDefinitions(connection, tableName) {
|
|
193
|
+
const sql = `select sql from sqlite_master where type = ? and name = ?`;
|
|
194
|
+
const tableDefinition = await connection.execute(sql, ['table', tableName], 'get');
|
|
195
|
+
const checkConstraints = [...tableDefinition.sql.match(/[`["'][^`\]"']+[`\]"'] text check \(.*?\)/gi) ?? []];
|
|
196
|
+
return checkConstraints.reduce((o, item) => {
|
|
197
|
+
// check constraints are defined as (note that last closing paren is missing):
|
|
198
|
+
// `type` text check (`type` in ('local', 'global')
|
|
199
|
+
const match = item.match(/[`["']([^`\]"']+)[`\]"'] text check \(.* \((.*)\)/i);
|
|
200
|
+
/* istanbul ignore else */
|
|
201
|
+
if (match) {
|
|
202
|
+
o[match[1]] = match[2].split(',').map((item) => item.trim().match(/^\(?'(.*)'/)[1]);
|
|
203
|
+
}
|
|
204
|
+
return o;
|
|
205
|
+
}, {});
|
|
206
|
+
}
|
|
207
|
+
async getPrimaryKeys(connection, indexes, tableName, schemaName) {
|
|
208
|
+
const sql = `pragma table_info(\`${tableName}\`)`;
|
|
209
|
+
const cols = await connection.execute(sql);
|
|
210
|
+
return cols.filter(col => !!col.pk).map(col => col.name);
|
|
211
|
+
}
|
|
212
|
+
async getIndexes(connection, tableName, schemaName) {
|
|
213
|
+
const sql = `pragma table_info(\`${tableName}\`)`;
|
|
214
|
+
const cols = await connection.execute(sql);
|
|
215
|
+
const indexes = await connection.execute(`pragma index_list(\`${tableName}\`)`);
|
|
216
|
+
const ret = [];
|
|
217
|
+
for (const col of cols.filter(c => c.pk)) {
|
|
218
|
+
ret.push({
|
|
219
|
+
columnNames: [col.name],
|
|
220
|
+
keyName: 'primary',
|
|
221
|
+
constraint: true,
|
|
222
|
+
unique: true,
|
|
223
|
+
primary: true,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
for (const index of indexes.filter(index => !this.isImplicitIndex(index.name))) {
|
|
227
|
+
const res = await connection.execute(`pragma index_info(\`${index.name}\`)`);
|
|
228
|
+
ret.push(...res.map(row => ({
|
|
229
|
+
columnNames: [row.name],
|
|
230
|
+
keyName: index.name,
|
|
231
|
+
unique: !!index.unique,
|
|
232
|
+
constraint: !!index.unique,
|
|
233
|
+
primary: false,
|
|
234
|
+
})));
|
|
235
|
+
}
|
|
236
|
+
return this.mapIndexes(ret);
|
|
237
|
+
}
|
|
238
|
+
async getChecks(connection, tableName, schemaName) {
|
|
239
|
+
const { columns, constraints } = await this.getColumnDefinitions(connection, tableName, schemaName);
|
|
240
|
+
const checks = [];
|
|
241
|
+
for (const key of Object.keys(columns)) {
|
|
242
|
+
const column = columns[key];
|
|
243
|
+
const expression = column.definition.match(/ (check \((.*)\))/i);
|
|
244
|
+
if (expression) {
|
|
245
|
+
checks.push({
|
|
246
|
+
name: this.platform.getConfig().getNamingStrategy().indexName(tableName, [column.name], 'check'),
|
|
247
|
+
definition: expression[1],
|
|
248
|
+
expression: expression[2],
|
|
249
|
+
columnName: column.name,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
for (const constraint of constraints) {
|
|
254
|
+
const expression = constraint.match(/constraint *[`"']?(.*?)[`"']? * (check \((.*)\))/i);
|
|
255
|
+
if (expression) {
|
|
256
|
+
checks.push({
|
|
257
|
+
name: expression[1],
|
|
258
|
+
definition: expression[2],
|
|
259
|
+
expression: expression[3],
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return checks;
|
|
264
|
+
}
|
|
265
|
+
async getColumnDefinitions(connection, tableName, schemaName) {
|
|
266
|
+
const columns = await connection.execute(`pragma table_xinfo('${tableName}')`);
|
|
267
|
+
const sql = `select sql from sqlite_master where type = ? and name = ?`;
|
|
268
|
+
const tableDefinition = await connection.execute(sql, ['table', tableName], 'get');
|
|
269
|
+
return this.parseTableDefinition(tableDefinition.sql, columns);
|
|
270
|
+
}
|
|
271
|
+
async getForeignKeys(connection, tableName, schemaName) {
|
|
272
|
+
const { constraints } = await this.getColumnDefinitions(connection, tableName, schemaName);
|
|
273
|
+
const fks = await connection.execute(`pragma foreign_key_list(\`${tableName}\`)`);
|
|
274
|
+
return fks.reduce((ret, fk) => {
|
|
275
|
+
const constraintName = this.platform.getIndexName(tableName, [fk.from], 'foreign');
|
|
276
|
+
const constraint = constraints?.find(c => c.includes(constraintName));
|
|
277
|
+
ret[constraintName] = {
|
|
278
|
+
constraintName,
|
|
279
|
+
columnName: fk.from,
|
|
280
|
+
columnNames: [fk.from],
|
|
281
|
+
localTableName: tableName,
|
|
282
|
+
referencedTableName: fk.table,
|
|
283
|
+
referencedColumnName: fk.to,
|
|
284
|
+
referencedColumnNames: [fk.to],
|
|
285
|
+
updateRule: fk.on_update.toLowerCase(),
|
|
286
|
+
deleteRule: fk.on_delete.toLowerCase(),
|
|
287
|
+
deferMode: constraint?.match(/ deferrable initially (deferred|immediate)/i)?.[1].toLowerCase(),
|
|
288
|
+
};
|
|
289
|
+
return ret;
|
|
290
|
+
}, {});
|
|
291
|
+
}
|
|
292
|
+
getManagementDbName() {
|
|
293
|
+
return '';
|
|
294
|
+
}
|
|
295
|
+
getCreateDatabaseSQL(name) {
|
|
296
|
+
return '';
|
|
297
|
+
}
|
|
298
|
+
async databaseExists(connection, name) {
|
|
299
|
+
const tables = await connection.execute(this.getListTablesSQL());
|
|
300
|
+
return tables.length > 0;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Implicit indexes will be ignored when diffing
|
|
304
|
+
*/
|
|
305
|
+
isImplicitIndex(name) {
|
|
306
|
+
// Ignore indexes with reserved names, e.g. autoindexes
|
|
307
|
+
return name.startsWith('sqlite_');
|
|
308
|
+
}
|
|
309
|
+
dropIndex(table, index, oldIndexName = index.keyName) {
|
|
310
|
+
return `drop index ${this.quote(oldIndexName)}`;
|
|
311
|
+
}
|
|
312
|
+
alterTable(diff, safe) {
|
|
313
|
+
const ret = [];
|
|
314
|
+
const [schemaName, tableName] = this.splitTableName(diff.name);
|
|
315
|
+
if (core_1.Utils.hasObjectKeys(diff.removedChecks)
|
|
316
|
+
|| core_1.Utils.hasObjectKeys(diff.changedChecks)
|
|
317
|
+
|| core_1.Utils.hasObjectKeys(diff.changedForeignKeys)
|
|
318
|
+
|| core_1.Utils.hasObjectKeys(diff.changedColumns)) {
|
|
319
|
+
return this.getAlterTempTableSQL(diff);
|
|
320
|
+
}
|
|
321
|
+
for (const index of Object.values(diff.removedIndexes)) {
|
|
322
|
+
this.append(ret, this.dropIndex(diff.name, index));
|
|
323
|
+
}
|
|
324
|
+
for (const index of Object.values(diff.changedIndexes)) {
|
|
325
|
+
this.append(ret, this.dropIndex(diff.name, index));
|
|
326
|
+
}
|
|
327
|
+
/* istanbul ignore else */
|
|
328
|
+
if (!safe && Object.values(diff.removedColumns).length > 0) {
|
|
329
|
+
this.append(ret, this.getDropColumnsSQL(tableName, Object.values(diff.removedColumns), schemaName));
|
|
330
|
+
}
|
|
331
|
+
if (Object.values(diff.addedColumns).length > 0) {
|
|
332
|
+
this.append(ret, this.getAddColumnsSQL(diff.toTable, Object.values(diff.addedColumns), diff));
|
|
333
|
+
}
|
|
334
|
+
if (core_1.Utils.hasObjectKeys(diff.addedForeignKeys) || core_1.Utils.hasObjectKeys(diff.addedChecks)) {
|
|
335
|
+
return this.getAlterTempTableSQL(diff);
|
|
336
|
+
}
|
|
337
|
+
for (const [oldColumnName, column] of Object.entries(diff.renamedColumns)) {
|
|
338
|
+
this.append(ret, this.getRenameColumnSQL(tableName, oldColumnName, column, schemaName));
|
|
339
|
+
}
|
|
340
|
+
for (const index of Object.values(diff.addedIndexes)) {
|
|
341
|
+
ret.push(this.createIndex(index, diff.toTable));
|
|
342
|
+
}
|
|
343
|
+
for (const index of Object.values(diff.changedIndexes)) {
|
|
344
|
+
ret.push(this.createIndex(index, diff.toTable, true));
|
|
345
|
+
}
|
|
346
|
+
for (const [oldIndexName, index] of Object.entries(diff.renamedIndexes)) {
|
|
347
|
+
if (index.unique) {
|
|
348
|
+
this.append(ret, this.dropIndex(diff.name, index, oldIndexName));
|
|
349
|
+
this.append(ret, this.createIndex(index, diff.toTable));
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.append(ret, this.getRenameIndexSQL(diff.name, index, oldIndexName));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return ret;
|
|
356
|
+
}
|
|
357
|
+
getAlterTempTableSQL(changedTable) {
|
|
358
|
+
const tempName = `${(changedTable.toTable.name)}__temp_alter`;
|
|
359
|
+
const quotedName = this.quote(changedTable.toTable.name);
|
|
360
|
+
const quotedTempName = this.quote(tempName);
|
|
361
|
+
const [first, ...rest] = this.createTable(changedTable.toTable);
|
|
362
|
+
const sql = [
|
|
363
|
+
'pragma foreign_keys = off;',
|
|
364
|
+
first.replace(`create table ${quotedName}`, `create table ${quotedTempName}`),
|
|
365
|
+
];
|
|
366
|
+
const columns = [];
|
|
367
|
+
for (const column of changedTable.toTable.getColumns()) {
|
|
368
|
+
const fromColumn = changedTable.fromTable.getColumn(column.name);
|
|
369
|
+
if (fromColumn) {
|
|
370
|
+
columns.push(this.quote(column.name));
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
columns.push(`null as ${this.quote(column.name)}`);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
sql.push(`insert into ${quotedTempName} select ${columns.join(', ')} from ${quotedName};`);
|
|
377
|
+
sql.push(`drop table ${quotedName};`);
|
|
378
|
+
sql.push(`alter table ${quotedTempName} rename to ${quotedName};`);
|
|
379
|
+
sql.push(...rest);
|
|
380
|
+
sql.push('pragma foreign_keys = on;');
|
|
381
|
+
return sql;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
exports.SqliteSchemaHelper = SqliteSchemaHelper;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export * from './BaseSqliteConnection';
|
|
2
2
|
export * from './BaseSqlitePlatform';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './LibSqlKnexDialect';
|
|
7
|
-
export * from './SqliteKnexDialect';
|
|
3
|
+
export * from './SqliteSchemaHelper';
|
|
4
|
+
export * from './SqliteNativeQueryBuilder';
|
|
5
|
+
export * from './SqliteExceptionConverter';
|
package/dialects/sqlite/index.js
CHANGED
|
@@ -16,8 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BaseSqliteConnection"), exports);
|
|
18
18
|
__exportStar(require("./BaseSqlitePlatform"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./LibSqlKnexDialect"), exports);
|
|
23
|
-
__exportStar(require("./SqliteKnexDialect"), exports);
|
|
19
|
+
__exportStar(require("./SqliteSchemaHelper"), exports);
|
|
20
|
+
__exportStar(require("./SqliteNativeQueryBuilder"), exports);
|
|
21
|
+
__exportStar(require("./SqliteExceptionConverter"), exports);
|
package/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
export * from './AbstractSqlConnection';
|
|
6
6
|
export * from './AbstractSqlDriver';
|
|
7
7
|
export * from './AbstractSqlPlatform';
|
|
8
|
-
export * from './MonkeyPatchable';
|
|
9
8
|
export * from './SqlEntityManager';
|
|
10
9
|
export * from './SqlEntityRepository';
|
|
11
10
|
export * from './query';
|
|
@@ -15,5 +14,5 @@ export * from './typings';
|
|
|
15
14
|
export { SqlEntityManager as EntityManager } from './SqlEntityManager';
|
|
16
15
|
export { SqlEntityRepository as EntityRepository } from './SqlEntityRepository';
|
|
17
16
|
/** @ignore */
|
|
18
|
-
export {
|
|
17
|
+
export { Kysely } from 'kysely';
|
|
19
18
|
export * from '@mikro-orm/core';
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.Kysely = exports.EntityRepository = exports.EntityManager = void 0;
|
|
18
18
|
/**
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
* @module knex
|
|
@@ -23,7 +23,6 @@ exports.knex = exports.Knex = exports.EntityRepository = exports.EntityManager =
|
|
|
23
23
|
__exportStar(require("./AbstractSqlConnection"), exports);
|
|
24
24
|
__exportStar(require("./AbstractSqlDriver"), exports);
|
|
25
25
|
__exportStar(require("./AbstractSqlPlatform"), exports);
|
|
26
|
-
__exportStar(require("./MonkeyPatchable"), exports);
|
|
27
26
|
__exportStar(require("./SqlEntityManager"), exports);
|
|
28
27
|
__exportStar(require("./SqlEntityRepository"), exports);
|
|
29
28
|
__exportStar(require("./query"), exports);
|
|
@@ -35,7 +34,6 @@ Object.defineProperty(exports, "EntityManager", { enumerable: true, get: functio
|
|
|
35
34
|
var SqlEntityRepository_1 = require("./SqlEntityRepository");
|
|
36
35
|
Object.defineProperty(exports, "EntityRepository", { enumerable: true, get: function () { return SqlEntityRepository_1.SqlEntityRepository; } });
|
|
37
36
|
/** @ignore */
|
|
38
|
-
var
|
|
39
|
-
Object.defineProperty(exports, "
|
|
40
|
-
Object.defineProperty(exports, "knex", { enumerable: true, get: function () { return knex_1.knex; } });
|
|
37
|
+
var kysely_1 = require("kysely");
|
|
38
|
+
Object.defineProperty(exports, "Kysely", { enumerable: true, get: function () { return kysely_1.Kysely; } });
|
|
41
39
|
__exportStar(require("@mikro-orm/core"), exports);
|
package/index.mjs
CHANGED
|
@@ -19,12 +19,10 @@ export const ArrayType = mod.ArrayType;
|
|
|
19
19
|
export const BaseEntity = mod.BaseEntity;
|
|
20
20
|
export const BaseSqliteConnection = mod.BaseSqliteConnection;
|
|
21
21
|
export const BaseSqlitePlatform = mod.BaseSqlitePlatform;
|
|
22
|
-
export const BaseSqliteSchemaHelper = mod.BaseSqliteSchemaHelper;
|
|
23
22
|
export const BeforeCreate = mod.BeforeCreate;
|
|
24
23
|
export const BeforeDelete = mod.BeforeDelete;
|
|
25
24
|
export const BeforeUpdate = mod.BeforeUpdate;
|
|
26
25
|
export const BeforeUpsert = mod.BeforeUpsert;
|
|
27
|
-
export const BetterSqliteKnexDialect = mod.BetterSqliteKnexDialect;
|
|
28
26
|
export const BigIntType = mod.BigIntType;
|
|
29
27
|
export const BlobType = mod.BlobType;
|
|
30
28
|
export const BooleanType = mod.BooleanType;
|
|
@@ -112,14 +110,12 @@ export const JSON_KEY_OPERATORS = mod.JSON_KEY_OPERATORS;
|
|
|
112
110
|
export const JoinType = mod.JoinType;
|
|
113
111
|
export const JsonProperty = mod.JsonProperty;
|
|
114
112
|
export const JsonType = mod.JsonType;
|
|
115
|
-
export const
|
|
116
|
-
export const LibSqlKnexDialect = mod.LibSqlKnexDialect;
|
|
113
|
+
export const Kysely = mod.Kysely;
|
|
117
114
|
export const LoadStrategy = mod.LoadStrategy;
|
|
118
115
|
export const LockMode = mod.LockMode;
|
|
119
116
|
export const LockWaitTimeoutException = mod.LockWaitTimeoutException;
|
|
120
117
|
export const ManyToMany = mod.ManyToMany;
|
|
121
118
|
export const ManyToOne = mod.ManyToOne;
|
|
122
|
-
export const MariaDbKnexDialect = mod.MariaDbKnexDialect;
|
|
123
119
|
export const MediumIntType = mod.MediumIntType;
|
|
124
120
|
export const MemoryCacheAdapter = mod.MemoryCacheAdapter;
|
|
125
121
|
export const MetadataDiscovery = mod.MetadataDiscovery;
|
|
@@ -129,13 +125,12 @@ export const MetadataStorage = mod.MetadataStorage;
|
|
|
129
125
|
export const MetadataValidator = mod.MetadataValidator;
|
|
130
126
|
export const MikroORM = mod.MikroORM;
|
|
131
127
|
export const MongoNamingStrategy = mod.MongoNamingStrategy;
|
|
132
|
-
export const
|
|
133
|
-
export const MsSqlKnexDialect = mod.MsSqlKnexDialect;
|
|
134
|
-
export const MySqlConnection = mod.MySqlConnection;
|
|
128
|
+
export const MsSqlNativeQueryBuilder = mod.MsSqlNativeQueryBuilder;
|
|
135
129
|
export const MySqlExceptionConverter = mod.MySqlExceptionConverter;
|
|
136
|
-
export const
|
|
130
|
+
export const MySqlNativeQueryBuilder = mod.MySqlNativeQueryBuilder;
|
|
137
131
|
export const MySqlPlatform = mod.MySqlPlatform;
|
|
138
132
|
export const MySqlSchemaHelper = mod.MySqlSchemaHelper;
|
|
133
|
+
export const NativeQueryBuilder = mod.NativeQueryBuilder;
|
|
139
134
|
export const NodeState = mod.NodeState;
|
|
140
135
|
export const NonUniqueFieldNameException = mod.NonUniqueFieldNameException;
|
|
141
136
|
export const NotFoundError = mod.NotFoundError;
|
|
@@ -155,7 +150,7 @@ export const PlainObject = mod.PlainObject;
|
|
|
155
150
|
export const Platform = mod.Platform;
|
|
156
151
|
export const PopulateHint = mod.PopulateHint;
|
|
157
152
|
export const PopulatePath = mod.PopulatePath;
|
|
158
|
-
export const
|
|
153
|
+
export const PostgreSqlNativeQueryBuilder = mod.PostgreSqlNativeQueryBuilder;
|
|
159
154
|
export const PrimaryKey = mod.PrimaryKey;
|
|
160
155
|
export const PrimaryKeyProp = mod.PrimaryKeyProp;
|
|
161
156
|
export const Property = mod.Property;
|
|
@@ -167,6 +162,7 @@ export const QueryOperator = mod.QueryOperator;
|
|
|
167
162
|
export const QueryOrder = mod.QueryOrder;
|
|
168
163
|
export const QueryOrderNumeric = mod.QueryOrderNumeric;
|
|
169
164
|
export const QueryType = mod.QueryType;
|
|
165
|
+
export const Raw = mod.Raw;
|
|
170
166
|
export const RawQueryFragment = mod.RawQueryFragment;
|
|
171
167
|
export const ReadOnlyException = mod.ReadOnlyException;
|
|
172
168
|
export const Ref = mod.Ref;
|
|
@@ -188,8 +184,9 @@ export const SmallIntType = mod.SmallIntType;
|
|
|
188
184
|
export const SqlEntityManager = mod.SqlEntityManager;
|
|
189
185
|
export const SqlEntityRepository = mod.SqlEntityRepository;
|
|
190
186
|
export const SqlSchemaGenerator = mod.SqlSchemaGenerator;
|
|
191
|
-
export const
|
|
192
|
-
export const
|
|
187
|
+
export const SqliteExceptionConverter = mod.SqliteExceptionConverter;
|
|
188
|
+
export const SqliteNativeQueryBuilder = mod.SqliteNativeQueryBuilder;
|
|
189
|
+
export const SqliteSchemaHelper = mod.SqliteSchemaHelper;
|
|
193
190
|
export const StringType = mod.StringType;
|
|
194
191
|
export const SyntaxErrorException = mod.SyntaxErrorException;
|
|
195
192
|
export const TableExistsException = mod.TableExistsException;
|
|
@@ -223,7 +220,7 @@ export const equals = mod.equals;
|
|
|
223
220
|
export const getOnConflictFields = mod.getOnConflictFields;
|
|
224
221
|
export const getOnConflictReturningFields = mod.getOnConflictReturningFields;
|
|
225
222
|
export const helper = mod.helper;
|
|
226
|
-
export const
|
|
223
|
+
export const isRaw = mod.isRaw;
|
|
227
224
|
export const parseJsonSafe = mod.parseJsonSafe;
|
|
228
225
|
export const raw = mod.raw;
|
|
229
226
|
export const ref = mod.ref;
|