@cloudcome/utils-uni 1.13.0 → 1.15.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.
@@ -7,144 +7,3 @@ export type ClientDatabaseOutput<T> = {
7
7
  };
8
8
  };
9
9
  export type CloudDatabaseOutput<T> = T;
10
- export type DatabaseQueryCommand = {
11
- _: never;
12
- };
13
- export type DatabaseMutateCommand = {
14
- _: never;
15
- };
16
- /**
17
- * DatabaseCommand 数据库操作命令类型定义
18
- */
19
- export type DatabaseCommand = {
20
- /**
21
- * 聚合表达式操作符
22
- * @param expr 表达式参数
23
- * @returns 返回聚合表达式结果
24
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-expr expr 文档}
25
- */
26
- expr: (expr: unknown) => DatabaseQueryCommand;
27
- /**
28
- * 等于操作符
29
- * @param value 比较值
30
- * @returns 返回查询条件
31
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-eq eq 文档}
32
- */
33
- eq: (value: unknown) => DatabaseQueryCommand;
34
- /**
35
- * 不等于操作符
36
- * @param value 比较值
37
- * @returns 返回查询条件
38
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-neq neq 文档}
39
- */
40
- neq: (value: unknown) => DatabaseQueryCommand;
41
- /**
42
- * 大于操作符
43
- * @param value 比较值
44
- * @returns 返回查询条件
45
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-gt gt 文档}
46
- */
47
- gt: (value: unknown) => DatabaseQueryCommand;
48
- /**
49
- * 大于等于操作符
50
- * @param value 比较值
51
- * @returns 返回查询条件
52
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-gte gte 文档}
53
- */
54
- gte: (value: unknown) => DatabaseQueryCommand;
55
- /**
56
- * 小于操作符
57
- * @param value 比较值
58
- * @returns 返回查询条件
59
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-lt lt 文档}
60
- */
61
- lt: (value: unknown) => DatabaseQueryCommand;
62
- /**
63
- * 小于等于操作符
64
- * @param value 比较值
65
- * @returns 返回查询条件
66
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-lte lte 文档}
67
- */
68
- lte: (value: unknown) => DatabaseQueryCommand;
69
- /**
70
- * 包含在数组内操作符
71
- * @param value 包含的值数组
72
- * @returns 返回查询条件
73
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-in in 文档}
74
- */
75
- in: (value: unknown[]) => DatabaseQueryCommand;
76
- /**
77
- * 不包含在数组内操作符
78
- * @param value 不包含的值数组
79
- * @returns 返回查询条件
80
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-nin nin 文档}
81
- */
82
- nin: (value: unknown[]) => DatabaseQueryCommand;
83
- /**
84
- * 逻辑与操作符
85
- * @param args 多个查询条件
86
- * @returns 返回逻辑与查询条件
87
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-and and 文档}
88
- */
89
- and: (...args: unknown[]) => DatabaseQueryCommand;
90
- /**
91
- * 逻辑或操作符
92
- * @param args 多个查询条件
93
- * @returns 返回逻辑或查询条件
94
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#dbcmd-or or 文档}
95
- */
96
- or: (...args: unknown[]) => DatabaseQueryCommand;
97
- /**
98
- * 自增操作符
99
- * @param value 增加的数值
100
- * @returns 返回更新操作
101
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-inc inc 文档}
102
- */
103
- inc: (value: number) => DatabaseMutateCommand;
104
- /**
105
- * 自乘操作符
106
- * @param value 相乘的数值
107
- * @returns 返回更新操作
108
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-mul mul 文档}
109
- */
110
- mul: (value: number) => DatabaseMutateCommand;
111
- /**
112
- * 设置字段值操作符
113
- * @param value 设置的值
114
- * @returns 返回更新操作
115
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-set set 文档}
116
- */
117
- set: (value: unknown) => DatabaseMutateCommand;
118
- /**
119
- * 数组末尾添加元素操作符
120
- * @param value 添加的值
121
- * @returns 返回更新操作
122
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-push push 文档}
123
- */
124
- push: (value: unknown) => DatabaseMutateCommand;
125
- /**
126
- * 数组开头添加元素操作符
127
- * @param value 添加的值
128
- * @returns 返回更新操作
129
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-unshift unshift 文档}
130
- */
131
- unshift: (value: unknown) => DatabaseMutateCommand;
132
- /**
133
- * 删除数组末尾元素操作符
134
- * @returns 返回更新操作
135
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-pop pop 文档}
136
- */
137
- pop: () => DatabaseMutateCommand;
138
- /**
139
- * 删除数组开头元素操作符
140
- * @returns 返回更新操作
141
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-shift shift 文档}
142
- */
143
- shift: () => DatabaseMutateCommand;
144
- /**
145
- * 删除字段操作符
146
- * @returns 返回更新操作
147
- * @see {@link https://doc.dcloud.net.cn/uniCloud/cf-database.html#operator-remove remove 文档}
148
- */
149
- remove: () => DatabaseMutateCommand;
150
- };
@@ -1,4 +1,4 @@
1
- import { DbCreate, DbSelect, DbUpdate, DbWhere } from './db.class';
1
+ import { DbCreate, DbSelect, DbUpdate, DbWhere } from './_db.class';
2
2
  import { DbProxy } from './proxy';
3
3
  export type DbUniqueOptions<T, S extends DbSelect<T>, C extends DbCreate<T>, U extends DbUpdate<T>> = {
4
4
  /** 查询条件 */
@@ -1,5 +1,5 @@
1
1
  import { Exact } from '@cloudcome/utils-core/types';
2
- import { DbCreate, DbQuery, DbSelect, DbUpdate, DbWhere } from './db.class';
2
+ import { DbCreate, DbQuery, DbSelect, DbUpdate, DbWhere } from './_db.class';
3
3
  import { DbProxy } from './proxy';
4
4
  export type DbUpsertOptions<T, S extends DbSelect<T>, C extends DbCreate<T>, U extends DbUpdate<T>> = {
5
5
  /** 查询条件 */
@@ -46,4 +46,4 @@ export type DbUpsertOutput = {
46
46
  /** 是否为更新操作 */
47
47
  updated: boolean;
48
48
  };
49
- export declare function dbUpsert<T, S extends DbSelect<T>, C extends DbCreate<T>, U extends DbUpdate<T>>(dbProxy: DbProxy<T>, options: DbUpsertOptions<T, S, C, U>): Promise<DbUpsertOutput>;
49
+ export declare function dbUpsert<D1, S1 extends DbSelect<D1>, C extends DbCreate<D1>, U extends DbUpdate<D1>>(dbProxy: DbProxy<D1>, options: DbUpsertOptions<D1, S1, C, U>): Promise<DbUpsertOutput>;