@syntropix/database 0.1.0 → 0.1.1

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/dist/index.d.ts CHANGED
@@ -1,9 +1,620 @@
1
- export { Client } from './core/client';
2
- export * from './core/config';
3
- export { SyntropixClient } from './core/syntropix';
4
- export { BaseModel, Column, ForeignKey } from './types/basemodel';
5
- export * from './types/common';
6
- export { ColumnType } from './types/data-type';
7
- export * from './types/field';
8
- export * from './types/filter';
9
- export * from './types/requests';
1
+ declare class ClientConfig {
2
+ apiKey?: string;
3
+ baseUrl?: string;
4
+ timeout?: number;
5
+ retries?: number;
6
+ constructor(config?: any);
7
+ }
8
+
9
+ declare class Client {
10
+ protected config: ClientConfig;
11
+ constructor(config: ClientConfig);
12
+ private headers;
13
+ private url;
14
+ get(path: string, data?: Record<string, any>): Promise<Record<string, any>>;
15
+ post(path: string, data?: Record<string, any>): Promise<Record<string, any>>;
16
+ }
17
+
18
+ interface StringType {
19
+ String: number;
20
+ }
21
+ interface VectorType {
22
+ Vector: number;
23
+ }
24
+ interface EnumType {
25
+ Enum: {
26
+ name: string;
27
+ variants: string[];
28
+ };
29
+ }
30
+ interface MoneyType {
31
+ Money: [number, number] | null;
32
+ }
33
+ interface DecimalType {
34
+ Decimal: [number, number] | null;
35
+ }
36
+ type ArrayDataTypeMap = typeof ArrayDataType;
37
+ type ArrayDataTypeValues = ArrayDataTypeMap[keyof ArrayDataTypeMap];
38
+ type ArrayDataTypeReturnTypes = ReturnType<Extract<ArrayDataTypeValues, (...args: any[]) => any>>;
39
+ declare const ArrayDataType: {
40
+ readonly String: (maxLength: number) => StringType;
41
+ readonly Text: "Text";
42
+ readonly Integer: "Integer";
43
+ readonly BigInteger: "BigInteger";
44
+ readonly Double: "Double";
45
+ readonly Decimal: (precision: number, scale: number) => DecimalType;
46
+ readonly DateTime: "DateTime";
47
+ readonly Timestamp: "Timestamp";
48
+ readonly Date: "Date";
49
+ readonly Boolean: "Boolean";
50
+ readonly Money: (precision: number, scale: number) => MoneyType;
51
+ readonly Uuid: "Uuid";
52
+ readonly Enum: (name: string, variants: string[]) => EnumType;
53
+ readonly Json: "Json";
54
+ };
55
+ type ArrayDataType = Exclude<ArrayDataTypeValues, (...args: any[]) => any> | ArrayDataTypeReturnTypes;
56
+ interface ArrayType {
57
+ Array: ArrayDataType;
58
+ }
59
+ type DataTypeMap = typeof ColumnDataType;
60
+ type DataTypeValues = DataTypeMap[keyof DataTypeMap];
61
+ type DataTypeReturnTypes = ReturnType<Extract<DataTypeValues, (...args: any[]) => any>>;
62
+ declare const ColumnDataType: {
63
+ readonly Integer: "Integer";
64
+ readonly String: (maxLength: number) => StringType;
65
+ readonly Text: "Text";
66
+ readonly Boolean: "Boolean";
67
+ readonly DateTime: "DateTime";
68
+ readonly Timestamp: "Timestamp";
69
+ readonly Date: "Date";
70
+ readonly Json: "Json";
71
+ readonly Uuid: "Uuid";
72
+ readonly Double: "Double";
73
+ readonly Vector: (dimensions: number) => VectorType;
74
+ readonly Array: (dataType: ArrayDataType) => ArrayType;
75
+ readonly Enum: (name: string, variants: string[]) => EnumType;
76
+ readonly Money: (precision: number, scale: number) => MoneyType;
77
+ readonly Decimal: (precision: number, scale: number) => DecimalType;
78
+ };
79
+ type ColumnDataType = Exclude<DataTypeValues, (...args: any[]) => any> | DataTypeReturnTypes;
80
+
81
+ declare enum SortType {
82
+ Descending = "Descending",
83
+ Ascending = "Ascending"
84
+ }
85
+ interface SimilarityOptions {
86
+ threshold: number;
87
+ order?: SortType;
88
+ alias?: string;
89
+ }
90
+ declare enum FilterOperation {
91
+ LT = "LT",
92
+ LTE = "LTE",
93
+ GT = "GT",
94
+ GTE = "GTE",
95
+ EQ = "EQ",
96
+ NEQ = "NEQ",
97
+ Between = "Between",
98
+ In = "In",
99
+ Contains = "Contains",
100
+ Overlap = "Overlap",
101
+ NotIn = "NotIn",
102
+ Like = "Like",
103
+ NotLike = "NotLike",
104
+ ILike = "ILike",
105
+ NotILike = "NotILike",
106
+ IsNull = "IsNull",
107
+ IsNotNull = "IsNotNull",
108
+ Similarity = "Similarity",
109
+ SimilarityDistance = "SimilarityDistance",
110
+ WordSimilarity = "WordSimilarity",
111
+ WordSimilarityDistance = "WordSimilarityDistance",
112
+ StrictWordSimilarity = "StrictWordSimilarity",
113
+ StrictWordSimilarityDistance = "StrictWordSimilarityDistance",
114
+ EuclideanDistance = "EuclideanDistance",
115
+ NegativeInnerProduct = "NegativeInnerProduct",
116
+ CosineDistance = "CosineDistance"
117
+ }
118
+ interface FilterItem {
119
+ column: string;
120
+ operator: FilterOperation;
121
+ staticValue?: any;
122
+ columnValue?: string;
123
+ simiarityOptions?: SimilarityOptions;
124
+ }
125
+ type FilterGroup = FilterItem[];
126
+ type Filter = FilterGroup[];
127
+ declare const AND: (...conditions: FilterItem[]) => FilterGroup;
128
+ declare const OR: (...conditions: FilterGroup[]) => Filter;
129
+ declare const EQ: (field: string, value: any) => FilterItem;
130
+ declare const NE: (field: string, value: any) => FilterItem;
131
+ declare const GT: (field: string, value: any) => FilterItem;
132
+ declare const GTE: (field: string, value: any) => FilterItem;
133
+ declare const LT: (field: string, value: any) => FilterItem;
134
+ declare const LTE: (field: string, value: any) => FilterItem;
135
+ declare const IN: (field: string, values: any[]) => FilterItem;
136
+ declare const CONTAINS: (field: string, value: any) => FilterItem;
137
+ declare const OVERLAP: (field: string, value: any) => FilterItem;
138
+ declare const I_LIKE: (field: string, pattern: string) => FilterItem;
139
+ declare const NOT_I_LIKE: (field: string, pattern: string) => FilterItem;
140
+ declare const NOT_IN: (field: string, values: any[]) => FilterItem;
141
+ declare const LIKE: (field: string, pattern: string) => FilterItem;
142
+ declare const NOT_LIKE: (field: string, pattern: string) => FilterItem;
143
+ declare const IS_NULL: (field: string) => FilterItem;
144
+ declare const IS_NOT_NULL: (field: string) => FilterItem;
145
+ declare const BETWEEN: (field: string, min: any, max: any) => FilterItem;
146
+ declare const EQ_COL: (field: string, otherField: string) => FilterItem;
147
+ declare const NE_COL: (field: string, otherField: string) => FilterItem;
148
+ declare const GT_COL: (field: string, otherField: string) => FilterItem;
149
+ declare const GTE_COL: (field: string, otherField: string) => FilterItem;
150
+ declare const LT_COL: (field: string, otherField: string) => FilterItem;
151
+ declare const LTE_COL: (field: string, otherField: string) => FilterItem;
152
+ declare const SIMILARITY: (field: string, value: any, options: SimilarityOptions) => FilterItem;
153
+ declare const SIMILARITY_DISTANCE: (field: string, value: any, options: SimilarityOptions) => FilterItem;
154
+ declare const WORD_SIMILARITY: (field: string, value: any, options: SimilarityOptions) => FilterItem;
155
+ declare const WORD_SIMILARITY_DISTANCE: (field: string, value: any, options: SimilarityOptions) => FilterItem;
156
+ declare const STRICT_WORD_SIMILARITY: (field: string, value: any, options: SimilarityOptions) => FilterItem;
157
+ declare const STRICT_WORD_SIMILARITY_DISTANCE: (field: string, value: any, options: SimilarityOptions) => FilterItem;
158
+ declare const EUCLIDEAN_DISTANCE: (field: string, value: any, options: SimilarityOptions) => FilterItem;
159
+ declare const NEGATIVE_INNER_PRODUCT: (field: string, value: any, options: SimilarityOptions) => FilterItem;
160
+ declare const COSINE_DISTANCE: (field: string, value: any, options: SimilarityOptions) => FilterItem;
161
+ declare const Value: (value: any) => any;
162
+ declare function FilterWrapper(filter: Filter | FilterGroup | FilterItem | undefined): Filter | undefined;
163
+
164
+ declare enum ForeignKeyAction {
165
+ Cascade = "Cascade",
166
+ Restrict = "Restrict",
167
+ SetNull = "SetNull",
168
+ NoAction = "NoAction",
169
+ SetDefault = "SetDefault"
170
+ }
171
+ declare enum AggregateFunction {
172
+ Count = "Count",
173
+ Sum = "Sum",
174
+ Avg = "Avg",
175
+ Min = "Min",
176
+ Max = "Max",
177
+ CountDistinct = "CountDistinct"
178
+ }
179
+ interface Sort {
180
+ column: string;
181
+ direction: SortType;
182
+ }
183
+ interface Join {
184
+ table: string;
185
+ on: any;
186
+ }
187
+ interface Aggregate {
188
+ column: string;
189
+ function: AggregateFunction;
190
+ alias: string;
191
+ }
192
+ interface GroupBy {
193
+ columns: string[];
194
+ }
195
+ interface ForeignKey$1 {
196
+ name?: string;
197
+ fromTableName: string;
198
+ fromColumnName: string;
199
+ toTableName: string;
200
+ toColumnName: string;
201
+ onDelete?: ForeignKeyAction;
202
+ onUpdate?: ForeignKeyAction;
203
+ }
204
+ interface Column$1 {
205
+ name: string;
206
+ displayName?: string;
207
+ description?: string;
208
+ columnType: ColumnDataType;
209
+ isPrimaryKey?: boolean;
210
+ isNullable?: boolean;
211
+ autoIncrement?: boolean;
212
+ default?: any;
213
+ defaultAccess?: SyntropixDBAccessType;
214
+ }
215
+ interface Index {
216
+ name: string;
217
+ columns: string[];
218
+ unique?: boolean;
219
+ }
220
+ interface SyntropixDBTable {
221
+ id: string;
222
+ name: string;
223
+ description: string;
224
+ createdAt: Date;
225
+ columns: Column$1[];
226
+ }
227
+ interface SyntropixDBTableListItem {
228
+ id: string;
229
+ name: string;
230
+ description: string;
231
+ metadata: Record<string, any>;
232
+ path: string;
233
+ visible: boolean;
234
+ access: SyntropixDBAccessType;
235
+ }
236
+
237
+ declare const SyntropixDBAccessType: {
238
+ readonly None: "None";
239
+ readonly Read: "Read";
240
+ readonly Write: "Write";
241
+ readonly Admin: "Admin";
242
+ };
243
+ type SyntropixDBAccessType = (typeof SyntropixDBAccessType)[keyof typeof SyntropixDBAccessType];
244
+ interface TableCreate {
245
+ name: string;
246
+ displayName?: string;
247
+ description?: string;
248
+ columns: Column$1[];
249
+ foreignKeys: ForeignKey$1[];
250
+ indexes: Index[];
251
+ defaultAccess?: SyntropixDBAccessType;
252
+ metadata?: Record<string, any>;
253
+ visible?: boolean;
254
+ path?: string;
255
+ }
256
+ interface TableDrop {
257
+ tableName: string;
258
+ }
259
+ interface TableRename {
260
+ tableName: string;
261
+ newTableName: string;
262
+ }
263
+ interface TableTruncate {
264
+ tableName: string;
265
+ }
266
+ interface TableAddColumn {
267
+ tableName: string;
268
+ column: Column$1;
269
+ }
270
+ interface TableDropColumn {
271
+ tableName: string;
272
+ columnName: string;
273
+ }
274
+ interface TableModifyColumn {
275
+ tableName: string;
276
+ column: Column$1;
277
+ }
278
+ interface TableGetSchema {
279
+ tableName: string;
280
+ }
281
+ interface TableGetList {
282
+ search?: string;
283
+ path?: string;
284
+ page?: number;
285
+ pageSize?: number;
286
+ }
287
+ interface InsertData {
288
+ columns: string[];
289
+ values: any[][];
290
+ }
291
+ interface Insert {
292
+ tableName: string;
293
+ data: InsertData;
294
+ }
295
+ interface UpdatePayload {
296
+ filter: Filter;
297
+ columns: string[];
298
+ values: any[];
299
+ }
300
+ interface Update {
301
+ tableName: string;
302
+ payload: UpdatePayload;
303
+ }
304
+ interface DeleteDataPayload {
305
+ filter: Filter;
306
+ }
307
+ interface DeleteData {
308
+ tableName: string;
309
+ payload: DeleteDataPayload;
310
+ }
311
+ interface QueryPayload {
312
+ filter?: Filter | FilterGroup | FilterItem;
313
+ sort?: Sort[];
314
+ aggregate?: Aggregate[];
315
+ join?: Join[];
316
+ limit?: number;
317
+ offset?: number;
318
+ groupBy?: GroupBy;
319
+ select?: string[];
320
+ }
321
+ interface Query {
322
+ tableName: string;
323
+ query: QueryPayload;
324
+ }
325
+
326
+ declare class DataClient {
327
+ private client;
328
+ constructor(config?: ClientConfig);
329
+ insertData(data: Insert): Promise<any>;
330
+ insertOne(data: Insert): Promise<any>;
331
+ updateByPrimaryKey(pk: string, data: Update): Promise<any>;
332
+ queryOne(data: Query, model?: any): Promise<any>;
333
+ queryMany(data: Query, model?: any): Promise<any>;
334
+ updateData(data: Update): Promise<any>;
335
+ deleteData(data: DeleteData): Promise<any>;
336
+ }
337
+
338
+ interface TableCreateResponse {
339
+ _id: {
340
+ $oid: string;
341
+ };
342
+ table: {
343
+ id: string;
344
+ name: string;
345
+ description: string;
346
+ createdAt: any;
347
+ columns: Column$1[];
348
+ foreignKeys: ForeignKey$1[];
349
+ indexes: Index[];
350
+ schema: string;
351
+ defaultAccess: string | null;
352
+ };
353
+ createdAt: any;
354
+ updatedAt: any;
355
+ createdBy: string;
356
+ metadata: Record<string, any>;
357
+ triggers: any[];
358
+ }
359
+
360
+ declare class TableClient {
361
+ private client;
362
+ constructor(config?: ClientConfig);
363
+ createTable(data: TableCreate): Promise<TableCreateResponse>;
364
+ dropTable(data: TableDrop): Promise<any>;
365
+ renameTable(data: TableRename): Promise<any>;
366
+ truncateTable(data: TableTruncate): Promise<any>;
367
+ addColumn(data: TableAddColumn): Promise<any>;
368
+ dropColumn(data: TableDropColumn): Promise<any>;
369
+ modifyColumn(data: TableModifyColumn): Promise<any>;
370
+ getTableSchema(data: TableGetSchema): Promise<SyntropixDBTable>;
371
+ getTableList(data: TableGetList): Promise<SyntropixDBTableListItem[]>;
372
+ }
373
+
374
+ declare class SyntropixClient {
375
+ private config;
376
+ private _tableClient?;
377
+ private _dataClient?;
378
+ constructor(config?: ClientConfig);
379
+ get table(): TableClient;
380
+ get data(): DataClient;
381
+ }
382
+
383
+ declare abstract class Field {
384
+ name: string;
385
+ description: string;
386
+ columnType: ColumnDataType;
387
+ isPrimaryKey: boolean;
388
+ isNullable: boolean;
389
+ autoIncrement: boolean;
390
+ default?: any;
391
+ defaultAccess?: SyntropixDBAccessType;
392
+ constructor(columnType: ColumnDataType, options?: {
393
+ name?: string;
394
+ description?: string;
395
+ isPrimaryKey?: boolean;
396
+ isNullable?: boolean;
397
+ autoIncrement?: boolean;
398
+ default?: any;
399
+ defaultAccess?: SyntropixDBAccessType;
400
+ });
401
+ into(): Column$1;
402
+ }
403
+ declare class ForeignKeyField extends Field {
404
+ tableName: string;
405
+ columnName: string;
406
+ onDelete: ForeignKeyAction;
407
+ onUpdate: ForeignKeyAction;
408
+ constructor(columnType: ColumnDataType, tableName: string, columnName: string, options?: {
409
+ onDelete?: ForeignKeyAction;
410
+ onUpdate?: ForeignKeyAction;
411
+ description?: string;
412
+ isPrimaryKey?: boolean;
413
+ isNullable?: boolean;
414
+ default?: any;
415
+ defaultAccess?: SyntropixDBAccessType;
416
+ });
417
+ }
418
+ declare class StringField extends Field {
419
+ constructor(maxLength: number, options?: {
420
+ description?: string;
421
+ isPrimaryKey?: boolean;
422
+ isNullable?: boolean;
423
+ default?: string;
424
+ defaultAccess?: SyntropixDBAccessType;
425
+ });
426
+ }
427
+ declare class TextField extends Field {
428
+ constructor(options?: {
429
+ description?: string;
430
+ isPrimaryKey?: boolean;
431
+ isNullable?: boolean;
432
+ default?: string;
433
+ defaultAccess?: SyntropixDBAccessType;
434
+ });
435
+ }
436
+ declare class IntegerField extends Field {
437
+ constructor(options?: {
438
+ description?: string;
439
+ isPrimaryKey?: boolean;
440
+ isNullable?: boolean;
441
+ autoIncrement?: boolean;
442
+ default?: number;
443
+ defaultAccess?: SyntropixDBAccessType;
444
+ });
445
+ }
446
+ declare class BooleanField extends Field {
447
+ constructor(options?: {
448
+ description?: string;
449
+ isPrimaryKey?: boolean;
450
+ isNullable?: boolean;
451
+ default?: boolean;
452
+ defaultAccess?: SyntropixDBAccessType;
453
+ });
454
+ }
455
+ declare class DateTimeField extends Field {
456
+ constructor(options?: {
457
+ description?: string;
458
+ isPrimaryKey?: boolean;
459
+ isNullable?: boolean;
460
+ default?: Date;
461
+ defaultAccess?: SyntropixDBAccessType;
462
+ });
463
+ }
464
+ declare class TimestampField extends Field {
465
+ constructor(options?: {
466
+ description?: string;
467
+ isPrimaryKey?: boolean;
468
+ isNullable?: boolean;
469
+ default?: Date;
470
+ defaultAccess?: SyntropixDBAccessType;
471
+ });
472
+ }
473
+ declare class DateField extends Field {
474
+ constructor(options?: {
475
+ description?: string;
476
+ isPrimaryKey?: boolean;
477
+ isNullable?: boolean;
478
+ default?: Date;
479
+ defaultAccess?: SyntropixDBAccessType;
480
+ });
481
+ }
482
+ declare class JsonField extends Field {
483
+ constructor(options?: {
484
+ description?: string;
485
+ isPrimaryKey?: boolean;
486
+ isNullable?: boolean;
487
+ default?: Record<string, any>;
488
+ defaultAccess?: SyntropixDBAccessType;
489
+ });
490
+ }
491
+ declare class UuidField extends Field {
492
+ constructor(options?: {
493
+ description?: string;
494
+ isPrimaryKey?: boolean;
495
+ isNullable?: boolean;
496
+ default?: string;
497
+ defaultAccess?: SyntropixDBAccessType;
498
+ });
499
+ }
500
+ declare class VectorField extends Field {
501
+ constructor(dimensions: number, options?: {
502
+ description?: string;
503
+ isPrimaryKey?: boolean;
504
+ isNullable?: boolean;
505
+ default?: number[];
506
+ defaultAccess?: SyntropixDBAccessType;
507
+ });
508
+ }
509
+ declare class ArrayField extends Field {
510
+ constructor(dataType: ArrayDataType, options?: {
511
+ description?: string;
512
+ isPrimaryKey?: boolean;
513
+ isNullable?: boolean;
514
+ default?: any[];
515
+ defaultAccess?: SyntropixDBAccessType;
516
+ });
517
+ }
518
+ declare class EnumField extends Field {
519
+ constructor(name: string, variants: string[], options?: {
520
+ description?: string;
521
+ isPrimaryKey?: boolean;
522
+ isNullable?: boolean;
523
+ default?: string;
524
+ defaultAccess?: SyntropixDBAccessType;
525
+ });
526
+ }
527
+ declare class MoneyField extends Field {
528
+ constructor(precision: number, scale: number, options?: {
529
+ description?: string;
530
+ isPrimaryKey?: boolean;
531
+ isNullable?: boolean;
532
+ default?: number;
533
+ defaultAccess?: SyntropixDBAccessType;
534
+ });
535
+ }
536
+ declare class DecimalField extends Field {
537
+ constructor(precision: number, scale: number, options?: {
538
+ description?: string;
539
+ isPrimaryKey?: boolean;
540
+ isNullable?: boolean;
541
+ default?: number;
542
+ defaultAccess?: SyntropixDBAccessType;
543
+ });
544
+ }
545
+ declare class DoubleField extends Field {
546
+ constructor(options?: {
547
+ description?: string;
548
+ isPrimaryKey?: boolean;
549
+ isNullable?: boolean;
550
+ default?: number;
551
+ defaultAccess?: SyntropixDBAccessType;
552
+ });
553
+ }
554
+
555
+ declare function Column(options?: {
556
+ type?: ColumnDataType;
557
+ name?: string;
558
+ description?: string;
559
+ primary?: boolean;
560
+ nullable?: boolean;
561
+ autoIncrement?: boolean;
562
+ default?: any;
563
+ }): (target: any, propertyKey: string) => void;
564
+ declare function ForeignKey(tableName: string, columnName: string, options?: {
565
+ type?: ColumnDataType;
566
+ name?: string;
567
+ onDelete?: string;
568
+ onUpdate?: string;
569
+ description?: string;
570
+ nullable?: boolean;
571
+ default?: any;
572
+ }): (target: any, propertyKey: string) => void;
573
+ declare class BaseModel {
574
+ private _client?;
575
+ private _extra;
576
+ constructor(data?: Record<string, any>);
577
+ protected static getTableName(): string;
578
+ static getDescription(): string;
579
+ protected static getIndexes(): Index[];
580
+ protected static getFields(): Record<string, Field>;
581
+ protected static getPrimaryKeyName(): string;
582
+ protected static getAssociations(): ForeignKeyField[];
583
+ protected getFields(): Record<string, Field>;
584
+ protected getTableName(): string;
585
+ protected getPrimaryKeyName(): string;
586
+ protected getPrimaryKey(): Field | undefined;
587
+ protected get client(): SyntropixClient;
588
+ static createTable(_client?: SyntropixClient | null): Promise<TableCreateResponse>;
589
+ static dropTable(_client?: SyntropixClient | null): Promise<any>;
590
+ static renameTable(newName: string, _client?: SyntropixClient | null): Promise<any>;
591
+ static truncateTable(_client?: SyntropixClient | null): Promise<any>;
592
+ static create<T extends BaseModel>(this: new (data?: any) => T, data: Record<string, any>, _client?: SyntropixClient | null): Promise<any>;
593
+ save(_client?: SyntropixClient | null): Promise<any>;
594
+ remove(filter?: Filter, _client?: SyntropixClient | null): Promise<number>;
595
+ static bulkCreate<T extends BaseModel>(this: new (data?: any) => T, datas: Record<string, any>[], batchSize?: number, _client?: SyntropixClient | null): Promise<number>;
596
+ static update<T extends BaseModel>(this: new (data?: any) => T, filter: Filter, data: Record<string, any>, _client?: SyntropixClient | null): Promise<number>;
597
+ static delete<T extends BaseModel>(this: new (data?: any) => T, filter: Filter, _client?: SyntropixClient | null): Promise<number>;
598
+ static get<T extends BaseModel>(this: new (data?: any) => T, filter: Filter, select?: string[], _client?: SyntropixClient | null): Promise<T>;
599
+ static filter<T extends BaseModel>(this: new (data?: any) => T, options: {
600
+ filter: Filter;
601
+ sort?: Sort[];
602
+ aggregate?: Aggregate[];
603
+ join?: Join;
604
+ limit?: number;
605
+ offset?: number;
606
+ groupBy?: GroupBy;
607
+ select?: string[];
608
+ _client?: SyntropixClient | null;
609
+ }): Promise<T[]>;
610
+ static count<T extends BaseModel>(this: new (data?: any) => T, options?: {
611
+ filter?: Filter;
612
+ join?: Join;
613
+ groupBy?: GroupBy;
614
+ _client?: SyntropixClient | null;
615
+ }): Promise<number>;
616
+ toString(): string;
617
+ toJSON(): Record<string, any>;
618
+ }
619
+
620
+ export { AND, type Aggregate, AggregateFunction, ArrayField, BETWEEN, BaseModel, BooleanField, CONTAINS, COSINE_DISTANCE, Client, ClientConfig, Column, ColumnDataType, DateField, DateTimeField, DecimalField, type DeleteData, type DeleteDataPayload, DoubleField, EQ, EQ_COL, EUCLIDEAN_DISTANCE, EnumField, Field, type Filter, type FilterGroup, type FilterItem, FilterOperation, FilterWrapper, ForeignKey, ForeignKeyAction, ForeignKeyField, GT, GTE, GTE_COL, GT_COL, type GroupBy, IN, IS_NOT_NULL, IS_NULL, I_LIKE, type Index, type Insert, type InsertData, IntegerField, type Join, JsonField, LIKE, LT, LTE, LTE_COL, LT_COL, MoneyField, NE, NEGATIVE_INNER_PRODUCT, NE_COL, NOT_IN, NOT_I_LIKE, NOT_LIKE, OR, OVERLAP, type Query, type QueryPayload, SIMILARITY, SIMILARITY_DISTANCE, STRICT_WORD_SIMILARITY, STRICT_WORD_SIMILARITY_DISTANCE, type SimilarityOptions, type Sort, SortType, StringField, SyntropixClient, SyntropixDBAccessType, type SyntropixDBTable, type SyntropixDBTableListItem, type TableAddColumn, type TableCreate, type TableDrop, type TableDropColumn, type TableGetList, type TableGetSchema, type TableModifyColumn, type TableRename, type TableTruncate, TextField, TimestampField, type Update, type UpdatePayload, UuidField, Value, VectorField, WORD_SIMILARITY, WORD_SIMILARITY_DISTANCE };