@mlagie/sql-connector 2.1.3 → 2.1.4
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.ts +12 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -39,6 +39,17 @@ export interface SchemaDict {
|
|
|
39
39
|
[key: string]: SchemaField;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export type SelectAggregation = {
|
|
43
|
+
col?: string;
|
|
44
|
+
sum?: string;
|
|
45
|
+
distinct?: string;
|
|
46
|
+
dateFormat?: [string, string];
|
|
47
|
+
count?: string | string[] | Record<string, any>;
|
|
48
|
+
as?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type SelectItem = string | SelectAggregation;
|
|
52
|
+
|
|
42
53
|
type NormalizeSqlType<T> =
|
|
43
54
|
T extends StringConstructor
|
|
44
55
|
? "String"
|
|
@@ -193,7 +204,7 @@ export class Model<TSchema extends SchemaDict = SchemaDict> {
|
|
|
193
204
|
* @returns {Promise<Array<Object>>}
|
|
194
205
|
*/
|
|
195
206
|
find(options?: {
|
|
196
|
-
select?:
|
|
207
|
+
select?: SelectItem[];
|
|
197
208
|
where?: Record<string, any> | Partial<InferSchema<TSchema>> | string;
|
|
198
209
|
order?: [string, string][];
|
|
199
210
|
limit?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlagie/sql-connector",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.4",
|
|
4
4
|
"description": "The sql-connector module allows you to manage connections to a MySQL database, define table schemas, and interact with data in a simple and efficient way.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|