@mikro-orm/sql 7.0.2 → 7.0.3-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 +58 -94
- package/AbstractSqlConnection.js +238 -235
- package/AbstractSqlDriver.d.ts +155 -411
- package/AbstractSqlDriver.js +1937 -2061
- package/AbstractSqlPlatform.d.ts +73 -83
- package/AbstractSqlPlatform.js +158 -162
- package/PivotCollectionPersister.d.ts +15 -33
- package/PivotCollectionPersister.js +160 -158
- package/SqlEntityManager.d.ts +22 -67
- package/SqlEntityManager.js +38 -54
- package/SqlEntityRepository.d.ts +14 -14
- package/SqlEntityRepository.js +23 -23
- package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
- package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
- package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
- package/dialects/mysql/BaseMySqlPlatform.js +131 -134
- package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
- package/dialects/mysql/MySqlExceptionConverter.js +77 -91
- package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
- package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
- package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
- package/dialects/mysql/MySqlSchemaHelper.js +319 -327
- package/dialects/oracledb/OracleDialect.d.ts +52 -81
- package/dialects/oracledb/OracleDialect.js +149 -155
- package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
- package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
- package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +105 -108
- package/dialects/postgresql/BasePostgreSqlPlatform.js +350 -351
- package/dialects/postgresql/FullTextType.d.ts +6 -10
- package/dialects/postgresql/FullTextType.js +51 -51
- package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
- package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
- package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
- package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
- package/dialects/postgresql/PostgreSqlSchemaHelper.js +683 -711
- package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
- package/dialects/sqlite/BaseSqliteConnection.js +19 -21
- package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
- package/dialects/sqlite/NodeSqliteDialect.js +23 -23
- package/dialects/sqlite/SqliteDriver.d.ts +1 -1
- package/dialects/sqlite/SqliteDriver.js +3 -3
- package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
- package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
- package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
- package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
- package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
- package/dialects/sqlite/SqlitePlatform.js +139 -139
- package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
- package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
- package/package.json +2 -2
- package/plugin/index.d.ts +35 -42
- package/plugin/index.js +36 -43
- package/plugin/transformer.d.ts +94 -117
- package/plugin/transformer.js +881 -890
- package/query/ArrayCriteriaNode.d.ts +4 -4
- package/query/ArrayCriteriaNode.js +18 -18
- package/query/CriteriaNode.d.ts +25 -35
- package/query/CriteriaNode.js +123 -133
- package/query/CriteriaNodeFactory.d.ts +6 -49
- package/query/CriteriaNodeFactory.js +94 -97
- package/query/NativeQueryBuilder.d.ts +118 -118
- package/query/NativeQueryBuilder.js +480 -484
- package/query/ObjectCriteriaNode.d.ts +12 -12
- package/query/ObjectCriteriaNode.js +282 -298
- package/query/QueryBuilder.d.ts +904 -1546
- package/query/QueryBuilder.js +2145 -2270
- package/query/QueryBuilderHelper.d.ts +72 -153
- package/query/QueryBuilderHelper.js +1028 -1079
- package/query/ScalarCriteriaNode.d.ts +3 -3
- package/query/ScalarCriteriaNode.js +46 -53
- package/query/enums.d.ts +14 -14
- package/query/enums.js +14 -14
- package/query/raw.d.ts +6 -16
- package/query/raw.js +10 -10
- package/schema/DatabaseSchema.d.ts +50 -73
- package/schema/DatabaseSchema.js +307 -331
- package/schema/DatabaseTable.d.ts +73 -96
- package/schema/DatabaseTable.js +927 -1012
- package/schema/SchemaComparator.d.ts +54 -58
- package/schema/SchemaComparator.js +719 -745
- package/schema/SchemaHelper.d.ts +95 -109
- package/schema/SchemaHelper.js +659 -675
- package/schema/SqlSchemaGenerator.d.ts +58 -78
- package/schema/SqlSchemaGenerator.js +501 -535
- package/typings.d.ts +266 -380
|
@@ -2,7 +2,9 @@ import { type Dialect } from 'kysely';
|
|
|
2
2
|
import type { Dictionary } from '@mikro-orm/core';
|
|
3
3
|
import { AbstractSqlConnection } from '../../AbstractSqlConnection.js';
|
|
4
4
|
export declare class BaseSqliteConnection extends AbstractSqlConnection {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
createKyselyDialect(options: Dictionary): Dialect;
|
|
6
|
+
connect(options?: {
|
|
7
|
+
skipOnConnect?: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
protected attachDatabases(): Promise<void>;
|
|
8
10
|
}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { CompiledQuery } from 'kysely';
|
|
2
2
|
import { AbstractSqlConnection } from '../../AbstractSqlConnection.js';
|
|
3
3
|
export class BaseSqliteConnection extends AbstractSqlConnection {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'e.g. `new NodeSqliteDialect(...)` for node:sqlite or a custom dialect for other libraries.',
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
async connect(options) {
|
|
11
|
-
await super.connect(options);
|
|
12
|
-
await this.getClient().executeQuery(CompiledQuery.raw('pragma foreign_keys = on'));
|
|
13
|
-
await this.attachDatabases();
|
|
14
|
-
}
|
|
15
|
-
async attachDatabases() {
|
|
16
|
-
const attachDatabases = this.config.get('attachDatabases');
|
|
17
|
-
if (!attachDatabases?.length) {
|
|
18
|
-
return;
|
|
4
|
+
createKyselyDialect(options) {
|
|
5
|
+
throw new Error('No SQLite dialect configured. Pass a Kysely dialect via the `driverOptions` config option, ' +
|
|
6
|
+
'e.g. `new NodeSqliteDialect(...)` for node:sqlite or a custom dialect for other libraries.');
|
|
19
7
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
async connect(options) {
|
|
9
|
+
await super.connect(options);
|
|
10
|
+
await this.getClient().executeQuery(CompiledQuery.raw('pragma foreign_keys = on'));
|
|
11
|
+
await this.attachDatabases();
|
|
12
|
+
}
|
|
13
|
+
async attachDatabases() {
|
|
14
|
+
const attachDatabases = this.config.get('attachDatabases');
|
|
15
|
+
if (!attachDatabases?.length) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const { fs } = await import('@mikro-orm/core/fs-utils');
|
|
19
|
+
const baseDir = this.config.get('baseDir');
|
|
20
|
+
for (const db of attachDatabases) {
|
|
21
|
+
const path = fs.absolutePath(db.path, baseDir);
|
|
22
|
+
await this.execute(`attach database '${path}' as ${this.platform.quoteIdentifier(db.name)}`);
|
|
23
|
+
}
|
|
25
24
|
}
|
|
26
|
-
}
|
|
27
25
|
}
|
|
@@ -17,27 +17,27 @@ import { SqliteDialect } from 'kysely';
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export class NodeSqliteDialect extends SqliteDialect {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
20
|
+
constructor(dbName) {
|
|
21
|
+
const { DatabaseSync } = globalThis.process.getBuiltinModule('node:sqlite');
|
|
22
|
+
super({
|
|
23
|
+
database: () => {
|
|
24
|
+
const db = new DatabaseSync(dbName);
|
|
25
|
+
return {
|
|
26
|
+
prepare(sql) {
|
|
27
|
+
const stmt = db.prepare(sql);
|
|
28
|
+
return {
|
|
29
|
+
reader: /^\s*(select|pragma|explain|with)/i.test(sql) || /\breturning\b/i.test(sql),
|
|
30
|
+
all: (params) => stmt.all(...params),
|
|
31
|
+
run: (params) => stmt.run(...params),
|
|
32
|
+
/* v8 ignore next */
|
|
33
|
+
get: (params) => stmt.get(...params),
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
close() {
|
|
37
|
+
db.close();
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
43
|
}
|
|
@@ -8,5 +8,5 @@ import { BaseSqliteConnection } from './BaseSqliteConnection.js';
|
|
|
8
8
|
* For the default better-sqlite3 experience, use `@mikro-orm/sqlite` instead.
|
|
9
9
|
*/
|
|
10
10
|
export declare class SqliteDriver extends AbstractSqlDriver<BaseSqliteConnection> {
|
|
11
|
-
|
|
11
|
+
constructor(config: Configuration);
|
|
12
12
|
}
|
|
@@ -8,7 +8,7 @@ import { SqlitePlatform } from './SqlitePlatform.js';
|
|
|
8
8
|
* For the default better-sqlite3 experience, use `@mikro-orm/sqlite` instead.
|
|
9
9
|
*/
|
|
10
10
|
export class SqliteDriver extends AbstractSqlDriver {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super(config, new SqlitePlatform(), BaseSqliteConnection, ['kysely']);
|
|
13
|
+
}
|
|
14
14
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ExceptionConverter, type Dictionary, type DriverException } from '@mikro-orm/core';
|
|
2
2
|
export declare class SqliteExceptionConverter extends ExceptionConverter {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @inheritDoc
|
|
5
|
+
* @see http://www.sqlite.org/c3ref/c_abort.html
|
|
6
|
+
* @see https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractSQLiteDriver.php
|
|
7
|
+
*/
|
|
8
|
+
convertException(exception: Error & Dictionary): DriverException;
|
|
9
9
|
}
|
|
@@ -1,70 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConnectionException,
|
|
3
|
-
ExceptionConverter,
|
|
4
|
-
InvalidFieldNameException,
|
|
5
|
-
LockWaitTimeoutException,
|
|
6
|
-
NonUniqueFieldNameException,
|
|
7
|
-
CheckConstraintViolationException,
|
|
8
|
-
NotNullConstraintViolationException,
|
|
9
|
-
ReadOnlyException,
|
|
10
|
-
SyntaxErrorException,
|
|
11
|
-
TableExistsException,
|
|
12
|
-
TableNotFoundException,
|
|
13
|
-
UniqueConstraintViolationException,
|
|
14
|
-
ForeignKeyConstraintViolationException,
|
|
15
|
-
} from '@mikro-orm/core';
|
|
1
|
+
import { ConnectionException, ExceptionConverter, InvalidFieldNameException, LockWaitTimeoutException, NonUniqueFieldNameException, CheckConstraintViolationException, NotNullConstraintViolationException, ReadOnlyException, SyntaxErrorException, TableExistsException, TableNotFoundException, UniqueConstraintViolationException, ForeignKeyConstraintViolationException, } from '@mikro-orm/core';
|
|
16
2
|
export class SqliteExceptionConverter extends ExceptionConverter {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @inheritDoc
|
|
5
|
+
* @see http://www.sqlite.org/c3ref/c_abort.html
|
|
6
|
+
* @see https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractSQLiteDriver.php
|
|
7
|
+
*/
|
|
8
|
+
convertException(exception) {
|
|
9
|
+
/* v8 ignore next */
|
|
10
|
+
if (exception.message.includes('database is locked')) {
|
|
11
|
+
return new LockWaitTimeoutException(exception);
|
|
12
|
+
}
|
|
13
|
+
if (exception.message.includes('must be unique') ||
|
|
14
|
+
exception.message.includes('is not unique') ||
|
|
15
|
+
exception.message.includes('are not unique') ||
|
|
16
|
+
exception.message.includes('UNIQUE constraint failed')) {
|
|
17
|
+
return new UniqueConstraintViolationException(exception);
|
|
18
|
+
}
|
|
19
|
+
if (exception.message.includes('may not be NULL') || exception.message.includes('NOT NULL constraint failed')) {
|
|
20
|
+
return new NotNullConstraintViolationException(exception);
|
|
21
|
+
}
|
|
22
|
+
/* v8 ignore next */
|
|
23
|
+
if (exception.message.includes('CHECK constraint failed')) {
|
|
24
|
+
return new CheckConstraintViolationException(exception);
|
|
25
|
+
}
|
|
26
|
+
if (exception.message.includes('no such table:')) {
|
|
27
|
+
return new TableNotFoundException(exception);
|
|
28
|
+
}
|
|
29
|
+
if (exception.message.includes('already exists')) {
|
|
30
|
+
return new TableExistsException(exception);
|
|
31
|
+
}
|
|
32
|
+
if (exception.message.includes('no such column:')) {
|
|
33
|
+
return new InvalidFieldNameException(exception);
|
|
34
|
+
}
|
|
35
|
+
if (exception.message.includes('ambiguous column name')) {
|
|
36
|
+
return new NonUniqueFieldNameException(exception);
|
|
37
|
+
}
|
|
38
|
+
if (exception.message.includes('syntax error')) {
|
|
39
|
+
return new SyntaxErrorException(exception);
|
|
40
|
+
}
|
|
41
|
+
/* v8 ignore next */
|
|
42
|
+
if (exception.message.includes('attempt to write a readonly database')) {
|
|
43
|
+
return new ReadOnlyException(exception);
|
|
44
|
+
}
|
|
45
|
+
/* v8 ignore next */
|
|
46
|
+
if (exception.message.includes('unable to open database file')) {
|
|
47
|
+
return new ConnectionException(exception);
|
|
48
|
+
}
|
|
49
|
+
if (exception.message.includes('FOREIGN KEY constraint failed')) {
|
|
50
|
+
return new ForeignKeyConstraintViolationException(exception);
|
|
51
|
+
}
|
|
52
|
+
return super.convertException(exception);
|
|
26
53
|
}
|
|
27
|
-
if (
|
|
28
|
-
exception.message.includes('must be unique') ||
|
|
29
|
-
exception.message.includes('is not unique') ||
|
|
30
|
-
exception.message.includes('are not unique') ||
|
|
31
|
-
exception.message.includes('UNIQUE constraint failed')
|
|
32
|
-
) {
|
|
33
|
-
return new UniqueConstraintViolationException(exception);
|
|
34
|
-
}
|
|
35
|
-
if (exception.message.includes('may not be NULL') || exception.message.includes('NOT NULL constraint failed')) {
|
|
36
|
-
return new NotNullConstraintViolationException(exception);
|
|
37
|
-
}
|
|
38
|
-
/* v8 ignore next */
|
|
39
|
-
if (exception.message.includes('CHECK constraint failed')) {
|
|
40
|
-
return new CheckConstraintViolationException(exception);
|
|
41
|
-
}
|
|
42
|
-
if (exception.message.includes('no such table:')) {
|
|
43
|
-
return new TableNotFoundException(exception);
|
|
44
|
-
}
|
|
45
|
-
if (exception.message.includes('already exists')) {
|
|
46
|
-
return new TableExistsException(exception);
|
|
47
|
-
}
|
|
48
|
-
if (exception.message.includes('no such column:')) {
|
|
49
|
-
return new InvalidFieldNameException(exception);
|
|
50
|
-
}
|
|
51
|
-
if (exception.message.includes('ambiguous column name')) {
|
|
52
|
-
return new NonUniqueFieldNameException(exception);
|
|
53
|
-
}
|
|
54
|
-
if (exception.message.includes('syntax error')) {
|
|
55
|
-
return new SyntaxErrorException(exception);
|
|
56
|
-
}
|
|
57
|
-
/* v8 ignore next */
|
|
58
|
-
if (exception.message.includes('attempt to write a readonly database')) {
|
|
59
|
-
return new ReadOnlyException(exception);
|
|
60
|
-
}
|
|
61
|
-
/* v8 ignore next */
|
|
62
|
-
if (exception.message.includes('unable to open database file')) {
|
|
63
|
-
return new ConnectionException(exception);
|
|
64
|
-
}
|
|
65
|
-
if (exception.message.includes('FOREIGN KEY constraint failed')) {
|
|
66
|
-
return new ForeignKeyConstraintViolationException(exception);
|
|
67
|
-
}
|
|
68
|
-
return super.convertException(exception);
|
|
69
|
-
}
|
|
70
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NativeQueryBuilder } from '../../query/NativeQueryBuilder.js';
|
|
2
2
|
/** @internal */
|
|
3
3
|
export declare class SqliteNativeQueryBuilder extends NativeQueryBuilder {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
protected compileTruncate(): void;
|
|
5
|
+
protected addLockClause(): void;
|
|
6
6
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NativeQueryBuilder } from '../../query/NativeQueryBuilder.js';
|
|
2
2
|
/** @internal */
|
|
3
3
|
export class SqliteNativeQueryBuilder extends NativeQueryBuilder {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
compileTruncate() {
|
|
5
|
+
const sql = `delete from ${this.getTableName()}`;
|
|
6
|
+
this.parts.push(sql);
|
|
7
|
+
}
|
|
8
|
+
addLockClause() {
|
|
9
|
+
return; // not supported
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -4,68 +4,77 @@ import { SqliteNativeQueryBuilder } from './SqliteNativeQueryBuilder.js';
|
|
|
4
4
|
import { SqliteSchemaHelper } from './SqliteSchemaHelper.js';
|
|
5
5
|
import { SqliteExceptionConverter } from './SqliteExceptionConverter.js';
|
|
6
6
|
export declare class SqlitePlatform extends AbstractSqlPlatform {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
|
66
|
-
|
|
7
|
+
protected readonly schemaHelper: SqliteSchemaHelper;
|
|
8
|
+
protected readonly exceptionConverter: SqliteExceptionConverter;
|
|
9
|
+
/** @internal */
|
|
10
|
+
createNativeQueryBuilder(): SqliteNativeQueryBuilder;
|
|
11
|
+
usesDefaultKeyword(): boolean;
|
|
12
|
+
usesReturningStatement(): boolean;
|
|
13
|
+
usesEnumCheckConstraints(): boolean;
|
|
14
|
+
getCurrentTimestampSQL(length: number): string;
|
|
15
|
+
getDateTimeTypeDeclarationSQL(column: {
|
|
16
|
+
length: number;
|
|
17
|
+
}): string;
|
|
18
|
+
getBeginTransactionSQL(options?: {
|
|
19
|
+
isolationLevel?: IsolationLevel;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
}): string[];
|
|
22
|
+
getEnumTypeDeclarationSQL(column: {
|
|
23
|
+
items?: unknown[];
|
|
24
|
+
fieldNames: string[];
|
|
25
|
+
length?: number;
|
|
26
|
+
unsigned?: boolean;
|
|
27
|
+
autoincrement?: boolean;
|
|
28
|
+
}): string;
|
|
29
|
+
getTinyIntTypeDeclarationSQL(column: {
|
|
30
|
+
length?: number;
|
|
31
|
+
unsigned?: boolean;
|
|
32
|
+
autoincrement?: boolean;
|
|
33
|
+
}): string;
|
|
34
|
+
getSmallIntTypeDeclarationSQL(column: {
|
|
35
|
+
length?: number;
|
|
36
|
+
unsigned?: boolean;
|
|
37
|
+
autoincrement?: boolean;
|
|
38
|
+
}): string;
|
|
39
|
+
getIntegerTypeDeclarationSQL(column: {
|
|
40
|
+
length?: number;
|
|
41
|
+
unsigned?: boolean;
|
|
42
|
+
autoincrement?: boolean;
|
|
43
|
+
}): string;
|
|
44
|
+
getFloatDeclarationSQL(): string;
|
|
45
|
+
getBooleanTypeDeclarationSQL(): string;
|
|
46
|
+
getCharTypeDeclarationSQL(column: {
|
|
47
|
+
length?: number;
|
|
48
|
+
}): string;
|
|
49
|
+
getVarcharTypeDeclarationSQL(column: {
|
|
50
|
+
length?: number;
|
|
51
|
+
}): string;
|
|
52
|
+
normalizeColumnType(type: string, options: {
|
|
53
|
+
length?: number;
|
|
54
|
+
precision?: number;
|
|
55
|
+
scale?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
convertsJsonAutomatically(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* This is used to narrow the value of Date properties as they will be stored as timestamps in sqlite.
|
|
60
|
+
* We use this method to convert Dates to timestamps when computing the changeset, so we have the right
|
|
61
|
+
* data type in the payload as well as in original entity data. Without that, we would end up with diffs
|
|
62
|
+
* including all Date properties, as we would be comparing Date object with timestamp.
|
|
63
|
+
*/
|
|
64
|
+
processDateProperty(value: unknown): string | number | Date;
|
|
65
|
+
getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string;
|
|
66
|
+
supportsDeferredUniqueConstraints(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* SQLite supports schemas via ATTACH DATABASE. Returns true when there are
|
|
69
|
+
* attached databases configured.
|
|
70
|
+
*/
|
|
71
|
+
supportsSchemas(): boolean;
|
|
72
|
+
getDefaultSchemaName(): string | undefined;
|
|
73
|
+
getFullTextWhereClause(): string;
|
|
74
|
+
escape(value: any): string;
|
|
75
|
+
convertVersionValue(value: Date | number, prop: EntityProperty): number | {
|
|
67
76
|
$in: (string | number)[];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
};
|
|
78
|
+
getJsonArrayElementPropertySQL(alias: string, property: string, _type: string): string;
|
|
79
|
+
quoteValue(value: any): string;
|
|
71
80
|
}
|