@mikro-orm/sql 7.0.2 → 7.0.3-dev.1

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 (86) hide show
  1. package/AbstractSqlConnection.d.ts +58 -94
  2. package/AbstractSqlConnection.js +238 -235
  3. package/AbstractSqlDriver.d.ts +155 -411
  4. package/AbstractSqlDriver.js +1937 -2061
  5. package/AbstractSqlPlatform.d.ts +73 -83
  6. package/AbstractSqlPlatform.js +158 -162
  7. package/PivotCollectionPersister.d.ts +15 -33
  8. package/PivotCollectionPersister.js +160 -158
  9. package/SqlEntityManager.d.ts +22 -67
  10. package/SqlEntityManager.js +38 -54
  11. package/SqlEntityRepository.d.ts +14 -14
  12. package/SqlEntityRepository.js +23 -23
  13. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  14. package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
  15. package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
  16. package/dialects/mysql/BaseMySqlPlatform.js +131 -134
  17. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  18. package/dialects/mysql/MySqlExceptionConverter.js +77 -91
  19. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  20. package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
  21. package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
  22. package/dialects/mysql/MySqlSchemaHelper.js +319 -327
  23. package/dialects/oracledb/OracleDialect.d.ts +52 -81
  24. package/dialects/oracledb/OracleDialect.js +149 -155
  25. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  26. package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
  27. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +105 -108
  28. package/dialects/postgresql/BasePostgreSqlPlatform.js +350 -351
  29. package/dialects/postgresql/FullTextType.d.ts +6 -10
  30. package/dialects/postgresql/FullTextType.js +51 -51
  31. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  32. package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
  33. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  34. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  35. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
  36. package/dialects/postgresql/PostgreSqlSchemaHelper.js +683 -711
  37. package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
  38. package/dialects/sqlite/BaseSqliteConnection.js +19 -21
  39. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  40. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  41. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  42. package/dialects/sqlite/SqliteDriver.js +3 -3
  43. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  44. package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
  45. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  46. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  47. package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
  48. package/dialects/sqlite/SqlitePlatform.js +139 -139
  49. package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
  50. package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
  51. package/package.json +2 -2
  52. package/plugin/index.d.ts +35 -42
  53. package/plugin/index.js +36 -43
  54. package/plugin/transformer.d.ts +94 -117
  55. package/plugin/transformer.js +881 -890
  56. package/query/ArrayCriteriaNode.d.ts +4 -4
  57. package/query/ArrayCriteriaNode.js +18 -18
  58. package/query/CriteriaNode.d.ts +25 -35
  59. package/query/CriteriaNode.js +123 -133
  60. package/query/CriteriaNodeFactory.d.ts +6 -49
  61. package/query/CriteriaNodeFactory.js +94 -97
  62. package/query/NativeQueryBuilder.d.ts +118 -118
  63. package/query/NativeQueryBuilder.js +480 -484
  64. package/query/ObjectCriteriaNode.d.ts +12 -12
  65. package/query/ObjectCriteriaNode.js +282 -298
  66. package/query/QueryBuilder.d.ts +904 -1546
  67. package/query/QueryBuilder.js +2145 -2270
  68. package/query/QueryBuilderHelper.d.ts +72 -153
  69. package/query/QueryBuilderHelper.js +1028 -1079
  70. package/query/ScalarCriteriaNode.d.ts +3 -3
  71. package/query/ScalarCriteriaNode.js +46 -53
  72. package/query/enums.d.ts +14 -14
  73. package/query/enums.js +14 -14
  74. package/query/raw.d.ts +6 -16
  75. package/query/raw.js +10 -10
  76. package/schema/DatabaseSchema.d.ts +50 -73
  77. package/schema/DatabaseSchema.js +307 -331
  78. package/schema/DatabaseTable.d.ts +73 -96
  79. package/schema/DatabaseTable.js +927 -1012
  80. package/schema/SchemaComparator.d.ts +66 -58
  81. package/schema/SchemaComparator.js +740 -744
  82. package/schema/SchemaHelper.d.ts +95 -109
  83. package/schema/SchemaHelper.js +659 -675
  84. package/schema/SqlSchemaGenerator.d.ts +58 -78
  85. package/schema/SqlSchemaGenerator.js +501 -535
  86. package/typings.d.ts +266 -380
@@ -7,62 +7,70 @@ import type { AbstractSqlPlatform } from '../AbstractSqlPlatform.js';
7
7
  * Compares two Schemas and return an instance of SchemaDifference.
8
8
  */
