@mikro-orm/sql 7.0.3 → 7.0.4-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.
Files changed (87) hide show
  1. package/AbstractSqlConnection.d.ts +58 -94
  2. package/AbstractSqlConnection.js +238 -235
  3. package/AbstractSqlDriver.d.ts +155 -410
  4. package/AbstractSqlDriver.js +1941 -2064
  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/README.md +1 -1
  10. package/SqlEntityManager.d.ts +22 -67
  11. package/SqlEntityManager.js +38 -54
  12. package/SqlEntityRepository.d.ts +14 -14
  13. package/SqlEntityRepository.js +23 -23
  14. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  15. package/dialects/mssql/MsSqlNativeQueryBuilder.js +194 -192
  16. package/dialects/mysql/BaseMySqlPlatform.d.ts +45 -64
  17. package/dialects/mysql/BaseMySqlPlatform.js +131 -134
  18. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  19. package/dialects/mysql/MySqlExceptionConverter.js +77 -91
  20. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  21. package/dialects/mysql/MySqlNativeQueryBuilder.js +69 -66
  22. package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
  23. package/dialects/mysql/MySqlSchemaHelper.js +319 -327
  24. package/dialects/oracledb/OracleDialect.d.ts +52 -81
  25. package/dialects/oracledb/OracleDialect.js +149 -155
  26. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  27. package/dialects/oracledb/OracleNativeQueryBuilder.js +236 -232
  28. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +105 -108
  29. package/dialects/postgresql/BasePostgreSqlPlatform.js +350 -351
  30. package/dialects/postgresql/FullTextType.d.ts +6 -10
  31. package/dialects/postgresql/FullTextType.js +51 -51
  32. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  33. package/dialects/postgresql/PostgreSqlExceptionConverter.js +43 -55
  34. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  35. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  36. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +82 -102
  37. package/dialects/postgresql/PostgreSqlSchemaHelper.js +705 -733
  38. package/dialects/sqlite/BaseSqliteConnection.d.ts +5 -3
  39. package/dialects/sqlite/BaseSqliteConnection.js +19 -21
  40. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  41. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  42. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  43. package/dialects/sqlite/SqliteDriver.js +3 -3
  44. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  45. package/dialects/sqlite/SqliteExceptionConverter.js +51 -67
  46. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  47. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  48. package/dialects/sqlite/SqlitePlatform.d.ts +72 -63
  49. package/dialects/sqlite/SqlitePlatform.js +139 -139
  50. package/dialects/sqlite/SqliteSchemaHelper.d.ts +60 -70
  51. package/dialects/sqlite/SqliteSchemaHelper.js +520 -533
  52. package/package.json +2 -2
  53. package/plugin/index.d.ts +35 -42
  54. package/plugin/index.js +36 -43
  55. package/plugin/transformer.d.ts +94 -117
  56. package/plugin/transformer.js +881 -890
  57. package/query/ArrayCriteriaNode.d.ts +4 -4
  58. package/query/ArrayCriteriaNode.js +18 -18
  59. package/query/CriteriaNode.d.ts +25 -35
  60. package/query/CriteriaNode.js +123 -133
  61. package/query/CriteriaNodeFactory.d.ts +6 -49
  62. package/query/CriteriaNodeFactory.js +94 -97
  63. package/query/NativeQueryBuilder.d.ts +118 -118
  64. package/query/NativeQueryBuilder.js +480 -484
  65. package/query/ObjectCriteriaNode.d.ts +12 -12
  66. package/query/ObjectCriteriaNode.js +282 -298
  67. package/query/QueryBuilder.d.ts +904 -1546
  68. package/query/QueryBuilder.js +2164 -2294
  69. package/query/QueryBuilderHelper.d.ts +72 -153
  70. package/query/QueryBuilderHelper.js +1028 -1079
  71. package/query/ScalarCriteriaNode.d.ts +3 -3
  72. package/query/ScalarCriteriaNode.js +46 -53
  73. package/query/enums.d.ts +14 -14
  74. package/query/enums.js +14 -14
  75. package/query/raw.d.ts +6 -16
  76. package/query/raw.js +10 -10
  77. package/schema/DatabaseSchema.d.ts +50 -73
  78. package/schema/DatabaseSchema.js +307 -331
  79. package/schema/DatabaseTable.d.ts +73 -96
  80. package/schema/DatabaseTable.js +927 -1012
  81. package/schema/SchemaComparator.d.ts +66 -70
  82. package/schema/SchemaComparator.js +740 -766
  83. package/schema/SchemaHelper.d.ts +95 -109
  84. package/schema/SchemaHelper.js +659 -675
  85. package/schema/SqlSchemaGenerator.d.ts +58 -78
  86. package/schema/SqlSchemaGenerator.js +501 -535
  87. package/typings.d.ts +266 -380
@@ -7,74 +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
- /**
65
- * Compares two view expressions, with special handling for SELECT *.
66
- * Databases like PostgreSQL and MySQL expand `SELECT *` to explicit column names
67
- * in their stored view definitions, which makes diffExpression always detect changes.
68
- * When SELECT * is present, we strip the first SELECT...FROM column list from both
69
- * sides and compare only the structural parts (FROM clause onwards).
70
- * Note: this means changes *within* subqueries in the SELECT list of a SELECT * view
71
- * may not be detected — an acceptable tradeoff since SELECT * views are inherently
72
- * column-list-agnostic.
73
- * @see https://github.com/mikro-orm/mikro-orm/issues/7308
74
- */
75
- private diffViewExpression;
76
- parseJsonDefault(defaultValue?: string | null): Dictionary | string | null;
77
- hasSameDefaultValue(from: Column, to: Column): boolean;
78
- private mapColumnToProperty;
79
- 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;
80
76
  }