fib-orm 2.0.0 → 3.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.
- package/README.md +42 -6
- package/index.d.ts +11 -0
- package/index.js +15 -0
- package/package.json +36 -34
- package/{lib/cli/commands/ddlFrom.js → src/cli/commands/ddlFrom.ts} +40 -26
- package/{lib/cli/commands/dumpModel.js → src/cli/commands/dumpModel.ts} +78 -31
- package/{lib/cli/commands/escape.js → src/cli/commands/escape.ts} +51 -28
- package/{lib/cli/commands/spinner.js → src/cli/commands/spinner.ts} +20 -10
- package/{lib/cli/commands/upgrade.js → src/cli/commands/upgrade.ts} +53 -33
- package/src/cli/helpers/ddl.ts +84 -0
- package/src/cli/helpers/package.ts +81 -0
- package/src/cli/index.ts +24 -0
- package/src/cli/wrapSubcommand.ts +66 -0
- package/src/db-driver/Typo.d.ts +141 -0
- package/src/db-driver/built-ins/base.class.ts +260 -0
- package/src/db-driver/built-ins/driver-dm.ts +62 -0
- package/src/db-driver/built-ins/driver-mssql.ts +67 -0
- package/src/db-driver/built-ins/driver-mysql.ts +44 -0
- package/src/db-driver/built-ins/driver-postgresql.ts +94 -0
- package/src/db-driver/built-ins/driver-redis.ts +45 -0
- package/src/db-driver/built-ins/driver-sqlite.ts +41 -0
- package/src/db-driver/index.ts +6 -0
- package/src/db-driver/parseQueryString.ts +76 -0
- package/src/db-driver/utils.ts +204 -0
- package/src/knex/deps/tarn/PendingOperation.ts +56 -0
- package/src/knex/deps/tarn/Pool.ts +610 -0
- package/src/knex/deps/tarn/PromiseInspection.ts +29 -0
- package/src/knex/deps/tarn/Resource.ts +22 -0
- package/src/knex/deps/tarn/TimeoutError.ts +1 -0
- package/src/knex/deps/tarn/tarn.ts +7 -0
- package/src/knex/deps/tarn/utils.ts +62 -0
- package/src/knex/knex.ts +11 -0
- package/src/knex/result.d.ts +27 -0
- package/src/knex/sandbox.ts +45 -0
- package/src/knex/tables.d.ts +4 -0
- package/src/knex/types.d.ts +3228 -0
- package/src/orm/Adapters.ts +53 -0
- package/src/orm/AggregateFunctions.ts +254 -0
- package/src/orm/Associations/Extend.ts +405 -0
- package/src/orm/Associations/Many.ts +784 -0
- package/src/orm/Associations/One.ts +494 -0
- package/src/orm/Associations/_utils.ts +72 -0
- package/src/orm/ChainFind.ts +427 -0
- package/src/orm/ChainInstance.ts +97 -0
- package/src/orm/Debug.ts +21 -0
- package/src/orm/Drivers/DB/base.ts +7 -0
- package/src/orm/Drivers/DB/dm.ts +35 -0
- package/src/orm/Drivers/DB/mssql.ts +35 -0
- package/src/orm/Drivers/DB/mysql.ts +35 -0
- package/src/orm/Drivers/DB/postgres.ts +35 -0
- package/src/orm/Drivers/DB/sqlite3.ts +60 -0
- package/src/orm/Drivers/DML/_ddl-sql.ts +85 -0
- package/src/orm/Drivers/DML/_dml-helpers.ts +66 -0
- package/src/orm/Drivers/DML/_shared.ts +61 -0
- package/src/orm/Drivers/DML/_utils.ts +112 -0
- package/{lib/orm/Drivers/DML/dm.js → src/orm/Drivers/DML/dm.ts} +178 -85
- package/src/orm/Drivers/DML/index.ts +10 -0
- package/src/orm/Drivers/DML/mssql.ts +366 -0
- package/src/orm/Drivers/DML/mysql.ts +347 -0
- package/src/orm/Drivers/DML/postgres.ts +382 -0
- package/src/orm/Drivers/DML/sqlite.ts +361 -0
- package/src/orm/Error.ts +49 -0
- package/src/orm/Helpers.ts +297 -0
- package/src/orm/Hook.ts +125 -0
- package/src/orm/Instance.ts +944 -0
- package/src/orm/LazyLoad.ts +117 -0
- package/src/orm/Model.ts +1235 -0
- package/src/orm/ORM.ts +301 -0
- package/src/orm/Patch/fib-cache.ts +7 -0
- package/src/orm/Patch/plugin.ts +25 -0
- package/src/orm/Property.ts +86 -0
- package/src/orm/Settings.ts +134 -0
- package/src/orm/Singleton.ts +97 -0
- package/src/orm/Typo/Adapter.d.ts +5 -0
- package/src/orm/Typo/DMLDriver.d.ts +260 -0
- package/src/orm/Typo/Db.d.ts +100 -0
- package/src/orm/Typo/Error.d.ts +36 -0
- package/src/orm/Typo/ORM.d.ts +315 -0
- package/src/orm/Typo/Validators.d.ts +39 -0
- package/src/orm/Typo/_common.d.ts +44 -0
- package/src/orm/Typo/assoc.d.ts +280 -0
- package/src/orm/Typo/hook.d.ts +68 -0
- package/src/orm/Typo/instance.d.ts +214 -0
- package/{lib → src}/orm/Typo/model.d.ts +297 -176
- package/src/orm/Typo/patch.d.ts +39 -0
- package/src/orm/Typo/property.d.ts +79 -0
- package/src/orm/Typo/query.d.ts +266 -0
- package/{lib → src}/orm/Typo/settings.d.ts +14 -7
- package/{lib → src}/orm/Typo/synchronous.d.ts +51 -26
- package/src/orm/Utilities.ts +1313 -0
- package/src/orm/Validators.ts +127 -0
- package/src/orm/Where/common.ts +8 -0
- package/src/orm/Where/filterDate.ts +74 -0
- package/src/orm/cloneDeep.ts +45 -0
- package/src/orm/index.ts +231 -0
- package/src/orm-core/callback.d.ts +15 -0
- package/{lib → src}/orm-core/dialect.d.ts +75 -52
- package/src/orm-core/error.ts +71 -0
- package/{lib/orm-core/index.d.ts → src/orm-core/index.ts} +8 -2
- package/src/orm-core/sync.d.ts +14 -0
- package/src/orm-core/utils.ts +4 -0
- package/src/orm-property/Property.ts +110 -0
- package/src/orm-property/Utils.ts +26 -0
- package/src/orm-property/customTypes.ts +13 -0
- package/src/orm-property/index.ts +34 -0
- package/src/orm-property/transformer.ts +16 -0
- package/{lib/orm-property/transformers/dm.js → src/orm-property/transformers/dm.ts} +128 -68
- package/src/orm-property/transformers/index.ts +10 -0
- package/src/orm-property/transformers/mssql.ts +285 -0
- package/src/orm-property/transformers/mysql.ts +395 -0
- package/src/orm-property/transformers/postgresql.ts +267 -0
- package/src/orm-property/transformers/sqlite.ts +217 -0
- package/src/plugins/orm-plugin-uacl/Typo.d.ts +173 -0
- package/src/plugins/orm-plugin-uacl/_utils.ts +237 -0
- package/src/plugins/orm-plugin-uacl/acl-tree.ts +440 -0
- package/src/plugins/orm-plugin-uacl/config-acl-tree.ts +592 -0
- package/src/plugins/orm-plugin-uacl/index.ts +180 -0
- package/src/plugins/orm-plugin-uacl/tree.ts +331 -0
- package/src/sql-ddl-sync/Dialects/dm.ts +493 -0
- package/{lib/sql-query/Dialects/index.d.ts → src/sql-ddl-sync/Dialects/index.ts} +3 -3
- package/src/sql-ddl-sync/Dialects/mssql.ts +441 -0
- package/src/sql-ddl-sync/Dialects/mysql.ts +414 -0
- package/src/sql-ddl-sync/Dialects/postgresql.ts +474 -0
- package/src/sql-ddl-sync/Dialects/sqlite.ts +439 -0
- package/src/sql-ddl-sync/SQL.ts +157 -0
- package/src/sql-ddl-sync/Typo/Collection.d.ts +19 -0
- package/src/sql-ddl-sync/Typo/DbIndex.d.ts +11 -0
- package/{lib → src}/sql-ddl-sync/Typo/Dialect.d.ts +67 -52
- package/src/sql-ddl-sync/Typo/Driver.d.ts +67 -0
- package/src/sql-ddl-sync/Typo/Query.d.ts +8 -0
- package/src/sql-ddl-sync/Typo/SQL.d.ts +45 -0
- package/src/sql-ddl-sync/Typo/_common.d.ts +59 -0
- package/src/sql-ddl-sync/Utils.ts +291 -0
- package/src/sql-ddl-sync/index.ts +599 -0
- package/src/sql-query/Comparators.ts +115 -0
- package/src/sql-query/Create.ts +87 -0
- package/{lib/sql-query/Dialects/dm.js → src/sql-query/Dialects/dm.ts} +42 -21
- package/src/sql-query/Dialects/index.ts +14 -0
- package/src/sql-query/Dialects/mssql.ts +91 -0
- package/src/sql-query/Dialects/mysql.ts +120 -0
- package/src/sql-query/Dialects/postgresql.ts +99 -0
- package/src/sql-query/Dialects/sqlite.ts +80 -0
- package/src/sql-query/Helpers.ts +303 -0
- package/src/sql-query/Insert.ts +41 -0
- package/src/sql-query/Query.ts +140 -0
- package/src/sql-query/Remove.ts +111 -0
- package/src/sql-query/Select.ts +719 -0
- package/src/sql-query/Set.ts +25 -0
- package/src/sql-query/Typo/Aggregation.d.ts +34 -0
- package/src/sql-query/Typo/Comparators.d.ts +156 -0
- package/src/sql-query/Typo/Dialect.d.ts +51 -0
- package/src/sql-query/Typo/Field.d.ts +10 -0
- package/src/sql-query/Typo/Helper.d.ts +4 -0
- package/src/sql-query/Typo/Query-ChainBuilder.d.ts +110 -0
- package/src/sql-query/Typo/Query.d.ts +65 -0
- package/src/sql-query/Typo/Sql.d.ts +192 -0
- package/src/sql-query/Typo/SubQuery.d.ts +52 -0
- package/{lib/sql-query/Typo/index.d.ts → src/sql-query/Typo/index.ts} +5 -2
- package/src/sql-query/Update.ts +50 -0
- package/src/sql-query/Where.ts +435 -0
- package/{lib/orm/Patch → src/typings}/fib-cache.d.ts +4 -3
- package/lib/cli/commands/ddlFrom.d.ts +0 -2
- package/lib/cli/commands/dumpModel.d.ts +0 -2
- package/lib/cli/commands/escape.d.ts +0 -2
- package/lib/cli/commands/spinner.d.ts +0 -2
- package/lib/cli/commands/upgrade.d.ts +0 -2
- package/lib/cli/helpers/ddl.d.ts +0 -17
- package/lib/cli/helpers/ddl.js +0 -55
- package/lib/cli/helpers/package.d.ts +0 -26
- package/lib/cli/helpers/package.js +0 -56
- package/lib/cli/index.d.ts +0 -2
- package/lib/cli/index.js +0 -18
- package/lib/db-driver/Typo.d.ts +0 -112
- package/lib/db-driver/Typo.js +0 -1
- package/lib/db-driver/built-ins/base.class.d.ts +0 -96
- package/lib/db-driver/built-ins/base.class.js +0 -186
- package/lib/db-driver/built-ins/driver-dm.d.ts +0 -18
- package/lib/db-driver/built-ins/driver-dm.js +0 -53
- package/lib/db-driver/built-ins/driver-mongodb.d.ts +0 -24
- package/lib/db-driver/built-ins/driver-mongodb.js +0 -46
- package/lib/db-driver/built-ins/driver-mysql.d.ts +0 -18
- package/lib/db-driver/built-ins/driver-mysql.js +0 -37
- package/lib/db-driver/built-ins/driver-postgresql.d.ts +0 -22
- package/lib/db-driver/built-ins/driver-postgresql.js +0 -76
- package/lib/db-driver/built-ins/driver-redis.d.ts +0 -12
- package/lib/db-driver/built-ins/driver-redis.js +0 -35
- package/lib/db-driver/built-ins/driver-sqlite.d.ts +0 -17
- package/lib/db-driver/built-ins/driver-sqlite.js +0 -34
- package/lib/db-driver/index.d.ts +0 -3
- package/lib/db-driver/index.js +0 -4
- package/lib/db-driver/utils.d.ts +0 -14
- package/lib/db-driver/utils.js +0 -187
- package/lib/knex/deps/tarn/dist/PendingOperation.d.ts +0 -12
- package/lib/knex/deps/tarn/dist/PendingOperation.js +0 -48
- package/lib/knex/deps/tarn/dist/Pool.d.ts +0 -97
- package/lib/knex/deps/tarn/dist/Pool.js +0 -516
- package/lib/knex/deps/tarn/dist/PromiseInspection.d.ts +0 -16
- package/lib/knex/deps/tarn/dist/PromiseInspection.js +0 -21
- package/lib/knex/deps/tarn/dist/Resource.d.ts +0 -9
- package/lib/knex/deps/tarn/dist/Resource.js +0 -19
- package/lib/knex/deps/tarn/dist/TimeoutError.d.ts +0 -2
- package/lib/knex/deps/tarn/dist/TimeoutError.js +0 -5
- package/lib/knex/deps/tarn/dist/tarn.d.ts +0 -3
- package/lib/knex/deps/tarn/dist/tarn.js +0 -10
- package/lib/knex/deps/tarn/dist/utils.d.ts +0 -14
- package/lib/knex/deps/tarn/dist/utils.js +0 -60
- package/lib/knex/knex.d.ts +0 -2
- package/lib/knex/knex.js +0 -3
- package/lib/knex/sandbox.d.ts +0 -4
- package/lib/knex/sandbox.js +0 -22
- package/lib/orm/Adapters.d.ts +0 -3
- package/lib/orm/Adapters.js +0 -44
- package/lib/orm/AggregateFunctions.d.ts +0 -3
- package/lib/orm/AggregateFunctions.js +0 -176
- package/lib/orm/Associations/Extend.d.ts +0 -22
- package/lib/orm/Associations/Extend.js +0 -274
- package/lib/orm/Associations/Many.d.ts +0 -17
- package/lib/orm/Associations/Many.js +0 -569
- package/lib/orm/Associations/One.d.ts +0 -16
- package/lib/orm/Associations/One.js +0 -310
- package/lib/orm/Associations/_utils.d.ts +0 -15
- package/lib/orm/Associations/_utils.js +0 -52
- package/lib/orm/ChainFind.d.ts +0 -3
- package/lib/orm/ChainFind.js +0 -327
- package/lib/orm/ChainInstance.d.ts +0 -6
- package/lib/orm/ChainInstance.js +0 -73
- package/lib/orm/Debug.d.ts +0 -2
- package/lib/orm/Debug.js +0 -17
- package/lib/orm/Drivers/DB/base.d.ts +0 -3
- package/lib/orm/Drivers/DB/base.js +0 -3
- package/lib/orm/Drivers/DB/dm.d.ts +0 -11
- package/lib/orm/Drivers/DB/dm.js +0 -23
- package/lib/orm/Drivers/DB/mysql.d.ts +0 -11
- package/lib/orm/Drivers/DB/mysql.js +0 -23
- package/lib/orm/Drivers/DB/postgres.d.ts +0 -11
- package/lib/orm/Drivers/DB/postgres.js +0 -22
- package/lib/orm/Drivers/DB/sqlite3.d.ts +0 -16
- package/lib/orm/Drivers/DB/sqlite3.js +0 -39
- package/lib/orm/Drivers/DML/_ddl-sql.d.ts +0 -3
- package/lib/orm/Drivers/DML/_ddl-sql.js +0 -51
- package/lib/orm/Drivers/DML/_dml-helpers.d.ts +0 -19
- package/lib/orm/Drivers/DML/_dml-helpers.js +0 -51
- package/lib/orm/Drivers/DML/_shared.d.ts +0 -9
- package/lib/orm/Drivers/DML/_shared.js +0 -38
- package/lib/orm/Drivers/DML/_utils.d.ts +0 -8
- package/lib/orm/Drivers/DML/_utils.js +0 -67
- package/lib/orm/Drivers/DML/constants.d.ts +0 -3
- package/lib/orm/Drivers/DML/constants.js +0 -2
- package/lib/orm/Drivers/DML/dm.d.ts +0 -2
- package/lib/orm/Drivers/DML/index.d.ts +0 -4
- package/lib/orm/Drivers/DML/index.js +0 -6
- package/lib/orm/Drivers/DML/mysql.d.ts +0 -2
- package/lib/orm/Drivers/DML/mysql.js +0 -251
- package/lib/orm/Drivers/DML/postgres.d.ts +0 -3
- package/lib/orm/Drivers/DML/postgres.js +0 -276
- package/lib/orm/Drivers/DML/sqlite.d.ts +0 -2
- package/lib/orm/Drivers/DML/sqlite.js +0 -266
- package/lib/orm/Error.d.ts +0 -11
- package/lib/orm/Error.js +0 -40
- package/lib/orm/Helpers.d.ts +0 -35
- package/lib/orm/Helpers.js +0 -233
- package/lib/orm/Hook.d.ts +0 -13
- package/lib/orm/Hook.js +0 -99
- package/lib/orm/Instance.d.ts +0 -2
- package/lib/orm/Instance.js +0 -697
- package/lib/orm/LazyLoad.d.ts +0 -4
- package/lib/orm/LazyLoad.js +0 -76
- package/lib/orm/Model.d.ts +0 -7
- package/lib/orm/Model.js +0 -971
- package/lib/orm/ORM.d.ts +0 -37
- package/lib/orm/ORM.js +0 -241
- package/lib/orm/Patch/fib-cache.js +0 -2
- package/lib/orm/Patch/plugin.d.ts +0 -4
- package/lib/orm/Patch/plugin.js +0 -13
- package/lib/orm/Property.d.ts +0 -9
- package/lib/orm/Property.js +0 -71
- package/lib/orm/Settings.d.ts +0 -42
- package/lib/orm/Settings.js +0 -119
- package/lib/orm/Singleton.d.ts +0 -5
- package/lib/orm/Singleton.js +0 -72
- package/lib/orm/Typo/Adapter.d.ts +0 -5
- package/lib/orm/Typo/Adapter.js +0 -1
- package/lib/orm/Typo/DMLDriver.d.ts +0 -210
- package/lib/orm/Typo/DMLDriver.js +0 -1
- package/lib/orm/Typo/Db.d.ts +0 -38
- package/lib/orm/Typo/Db.js +0 -1
- package/lib/orm/Typo/Error.d.ts +0 -31
- package/lib/orm/Typo/Error.js +0 -1
- package/lib/orm/Typo/ORM.d.ts +0 -233
- package/lib/orm/Typo/ORM.js +0 -3
- package/lib/orm/Typo/Validators.d.ts +0 -32
- package/lib/orm/Typo/Validators.js +0 -2
- package/lib/orm/Typo/_common.d.ts +0 -38
- package/lib/orm/Typo/_common.js +0 -1
- package/lib/orm/Typo/assoc.d.ts +0 -221
- package/lib/orm/Typo/assoc.js +0 -1
- package/lib/orm/Typo/hook.d.ts +0 -42
- package/lib/orm/Typo/hook.js +0 -1
- package/lib/orm/Typo/instance.d.ts +0 -157
- package/lib/orm/Typo/instance.js +0 -1
- package/lib/orm/Typo/model.js +0 -6
- package/lib/orm/Typo/patch.d.ts +0 -31
- package/lib/orm/Typo/patch.js +0 -1
- package/lib/orm/Typo/property.d.ts +0 -57
- package/lib/orm/Typo/property.js +0 -1
- package/lib/orm/Typo/query.d.ts +0 -216
- package/lib/orm/Typo/query.js +0 -1
- package/lib/orm/Typo/settings.js +0 -5
- package/lib/orm/Typo/synchronous.js +0 -1
- package/lib/orm/Utilities.d.ts +0 -179
- package/lib/orm/Utilities.js +0 -975
- package/lib/orm/Validators.d.ts +0 -34
- package/lib/orm/Validators.js +0 -100
- package/lib/orm/Where/common.d.ts +0 -1
- package/lib/orm/Where/common.js +0 -7
- package/lib/orm/Where/filterDate.d.ts +0 -11
- package/lib/orm/Where/filterDate.js +0 -58
- package/lib/orm/index.d.ts +0 -68
- package/lib/orm/index.js +0 -157
- package/lib/orm-core/callback.d.ts +0 -12
- package/lib/orm-core/callback.js +0 -1
- package/lib/orm-core/dialect.js +0 -1
- package/lib/orm-core/error.d.ts +0 -16
- package/lib/orm-core/error.js +0 -29
- package/lib/orm-core/index.js +0 -6
- package/lib/orm-core/sync.d.ts +0 -12
- package/lib/orm-core/sync.js +0 -1
- package/lib/orm-core/utils.d.ts +0 -1
- package/lib/orm-core/utils.js +0 -5
- package/lib/orm-property/Property.d.ts +0 -78
- package/lib/orm-property/Property.js +0 -1
- package/lib/orm-property/Utils.d.ts +0 -9
- package/lib/orm-property/Utils.js +0 -13
- package/lib/orm-property/customTypes.d.ts +0 -2
- package/lib/orm-property/customTypes.js +0 -13
- package/lib/orm-property/index.d.ts +0 -10
- package/lib/orm-property/index.js +0 -22
- package/lib/orm-property/transformer.d.ts +0 -5
- package/lib/orm-property/transformer.js +0 -10
- package/lib/orm-property/transformers/dm.d.ts +0 -29
- package/lib/orm-property/transformers/index.d.ts +0 -4
- package/lib/orm-property/transformers/index.js +0 -5
- package/lib/orm-property/transformers/mysql.d.ts +0 -102
- package/lib/orm-property/transformers/mysql.js +0 -261
- package/lib/orm-property/transformers/postgresql.d.ts +0 -54
- package/lib/orm-property/transformers/postgresql.js +0 -189
- package/lib/orm-property/transformers/sqlite.d.ts +0 -19
- package/lib/orm-property/transformers/sqlite.js +0 -171
- package/lib/sql-ddl-sync/Dialects/dm.d.ts +0 -40
- package/lib/sql-ddl-sync/Dialects/dm.js +0 -296
- package/lib/sql-ddl-sync/Dialects/index.d.ts +0 -7
- package/lib/sql-ddl-sync/Dialects/index.js +0 -7
- package/lib/sql-ddl-sync/Dialects/mysql.d.ts +0 -39
- package/lib/sql-ddl-sync/Dialects/mysql.js +0 -240
- package/lib/sql-ddl-sync/Dialects/postgresql.d.ts +0 -40
- package/lib/sql-ddl-sync/Dialects/postgresql.js +0 -286
- package/lib/sql-ddl-sync/Dialects/sqlite.d.ts +0 -44
- package/lib/sql-ddl-sync/Dialects/sqlite.js +0 -256
- package/lib/sql-ddl-sync/SQL.d.ts +0 -12
- package/lib/sql-ddl-sync/SQL.js +0 -108
- package/lib/sql-ddl-sync/Typo/Collection.d.ts +0 -13
- package/lib/sql-ddl-sync/Typo/Collection.js +0 -1
- package/lib/sql-ddl-sync/Typo/DbIndex.d.ts +0 -13
- package/lib/sql-ddl-sync/Typo/DbIndex.js +0 -1
- package/lib/sql-ddl-sync/Typo/Dialect.js +0 -1
- package/lib/sql-ddl-sync/Typo/Driver.d.ts +0 -53
- package/lib/sql-ddl-sync/Typo/Driver.js +0 -1
- package/lib/sql-ddl-sync/Typo/Query.d.ts +0 -7
- package/lib/sql-ddl-sync/Typo/Query.js +0 -1
- package/lib/sql-ddl-sync/Typo/SQL.d.ts +0 -31
- package/lib/sql-ddl-sync/Typo/SQL.js +0 -1
- package/lib/sql-ddl-sync/Typo/_common.d.ts +0 -29
- package/lib/sql-ddl-sync/Typo/_common.js +0 -1
- package/lib/sql-ddl-sync/Utils.d.ts +0 -40
- package/lib/sql-ddl-sync/Utils.js +0 -217
- package/lib/sql-ddl-sync/index.d.ts +0 -87
- package/lib/sql-ddl-sync/index.js +0 -371
- package/lib/sql-query/Comparators.d.ts +0 -3
- package/lib/sql-query/Comparators.js +0 -94
- package/lib/sql-query/Create.d.ts +0 -35
- package/lib/sql-query/Create.js +0 -77
- package/lib/sql-query/Dialects/dm.d.ts +0 -3
- package/lib/sql-query/Dialects/index.js +0 -12
- package/lib/sql-query/Dialects/mssql.d.ts +0 -3
- package/lib/sql-query/Dialects/mssql.js +0 -73
- package/lib/sql-query/Dialects/mysql.d.ts +0 -3
- package/lib/sql-query/Dialects/mysql.js +0 -100
- package/lib/sql-query/Dialects/postgresql.d.ts +0 -3
- package/lib/sql-query/Dialects/postgresql.js +0 -76
- package/lib/sql-query/Dialects/sqlite.d.ts +0 -3
- package/lib/sql-query/Dialects/sqlite.js +0 -61
- package/lib/sql-query/Helpers.d.ts +0 -38
- package/lib/sql-query/Helpers.js +0 -259
- package/lib/sql-query/Insert.d.ts +0 -12
- package/lib/sql-query/Insert.js +0 -33
- package/lib/sql-query/Query.d.ts +0 -29
- package/lib/sql-query/Query.js +0 -119
- package/lib/sql-query/Remove.d.ts +0 -16
- package/lib/sql-query/Remove.js +0 -93
- package/lib/sql-query/Select.d.ts +0 -62
- package/lib/sql-query/Select.js +0 -533
- package/lib/sql-query/Set.d.ts +0 -4
- package/lib/sql-query/Set.js +0 -16
- package/lib/sql-query/Typo/Aggregation.d.ts +0 -32
- package/lib/sql-query/Typo/Aggregation.js +0 -1
- package/lib/sql-query/Typo/Comparators.d.ts +0 -140
- package/lib/sql-query/Typo/Comparators.js +0 -1
- package/lib/sql-query/Typo/Dialect.d.ts +0 -39
- package/lib/sql-query/Typo/Dialect.js +0 -1
- package/lib/sql-query/Typo/Field.d.ts +0 -8
- package/lib/sql-query/Typo/Field.js +0 -1
- package/lib/sql-query/Typo/Helper.d.ts +0 -4
- package/lib/sql-query/Typo/Helper.js +0 -1
- package/lib/sql-query/Typo/Query-ChainBuilder.d.ts +0 -80
- package/lib/sql-query/Typo/Query-ChainBuilder.js +0 -1
- package/lib/sql-query/Typo/Query.d.ts +0 -34
- package/lib/sql-query/Typo/Query.js +0 -16
- package/lib/sql-query/Typo/Sql.d.ts +0 -143
- package/lib/sql-query/Typo/Sql.js +0 -1
- package/lib/sql-query/Typo/SubQuery.d.ts +0 -39
- package/lib/sql-query/Typo/SubQuery.js +0 -1
- package/lib/sql-query/Typo/index.js +0 -1
- package/lib/sql-query/Update.d.ts +0 -15
- package/lib/sql-query/Update.js +0 -38
- package/lib/sql-query/Where.d.ts +0 -4
- package/lib/sql-query/Where.js +0 -280
- /package/{lib → src}/codepoints-map.json +0 -0
package/lib/orm/Typo/assoc.d.ts
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import type { FxOrmHook } from "./hook";
|
|
2
|
-
import type { FxOrmModel } from "./model";
|
|
3
|
-
import type { FxOrmProperty } from "./property";
|
|
4
|
-
import type { FxOrmCommon } from "./_common";
|
|
5
|
-
import type { FxOrmInstance } from "./instance";
|
|
6
|
-
export declare namespace FxOrmAssociation {
|
|
7
|
-
type AssociationType = 'extendsTo' | 'hasOne' | 'hasMany';
|
|
8
|
-
/**
|
|
9
|
-
* @type.function: (model_name: string, idkey: string) => string
|
|
10
|
-
*
|
|
11
|
-
* @string.default: `{model_name}_${idkey}`
|
|
12
|
-
*/
|
|
13
|
-
type AssociationKeyComputation = ((model_name: string, idkey: string) => string) | string;
|
|
14
|
-
interface AssociationDefinitionOptions {
|
|
15
|
-
/**
|
|
16
|
-
* it's also accessor base for `extendsTo`, `hasOne`, `hasMany`,
|
|
17
|
-
*
|
|
18
|
-
* @notice fallback from `acessor` for `hasOne`, `hasMany`
|
|
19
|
-
*/
|
|
20
|
-
name?: string;
|
|
21
|
-
model?: FxOrmModel.Model;
|
|
22
|
-
field?: string | Record<string, FxOrmProperty.NormalizedProperty>;
|
|
23
|
-
__for_extension?: boolean;
|
|
24
|
-
required?: boolean;
|
|
25
|
-
reversed?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* accessor base for `hasOne`, `hasMany`
|
|
28
|
-
*/
|
|
29
|
-
accessor?: string;
|
|
30
|
-
/**
|
|
31
|
-
* accessor base for `hasOne`
|
|
32
|
-
*/
|
|
33
|
-
reverseAccessor?: string;
|
|
34
|
-
autoFetch?: boolean;
|
|
35
|
-
autoFetchLimit?: number;
|
|
36
|
-
getAccessor?: string;
|
|
37
|
-
setAccessor?: string;
|
|
38
|
-
hasAccessor?: string;
|
|
39
|
-
delAccessor?: string;
|
|
40
|
-
addAccessor?: string;
|
|
41
|
-
modelFindByAccessor?: string;
|
|
42
|
-
hooks?: InstanceAssociationItem['hooks'];
|
|
43
|
-
}
|
|
44
|
-
interface AssociationDefinitionOptions_ExtendsTo extends AssociationDefinitionOptions {
|
|
45
|
-
table?: string;
|
|
46
|
-
reverse?: string;
|
|
47
|
-
reverseHooks?: InstanceAssociationItem_HasOne['hooks'];
|
|
48
|
-
}
|
|
49
|
-
interface AssociationDefinitionOptions_HasOne extends AssociationDefinitionOptions {
|
|
50
|
-
reverse?: string;
|
|
51
|
-
reverseHooks?: InstanceAssociationItem_HasOne['hooks'];
|
|
52
|
-
}
|
|
53
|
-
interface AssociationDefinitionOptions_HasMany extends AssociationDefinitionOptions {
|
|
54
|
-
reverse?: string;
|
|
55
|
-
reverseHooks?: AssociationDefinitionOptions_HasMany['hooks'];
|
|
56
|
-
key?: boolean;
|
|
57
|
-
mergeId?: string | Record<string, FxOrmModel.ModelPropertyDefinition>;
|
|
58
|
-
mergeAssocId?: string | Record<string, FxOrmModel.ModelPropertyDefinition>;
|
|
59
|
-
reverseAssociation?: string;
|
|
60
|
-
hooks?: InstanceAssociationItem['hooks'] & {
|
|
61
|
-
beforeAdd?: FxOrmHook.HookActionWithCtxCallback<FxOrmInstance.Instance, __AssocHooksCtx>;
|
|
62
|
-
afterAdd?: FxOrmHook.HookRetOnlyPayloadCallback<FxOrmInstance.Instance, __AssocHooksCtx>;
|
|
63
|
-
/** @deprecated */
|
|
64
|
-
beforeSave?: {
|
|
65
|
-
(next?: FxOrmHook.HookActionNextor): void;
|
|
66
|
-
(extra: any, next?: FxOrmHook.HookActionNextor): void;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
mergeTable?: string;
|
|
70
|
-
association?: string;
|
|
71
|
-
getAccessor?: string;
|
|
72
|
-
setAccessor?: string;
|
|
73
|
-
hasAccessor?: string;
|
|
74
|
-
delAccessor?: string;
|
|
75
|
-
addAccessor?: string;
|
|
76
|
-
}
|
|
77
|
-
interface InstanceAssociationItemHooks {
|
|
78
|
-
beforeSet?: {
|
|
79
|
-
(func: FxOrmHook.HookActionCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
80
|
-
};
|
|
81
|
-
afterSet?: {
|
|
82
|
-
(func: FxOrmHook.HookResultCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
83
|
-
};
|
|
84
|
-
beforeRemove?: {
|
|
85
|
-
(func: FxOrmHook.HookActionCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
86
|
-
};
|
|
87
|
-
afterRemove?: {
|
|
88
|
-
(func: FxOrmHook.HookResultCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
89
|
-
};
|
|
90
|
-
beforeAdd?: {
|
|
91
|
-
(func: FxOrmHook.HookActionCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
92
|
-
};
|
|
93
|
-
afterAdd?: {
|
|
94
|
-
(func: FxOrmHook.HookResultCallback, opts?: FxOrmHook.HookPatchOptions & Record<string, any>): any;
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
/** @internal */
|
|
98
|
-
type __AssocHooksCtx = {
|
|
99
|
-
instance?: FxOrmInstance.Instance;
|
|
100
|
-
association?: FxOrmInstance.Instance;
|
|
101
|
-
associations?: (FxOrmInstance.Instance)[];
|
|
102
|
-
association_ids?: any[];
|
|
103
|
-
removeConditions?: Record<string, any>;
|
|
104
|
-
useChannel?: () => FxOrmHook.HookChannelResults<Function>;
|
|
105
|
-
$ref?: {
|
|
106
|
-
instance?: __AssocHooksCtx['instance'];
|
|
107
|
-
association?: __AssocHooksCtx['association'];
|
|
108
|
-
associations?: __AssocHooksCtx['associations'];
|
|
109
|
-
association_ids?: __AssocHooksCtx['association_ids'];
|
|
110
|
-
removeConditions?: __AssocHooksCtx['removeConditions'];
|
|
111
|
-
useChannel?: __AssocHooksCtx['useChannel'];
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
interface InstanceAssociationItem extends InstanceAssociationItemHooks {
|
|
115
|
-
name: string;
|
|
116
|
-
model: FxOrmModel.Model;
|
|
117
|
-
field: string | Record<string, FxOrmProperty.NormalizedProperty>;
|
|
118
|
-
hooks: {
|
|
119
|
-
beforeSet?: FxOrmCommon.Arraible<FxOrmHook.HookActionWithCtxCallback<FxOrmInstance.Instance, __AssocHooksCtx>>;
|
|
120
|
-
afterSet?: FxOrmCommon.Arraible<FxOrmHook.HookRetOnlyPayloadCallback<FxOrmInstance.Instance, __AssocHooksCtx>>;
|
|
121
|
-
beforeRemove?: FxOrmCommon.Arraible<FxOrmHook.HookActionWithCtxCallback<FxOrmInstance.Instance, __AssocHooksCtx>>;
|
|
122
|
-
afterRemove?: FxOrmCommon.Arraible<FxOrmHook.HookRetOnlyPayloadCallback<FxOrmInstance.Instance, __AssocHooksCtx>>;
|
|
123
|
-
[k: string]: FxOrmCommon.Arraible<FxOrmHook.HookActionWithCtxCallback<FxOrmInstance.Instance, __AssocHooksCtx> | FxOrmHook.HookRetOnlyPayloadCallback<FxOrmInstance.Instance, __AssocHooksCtx>>;
|
|
124
|
-
};
|
|
125
|
-
__for_extension?: boolean;
|
|
126
|
-
getAccessor: string;
|
|
127
|
-
getSyncAccessor: string;
|
|
128
|
-
setAccessor: string;
|
|
129
|
-
setSyncAccessor: string;
|
|
130
|
-
hasAccessor: string;
|
|
131
|
-
hasSyncAccessor: string;
|
|
132
|
-
delAccessor: string;
|
|
133
|
-
delSyncAccessor: string;
|
|
134
|
-
addAccessor?: string;
|
|
135
|
-
addSyncAccessor?: string;
|
|
136
|
-
modelFindByAccessor?: string;
|
|
137
|
-
modelFindBySyncAccessor?: string;
|
|
138
|
-
reversed?: boolean;
|
|
139
|
-
autoFetch: boolean;
|
|
140
|
-
autoFetchLimit: number;
|
|
141
|
-
mapsTo?: FxOrmModel.ModelPropertyDefinition['mapsTo'];
|
|
142
|
-
[k: string]: any;
|
|
143
|
-
}
|
|
144
|
-
type InstanceAssociatedInstance = FxOrmInstance.Instance;
|
|
145
|
-
interface InstanceAssociationItem_ExtendTos extends InstanceAssociationItem {
|
|
146
|
-
table: string;
|
|
147
|
-
reverse?: string;
|
|
148
|
-
modelFindByAccessor: string;
|
|
149
|
-
}
|
|
150
|
-
interface InstanceAssociationItem_HasOne extends InstanceAssociationItem {
|
|
151
|
-
field: Record<string, FxOrmProperty.NormalizedProperty>;
|
|
152
|
-
reverse?: string;
|
|
153
|
-
reverseHooks?: InstanceAssociationItem_HasOne['hooks'];
|
|
154
|
-
accessor?: string;
|
|
155
|
-
reverseAccessor?: string;
|
|
156
|
-
modelFindByAccessor: string;
|
|
157
|
-
required?: boolean;
|
|
158
|
-
__for_extension?: boolean;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* @description information collected from code like:
|
|
162
|
-
*
|
|
163
|
-
* ```js
|
|
164
|
-
* Host.hasMany(Other, {
|
|
165
|
-
* mergeTable: 'merge_table',
|
|
166
|
-
* mergeId: ['host_id'], // optional,
|
|
167
|
-
* mergeAssocId: ['other_id']
|
|
168
|
-
* })
|
|
169
|
-
* ```
|
|
170
|
-
*/
|
|
171
|
-
interface InstanceAssociationItem_HasMany extends InstanceAssociationItem {
|
|
172
|
-
props: Record<string, FxOrmProperty.NormalizedProperty>;
|
|
173
|
-
mergeTable: string;
|
|
174
|
-
/**
|
|
175
|
-
* @description associated properties linked to Host on merge table
|
|
176
|
-
*/
|
|
177
|
-
mergeId: Record<string, FxOrmProperty.NormalizedProperty>;
|
|
178
|
-
/**
|
|
179
|
-
* @description associated properties linked to Other on merge table
|
|
180
|
-
*/
|
|
181
|
-
mergeAssocId: Record<string, FxOrmProperty.NormalizedProperty>;
|
|
182
|
-
getAccessor: string;
|
|
183
|
-
setAccessor: string;
|
|
184
|
-
hasAccessor: string;
|
|
185
|
-
delAccessor: string;
|
|
186
|
-
addAccessor: string;
|
|
187
|
-
modelFindByAccessor?: string;
|
|
188
|
-
hooks: AssociationDefinitionOptions_HasMany['hooks'];
|
|
189
|
-
}
|
|
190
|
-
interface InstanceAssociationItemInformation {
|
|
191
|
-
changed: boolean;
|
|
192
|
-
value?: InstanceAssociatedInstance;
|
|
193
|
-
data?: InstanceAssociationItem;
|
|
194
|
-
}
|
|
195
|
-
interface ModelAssociationMethod__Options {
|
|
196
|
-
/** @deprecated use `extra_where` directly */
|
|
197
|
-
join_where?: FxOrmModel.ModelQueryConditions__Find;
|
|
198
|
-
/** @internal */
|
|
199
|
-
extra?: FxOrmModel.ModelOptions__Find['extra'];
|
|
200
|
-
/** @internal */
|
|
201
|
-
extra_info?: {
|
|
202
|
-
table: string;
|
|
203
|
-
id: FxOrmModel.Model['id'];
|
|
204
|
-
id_prop: string[];
|
|
205
|
-
assoc_prop: string[];
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
interface ModelAssociationMethod__FindOptions extends FxOrmModel.ModelOptions__Find, ModelAssociationMethod__Options {
|
|
209
|
-
}
|
|
210
|
-
interface ModelAssociationMethod__GetOptions extends FxOrmModel.ModelOptions__Find, ModelAssociationMethod__Options {
|
|
211
|
-
}
|
|
212
|
-
interface ModelAssociationMethod__FindByOptions extends FxOrmModel.ModelOptions__Findby, ModelAssociationMethod__Options {
|
|
213
|
-
}
|
|
214
|
-
interface AccessorOptions_has {
|
|
215
|
-
}
|
|
216
|
-
type AccessorOptions_get = FxOrmCommon.IdType | FxOrmModel.ModelQueryConditions__Find;
|
|
217
|
-
interface AutoFetchInstanceOptions {
|
|
218
|
-
autoFetch?: boolean;
|
|
219
|
-
autoFetchLimit?: number;
|
|
220
|
-
}
|
|
221
|
-
}
|
package/lib/orm/Typo/assoc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/orm/Typo/hook.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { FxOrmCommon } from './_common';
|
|
2
|
-
import type { FxOrmInstance } from './instance';
|
|
3
|
-
export declare namespace FxOrmHook {
|
|
4
|
-
export interface HookActionNextor<TTHIS = FxOrmInstance.Instance> {
|
|
5
|
-
(this: TTHIS, err?: Error | null): any;
|
|
6
|
-
}
|
|
7
|
-
export interface HookActionCallback<TTHIS = FxOrmInstance.Instance> {
|
|
8
|
-
(this: TTHIS, next?: HookActionNextor<TTHIS>): any;
|
|
9
|
-
}
|
|
10
|
-
export interface HookActionWithCtxCallback<TTHIS = FxOrmInstance.Instance, TPayload extends Record<string, any> = Record<string, any>> {
|
|
11
|
-
(this: TTHIS, ctx?: TPayload, next?: HookActionNextor<TTHIS>): any;
|
|
12
|
-
}
|
|
13
|
-
export interface HookWait<CTX_SELF = FxOrmInstance.Instance, TNEXT_THIS = any> {
|
|
14
|
-
(self: CTX_SELF, hook: FxOrmCommon.Arraible<HookActionCallback | HookActionWithCtxCallback | FxOrmCommon.Arraible<HookActionCallback | HookActionWithCtxCallback>>, nextor: FxOrmCommon.GenericCallback<TNEXT_THIS>, ctx?: Record<string, any>): void;
|
|
15
|
-
}
|
|
16
|
-
export type HookResultCallback<TTHIS = FxOrmInstance.Instance> = ((this: TTHIS, success?: boolean) => any);
|
|
17
|
-
export type HookRetPayloadCallback<TTHIS = FxOrmInstance.Instance, TPAYLOAD = any, TResult = boolean> = (this: TTHIS, arg1?: TPAYLOAD, success?: TResult) => any;
|
|
18
|
-
export type HookRetOnlyPayloadCallback<TTHIS = FxOrmInstance.Instance, TPAYLOAD = any> = (this: TTHIS, arg1?: TPAYLOAD) => any;
|
|
19
|
-
export interface HookTrigger<CTX_SELF = FxOrmInstance.Instance, RESULT_TYPE = boolean> {
|
|
20
|
-
(self: CTX_SELF, cur: FxOrmCommon.Arraible<HookResultCallback | HookRetPayloadCallback>, _?: RESULT_TYPE, ...args: any): void;
|
|
21
|
-
}
|
|
22
|
-
export interface HookPatchOptions {
|
|
23
|
-
/**
|
|
24
|
-
* @default false
|
|
25
|
-
* 'prepend': prepend old oldhook to new hook
|
|
26
|
-
* 'append': append old oldhook to new hook
|
|
27
|
-
* undefined: overwrite oldhook
|
|
28
|
-
*/
|
|
29
|
-
oldhook?: 'prepend' | 'append' | 'initial' | 'overwrite' | undefined;
|
|
30
|
-
}
|
|
31
|
-
export interface HookChannel<FTYPE = Function> {
|
|
32
|
-
(name: string, handler: FTYPE): HookChannelResults;
|
|
33
|
-
(handler: FTYPE): HookChannelResults;
|
|
34
|
-
(name?: string): HookChannelResults;
|
|
35
|
-
}
|
|
36
|
-
type HookTuple<FTYPE = Function> = [FTYPE, (fn: FTYPE, ...args: any) => any];
|
|
37
|
-
export interface HookChannelResults<FTYPE = Function> extends HookTuple<FTYPE> {
|
|
38
|
-
run: (...args: any) => any;
|
|
39
|
-
set: (fn: Function, ...args: any) => any;
|
|
40
|
-
}
|
|
41
|
-
export {};
|
|
42
|
-
}
|
package/lib/orm/Typo/hook.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/// <reference types="@fibjs/types" />
|
|
2
|
-
import type { FxOrmAssociation } from "./assoc";
|
|
3
|
-
import type { FxOrmDMLDriver } from "./DMLDriver";
|
|
4
|
-
import type { FxOrmHook } from "./hook";
|
|
5
|
-
import type { FxOrmModel } from "./model";
|
|
6
|
-
import type { FxOrmProperty } from "./property";
|
|
7
|
-
import type { FxOrmValidators } from "./Validators";
|
|
8
|
-
import type { FxOrmCommon } from "./_common";
|
|
9
|
-
import type { FxOrmError } from "./Error";
|
|
10
|
-
export declare namespace FxOrmInstance {
|
|
11
|
-
export interface InstanceDataPayload {
|
|
12
|
-
[key: string]: any;
|
|
13
|
-
}
|
|
14
|
-
export interface CreateOptions {
|
|
15
|
-
autoFetch?: boolean;
|
|
16
|
-
autoFetchLimit?: number;
|
|
17
|
-
cascadeRemove?: boolean;
|
|
18
|
-
uid?: string;
|
|
19
|
-
isNew?: boolean;
|
|
20
|
-
isShell?: boolean;
|
|
21
|
-
autoSave?: boolean;
|
|
22
|
-
extra?: InstanceConstructorOptions['extra'];
|
|
23
|
-
extra_info?: InstanceConstructorOptions['extra_info'];
|
|
24
|
-
}
|
|
25
|
-
export interface SaveOptions {
|
|
26
|
-
saveAssociations?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface InstanceConstructorOptions {
|
|
29
|
-
table: string;
|
|
30
|
-
keys?: FxOrmModel.ModelConstructorOptions['keys'];
|
|
31
|
-
originalKeyValues?: InstanceDataPayload;
|
|
32
|
-
data?: InstanceDataPayload;
|
|
33
|
-
/**
|
|
34
|
-
* @description changes records
|
|
35
|
-
*/
|
|
36
|
-
changes?: string[];
|
|
37
|
-
extra?: string[] | Record<string, FxOrmProperty.NormalizedProperty>;
|
|
38
|
-
extra_info?: {
|
|
39
|
-
table: string;
|
|
40
|
-
id: string[];
|
|
41
|
-
id_prop: string[];
|
|
42
|
-
assoc_prop: string[];
|
|
43
|
-
};
|
|
44
|
-
isNew?: boolean;
|
|
45
|
-
isShell?: boolean;
|
|
46
|
-
autoSave?: FxOrmModel.ModelConstructorOptions['autoSave'];
|
|
47
|
-
methods?: FxOrmModel.ModelConstructorOptions['methods'];
|
|
48
|
-
/**
|
|
49
|
-
* @description all key properties of the instance, determined by the model
|
|
50
|
-
*/
|
|
51
|
-
keyProperties: FxOrmProperty.NormalizedProperty[];
|
|
52
|
-
validations: FxOrmValidators.IValidatorHash;
|
|
53
|
-
hooks: FxOrmModel.ModelConstructorOptions['hooks'];
|
|
54
|
-
one_associations: FxOrmAssociation.InstanceAssociationItem_HasOne[];
|
|
55
|
-
many_associations: FxOrmAssociation.InstanceAssociationItem_HasMany[];
|
|
56
|
-
extend_associations: FxOrmAssociation.InstanceAssociationItem_ExtendTos[];
|
|
57
|
-
association_properties: string[];
|
|
58
|
-
uid: FxOrmDMLDriver.DriverUidType;
|
|
59
|
-
driver: FxOrmDMLDriver.DMLDriver;
|
|
60
|
-
/**
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
__setupAssociations: (instance: Instance) => void;
|
|
64
|
-
fieldToPropertyMap: FxOrmProperty.FieldToPropertyMapType;
|
|
65
|
-
/**
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
events?: {
|
|
69
|
-
[k: string]: FxOrmCommon.GenericCallback<any>;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
export interface InnerInstanceRuntimeData extends InstanceConstructorOptions {
|
|
73
|
-
associations?: {
|
|
74
|
-
[key: string]: FxOrmAssociation.InstanceAssociationItemInformation;
|
|
75
|
-
};
|
|
76
|
-
extrachanges: string[];
|
|
77
|
-
/** @internal */
|
|
78
|
-
__validationData: Record<string, FxOrmError.ExtendedError[]>;
|
|
79
|
-
}
|
|
80
|
-
type __AddThisToMethods<TMethods extends Record<string, (...args: any) => any>> = TMethods extends void ? {} : {
|
|
81
|
-
[P in keyof TMethods]: (...args: Parameters<TMethods[P]>) => ReturnType<TMethods[P]>;
|
|
82
|
-
};
|
|
83
|
-
export type InstanceConstructor = new (model: FxOrmModel.Model, opts: InstanceConstructorOptions) => FxOrmInstance.Instance;
|
|
84
|
-
export type InstanceEventType = 'ready' | 'save' | 'beforeRemove' | 'remove';
|
|
85
|
-
export type Instance<TProperties extends Record<string, FieldRuntimeType> = Record<string, FieldRuntimeType>, Methods extends Record<string, (...args: any) => any> = Record<string, (...args: any) => any>> = {
|
|
86
|
-
on(event: InstanceEventType | string, callback: FxOrmCommon.GenericCallback<any>): Instance;
|
|
87
|
-
$on: Class_EventEmitter['on'];
|
|
88
|
-
$off: Class_EventEmitter['off'];
|
|
89
|
-
$emit: Class_EventEmitter['emit'];
|
|
90
|
-
validate(callback: FxOrmCommon.ValidatorCallback): void;
|
|
91
|
-
validateSync(): false | FxOrmError.ExtendedError[];
|
|
92
|
-
save(callback?: FxOrmCommon.VoidCallback): Instance;
|
|
93
|
-
save(data: InstanceDataPayload, callback?: FxOrmCommon.VoidCallback): Instance;
|
|
94
|
-
save(data: InstanceDataPayload, options: SaveOptions, callback?: FxOrmCommon.VoidCallback): Instance;
|
|
95
|
-
saveSync(data?: FxOrmInstance.InstanceDataPayload, options?: FxOrmInstance.SaveOptions): FxOrmInstance.Instance;
|
|
96
|
-
saved(): boolean;
|
|
97
|
-
remove(callback?: FxOrmCommon.VoidCallback): Instance;
|
|
98
|
-
removeSync(): void;
|
|
99
|
-
/**
|
|
100
|
-
* @noenum
|
|
101
|
-
*/
|
|
102
|
-
isInstance: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* @noenum
|
|
105
|
-
*/
|
|
106
|
-
isPersisted(): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* @noenum
|
|
109
|
-
*/
|
|
110
|
-
isShell(): boolean;
|
|
111
|
-
/**
|
|
112
|
-
* @noenum
|
|
113
|
-
*/
|
|
114
|
-
set: (path: string | string[], value: any) => void;
|
|
115
|
-
markAsDirty: (propName: string) => void;
|
|
116
|
-
dirtyProperties: {
|
|
117
|
-
[key: string]: any;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* @internal
|
|
121
|
-
* @noenum
|
|
122
|
-
*/
|
|
123
|
-
__singleton_uid(): string | number;
|
|
124
|
-
/**
|
|
125
|
-
* @internal
|
|
126
|
-
* @noenum
|
|
127
|
-
*/
|
|
128
|
-
__instRtd?: InnerInstanceRuntimeData;
|
|
129
|
-
/**
|
|
130
|
-
* @noenum
|
|
131
|
-
*/
|
|
132
|
-
model(): FxOrmModel.Model<TProperties, Methods>;
|
|
133
|
-
/**
|
|
134
|
-
* @internal
|
|
135
|
-
*
|
|
136
|
-
* @warn only valid in corresponding hook
|
|
137
|
-
*/
|
|
138
|
-
readonly $hookRef: {
|
|
139
|
-
create: {
|
|
140
|
-
instance: Instance;
|
|
141
|
-
useChannel: FxOrmHook.HookChannel;
|
|
142
|
-
};
|
|
143
|
-
save: {
|
|
144
|
-
instance: Instance;
|
|
145
|
-
useChannel: FxOrmHook.HookChannel;
|
|
146
|
-
};
|
|
147
|
-
remove: {
|
|
148
|
-
instance: Instance;
|
|
149
|
-
useChannel: FxOrmHook.HookChannel;
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
} & TProperties & __AddThisToMethods<Methods> & {
|
|
153
|
-
[key: string]: any;
|
|
154
|
-
};
|
|
155
|
-
export type FieldRuntimeType = number | string | boolean | Date | object;
|
|
156
|
-
export {};
|
|
157
|
-
}
|
package/lib/orm/Typo/instance.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
package/lib/orm/Typo/model.js
DELETED
package/lib/orm/Typo/patch.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare namespace FxOrmPatch {
|
|
2
|
-
interface PatchedSyncfiedModelOrInstance {
|
|
3
|
-
/**
|
|
4
|
-
* @important
|
|
5
|
-
*
|
|
6
|
-
* methods patchSyncfied by 'fib-orm'
|
|
7
|
-
*/
|
|
8
|
-
countSync: Function;
|
|
9
|
-
firstSync: Function;
|
|
10
|
-
lastSync: Function;
|
|
11
|
-
allSync: Function;
|
|
12
|
-
whereSync: Function;
|
|
13
|
-
findSync: Function;
|
|
14
|
-
removeSync: Function;
|
|
15
|
-
runSync: Function;
|
|
16
|
-
}
|
|
17
|
-
interface PatchedSyncfiedInstanceWithDbWriteOperation extends PatchedSyncfiedModelOrInstance {
|
|
18
|
-
saveSync: Function;
|
|
19
|
-
removeSync: Function;
|
|
20
|
-
validateSync: Function;
|
|
21
|
-
modelSync: Function;
|
|
22
|
-
}
|
|
23
|
-
interface PatchedSyncfiedInstanceWithAssociations {
|
|
24
|
-
/**
|
|
25
|
-
* generated by association, but you don't know what it is
|
|
26
|
-
*/
|
|
27
|
-
[associationFunc: string]: Function;
|
|
28
|
-
}
|
|
29
|
-
interface PatchedSyncfiedInstantce extends FxOrmPatch.PatchedSyncfiedInstanceWithDbWriteOperation, FxOrmPatch.PatchedSyncfiedInstanceWithAssociations {
|
|
30
|
-
}
|
|
31
|
-
}
|
package/lib/orm/Typo/patch.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { FxOrmSqlDDLSync__Driver } from "../../sql-ddl-sync/index";
|
|
2
|
-
import type { FxSqlQuery } from '../../sql-query/Query';
|
|
3
|
-
import type { IProperty } from "../../orm-property/index";
|
|
4
|
-
export declare namespace FxOrmProperty {
|
|
5
|
-
/**
|
|
6
|
-
* @description key linked association type
|
|
7
|
-
* - 'primary': means this property is for column defined as 'primary'
|
|
8
|
-
* - 'hasOne': means this property is for column used as asscociated key in 'hasOne' assciation
|
|
9
|
-
* - 'extendsTo': means this property is for column used as asscociated key in 'extendsTo' assciation
|
|
10
|
-
*/
|
|
11
|
-
type KlassType = 'primary' | 'hasOne' | 'extendsTo';
|
|
12
|
-
interface CustomPropertyType extends FxOrmSqlDDLSync__Driver.CustomPropertyType {
|
|
13
|
-
datastoreType: {
|
|
14
|
-
(prop?: FxOrmProperty.NormalizedProperty): string;
|
|
15
|
-
};
|
|
16
|
-
valueToProperty?: {
|
|
17
|
-
(value?: any, prop?: FxOrmProperty.NormalizedProperty): any;
|
|
18
|
-
};
|
|
19
|
-
propertyToValue?: {
|
|
20
|
-
(value?: any, prop?: FxOrmProperty.NormalizedProperty): any;
|
|
21
|
-
};
|
|
22
|
-
datastoreGet?: {
|
|
23
|
-
(prop?: FxOrmProperty.NormalizedProperty, helper?: FxSqlQuery.Class_Query): any;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
type DataStoreProperty = IProperty & {
|
|
27
|
-
type: PropertyType | keyof GlobalCustomModelType;
|
|
28
|
-
/**
|
|
29
|
-
* @description virtual property is not stored in database,
|
|
30
|
-
* but maybe presented in query result
|
|
31
|
-
*/
|
|
32
|
-
virtual?: boolean;
|
|
33
|
-
};
|
|
34
|
-
type PropertyType = 'text' | 'integer' | 'number' | 'serial' | 'boolean' | 'date' | 'binary' | 'object' | 'enum' | 'point';
|
|
35
|
-
/**
|
|
36
|
-
* @description used for augumenting model's properties type
|
|
37
|
-
*/
|
|
38
|
-
interface GlobalCustomModelType {
|
|
39
|
-
}
|
|
40
|
-
type GetPrimitiveFromOrmPropertyType<T extends PropertyType = PropertyType> = T extends 'text' ? string : T extends 'enum' ? any[] : T extends 'integer' | 'number' | 'serial' ? number : T extends 'boolean' ? boolean : T extends 'date' ? number | Date : T extends 'binary' | 'object' | 'point' ? any : never;
|
|
41
|
-
/**
|
|
42
|
-
* @description useful when pass property's option(such as type, big, ...etc) internally, useless for exposed api.
|
|
43
|
-
*
|
|
44
|
-
* @notice though there's definition, but those fields SHOULD NEVER be set in NormalizedProperty:
|
|
45
|
-
* - `serial`
|
|
46
|
-
*/
|
|
47
|
-
interface NormalizedProperty extends DataStoreProperty {
|
|
48
|
-
key?: boolean;
|
|
49
|
-
klass?: KlassType;
|
|
50
|
-
lazyload?: boolean;
|
|
51
|
-
alwaysValidate?: boolean;
|
|
52
|
-
lazyname?: string;
|
|
53
|
-
}
|
|
54
|
-
interface FieldToPropertyMapType {
|
|
55
|
-
[f_name: string]: NormalizedProperty;
|
|
56
|
-
}
|
|
57
|
-
}
|
package/lib/orm/Typo/property.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|