imodel 0.5.1 → 0.5.2
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/index.d.mts +4 -3
- package/index.mjs +7 -4
- package/migrate.d.mts +1 -1
- package/migrate.mjs +1 -1
- package/package.json +1 -1
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* imodel v0.5.
|
|
2
|
+
* imodel v0.5.2
|
|
3
3
|
* (c) 2019-2025 undefined
|
|
4
4
|
* @license undefined
|
|
5
5
|
*/
|
|
@@ -686,7 +686,7 @@ interface IndexInfo extends IndexOptions {
|
|
|
686
686
|
interface Index extends IndexInfo {
|
|
687
687
|
name: string;
|
|
688
688
|
}
|
|
689
|
-
interface TableDefine<T extends Fields = Fields, TT extends string | VirtualTable |
|
|
689
|
+
interface TableDefine<T extends Fields = Fields, TT extends string | VirtualTable | undefined = string | VirtualTable | undefined> {
|
|
690
690
|
/** 字段信息 */
|
|
691
691
|
readonly fields: T;
|
|
692
692
|
/** 表名 */
|
|
@@ -1694,8 +1694,9 @@ declare class Query<T extends Fields, TB extends unknown = any> implements Query
|
|
|
1694
1694
|
static table<F extends Fields, T_1 extends new (o: QueryOptions<F>) => Query<F>>(this: T_1, table: string, fields: F, pseudo?: string): InstanceType<T_1>;
|
|
1695
1695
|
/**
|
|
1696
1696
|
* @param {QueryOptions<T, TB> | Query<T, TB>} options
|
|
1697
|
+
* @param {boolean} [noBuild]
|
|
1697
1698
|
*/
|
|
1698
|
-
constructor(options: QueryOptions<T, TB> | Query<T, TB
|
|
1699
|
+
constructor(options: QueryOptions<T, TB> | Query<T, TB>, noBuild?: boolean);
|
|
1699
1700
|
/** @readonly @type {string | VirtualTable | undefined} */
|
|
1700
1701
|
readonly table: string | VirtualTable | undefined;
|
|
1701
1702
|
/** @readonly @type {T} */
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* imodel v0.5.
|
|
2
|
+
* imodel v0.5.2
|
|
3
3
|
* (c) 2019-2025 undefined
|
|
4
4
|
* @license undefined
|
|
5
5
|
*/
|
|
@@ -3930,13 +3930,14 @@ class Query {
|
|
|
3930
3930
|
}
|
|
3931
3931
|
/**
|
|
3932
3932
|
* @param {QueryOptions<T, TB> | Query<T, TB>} options
|
|
3933
|
+
* @param {boolean} [noBuild]
|
|
3933
3934
|
*/
|
|
3934
|
-
constructor(options) {
|
|
3935
|
+
constructor(options, noBuild) {
|
|
3935
3936
|
if (options instanceof Query) {
|
|
3936
3937
|
this.table = options.table;
|
|
3937
3938
|
this.fields = options.fields;
|
|
3938
3939
|
this.pseudo = options.pseudo;
|
|
3939
|
-
this.#build = options.#build;
|
|
3940
|
+
this.#build = noBuild ? null : options.#build;
|
|
3940
3941
|
this.#options = {
|
|
3941
3942
|
...options.#options
|
|
3942
3943
|
};
|
|
@@ -3954,7 +3955,9 @@ class Query {
|
|
|
3954
3955
|
this.pseudo = typeof pseudo === 'string' ? pseudo : '';
|
|
3955
3956
|
this.#build = typeof build === 'function' ? build : null;
|
|
3956
3957
|
this.#primaryFields = Object.entries(fields).filter(([, v]) => v.primary).sort(([, a], [, b]) => Number(a.primary) - Number(b.primary)).map(([v]) => v);
|
|
3957
|
-
if (
|
|
3958
|
+
if (noBuild) {
|
|
3959
|
+
this.#build = null;
|
|
3960
|
+
} else if (typeof options[Build] === 'function') {
|
|
3958
3961
|
this.#build = options[Build].bind(options);
|
|
3959
3962
|
} else if (typeof build === 'function') {
|
|
3960
3963
|
this.#build = build.bind(options);
|
package/migrate.d.mts
CHANGED
package/migrate.mjs
CHANGED