9
9
  export declare class SchemaComparator {
10
- #private;
11
- constructor(platform: AbstractSqlPlatform);
12
- /**
13
- * Returns a SchemaDifference object containing the differences between the schemas fromSchema and toSchema.
14
- *
15
- * The returned differences are returned in such a way that they contain the
16
- * operations to change the schema stored in fromSchema to the schema that is
17
- * stored in toSchema.
18
- */
19
- compare(fromSchema: DatabaseSchema, toSchema: DatabaseSchema, inverseDiff?: SchemaDifference): SchemaDifference;
20
- /**
21
- * Returns the difference between the tables fromTable and toTable.
22
- * If there are no differences this method returns the boolean false.
23
- */
24
- diffTable(
25
- fromTable: DatabaseTable,
26
- toTable: DatabaseTable,
27
- inverseTableDiff?: TableDifference,
28
- ): TableDifference | false;
29
- /**
30
- * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
31
- * however ambiguities between different possibilities should not lead to renaming at all.
32
- */
33
- private detectColumnRenamings;
34
- /**
35
- * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop
36
- * however ambiguities between different possibilities should not lead to renaming at all.
37
- */
38
- private detectIndexRenamings;
39
- diffForeignKey(key1: ForeignKey, key2: ForeignKey, tableDifferences: TableDifference): boolean;
40
- /**
41
- * Returns the difference between the columns
42
- */
43
- diffColumn(fromColumn: Column, toColumn: Column, fromTable: DatabaseTable, logging?: boolean): Set<string>;
44
- diffEnumItems(items1?: string[], items2?: string[]): boolean;
45
- diffComment(comment1?: string, comment2?: string): boolean;
46
- /**
47
- * Finds the difference between the indexes index1 and index2.
48
- * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
49
- */
50
- diffIndex(index1: IndexDef, index2: IndexDef): boolean;
51
- /**
52
- * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
53
- */
54
- isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean;
55
- /**
56
- * Compare advanced column options between two indexes.
57
- */
58
- private compareIndexColumns;
59
- /**
60
- * Compare two arrays for equality (order matters).
61
- */
62
- private compareArrays;
63
- diffExpression(expr1: string, expr2: string): boolean;
64
- parseJsonDefault(defaultValue?: string | null): Dictionary | string | null;
65
- hasSameDefaultValue(from: Column, to: Column): boolean;
66
- private mapColumnToProperty;
67
- private log;
10
+ #private;
11
+ constructor(platform: AbstractSqlPlatform);
12
+ /**
13
+ * Returns a SchemaDifference object containing the differences between the schemas fromSchema and toSchema.
14
+ *
15
+ * The returned differences are returned in such a way that they contain the
16
+ * operations to change the schema stored in fromSchema to the schema that is
17
+ * stored in toSchema.
18
+ */
19
+ compare(fromSchema: DatabaseSchema, toSchema: DatabaseSchema, inverseDiff?: SchemaDifference): SchemaDifference;
20
+ /**
21
+ * Returns the difference between the tables fromTable and toTable.
22
+ * If there are no differences this method returns the boolean false.
23
+ */
24
+ diffTable(fromTable: DatabaseTable, toTable: DatabaseTable, inverseTableDiff?: TableDifference): TableDifference | false;
25
+ /**
26
+ * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
27
+ * however ambiguities between different possibilities should not lead to renaming at all.
28
+ */
29
+ private detectColumnRenamings;
30
+ /**
31
+ * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop
32
+ * however ambiguities between different possibilities should not lead to renaming at all.
33
+ */
34
+ private detectIndexRenamings;
35
+ diffForeignKey(key1: ForeignKey, key2: ForeignKey, tableDifferences: TableDifference): boolean;
36
+ /**
37
+ * Returns the difference between the columns
38
+ */
39
+ diffColumn(fromColumn: Column, toColumn: Column, fromTable: DatabaseTable, logging?: boolean): Set<string>;
40
+ diffEnumItems(items1?: string[], items2?: string[]): boolean;
41
+ diffComment(comment1?: string, comment2?: string): boolean;
42
+ /**
43
+ * Finds the difference between the indexes index1 and index2.
44
+ * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
45
+ */
46
+ diffIndex(index1: IndexDef, index2: IndexDef): boolean;
47
+ /**
48
+ * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
49
+ */
50
+ isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean;
51
+ /**
52
+ * Compare advanced column options between two indexes.
53
+ */
54
+ private compareIndexColumns;
55
+ /**
56
+ * Compare two arrays for equality (order matters).
57
+ */
58
+ private compareArrays;
59
+ diffExpression(expr1: string, expr2: string): boolean;
60
+ /**
61
+ * Compares two view expressions, with special handling for SELECT *.
62
+ * Databases like PostgreSQL and MySQL expand `SELECT *` to explicit column names
63
+ * in their stored view definitions, which makes diffExpression always detect changes.
64
+ * When SELECT * is present, we strip the first SELECT...FROM column list from both
65
+ * sides and compare only the structural parts (FROM clause onwards).
66
+ * Note: this means changes *within* subqueries in the SELECT list of a SELECT * view
67
+ * may not be detected — an acceptable tradeoff since SELECT * views are inherently
68
+ * column-list-agnostic.
69
+ * @see https://github.com/mikro-orm/mikro-orm/issues/7308
70
+ */
71
+ private diffViewExpression;
72
+ parseJsonDefault(defaultValue?: string | null): Dictionary | string | null;
73
+ hasSameDefaultValue(from: Column, to: Column): boolean;
74
+ private mapColumnToProperty;
75
+ private log;
68
76
  }