fib-orm 1.4.1 → 2.0.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 (295) hide show
  1. package/License +1 -1
  2. package/README.md +53 -0
  3. package/lib/cli/commands/ddlFrom.d.ts +2 -0
  4. package/lib/cli/commands/ddlFrom.js +74 -0
  5. package/lib/cli/commands/dumpModel.d.ts +2 -0
  6. package/lib/cli/commands/dumpModel.js +106 -0
  7. package/lib/cli/commands/escape.d.ts +2 -0
  8. package/lib/cli/commands/escape.js +68 -0
  9. package/lib/cli/commands/spinner.d.ts +2 -0
  10. package/lib/cli/commands/spinner.js +36 -0
  11. package/lib/cli/commands/upgrade.d.ts +2 -0
  12. package/lib/cli/commands/upgrade.js +65 -0
  13. package/lib/cli/helpers/ddl.d.ts +17 -0
  14. package/lib/cli/helpers/ddl.js +55 -0
  15. package/lib/cli/helpers/package.d.ts +26 -0
  16. package/lib/cli/helpers/package.js +56 -0
  17. package/lib/cli/index.d.ts +2 -0
  18. package/lib/cli/index.js +18 -0
  19. package/lib/codepoints-map.json +762 -0
  20. package/lib/db-driver/Typo.d.ts +112 -0
  21. package/lib/db-driver/Typo.js +1 -0
  22. package/lib/db-driver/built-ins/base.class.d.ts +96 -0
  23. package/lib/db-driver/built-ins/base.class.js +186 -0
  24. package/lib/db-driver/built-ins/driver-dm.d.ts +18 -0
  25. package/lib/db-driver/built-ins/driver-dm.js +53 -0
  26. package/lib/db-driver/built-ins/driver-mongodb.d.ts +24 -0
  27. package/lib/db-driver/built-ins/driver-mongodb.js +46 -0
  28. package/lib/db-driver/built-ins/driver-mysql.d.ts +18 -0
  29. package/lib/db-driver/built-ins/driver-mysql.js +37 -0
  30. package/lib/db-driver/built-ins/driver-postgresql.d.ts +22 -0
  31. package/lib/db-driver/built-ins/driver-postgresql.js +76 -0
  32. package/lib/db-driver/built-ins/driver-redis.d.ts +12 -0
  33. package/lib/db-driver/built-ins/driver-redis.js +35 -0
  34. package/lib/db-driver/built-ins/driver-sqlite.d.ts +17 -0
  35. package/lib/db-driver/built-ins/driver-sqlite.js +34 -0
  36. package/lib/db-driver/index.d.ts +3 -0
  37. package/lib/db-driver/index.js +4 -0
  38. package/lib/db-driver/utils.d.ts +14 -0
  39. package/lib/db-driver/utils.js +187 -0
  40. package/lib/knex/deps/tarn/dist/PendingOperation.d.ts +12 -0
  41. package/lib/knex/deps/tarn/dist/PendingOperation.js +48 -0
  42. package/lib/knex/deps/tarn/dist/Pool.d.ts +97 -0
  43. package/lib/knex/deps/tarn/dist/Pool.js +516 -0
  44. package/lib/knex/deps/tarn/dist/PromiseInspection.d.ts +16 -0
  45. package/lib/knex/deps/tarn/dist/PromiseInspection.js +21 -0
  46. package/lib/knex/deps/tarn/dist/Resource.d.ts +9 -0
  47. package/lib/knex/deps/tarn/dist/Resource.js +19 -0
  48. package/lib/knex/deps/tarn/dist/TimeoutError.d.ts +2 -0
  49. package/lib/knex/deps/tarn/dist/TimeoutError.js +5 -0
  50. package/lib/knex/deps/tarn/dist/tarn.d.ts +3 -0
  51. package/lib/knex/deps/tarn/dist/tarn.js +10 -0
  52. package/lib/knex/deps/tarn/dist/utils.d.ts +14 -0
  53. package/lib/knex/deps/tarn/dist/utils.js +60 -0
  54. package/lib/knex/knex.d.ts +2 -0
  55. package/lib/knex/knex.js +3 -0
  56. package/lib/knex/sandbox.d.ts +4 -0
  57. package/lib/knex/sandbox.js +22 -0
  58. package/lib/orm/Adapters.d.ts +3 -0
  59. package/lib/orm/Adapters.js +44 -0
  60. package/lib/orm/AggregateFunctions.d.ts +3 -0
  61. package/lib/orm/AggregateFunctions.js +176 -0
  62. package/lib/orm/Associations/Extend.d.ts +22 -0
  63. package/lib/orm/Associations/Extend.js +274 -0
  64. package/lib/orm/Associations/Many.d.ts +17 -0
  65. package/lib/orm/Associations/Many.js +569 -0
  66. package/lib/orm/Associations/One.d.ts +16 -0
  67. package/lib/orm/Associations/One.js +310 -0
  68. package/lib/orm/Associations/_utils.d.ts +15 -0
  69. package/lib/orm/Associations/_utils.js +52 -0
  70. package/lib/orm/ChainFind.d.ts +3 -0
  71. package/lib/orm/ChainFind.js +327 -0
  72. package/lib/orm/ChainInstance.d.ts +6 -0
  73. package/lib/orm/ChainInstance.js +73 -0
  74. package/lib/orm/Debug.d.ts +2 -0
  75. package/lib/orm/Debug.js +17 -0
  76. package/lib/orm/Drivers/DB/base.d.ts +3 -0
  77. package/lib/orm/Drivers/DB/base.js +3 -0
  78. package/lib/orm/Drivers/DB/dm.d.ts +11 -0
  79. package/lib/orm/Drivers/DB/dm.js +23 -0
  80. package/lib/orm/Drivers/DB/mysql.d.ts +11 -0
  81. package/lib/orm/Drivers/DB/mysql.js +23 -0
  82. package/lib/orm/Drivers/DB/postgres.d.ts +11 -0
  83. package/lib/orm/Drivers/DB/postgres.js +22 -0
  84. package/lib/orm/Drivers/DB/sqlite3.d.ts +16 -0
  85. package/lib/orm/Drivers/DB/sqlite3.js +39 -0
  86. package/lib/orm/Drivers/DML/_ddl-sql.d.ts +3 -0
  87. package/lib/orm/Drivers/DML/_ddl-sql.js +51 -0
  88. package/lib/orm/Drivers/DML/_dml-helpers.d.ts +19 -0
  89. package/lib/orm/Drivers/DML/_dml-helpers.js +51 -0
  90. package/lib/orm/Drivers/DML/_shared.d.ts +9 -0
  91. package/lib/orm/Drivers/DML/_shared.js +38 -0
  92. package/lib/orm/Drivers/DML/_utils.d.ts +8 -0
  93. package/lib/orm/Drivers/DML/_utils.js +67 -0
  94. package/lib/orm/Drivers/DML/constants.d.ts +3 -0
  95. package/lib/orm/Drivers/DML/constants.js +2 -0
  96. package/lib/orm/Drivers/DML/dm.d.ts +2 -0
  97. package/lib/orm/Drivers/DML/dm.js +293 -0
  98. package/lib/orm/Drivers/DML/index.d.ts +4 -0
  99. package/lib/orm/Drivers/DML/index.js +6 -0
  100. package/lib/orm/Drivers/DML/mysql.d.ts +2 -0
  101. package/lib/orm/Drivers/DML/mysql.js +251 -0
  102. package/lib/orm/Drivers/DML/postgres.d.ts +3 -0
  103. package/lib/orm/Drivers/DML/postgres.js +276 -0
  104. package/lib/orm/Drivers/DML/sqlite.d.ts +2 -0
  105. package/lib/orm/Drivers/DML/sqlite.js +266 -0
  106. package/lib/orm/Error.d.ts +11 -0
  107. package/lib/orm/Error.js +40 -0
  108. package/lib/orm/Helpers.d.ts +35 -0
  109. package/lib/orm/Helpers.js +233 -0
  110. package/lib/orm/Hook.d.ts +13 -0
  111. package/lib/orm/Hook.js +99 -0
  112. package/lib/orm/Instance.d.ts +2 -0
  113. package/lib/orm/Instance.js +697 -0
  114. package/lib/orm/LazyLoad.d.ts +4 -0
  115. package/lib/orm/LazyLoad.js +76 -0
  116. package/lib/orm/Model.d.ts +7 -0
  117. package/lib/orm/Model.js +971 -0
  118. package/lib/orm/ORM.d.ts +37 -0
  119. package/lib/orm/ORM.js +241 -0
  120. package/lib/orm/Patch/fib-cache.d.ts +40 -0
  121. package/lib/orm/Patch/fib-cache.js +2 -0
  122. package/lib/orm/Patch/plugin.d.ts +4 -0
  123. package/lib/orm/Patch/plugin.js +13 -0
  124. package/lib/orm/Property.d.ts +9 -0
  125. package/lib/orm/Property.js +71 -0
  126. package/lib/orm/Settings.d.ts +42 -0
  127. package/lib/orm/Settings.js +119 -0
  128. package/lib/orm/Singleton.d.ts +5 -0
  129. package/lib/orm/Singleton.js +72 -0
  130. package/lib/orm/Typo/Adapter.d.ts +5 -0
  131. package/lib/orm/Typo/Adapter.js +1 -0
  132. package/lib/orm/Typo/DMLDriver.d.ts +210 -0
  133. package/lib/orm/Typo/DMLDriver.js +1 -0
  134. package/lib/orm/Typo/Db.d.ts +38 -0
  135. package/lib/orm/Typo/Db.js +1 -0
  136. package/lib/orm/Typo/Error.d.ts +31 -0
  137. package/lib/orm/Typo/Error.js +1 -0
  138. package/lib/orm/Typo/ORM.d.ts +233 -0
  139. package/lib/orm/Typo/ORM.js +3 -0
  140. package/lib/orm/Typo/Validators.d.ts +32 -0
  141. package/lib/orm/Typo/Validators.js +2 -0
  142. package/lib/orm/Typo/_common.d.ts +38 -0
  143. package/lib/orm/Typo/_common.js +1 -0
  144. package/lib/orm/Typo/assoc.d.ts +221 -0
  145. package/lib/orm/Typo/assoc.js +1 -0
  146. package/lib/orm/Typo/hook.d.ts +42 -0
  147. package/lib/orm/Typo/hook.js +1 -0
  148. package/lib/orm/Typo/instance.d.ts +157 -0
  149. package/lib/orm/Typo/instance.js +1 -0
  150. package/lib/orm/Typo/model.d.ts +313 -0
  151. package/lib/orm/Typo/model.js +6 -0
  152. package/lib/orm/Typo/patch.d.ts +31 -0
  153. package/lib/orm/Typo/patch.js +1 -0
  154. package/lib/orm/Typo/property.d.ts +57 -0
  155. package/lib/orm/Typo/property.js +1 -0
  156. package/lib/orm/Typo/query.d.ts +216 -0
  157. package/lib/orm/Typo/query.js +1 -0
  158. package/lib/orm/Typo/settings.d.ts +35 -0
  159. package/lib/orm/Typo/settings.js +5 -0
  160. package/lib/orm/Typo/synchronous.d.ts +47 -0
  161. package/lib/orm/Typo/synchronous.js +1 -0
  162. package/lib/orm/Utilities.d.ts +179 -0
  163. package/lib/orm/Utilities.js +975 -0
  164. package/lib/orm/Validators.d.ts +34 -0
  165. package/lib/orm/Validators.js +100 -0
  166. package/lib/orm/Where/common.d.ts +1 -0
  167. package/lib/orm/Where/common.js +7 -0
  168. package/lib/orm/Where/filterDate.d.ts +11 -0
  169. package/lib/orm/Where/filterDate.js +58 -0
  170. package/lib/orm/index.d.ts +68 -0
  171. package/lib/orm/index.js +157 -0
  172. package/lib/orm-core/callback.d.ts +12 -0
  173. package/lib/orm-core/callback.js +1 -0
  174. package/lib/orm-core/dialect.d.ts +80 -0
  175. package/lib/orm-core/dialect.js +1 -0
  176. package/lib/orm-core/error.d.ts +16 -0
  177. package/lib/orm-core/error.js +29 -0
  178. package/lib/orm-core/index.d.ts +6 -0
  179. package/lib/orm-core/index.js +6 -0
  180. package/lib/orm-core/sync.d.ts +12 -0
  181. package/lib/orm-core/sync.js +1 -0
  182. package/lib/orm-core/utils.d.ts +1 -0
  183. package/lib/orm-core/utils.js +5 -0
  184. package/lib/orm-property/Property.d.ts +78 -0
  185. package/lib/orm-property/Property.js +1 -0
  186. package/lib/orm-property/Utils.d.ts +9 -0
  187. package/lib/orm-property/Utils.js +13 -0
  188. package/lib/orm-property/customTypes.d.ts +2 -0
  189. package/lib/orm-property/customTypes.js +13 -0
  190. package/lib/orm-property/index.d.ts +10 -0
  191. package/lib/orm-property/index.js +22 -0
  192. package/lib/orm-property/transformer.d.ts +5 -0
  193. package/lib/orm-property/transformer.js +10 -0
  194. package/lib/orm-property/transformers/dm.d.ts +29 -0
  195. package/lib/orm-property/transformers/dm.js +237 -0
  196. package/lib/orm-property/transformers/index.d.ts +4 -0
  197. package/lib/orm-property/transformers/index.js +5 -0
  198. package/lib/orm-property/transformers/mysql.d.ts +102 -0
  199. package/lib/orm-property/transformers/mysql.js +261 -0
  200. package/lib/orm-property/transformers/postgresql.d.ts +54 -0
  201. package/lib/orm-property/transformers/postgresql.js +189 -0
  202. package/lib/orm-property/transformers/sqlite.d.ts +19 -0
  203. package/lib/orm-property/transformers/sqlite.js +171 -0
  204. package/lib/sql-ddl-sync/Dialects/dm.d.ts +40 -0
  205. package/lib/sql-ddl-sync/Dialects/dm.js +296 -0
  206. package/lib/sql-ddl-sync/Dialects/index.d.ts +7 -0
  207. package/lib/sql-ddl-sync/Dialects/index.js +7 -0
  208. package/lib/sql-ddl-sync/Dialects/mysql.d.ts +39 -0
  209. package/lib/sql-ddl-sync/Dialects/mysql.js +240 -0
  210. package/lib/sql-ddl-sync/Dialects/postgresql.d.ts +40 -0
  211. package/lib/sql-ddl-sync/Dialects/postgresql.js +286 -0
  212. package/lib/sql-ddl-sync/Dialects/sqlite.d.ts +44 -0
  213. package/lib/sql-ddl-sync/Dialects/sqlite.js +256 -0
  214. package/lib/sql-ddl-sync/SQL.d.ts +12 -0
  215. package/lib/sql-ddl-sync/SQL.js +108 -0
  216. package/lib/sql-ddl-sync/Typo/Collection.d.ts +13 -0
  217. package/lib/sql-ddl-sync/Typo/Collection.js +1 -0
  218. package/lib/sql-ddl-sync/Typo/DbIndex.d.ts +13 -0
  219. package/lib/sql-ddl-sync/Typo/DbIndex.js +1 -0
  220. package/lib/sql-ddl-sync/Typo/Dialect.d.ts +81 -0
  221. package/lib/sql-ddl-sync/Typo/Dialect.js +1 -0
  222. package/lib/sql-ddl-sync/Typo/Driver.d.ts +53 -0
  223. package/lib/sql-ddl-sync/Typo/Driver.js +1 -0
  224. package/lib/sql-ddl-sync/Typo/Query.d.ts +7 -0
  225. package/lib/sql-ddl-sync/Typo/Query.js +1 -0
  226. package/lib/sql-ddl-sync/Typo/SQL.d.ts +31 -0
  227. package/lib/sql-ddl-sync/Typo/SQL.js +1 -0
  228. package/lib/sql-ddl-sync/Typo/_common.d.ts +29 -0
  229. package/lib/sql-ddl-sync/Typo/_common.js +1 -0
  230. package/lib/sql-ddl-sync/Utils.d.ts +40 -0
  231. package/lib/sql-ddl-sync/Utils.js +217 -0
  232. package/lib/sql-ddl-sync/index.d.ts +87 -0
  233. package/lib/sql-ddl-sync/index.js +371 -0
  234. package/lib/sql-query/Comparators.d.ts +3 -0
  235. package/lib/sql-query/Comparators.js +94 -0
  236. package/lib/sql-query/Create.d.ts +35 -0
  237. package/lib/sql-query/Create.js +77 -0
  238. package/lib/sql-query/Dialects/dm.d.ts +3 -0
  239. package/lib/sql-query/Dialects/dm.js +74 -0
  240. package/lib/sql-query/Dialects/index.d.ts +10 -0
  241. package/lib/sql-query/Dialects/index.js +12 -0
  242. package/lib/sql-query/Dialects/mssql.d.ts +3 -0
  243. package/lib/sql-query/Dialects/mssql.js +73 -0
  244. package/lib/sql-query/Dialects/mysql.d.ts +3 -0
  245. package/lib/sql-query/Dialects/mysql.js +100 -0
  246. package/lib/sql-query/Dialects/postgresql.d.ts +3 -0
  247. package/lib/sql-query/Dialects/postgresql.js +76 -0
  248. package/lib/sql-query/Dialects/sqlite.d.ts +3 -0
  249. package/lib/sql-query/Dialects/sqlite.js +61 -0
  250. package/lib/sql-query/Helpers.d.ts +38 -0
  251. package/lib/sql-query/Helpers.js +259 -0
  252. package/lib/sql-query/Insert.d.ts +12 -0
  253. package/lib/sql-query/Insert.js +33 -0
  254. package/lib/sql-query/Query.d.ts +29 -0
  255. package/lib/sql-query/Query.js +119 -0
  256. package/lib/sql-query/Remove.d.ts +16 -0
  257. package/lib/sql-query/Remove.js +93 -0
  258. package/lib/sql-query/Select.d.ts +62 -0
  259. package/lib/sql-query/Select.js +533 -0
  260. package/lib/sql-query/Set.d.ts +4 -0
  261. package/lib/sql-query/Set.js +16 -0
  262. package/lib/sql-query/Typo/Aggregation.d.ts +32 -0
  263. package/lib/sql-query/Typo/Aggregation.js +1 -0
  264. package/lib/sql-query/Typo/Comparators.d.ts +140 -0
  265. package/lib/sql-query/Typo/Comparators.js +1 -0
  266. package/lib/sql-query/Typo/Dialect.d.ts +39 -0
  267. package/lib/sql-query/Typo/Dialect.js +1 -0
  268. package/lib/sql-query/Typo/Field.d.ts +8 -0
  269. package/lib/sql-query/Typo/Field.js +1 -0
  270. package/lib/sql-query/Typo/Helper.d.ts +4 -0
  271. package/lib/sql-query/Typo/Helper.js +1 -0
  272. package/lib/sql-query/Typo/Query-ChainBuilder.d.ts +80 -0
  273. package/lib/sql-query/Typo/Query-ChainBuilder.js +1 -0
  274. package/lib/sql-query/Typo/Query.d.ts +34 -0
  275. package/lib/sql-query/Typo/Query.js +16 -0
  276. package/lib/sql-query/Typo/Sql.d.ts +143 -0
  277. package/lib/sql-query/Typo/Sql.js +1 -0
  278. package/lib/sql-query/Typo/SubQuery.d.ts +39 -0
  279. package/lib/sql-query/Typo/SubQuery.js +1 -0
  280. package/lib/sql-query/Typo/index.d.ts +9 -0
  281. package/lib/sql-query/Typo/index.js +1 -0
  282. package/lib/sql-query/Update.d.ts +15 -0
  283. package/lib/sql-query/Update.js +38 -0
  284. package/lib/sql-query/Where.d.ts +4 -0
  285. package/lib/sql-query/Where.js +280 -0
  286. package/package.json +72 -36
  287. package/.travis.yml +0 -14
  288. package/@types/index.d.ts +0 -193
  289. package/@types/orm_mirror/orm.d.ts +0 -275
  290. package/@types/orm_mirror/sql-query.d.ts +0 -79
  291. package/Readme.md +0 -843
  292. package/lib/index.js +0 -13
  293. package/lib/modules/mysql.js +0 -35
  294. package/lib/modules/sqlite3.js +0 -27
  295. package/lib/patch.js +0 -271
