@fxjs/orm
Advanced tools
Comparing version 1.16.6 to 1.16.7
@@ -39,3 +39,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
model: null, | ||
table: assoc_options.table || _utils_1.defineDefaultExtendsToTableName(Model.table, name), | ||
table: assoc_options.table || (0, _utils_1.defineDefaultExtendsToTableName)(Model.table, name), | ||
reverse: assoc_options.reverse, | ||
@@ -50,7 +50,7 @@ // reversed : assoc_options.reversed, | ||
}) || Utilities.formatAssociatedField(Model, Model.table, false, false), | ||
getAccessor: assoc_options.getAccessor || _utils_1.defineAssociationAccessorMethodName(_utils_1.ACCESSOR_KEYS.get, associationSemanticNameCore), | ||
setAccessor: assoc_options.setAccessor || _utils_1.defineAssociationAccessorMethodName(_utils_1.ACCESSOR_KEYS.set, associationSemanticNameCore), | ||
hasAccessor: assoc_options.hasAccessor || _utils_1.defineAssociationAccessorMethodName(_utils_1.ACCESSOR_KEYS.has, associationSemanticNameCore), | ||
delAccessor: assoc_options.delAccessor || _utils_1.defineAssociationAccessorMethodName(_utils_1.ACCESSOR_KEYS.del, associationSemanticNameCore), | ||
modelFindByAccessor: assoc_options.modelFindByAccessor || _utils_1.defineAssociationAccessorMethodName(_utils_1.ACCESSOR_KEYS.modelFindBy, associationSemanticNameCore), | ||
getAccessor: assoc_options.getAccessor || (0, _utils_1.defineAssociationAccessorMethodName)(_utils_1.ACCESSOR_KEYS.get, associationSemanticNameCore), | ||
setAccessor: assoc_options.setAccessor || (0, _utils_1.defineAssociationAccessorMethodName)(_utils_1.ACCESSOR_KEYS.set, associationSemanticNameCore), | ||
hasAccessor: assoc_options.hasAccessor || (0, _utils_1.defineAssociationAccessorMethodName)(_utils_1.ACCESSOR_KEYS.has, associationSemanticNameCore), | ||
delAccessor: assoc_options.delAccessor || (0, _utils_1.defineAssociationAccessorMethodName)(_utils_1.ACCESSOR_KEYS.del, associationSemanticNameCore), | ||
modelFindByAccessor: assoc_options.modelFindByAccessor || (0, _utils_1.defineAssociationAccessorMethodName)(_utils_1.ACCESSOR_KEYS.modelFindBy, associationSemanticNameCore), | ||
hooks: Object.assign({}, assoc_options.hooks), | ||
@@ -105,3 +105,3 @@ }; | ||
} | ||
return Model_1.listFindByChainOrRunSync(Model, {}, [ | ||
return (0, Model_1.listFindByChainOrRunSync)(Model, {}, [ | ||
{ | ||
@@ -116,3 +116,3 @@ association_name: association.name, | ||
Model[association.modelFindBySyncAccessor] = findByAccessorChainOrRunSync(true); | ||
_utils_1.addAssociationInfoToModel(Model, name, { | ||
(0, _utils_1.addAssociationInfoToModel)(Model, name, { | ||
type: 'extendsTo', | ||
@@ -119,0 +119,0 @@ association: association |
@@ -157,3 +157,3 @@ /// <reference lib="es5" /> | ||
exists.link = [ | ||
_utils_1.getMapsToFromPropertyHash(association.mergeAssocId)[0], | ||
(0, _utils_1.getMapsToFromPropertyHash)(association.mergeAssocId)[0], | ||
association.model.keys[0] | ||
@@ -168,3 +168,3 @@ ]; | ||
} | ||
return Model_1.listFindByChainOrRunSync(Model, {}, [ | ||
return (0, Model_1.listFindByChainOrRunSync)(Model, {}, [ | ||
{ | ||
@@ -179,3 +179,3 @@ association_name: association.name, | ||
Model[association.modelFindBySyncAccessor] = findByAccessorChainOrRunSync(true); | ||
_utils_1.addAssociationInfoToModel(Model, name, { | ||
(0, _utils_1.addAssociationInfoToModel)(Model, name, { | ||
type: 'hasMany', | ||
@@ -182,0 +182,0 @@ association: association |
@@ -98,3 +98,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
} | ||
return Model_1.listFindByChainOrRunSync(Model, {}, [ | ||
return (0, Model_1.listFindByChainOrRunSync)(Model, {}, [ | ||
{ | ||
@@ -109,3 +109,3 @@ association_name: association.name, | ||
Model[association.modelFindBySyncAccessor] = findByAccessorChainOrRunSync(true); | ||
_utils_1.addAssociationInfoToModel(Model, assoc_name, { | ||
(0, _utils_1.addAssociationInfoToModel)(Model, assoc_name, { | ||
type: 'hasOne', | ||
@@ -112,0 +112,0 @@ association |
@@ -20,3 +20,3 @@ const util = require("util"); | ||
const { tableConditions, topConditions } = Utilities.extractSelectTopConditions(conditions, vFields); | ||
const __pointTypeMapsTo = _dml_helpers_1.pickPointTypeFields(opts.driver, Model.allProperties); | ||
const __pointTypeMapsTo = (0, _dml_helpers_1.pickPointTypeFields)(opts.driver, Model.allProperties); | ||
foundItems = opts.driver.find(opts.only, opts.table, tableConditions, { | ||
@@ -23,0 +23,0 @@ limit: Utilities.coercePositiveInt(opts.limit, undefined), |
@@ -96,3 +96,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
const __pointTypeMapsTo = opts.__pointTypeMapsTo || []; | ||
_dml_helpers_1.filterFieldsOnFind({ | ||
(0, _dml_helpers_1.filterFieldsOnFind)({ | ||
dmlDriver: this, | ||
@@ -129,3 +129,3 @@ pointPropertiesMapsTo: __pointTypeMapsTo, | ||
__pointTypeMapsTo.forEach(field => { | ||
item[field] = _dml_helpers_1.safeParseJson(item[field]); | ||
item[field] = (0, _dml_helpers_1.safeParseJson)(item[field]); | ||
}); | ||
@@ -132,0 +132,0 @@ }); |
@@ -105,3 +105,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
__pointTypeMapsTo.forEach(field => { | ||
item[field] = _dml_helpers_1.safeParseJson(_dml_helpers_1.unwrapQuote(item[field])); | ||
item[field] = (0, _dml_helpers_1.safeParseJson)((0, _dml_helpers_1.unwrapQuote)(item[field])); | ||
}); | ||
@@ -108,0 +108,0 @@ }); |
@@ -49,3 +49,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
const syncResult = Utilities.catchBlocking(() => { | ||
const DMLDriver = Adapters_1.getAdapter(adapterName); | ||
const DMLDriver = (0, Adapters_1.getAdapter)(adapterName); | ||
const settings = Settings.Container(Settings.defaultSettingsInstance.get('*')); | ||
@@ -109,3 +109,3 @@ const driver = new DMLDriver(dbdriver.uri, null, { | ||
try { | ||
const DMLDriver = Adapters_1.getAdapter(proto); | ||
const DMLDriver = (0, Adapters_1.getAdapter)(proto); | ||
const settings = Settings.Container(Settings.defaultSettingsInstance.get('*')); | ||
@@ -112,0 +112,0 @@ const driver = new DMLDriver(null, connection, { |
@@ -278,3 +278,3 @@ /// <reference lib="es2017" /> | ||
const { tableConditions, topConditions } = Utilities.extractSelectTopConditions(conditions, vFields); | ||
const __pointTypeMapsTo = _dml_helpers_1.pickPointTypeFields(m_opts.driver, allProperties); | ||
const __pointTypeMapsTo = (0, _dml_helpers_1.pickPointTypeFields)(m_opts.driver, allProperties); | ||
try { | ||
@@ -722,4 +722,3 @@ founditems = m_opts.driver.find(model_selectable_fields, m_opts.table, tableConditions, { | ||
var prop = Property.normalize({ | ||
prop: propIn, | ||
name: (options && options.name || propIn.name), | ||
prop: propIn, name: (options && options.name || propIn.name), | ||
customTypes: m_opts.db.customTypes, settings: m_opts.settings | ||
@@ -897,3 +896,3 @@ }); | ||
alias: getTableAlias(`lj_${association.mergeTable}`), | ||
ids: _utils_1.getMapsToFromPropertyHash(association.mergeId) | ||
ids: (0, _utils_1.getMapsToFromPropertyHash)(association.mergeId) | ||
}; | ||
@@ -903,3 +902,3 @@ const rjoin_info = { | ||
alias: getTableAlias(`rj_${association.mergeTable}`), | ||
ids: _utils_1.getMapsToFromPropertyHash(association.mergeAssocId) | ||
ids: (0, _utils_1.getMapsToFromPropertyHash)(association.mergeAssocId) | ||
}; | ||
@@ -932,3 +931,3 @@ const right_info = { | ||
else if (isHasOne) { // support hasone | ||
const reled_ids = typeof association.field === 'string' ? [association.field] : (Array.isArray(association.field) ? association.field : _utils_1.getMapsToFromPropertyHash(association.field)); | ||
const reled_ids = typeof association.field === 'string' ? [association.field] : (Array.isArray(association.field) ? association.field : (0, _utils_1.getMapsToFromPropertyHash)(association.field)); | ||
const base_info = { | ||
@@ -935,0 +934,0 @@ table: `${model.table}`, |
@@ -119,2 +119,2 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
} | ||
exports.defaultSettingsInstance = Container(exports.defaults()); | ||
exports.defaultSettingsInstance = Container((0, exports.defaults)()); |
@@ -17,3 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
return; | ||
exports.modelClear(model, key); | ||
(0, exports.modelClear)(model, key); | ||
}); | ||
@@ -36,3 +36,3 @@ return this; | ||
const { driver_table_uid } = Helpers.parseDriverUidAndTableNameFromUID(key); | ||
return exports.modelGet(models[driver_table_uid], key, opts, reFetchSync); | ||
return (0, exports.modelGet)(models[driver_table_uid], key, opts, reFetchSync); | ||
}; | ||
@@ -39,0 +39,0 @@ exports.get = get; |
@@ -606,6 +606,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
if (host.properties) { | ||
filterDate_1.filterDate(conditions, { properties: host.properties }); | ||
(0, filterDate_1.filterDate)(conditions, { properties: host.properties }); | ||
} | ||
else { | ||
filterDate_1.filterDate(conditions, { properties: host.allProperties }); | ||
(0, filterDate_1.filterDate)(conditions, { properties: host.allProperties }); | ||
} | ||
@@ -659,3 +659,3 @@ return conditions; | ||
for (let k in AvailableHooks) { | ||
association[AvailableHooks[k]] = exports.createHookHelper(association.hooks, AvailableHooks[k], { initialHooks: Object.assign({}, association.hooks) }); | ||
association[AvailableHooks[k]] = (0, exports.createHookHelper)(association.hooks, AvailableHooks[k], { initialHooks: Object.assign({}, association.hooks) }); | ||
} | ||
@@ -751,3 +751,3 @@ } | ||
let name, _channel; | ||
Helpers_1.selectArgs(Array.prototype.slice.apply(arguments), (arg_type, arg) => { | ||
(0, Helpers_1.selectArgs)(Array.prototype.slice.apply(arguments), (arg_type, arg) => { | ||
switch (arg_type) { | ||
@@ -754,0 +754,0 @@ case 'string': |
@@ -30,3 +30,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
for (let k in conds) { | ||
if (common_1.isModelConjunctionsKey(k)) | ||
if ((0, common_1.isModelConjunctionsKey)(k)) | ||
Array.isArray(conds[k]) && conds[k].forEach((item) => filterDate(item, m)); | ||
@@ -33,0 +33,0 @@ else { |
{ | ||
"name": "@fxjs/orm", | ||
"version": "1.16.6", | ||
"version": "1.16.7", | ||
"description": "", | ||
@@ -37,11 +37,11 @@ "main": "lib", | ||
"@fibjs/enforce": "^0.1.1", | ||
"@fxjs/db-driver": "^0.5.1", | ||
"@fxjs/knex": "^0.4.1", | ||
"@fxjs/db-driver": "^0.5.2", | ||
"@fxjs/knex": "^0.4.2", | ||
"@fxjs/orm-core": "^0.3.2", | ||
"@fxjs/orm-property": "^0.4.1", | ||
"@fxjs/sql-ddl-sync": "^0.11.3", | ||
"@fxjs/sql-query": "^0.10.0", | ||
"@fxjs/orm-property": "^0.4.2", | ||
"@fxjs/sql-ddl-sync": "^0.11.4", | ||
"@fxjs/sql-query": "^0.10.1", | ||
"@types/knex": "^0.16.1", | ||
"fib-pool": "^1.6.0", | ||
"knex": "^0.19.5", | ||
"knex": "^2.5.1", | ||
"lodash.clonedeep": "^4.5.0", | ||
@@ -68,3 +68,3 @@ "lodash.flatten": "^4.4.0", | ||
"@fxjs/knex": ">= 0.3 <= 0.3", | ||
"knex": ">= 0.19.0 < 0.20" | ||
"knex": ">= 0.19.0 < 2.6" | ||
}, | ||
@@ -79,3 +79,3 @@ "private": false, | ||
}, | ||
"gitHead": "000676c2b83127ad5ebbf852863aa12f1f796bfa" | ||
"gitHead": "f2420f3142155b3a2946131c521dad005940e7f1" | ||
} |
import type { FxOrmQuery } from "./Typo/query"; | ||
declare const _default: (chain: FxOrmQuery.IChainFind, chain_cb: FxOrmQuery.IChainInstanceCallbackFn) => FxOrmQuery.IChainInstance; | ||
/** | ||
* NOT SUPPORTED | ||
*/ | ||
declare const _default: (chain: FxOrmQuery.IChainFind, chain_cb: FxOrmQuery.IChainInstanceCallbackFn) => FxOrmQuery.IChainInstance; | ||
export = _default; |
@@ -1,3 +0,2 @@ | ||
/// <reference types="@fibjs/types" /> | ||
declare const _default: () => Class_EventEmitter; | ||
export = _default; |
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/types" /> | ||
import type { FxOrmCommon } from '../../Typo/_common'; | ||
@@ -3,0 +4,0 @@ import type { FxOrmDb } from '../../Typo/Db'; |
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/types" /> | ||
import type { FxOrmCommon } from '../../Typo/_common'; | ||
@@ -3,0 +4,0 @@ import type { FxOrmDb } from '../../Typo/Db'; |
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/types" /> | ||
import type { FxOrmCommon } from '../../Typo/_common'; | ||
@@ -3,0 +4,0 @@ import type { FxOrmDb } from '../../Typo/Db'; |
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/types" /> | ||
import { FxDbDriverNS, IDbDriver } from "@fxjs/db-driver"; | ||
@@ -3,0 +5,0 @@ import type { FxOrmCommon } from "./_common"; |
/// <reference types="@fibjs/types" /> | ||
/// <reference types="@fibjs/enforce" /> | ||
/// <reference types="@fibjs/types" /> | ||
import type { FxOrmSqlDDLSync } from "@fxjs/sql-ddl-sync"; | ||
@@ -4,0 +5,0 @@ import { FxOrmAssociation } from "./assoc"; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="@fibjs/types" /> | ||
import FxORMCore = require('@fxjs/orm-core'); | ||
@@ -111,3 +110,3 @@ import { FxSqlQuery, FxSqlQuerySubQuery, FxSqlQuerySql, FxSqlQueryDialect } from '@fxjs/sql-query'; | ||
export declare function parseTableInputForSelect(ta_str: string): { | ||
pure_table: string | FxSqlQuerySql.SqlFromTableInput | `(${string})`; | ||
pure_table: string | FxSqlQuerySql.SqlFromTableInput; | ||
alias: string; | ||
@@ -114,0 +113,0 @@ from_tuple: FxSqlQuerySql.SqlTableTuple; |
435749
9268
+ Addedcolorette@2.0.19(transitive)
+ Addedcommander@10.0.1(transitive)
+ Addeddebug@4.3.4(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedesm@3.2.25(transitive)
+ Addedget-package-type@0.1.0(transitive)
+ Addedgetopts@2.3.0(transitive)
+ Addedinterpret@2.2.0(transitive)
+ Addedknex@2.5.1(transitive)
+ Addedms@2.1.2(transitive)
+ Addedpg-connection-string@2.6.1(transitive)
+ Addedrechoir@0.8.0(transitive)
+ Addedresolve-from@5.0.0(transitive)
+ Addedtarn@3.0.2(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-each@1.0.1(transitive)
- Removedarray-slice@1.1.0(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbluebird@3.7.2(transitive)
- Removedbraces@2.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcolorette@1.1.0(transitive)
- Removedcommander@3.0.2(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removeddebug@2.6.94.1.1(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddetect-file@1.0.0(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedexpand-tilde@2.0.2(transitive)
- Removedextend@3.0.2(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfill-range@4.0.0(transitive)
- Removedfindup-sync@3.0.0(transitive)
- Removedfined@1.2.0(transitive)
- Removedflagged-respawn@1.0.1(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfor-own@1.0.0(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedget-value@2.0.6(transitive)
- Removedgetopts@2.2.5(transitive)
- Removedglobal-modules@1.0.0(transitive)
- Removedglobal-prefix@1.0.2(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhomedir-polyfill@1.0.3(transitive)
- Removedinherits@2.0.4(transitive)
- Removedini@1.3.8(transitive)
- Removedinterpret@1.4.0(transitive)
- Removedis-absolute@1.0.0(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@3.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-relative@1.0.0(transitive)
- Removedis-unc-path@1.0.0(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedknex@0.19.5(transitive)
- Removedliftoff@3.1.0(transitive)
- Removedmake-iterator@1.0.1(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removednanomatch@1.2.13(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.defaults@1.1.0(transitive)
- Removedobject.map@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedparse-filepath@1.0.2(transitive)
- Removedparse-passwd@1.0.0(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-root@0.1.1(transitive)
- Removedpath-root-regex@0.1.2(transitive)
- Removedpg-connection-string@2.1.0(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedrechoir@0.6.2(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-dir@1.0.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedtarn@2.0.0(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedunc-path-regex@0.1.2(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removeduuid@3.4.0(transitive)
- Removedv8flags@3.2.0(transitive)
- Removedwhich@1.3.1(transitive)
Updated@fxjs/db-driver@^0.5.2
Updated@fxjs/knex@^0.4.2
Updated@fxjs/orm-property@^0.4.2
Updated@fxjs/sql-ddl-sync@^0.11.4
Updated@fxjs/sql-query@^0.10.1
Updatedknex@^2.5.1