@mikro-orm/sql 7.0.14-dev.8 → 7.0.14

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.
Files changed (89) hide show
  1. package/AbstractSqlConnection.d.ts +94 -58
  2. package/AbstractSqlConnection.js +235 -238
  3. package/AbstractSqlDriver.d.ts +410 -155
  4. package/AbstractSqlDriver.js +2100 -1972
  5. package/AbstractSqlPlatform.d.ts +86 -75
  6. package/AbstractSqlPlatform.js +169 -162
  7. package/PivotCollectionPersister.d.ts +33 -15
  8. package/PivotCollectionPersister.js +158 -160
  9. package/README.md +1 -1
  10. package/SqlEntityManager.d.ts +67 -22
  11. package/SqlEntityManager.js +54 -38
  12. package/SqlEntityRepository.d.ts +14 -14
  13. package/SqlEntityRepository.js +23 -23
  14. package/SqlMikroORM.d.ts +49 -8
  15. package/SqlMikroORM.js +8 -8
  16. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  17. package/dialects/mssql/MsSqlNativeQueryBuilder.js +199 -201
  18. package/dialects/mysql/BaseMySqlPlatform.d.ts +65 -46
  19. package/dialects/mysql/BaseMySqlPlatform.js +137 -134
  20. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  21. package/dialects/mysql/MySqlExceptionConverter.js +91 -77
  22. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  23. package/dialects/mysql/MySqlNativeQueryBuilder.js +66 -69
  24. package/dialects/mysql/MySqlSchemaHelper.d.ts +58 -39
  25. package/dialects/mysql/MySqlSchemaHelper.js +327 -319
  26. package/dialects/oracledb/OracleDialect.d.ts +81 -52
  27. package/dialects/oracledb/OracleDialect.js +155 -149
  28. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  29. package/dialects/oracledb/OracleNativeQueryBuilder.js +239 -243
  30. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +110 -107
  31. package/dialects/postgresql/BasePostgreSqlPlatform.js +370 -368
  32. package/dialects/postgresql/FullTextType.d.ts +10 -6
  33. package/dialects/postgresql/FullTextType.js +51 -51
  34. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  35. package/dialects/postgresql/PostgreSqlExceptionConverter.js +55 -43
  36. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  37. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  38. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +117 -82
  39. package/dialects/postgresql/PostgreSqlSchemaHelper.js +748 -712
  40. package/dialects/sqlite/BaseSqliteConnection.d.ts +3 -5
  41. package/dialects/sqlite/BaseSqliteConnection.js +21 -19
  42. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  43. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  44. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  45. package/dialects/sqlite/SqliteDriver.js +3 -3
  46. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  47. package/dialects/sqlite/SqliteExceptionConverter.js +67 -51
  48. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  49. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  50. package/dialects/sqlite/SqlitePlatform.d.ts +64 -73
  51. package/dialects/sqlite/SqlitePlatform.js +143 -143
  52. package/dialects/sqlite/SqliteSchemaHelper.d.ts +78 -61
  53. package/dialects/sqlite/SqliteSchemaHelper.js +541 -522
  54. package/package.json +4 -4
  55. package/plugin/index.d.ts +42 -35
  56. package/plugin/index.js +43 -36
  57. package/plugin/transformer.d.ts +117 -94
  58. package/plugin/transformer.js +890 -881
  59. package/query/ArrayCriteriaNode.d.ts +4 -4
  60. package/query/ArrayCriteriaNode.js +18 -18
  61. package/query/CriteriaNode.d.ts +35 -25
  62. package/query/CriteriaNode.js +142 -132
  63. package/query/CriteriaNodeFactory.d.ts +49 -6
  64. package/query/CriteriaNodeFactory.js +97 -94
  65. package/query/NativeQueryBuilder.d.ts +120 -120
  66. package/query/NativeQueryBuilder.js +507 -501
  67. package/query/ObjectCriteriaNode.d.ts +12 -12
  68. package/query/ObjectCriteriaNode.js +298 -282
  69. package/query/QueryBuilder.d.ts +1558 -906
  70. package/query/QueryBuilder.js +2331 -2202
  71. package/query/QueryBuilderHelper.d.ts +153 -72
  72. package/query/QueryBuilderHelper.js +1084 -1032
  73. package/query/ScalarCriteriaNode.d.ts +3 -3
  74. package/query/ScalarCriteriaNode.js +53 -46
  75. package/query/enums.d.ts +14 -14
  76. package/query/enums.js +14 -14
  77. package/query/raw.d.ts +16 -6
  78. package/query/raw.js +10 -10
  79. package/schema/DatabaseSchema.d.ts +74 -50
  80. package/schema/DatabaseSchema.js +359 -331
  81. package/schema/DatabaseTable.d.ts +96 -73
  82. package/schema/DatabaseTable.js +1046 -974
  83. package/schema/SchemaComparator.d.ts +70 -66
  84. package/schema/SchemaComparator.js +790 -765
  85. package/schema/SchemaHelper.d.ts +128 -97
  86. package/schema/SchemaHelper.js +683 -668
  87. package/schema/SqlSchemaGenerator.d.ts +79 -59
  88. package/schema/SqlSchemaGenerator.js +525 -495
  89. package/typings.d.ts +405 -275