@@ -0,0 +1,87 @@
1
+ import { FxOrmSqlDDLSync__Collection } from "./Typo/Collection";
2
+ import { FxOrmSqlDDLSync__DbIndex } from "./Typo/DbIndex";
3
+ import { FxOrmSqlDDLSync__Dialect } from "./Typo/Dialect";
4
+ import { FxOrmSqlDDLSync__Driver } from "./Typo/Driver";
5
+ import { FxOrmSqlDDLSync } from "./Typo/_common";
6
+ import { FxOrmCoreCallbackNS } from '../orm-core/index';
7
+ import "./Dialects";
8
+ import { IProperty } from '../orm-property/index';
9
+ import { IDbDriver } from "../db-driver/index";
10
+ export declare function dialect(name: FxOrmSqlDDLSync__Dialect.DialectType | 'psql'): typeof import("./Dialects/mysql") | typeof import("./Dialects/sqlite");
11
+ export declare class Sync<T extends IDbDriver.ISQLConn = IDbDriver.ISQLConn> {
12
+ strategy: FxOrmSqlDDLSync.SyncCollectionOptions['strategy'];
13
+ /**
14
+ * @description total changes count in this time `Sync`
15
+ * @deprecated
16
+ */
17
+ total_changes: number;
18
+ readonly collections: FxOrmSqlDDLSync__Collection.Collection[];
19
+ readonly dbdriver: IDbDriver.ITypedDriver<T>;
20
+ readonly Dialect: FxOrmSqlDDLSync__Dialect.Dialect<T>;
21
+ /**
22
+ * @description customTypes
23
+ */
24
+ readonly types: Record<string, FxOrmSqlDDLSync__Driver.CustomPropertyType<T>>;
25
+ private suppressColumnDrop;
26
+ private debug;
27
+ constructor(options: FxOrmSqlDDLSync.SyncOptions<T>);
28
+ [sync_method: string]: any;
29
+ defineCollection(collection_name: string, properties: FxOrmSqlDDLSync__Collection.Collection['properties'], options?: {
30
+ comment: FxOrmSqlDDLSync__Collection.Collection['comment'];
31
+ }): this;
32
+ findCollection(collection_name: string): FxOrmSqlDDLSync__Collection.Collection;
33
+ defineType(type: string, proto: FxOrmSqlDDLSync__Driver.CustomPropertyType<T>): this;
34
+ /**
35
+ * @description
36
+ * create collection in db if it doesn't exist, then sync all columns for it.
37
+ *
38
+ * @param collection collection relation to create
39
+ */
40
+ createCollection<T = any>(collection: FxOrmSqlDDLSync__Collection.Collection): T;
41
+ /**
42
+ * @description
43
+ * compare/diff properties between definition ones and the real ones,
44
+ * then sync column in definition but missing in the real
45
+ *
46
+ * @param collection collection properties user provided
47
+ * @param opts
48
+ * - opts.columns: properties from user(default from db)
49
+ * - opts.strategy: (default soft) strategy when conflict between local and remote db, see details below
50
+ *
51
+ * @strategy
52
+ * - 'soft': no change
53
+ * - 'mixed': add missing columns, but never change existed column in db
54
+ * - 'hard': modify existed columns in db
55
+ */
56
+ syncCollection(_collection: string | FxOrmSqlDDLSync__Collection.Collection, opts?: FxOrmSqlDDLSync.SyncCollectionOptions): void;
57
+ syncIndexes(collection_name: string, index_defs: FxOrmSqlDDLSync__DbIndex.CollectionDbIndexInfo[]): void;
58
+ /**
59
+ * @description
60
+ * sync all collections to db (if not existing), with initializing ones' properties.
61
+ *
62
+ * @callbackable
63
+ */
64
+ sync(cb: FxOrmCoreCallbackNS.ExecutionCallback<FxOrmSqlDDLSync.SyncResult>): void;
65
+ sync(): FxOrmSqlDDLSync.SyncResult;
66
+ /**
67
+ * @description
68
+ * sync all collections to db whatever it existed,
69
+ * with sync ones' properties whatever the property existed.
70
+ *
71
+ * @callbackable
72
+ */
73
+ forceSync(cb: FxOrmCoreCallbackNS.ExecutionCallback<FxOrmSqlDDLSync.SyncResult>): void;
74
+ forceSync(): FxOrmSqlDDLSync.SyncResult;
75
+ /**
76
+ * @description if sync one column
77
+ *
78
+ * @param property existed property in collection
79
+ * @param column column expected to be synced
80
+ */
81
+ needDefinitionToColumn(property: IProperty, column: IProperty, options?: {
82
+ collection?: string;
83
+ }): boolean;
84
+ }
85
+ export type { FxOrmSqlDDLSync } from "./Typo/_common";
86
+ export type { FxOrmSqlDDLSync__Driver } from "./Typo/Driver";
87
+ export type { FxOrmSqlDDLSync__Dialect } from "./Typo/Dialect";
@@ -0,0 +1,371 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.Sync = exports.dialect = void 0;
3
+ const FxORMCore = require("../orm-core/index");
4
+ const util = require("util");
5
+ const Utils_1 = require("./Utils");
6
+ require("./Dialects");
7
+ const index_1 = require("../orm-property/index");
8
+ const SQL_1 = require("./SQL");
9
+ const noOp = () => { };
10
+ function dialect(name) {
11
+ const Dialects = require('./Dialects');
12
+ switch (name) {
13
+ case 'psql':
14
+ case 'postgresql':
15
+ return Dialects['postgresql'];
16
+ case 'sqlite':
17
+ case 'mssql':
18
+ case 'mysql':
19
+ case 'dm':
20
+ return Dialects[name];
21
+ default:
22
+ throw new Error(`no dialect with name '${name}'`);
23
+ }
24
+ }
25
+ exports.dialect = dialect;
26
+ function alterCollectionComment(collection, dbdriver) {
27
+ if (dbdriver.type === 'sqlite')
28
+ return;
29
+ // don't remove old comment if not provided
30
+ if (!collection.comment)
31
+ return '';
32
+ dbdriver.execute((0, SQL_1.ALTER_TABLE_COMMENT)(dbdriver.type, collection.name, collection.comment));
33
+ }
34
+ function updateColumnsComment(collection, dbdriver, remote_properties) {
35
+ if (dbdriver.type !== 'psql' && dbdriver.type !== 'dm')
36
+ return;
37
+ // TODO: support mysql also
38
+ const dialect = (0, Utils_1.getSqlQueryDialect)(dbdriver.type);
39
+ for (let k in collection.properties) {
40
+ const prop = collection.properties[k];
41
+ if (!prop.comment)
42
+ continue;
43
+ const remote_prop = remote_properties[k];
44
+ const mapsTo = prop.mapsTo || k;
45
+ if (!mapsTo) {
46
+ this.debug(`[updateColumnsComment] No mapsTo for property '${k}' in collection '${collection.name}'`);
47
+ continue;
48
+ }
49
+ if (remote_prop.comment === prop.comment)
50
+ continue;
51
+ dbdriver.execute(dialect.escape(`comment on column ??.?? is ?`, [collection.name, mapsTo, prop.comment]));
52
+ }
53
+ }
54
+ /**
55
+ * @description iterate collection, create property's column which didn't exist.
56
+ *
57
+ * @param collection
58
+ * @param force_sync (dangerous) if force re-syncing property to column
59
+ */
60
+ function processCollection(syncInstnace, collection, opts) {
61
+ let has;
62
+ let is_processed = false;
63
+ has = syncInstnace.Dialect.hasCollectionSync(syncInstnace.dbdriver, collection.name);
64
+ if (!has) {
65
+ syncInstnace.createCollection(collection);
66
+ is_processed = true;
67
+ }
68
+ const { strategy = syncInstnace.strategy } = opts || {};
69
+ alterCollectionComment(collection, syncInstnace.dbdriver);
70
+ switch (strategy) {
71
+ case 'soft':
72
+ return is_processed;
73
+ case 'mixed':
74
+ case 'hard':
75
+ break;
76
+ }
77
+ syncInstnace.syncCollection(collection, { strategy });
78
+ return true;
79
+ }
80
+ /**
81
+ * @param collection_name table where column created
82
+ * @param prop column's property
83
+ */
84
+ function getColumnTypeRaw(syncInstance, collection_name, prop, opts) {
85
+ var _a;
86
+ let type;
87
+ /**
88
+ * get type, customTypes first
89
+ */
90
+ if (syncInstance.types.hasOwnProperty(prop.type)) {
91
+ type = syncInstance.types[prop.type].datastoreType(prop);
92
+ }
93
+ else { // fallback to driver's types
94
+ const { for: _for = 'create_table' } = opts || {};
95
+ const dbtype = syncInstance.dbdriver.type;
96
+ type = (0, index_1.transformer)(dbtype).toStorageType(prop, {
97
+ collection: collection_name,
98
+ customTypes: (_a = syncInstance.dbdriver) === null || _a === void 0 ? void 0 : _a.customTypes,
99
+ escapeVal: (0, Utils_1.getSqlQueryDialect)(dbtype).escapeVal,
100
+ userOptions: {
101
+ useDefaultValue: _for === 'create_table' || (dbtype === 'sqlite' && ['add_column', 'alter_column'].includes(_for)),
102
+ }
103
+ }).typeValue;
104
+ }
105
+ if (!type)
106
+ return false;
107
+ if (typeof type == "string") {
108
+ type = { value: type };
109
+ }
110
+ if (prop.mapsTo === undefined)
111
+ throw new Error("undefined prop.mapsTo" + JSON.stringify(prop));
112
+ return {
113
+ value: (0, Utils_1.getSqlQueryDialect)(syncInstance.dbdriver.type).escapeId(prop.mapsTo) + " " + type.value,
114
+ };
115
+ }
116
+ class Sync {
117
+ constructor(options) {
118
+ this.strategy = 'soft';
119
+ const dbdriver = options.dbdriver;
120
+ this.suppressColumnDrop = (0, Utils_1.filterSuppressColumnDrop)(options.suppressColumnDrop !== false, dbdriver.type);
121
+ this.strategy = (0, Utils_1.filterSyncStrategy)(options.syncStrategy);
122
+ this.debug = typeof options.debug === 'function' ? options.debug : noOp;
123
+ Object.defineProperty(this, 'types', { value: {}, writable: false });
124
+ Object.defineProperty(this, 'collections', { value: [], writable: false });
125
+ Object.defineProperty(this, 'dbdriver', { value: dbdriver, writable: false });
126
+ Object.defineProperty(this, 'Dialect', { value: dialect(dbdriver.type), writable: false });
127
+ }
128
+ defineCollection(collection_name, properties, options) {
129
+ let collectionIdx = this.collections.findIndex(collection => collection.name === collection_name);
130
+ if (collectionIdx >= 0)
131
+ this.collections.splice(collectionIdx, 1);
132
+ properties = Object.assign({}, properties);
133
+ let index_defs = [];
134
+ for (let k in properties) {
135
+ // reassign it
136
+ properties[k] = Object.assign({}, properties[k]);
137
+ properties[k].mapsTo = properties[k].mapsTo || k;
138
+ (0, Utils_1.extractCollectionIndexes)(collection_name, k, properties[k], this.dbdriver.type, index_defs);
139
+ (0, Utils_1.normalizeDefinedProperty)(properties[k], this.dbdriver.type);
140
+ }
141
+ if (typeof this.Dialect.convertIndexes === 'function') {
142
+ index_defs = this.Dialect.convertIndexes(collection_name, index_defs);
143
+ }
144
+ this.collections.push({
145
+ name: collection_name,
146
+ properties,
147
+ index_defs,
148
+ comment: options === null || options === void 0 ? void 0 : options.comment,
149
+ });
150
+ return this;
151
+ }
152
+ findCollection(collection_name) {
153
+ return this.collections.find(collection => collection.name === collection_name) || null;
154
+ }
155
+ defineType(type, proto) {
156
+ this.types[type] = proto;
157
+ return this;
158
+ }
159
+ /**
160
+ * @description
161
+ * create collection in db if it doesn't exist, then sync all columns for it.
162
+ *
163
+ * @param collection collection relation to create
164
+ */
165
+ createCollection(collection) {
166
+ const columns = [];
167
+ let keys = [];
168
+ for (let k in collection.properties) {
169
+ let property = collection.properties[k], col;
170
+ col = getColumnTypeRaw(this, collection.name, property, { for: 'create_table' });
171
+ if (col === false) {
172
+ (0, Utils_1.logJson)('createCollection', property);
173
+ throw new Error(`Invalid type definition for property '${k}'.`);
174
+ }
175
+ if (property.key)
176
+ keys.push(property.mapsTo);
177
+ columns.push(col.value);
178
+ }
179
+ this.debug("Creating " + collection.name);
180
+ // ? TODO: what it means?
181
+ if (typeof this.Dialect.processKeys === "function")
182
+ keys = this.Dialect.processKeys(keys);
183
+ this.total_changes += 1;
184
+ if (this.dbdriver.type === 'psql') {
185
+ (0, Utils_1.psqlRepairEnumTypes)(collection.properties, collection.name, this.dbdriver);
186
+ }
187
+ const result_1 = this.Dialect.createCollectionSync(this.dbdriver, collection.name, columns, keys, { comment: collection.comment });
188
+ this.syncIndexes(collection.name, collection.index_defs);
189
+ updateColumnsComment(collection, this.dbdriver, this.Dialect.getCollectionPropertiesSync(this.dbdriver, collection.name));
190
+ return result_1;
191
+ }
192
+ /**
193
+ * @description
194
+ * compare/diff properties between definition ones and the real ones,
195
+ * then sync column in definition but missing in the real
196
+ *
197
+ * @param collection collection properties user provided
198
+ * @param opts
199
+ * - opts.columns: properties from user(default from db)
200
+ * - opts.strategy: (default soft) strategy when conflict between local and remote db, see details below
201
+ *
202
+ * @strategy
203
+ * - 'soft': no change
204
+ * - 'mixed': add missing columns, but never change existed column in db
205
+ * - 'hard': modify existed columns in db
206
+ */
207
+ syncCollection(_collection, opts) {
208
+ const collection = typeof _collection === 'string' ? this.findCollection(_collection) : _collection;
209
+ if (!collection)
210
+ throw new Error('[syncCollection] invalid collection');
211
+ let { columns = this.Dialect.getCollectionPropertiesSync(this.dbdriver, collection.name), strategy = this.strategy, suppressColumnDrop = this.suppressColumnDrop } = opts || {};
212
+ suppressColumnDrop = (0, Utils_1.filterSuppressColumnDrop)(suppressColumnDrop, this.dbdriver.type);
213
+ strategy = (0, Utils_1.filterSyncStrategy)(strategy);
214
+ let last_k = null;
215
+ this.debug("Synchronizing " + collection.name);
216
+ if (strategy !== 'soft') {
217
+ for (let k in collection.properties) {
218
+ const prop = collection.properties[k];
219
+ if (!columns.hasOwnProperty(k)) {
220
+ prop.mapsTo = prop.mapsTo || k;
221
+ const col = getColumnTypeRaw(this, collection.name, prop, { for: 'add_column' });
222
+ if (col === false) {
223
+ (0, Utils_1.logJson)('syncCollection', prop);
224
+ throw new Error(`Invalid type definition for property '${k}'.`);
225
+ }
226
+ this.debug("Adding column " + collection.name + "." + k + ": " + col.value);
227
+ // check existence again
228
+ if (!this.Dialect.hasCollectionColumnsSync(this.dbdriver, collection.name, prop.mapsTo)) {
229
+ this.Dialect.addCollectionColumnSync(this.dbdriver, collection.name, col.value,
230
+ // for sqlite, added column must be the last one,
231
+ // we pass empty string to make `addCollectionColumnSync`
232
+ // find last column automatically
233
+ this.dbdriver.type === 'sqlite' ? '' : last_k);
234
+ this.total_changes += 1;
235
+ }
236
+ }
237
+ else if (strategy === 'hard' &&
238
+ this.dbdriver.type !== 'sqlite'
239
+ && this.needDefinitionToColumn(prop, columns[k], { collection: collection.name })) {
240
+ const col = getColumnTypeRaw(this, collection.name, prop, { for: 'alter_column' });
241
+ if (col === false) {
242
+ (0, Utils_1.logJson)('syncCollection', prop);
243
+ throw new Error(`Invalid type definition for property '${k}'.`);
244
+ }
245
+ this.debug("Modifying column " + collection.name + "." + k + ": " + col.value);
246
+ // check existence again
247
+ if (this.Dialect.hasCollectionColumnsSync(this.dbdriver, collection.name, prop.mapsTo)) {
248
+ this.Dialect.modifyCollectionColumnSync(this.dbdriver, collection.name, col.value);
249
+ this.total_changes += 1;
250
+ }
251
+ }
252
+ last_k = k;
253
+ }
254
+ if (strategy === 'hard' && !suppressColumnDrop) {
255
+ const hash = (0, Utils_1.getCollectionMapsTo_PropertyNameDict)(collection);
256
+ for (let colname in columns) {
257
+ if (collection.properties.hasOwnProperty(colname))
258
+ continue;
259
+ /* colname maybe mapsTo */
260
+ if (hash.hasOwnProperty(colname))
261
+ continue;
262
+ this.debug(`Dropping column ${collection.name}.${colname}`);
263
+ this.total_changes += 1;
264
+ this.Dialect.dropCollectionColumnSync(this.dbdriver, collection.name, colname);
265
+ }
266
+ }
267
+ }
268
+ this.syncIndexes(collection.name, collection.index_defs);
269
+ }
270
+ syncIndexes(collection_name, index_defs) {
271
+ if (index_defs.length == 0)
272
+ return;
273
+ const db_indexes = this.Dialect.getCollectionIndexesSync(this.dbdriver, collection_name);
274
+ for (let i = 0; i < index_defs.length; i++) {
275
+ if (!db_indexes.hasOwnProperty(index_defs[i].name)) {
276
+ this.debug("Adding index " + collection_name + "." + index_defs[i].name + " (" + index_defs[i].columns.join(", ") + ")");
277
+ this.total_changes += 1;
278
+ const index = index_defs[i];
279
+ this.Dialect.addIndexSync(this.dbdriver, index.name, index.unique, collection_name, index.columns);
280
+ continue;
281
+ }
282
+ else if (!db_indexes[index_defs[i].name].unique != !index_defs[i].unique) {
283
+ this.debug("Replacing index " + collection_name + "." + index_defs[i].name);
284
+ this.total_changes += 1;
285
+ const index = index_defs[i];
286
+ this.Dialect.removeIndexSync(this.dbdriver, index.name, collection_name);
287
+ this.Dialect.addIndexSync(this.dbdriver, index.name, index.unique, collection_name, index.columns);
288
+ }
289
+ delete db_indexes[index_defs[i].name];
290
+ }
291
+ for (let idx in db_indexes) {
292
+ this.debug("Removing index " + collection_name + "." + idx);
293
+ this.total_changes += 1;
294
+ this.Dialect.removeIndexSync(this.dbdriver, collection_name, idx);
295
+ }
296
+ }
297
+ sync(cb) {
298
+ const exposedErrResults = FxORMCore.Utils.exposeErrAndResultFromSyncMethod(() => {
299
+ this.total_changes = 0;
300
+ this.collections.forEach(collection => processCollection(this, collection, { strategy: this.strategy }));
301
+ return {
302
+ changes: this.total_changes
303
+ };
304
+ });
305
+ FxORMCore.Utils.throwErrOrCallabckErrResult(exposedErrResults, { no_throw: !!cb, callback: cb });
306
+ return exposedErrResults.result;
307
+ }
308
+ ;
309
+ forceSync(cb) {
310
+ const exposedErrResults = FxORMCore.Utils.exposeErrAndResultFromSyncMethod(() => {
311
+ this.total_changes = 0;
312
+ this.collections.forEach(collection => processCollection(this, collection, { strategy: 'hard' }));
313
+ return {
314
+ changes: this.total_changes
315
+ };
316
+ });
317
+ FxORMCore.Utils.throwErrOrCallabckErrResult(exposedErrResults, { no_throw: !!cb, callback: cb });
318
+ return exposedErrResults.result;
319
+ }
320
+ ;
321
+ /**
322
+ * @description if sync one column
323
+ *
324
+ * @param property existed property in collection
325
+ * @param column column expected to be synced
326
+ */
327
+ needDefinitionToColumn(property, column, options) {
328
+ if (property.serial && property.type === "number") {
329
+ property.type = "serial";
330
+ }
331
+ /* if type not equal, sync is required */
332
+ if (property.type != column.type) {
333
+ if (typeof this.Dialect.supportsType !== "function") {
334
+ return true;
335
+ }
336
+ if (this.Dialect.supportsType(property.type) !== column.type) {
337
+ return true;
338
+ }
339
+ }
340
+ /* deal with type which maybe require sync as type equals between two sides :start */
341
+ if (property.type === 'serial') {
342
+ return false; // serial columns have a fixed form, nothing more to check
343
+ }
344
+ if (property.required !== column.required && !property.key) {
345
+ return true;
346
+ }
347
+ const { collection: collection_name = undefined } = options || {};
348
+ if (property.hasOwnProperty('defaultValue')
349
+ && (0, Utils_1.filterPropertyDefaultValue)(property, {
350
+ collection: collection_name,
351
+ property,
352
+ driver: this.dbdriver
353
+ }) != column.defaultValue) {
354
+ return true;
355
+ }
356
+ if (property.type === 'number' || property.type === 'integer') {
357
+ if (column.hasOwnProperty('size') && (property.size || 4) != column.size) {
358
+ return true;
359
+ }
360
+ }
361
+ if (property.type === 'enum' && column.type === 'enum') {
362
+ if (util.difference(property.values, column.values).length > 0
363
+ || util.difference(column.values, property.values).length > 0) {
364
+ return true;
365
+ }
366
+ }
367
+ /* deal with type which maybe require sync as type equals between two sides :end */
368
+ return false;
369
+ }
370
+ }
371
+ exports.Sync = Sync;
@@ -0,0 +1,3 @@
1
+ import { FxSqlQueryComparator } from "./Typo/Comparators";
2
+ declare const _default: FxSqlQueryComparator.ComparatorHash;
3
+ export = _default;
@@ -0,0 +1,94 @@
1
+ function between(a, b, opts) {
2
+ return createSpecialObject({
3
+ from: a, to: b, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
4
+ }, 'between');
5
+ }
6
+ ;
7
+ function not_between(a, b, opts) {
8
+ return createSpecialObject({
9
+ from: a, to: b, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
10
+ }, 'not_between');
11
+ }
12
+ ;
13
+ function like(expr, opts) {
14
+ return createSpecialObject({
15
+ expr: expr, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
16
+ }, 'like');
17
+ }
18
+ ;
19
+ function not_like(expr, opts) {
20
+ return createSpecialObject({
21
+ expr: expr, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
22
+ }, 'not_like');
23
+ }
24
+ ;
25
+ function eq(v, opts) {
26
+ return createSpecialObject({
27
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
28
+ }, 'eq');
29
+ }
30
+ ;
31
+ function ne(v, opts) {
32
+ return createSpecialObject({
33
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
34
+ }, 'ne');
35
+ }
36
+ ;
37
+ function gt(v, opts) {
38
+ return createSpecialObject({
39
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
40
+ }, 'gt');
41
+ }
42
+ ;
43
+ function gte(v, opts) {
44
+ return createSpecialObject({
45
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
46
+ }, 'gte');
47
+ }
48
+ ;
49
+ function lt(v, opts) {
50
+ return createSpecialObject({
51
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
52
+ }, 'lt');
53
+ }
54
+ ;
55
+ function lte(v, opts) {
56
+ return createSpecialObject({
57
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
58
+ }, 'lte');
59
+ }
60
+ ;
61
+ function _in(v, opts) {
62
+ return createSpecialObject({
63
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
64
+ }, 'in');
65
+ }
66
+ ;
67
+ function not_in(v, opts) {
68
+ return createSpecialObject({
69
+ val: v, asIdentifier: !!(opts === null || opts === void 0 ? void 0 : opts.asIdentifier)
70
+ }, 'not_in');
71
+ }
72
+ ;
73
+ function createSpecialObject(obj, tag) {
74
+ Object.defineProperty(obj, "sql_comparator", {
75
+ configurable: false,
76
+ enumerable: false,
77
+ value: function () { return tag; }
78
+ });
79
+ return obj;
80
+ }
81
+ module.exports = {
82
+ between,
83
+ not_between,
84
+ like,
85
+ not_like,
86
+ eq,
87
+ ne,
88
+ gt,
89
+ gte,
90
+ lt,
91
+ lte,
92
+ in: _in,
93
+ not_in,
94
+ };
@@ -0,0 +1,35 @@
1
+ import { ChainBuilderBase } from "./Helpers";
2
+ import { FxSqlQueryDialect } from "./Typo/Dialect";
3
+ import { FxSqlQueryColumns } from "./Typo/Field";
4
+ import { FxSqlQueryChainBuilder } from "./Typo/Query-ChainBuilder";
5
+ /**
6
+ * Instantiate a new CREATE-type query builder
7
+ * @param Dialect
8
+ * @returns {{table: table, field: field, fields: fields, build: build}}
9
+ * @constructor
10
+ */
11
+ export declare class CreateQuery extends ChainBuilderBase implements FxSqlQueryChainBuilder.ChainBuilder__Create {
12
+ tableName: string;
13
+ structure: FxSqlQueryColumns.FieldItemTypeMap;
14
+ constructor(Dialect: FxSqlQueryDialect.Dialect);
15
+ /**
16
+ * Set the table name
17
+ * @param table_name
18
+ */
19
+ table(table_name: string): this;
20
+ /**
21
+ * Add a field
22
+ * @param name
23
+ * @param type
24
+ */
25
+ field(name: string, type: FxSqlQueryDialect.DialectFieldType): this;
26
+ /**
27
+ * Set all the fields
28
+ * @param fields
29
+ */
30
+ fields(fields?: FxSqlQueryColumns.FieldItemTypeMap): any;
31
+ /**
32
+ * Build a query from the passed params
33
+ */
34
+ build(): string;
35
+ }
@@ -0,0 +1,77 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.CreateQuery = void 0;
3
+ const Helpers_1 = require("./Helpers");
4
+ /**
5
+ * Instantiate a new CREATE-type query builder
6
+ * @param Dialect
7
+ * @returns {{table: table, field: field, fields: fields, build: build}}
8
+ * @constructor
9
+ */
10
+ class CreateQuery extends Helpers_1.ChainBuilderBase {
11
+ constructor(Dialect) {
12
+ super(Dialect);
13
+ this.tableName = null;
14
+ this.structure = {};
15
+ }
16
+ /**
17
+ * Set the table name
18
+ * @param table_name
19
+ */
20
+ table(table_name) {
21
+ this.tableName = table_name;
22
+ return this;
23
+ }
24
+ /**
25
+ * Add a field
26
+ * @param name
27
+ * @param type
28
+ */
29
+ field(name, type) {
30
+ this.structure[name] = type;
31
+ return this;
32
+ }
33
+ /**
34
+ * Set all the fields
35
+ * @param fields
36
+ */
37
+ fields(fields) {
38
+ if (!fields) {
39
+ return this.structure;
40
+ }
41
+ this.structure = fields;
42
+ return this;
43
+ }
44
+ /**
45
+ * Build a query from the passed params
46
+ */
47
+ build() {
48
+ if (!this.tableName) {
49
+ return '';
50
+ }
51
+ const structure = this.structure;
52
+ const sqlBuilder = this.Dialect.knex.schema.createTable(this.tableName, function (t) {
53
+ Object.keys(structure).forEach(field => {
54
+ const desc = structure[field];
55
+ switch (desc) {
56
+ case 'id':
57
+ t.increments(field);
58
+ break;
59
+ case 'int':
60
+ t.integer(field);
61
+ break;
62
+ case 'float':
63
+ t.float(field, 12, 2);
64
+ break;
65
+ case 'bool':
66
+ t.specificType(field, 'TINYINT(1)');
67
+ break;
68
+ case 'text':
69
+ t.text(field);
70
+ break;
71
+ }
72
+ });
73
+ });
74
+ return sqlBuilder.toQuery();
75
+ }
76
+ }
77
+ exports.CreateQuery = CreateQuery;
@@ -0,0 +1,3 @@
1
+ import { FxSqlQueryDialect } from "../Typo/Dialect";
2
+ declare const Dialect: FxSqlQueryDialect.Dialect;
3
+ export = Dialect;