@@ -2,9 +2,7 @@ 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
- createKyselyDialect(options: Dictionary): Dialect;
6
- connect(options?: {
7
- skipOnConnect?: boolean;
8
- }): Promise<void>;
9
- protected attachDatabases(): Promise<void>;
5
+ createKyselyDialect(options: Dictionary): Dialect;
6
+ connect(options?: { skipOnConnect?: boolean }): Promise<void>;
7
+ protected attachDatabases(): Promise<void>;
10
8
  }
@@ -1,25 +1,27 @@
1
1
  import { CompiledQuery } from 'kysely';
2
2
  import { AbstractSqlConnection } from '../../AbstractSqlConnection.js';
3
3
  export class BaseSqliteConnection extends AbstractSqlConnection {
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.');
4
+ createKyselyDialect(options) {
5
+ throw new Error(
6
+ 'No SQLite dialect configured. Pass a Kysely dialect via the `driverOptions` config option, ' +
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;
7
19
  }
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
- }
20
+ const { fs } = await import('@mikro-orm/core/fs-utils');
21
+ const baseDir = this.config.get('baseDir');
22
+ for (const db of attachDatabases) {
23
+ const path = fs.absolutePath(db.path, baseDir);
24
+ await this.execute(`attach database '${path}' as ${this.platform.quoteIdentifier(db.name)}`);
24
25
  }
26
+ }
25
27
  }
@@ -17,5 +17,5 @@ import { SqliteDialect } from 'kysely';
17
17
  * ```
18
18
  */
19
19
  export declare class NodeSqliteDialect extends SqliteDialect {
20
- constructor(dbName: string);
20
+ constructor(dbName: string);
21
21
  }
@@ -17,27 +17,27 @@ import { SqliteDialect } from 'kysely';
17
17
  * ```
18
18
  */
19
19
  export class NodeSqliteDialect extends SqliteDialect {
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
- }
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
- constructor(config: Configuration);
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
- constructor(config) {
12
- super(config, new SqlitePlatform(), BaseSqliteConnection, ['kysely']);
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
- * @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;
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,54 +1,70 @@
1
- import { ConnectionException, ExceptionConverter, InvalidFieldNameException, LockWaitTimeoutException, NonUniqueFieldNameException, CheckConstraintViolationException, NotNullConstraintViolationException, ReadOnlyException, SyntaxErrorException, TableExistsException, TableNotFoundException, UniqueConstraintViolationException, ForeignKeyConstraintViolationException, } from '@mikro-orm/core';
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';
2
16
  export class SqliteExceptionConverter extends ExceptionConverter {
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);
17
+ /**
18
+ * @inheritDoc
19
+ * @see http://www.sqlite.org/c3ref/c_abort.html
20
+ * @see https://github.com/doctrine/dbal/blob/master/src/Driver/AbstractSQLiteDriver.php
21
+ */
22
+ convertException(exception) {
23
+ /* v8 ignore next */
24
+ if (exception.message.includes('database is locked')) {
25
+ return new LockWaitTimeoutException(exception);
53
26
  }
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
+ }
54
70
  }
@@ -1,6 +1,6 @@
1
1
  import { NativeQueryBuilder } from '../../query/NativeQueryBuilder.js';
2
2
  /** @internal */
3
3
  export declare class SqliteNativeQueryBuilder extends NativeQueryBuilder {
4
- protected compileTruncate(): void;
5
- protected addLockClause(): void;
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
- compileTruncate() {
5
- const sql = `delete from ${this.getTableName()}`;
6
- this.parts.push(sql);
7
- }
8
- addLockClause() {
9
- return; // not supported
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,78 +4,69 @@ 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
- 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
- getDefaultVersionLength(): number;
19
- getBeginTransactionSQL(options?: {
20
- isolationLevel?: IsolationLevel;
21
- readOnly?: boolean;
22
- }): string[];
23
- getEnumTypeDeclarationSQL(column: {
24
- items?: unknown[];
25
- fieldNames: string[];
26
- length?: number;
27
- unsigned?: boolean;
28
- autoincrement?: boolean;
29
- }): string;
30
- getTinyIntTypeDeclarationSQL(column: {
31
- length?: number;
32
- unsigned?: boolean;
33
- autoincrement?: boolean;
34
- }): string;
35
- getSmallIntTypeDeclarationSQL(column: {
36
- length?: number;
37
- unsigned?: boolean;
38
- autoincrement?: boolean;
39
- }): string;
40
- getIntegerTypeDeclarationSQL(column: {
41
- length?: number;
42
- unsigned?: boolean;
43
- autoincrement?: boolean;
44
- }): string;
45
- getFloatDeclarationSQL(): string;
46
- getBooleanTypeDeclarationSQL(): string;
47
- getCharTypeDeclarationSQL(column: {
48
- length?: number;
49
- }): string;
50
- getVarcharTypeDeclarationSQL(column: {
51
- length?: number;
52
- }): string;
53
- normalizeColumnType(type: string, options: {
54
- length?: number;
55
- precision?: number;
56
- scale?: number;
57
- }): string;
58
- convertsJsonAutomatically(): boolean;
59
- /**
60
- * This is used to narrow the value of Date properties as they will be stored as timestamps in sqlite.
61
- * We use this method to convert Dates to timestamps when computing the changeset, so we have the right
62
- * data type in the payload as well as in original entity data. Without that, we would end up with diffs
63
- * including all Date properties, as we would be comparing Date object with timestamp.
64
- */
65
- processDateProperty(value: unknown): string | number | Date;
66
- getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string;
67
- supportsDeferredUniqueConstraints(): boolean;
68
- /**
69
- * SQLite supports schemas via ATTACH DATABASE. Returns true when there are
70
- * attached databases configured.
71
- */
72
- supportsSchemas(): boolean;
73
- getDefaultSchemaName(): string | undefined;
74
- getFullTextWhereClause(): string;
75
- escape(value: any): string;
76
- convertVersionValue(value: Date | number, prop: EntityProperty): number | {
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: { length: number }): string;
16
+ getDefaultVersionLength(): number;
17
+ getBeginTransactionSQL(options?: { isolationLevel?: IsolationLevel; readOnly?: boolean }): string[];
18
+ getEnumTypeDeclarationSQL(column: {
19
+ items?: unknown[];
20
+ fieldNames: string[];
21
+ length?: number;
22
+ unsigned?: boolean;
23
+ autoincrement?: boolean;
24
+ }): string;
25
+ getTinyIntTypeDeclarationSQL(column: { length?: number; unsigned?: boolean; autoincrement?: boolean }): string;
26
+ getSmallIntTypeDeclarationSQL(column: { length?: number; unsigned?: boolean; autoincrement?: boolean }): string;
27
+ getIntegerTypeDeclarationSQL(column: { length?: number; unsigned?: boolean; autoincrement?: boolean }): string;
28
+ getFloatDeclarationSQL(): string;
29
+ getBooleanTypeDeclarationSQL(): string;
30
+ getCharTypeDeclarationSQL(column: { length?: number }): string;
31
+ getVarcharTypeDeclarationSQL(column: { length?: number }): string;
32
+ normalizeColumnType(
33
+ type: string,
34
+ options: {
35
+ length?: number;
36
+ precision?: number;
37
+ scale?: number;
38
+ },
39
+ ): string;
40
+ convertsJsonAutomatically(): boolean;
41
+ /**
42
+ * This is used to narrow the value of Date properties as they will be stored as timestamps in sqlite.
43
+ * We use this method to convert Dates to timestamps when computing the changeset, so we have the right
44
+ * data type in the payload as well as in original entity data. Without that, we would end up with diffs
45
+ * including all Date properties, as we would be comparing Date object with timestamp.
46
+ */
47
+ processDateProperty(value: unknown): string | number | Date;
48
+ getIndexName(
49
+ tableName: string,
50
+ columns: string[],
51
+ type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence',
52
+ ): string;
53
+ supportsDeferredUniqueConstraints(): boolean;
54
+ /**
55
+ * SQLite supports schemas via ATTACH DATABASE. Returns true when there are
56
+ * attached databases configured.
57
+ */
58
+ supportsSchemas(): boolean;
59
+ getDefaultSchemaName(): string | undefined;
60
+ getFullTextWhereClause(): string;
61
+ escape(value: any): string;
62
+ convertVersionValue(
63
+ value: Date | number,
64
+ prop: EntityProperty,
65
+ ):
66
+ | number
67
+ | {
77
68
  $in: (string | number)[];
78
- };
79
- getJsonArrayElementPropertySQL(alias: string, property: string, _type: string): string;
80
- quoteValue(value: any): string;
69
+ };
70
+ getJsonArrayElementPropertySQL(alias: string, property: string, _type: string): string;
71
+ quoteValue(value: any): string;
81
72
  }