namirasoft-node-sequelize 1.4.11 → 1.4.13

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.
@@ -1,275 +1,273 @@
1
- import { ModelOptions, DataTypes, WhereOptions } from "sequelize";
2
- import { BaseSequelizeDatabase } from "./BaseSequelizeDatabase";
3
- import { BaseTable } from "namirasoft-node";
4
- import { ModelCtor, FindOptions, Transaction, Attributes } from 'sequelize';
5
- import { BaseSequelizeModel } from "./BaseSequelizeModel";
6
- import { BaseMetaColumn, BaseMetaTable, BaseUUID, NamingConvention, SortItem } from "namirasoft-core";
7
- import { AnySchema, ArraySchema, BaseTypeSchema, BigIntSchema, BoolSchema, DateSchema, DateTimeSchema, DecimalSchema, DoubleSchema, FloatSchema, IntegerSchema, MediumIntSchema, RealSchema, SmallIntSchema, StringSchema, TimeSchema, TinyIntSchema, TypeSchema, VariableSchema } from "namirasoft-schema";
8
- import { EnumSchema } from "namirasoft-schema";
9
- import { BaseSequelizeModelAttributeColumnOptions } from "./BaseSequelizeModelAttributeColumnOptions";
10
- import { BaseSequelizeModelAttributes } from "./BaseSequelizeModelAttributes";
11
-
12
- export abstract class BaseSequelizeTable<D extends BaseSequelizeDatabase, M extends BaseSequelizeModel> extends BaseTable<D, BaseSequelizeModelAttributeColumnOptions>
13
- {
14
- model!: ModelCtor<M>;
15
- attributes!: BaseSequelizeModelAttributes<M, Attributes<M>>;
16
- constructor(database: D)
17
- {
18
- super(database);
19
- }
20
- override getName(): string
21
- {
22
- return this.model.name;
23
- }
24
- protected override getExamples()
25
- {
26
- let ans: { [name: string]: string } = super.getExamples();
27
- let add = (name: string, uuid: BaseUUID) =>
28
- {
29
- if (uuid.short)
30
- ans[name] = uuid.new();
31
- };
32
- this.forEachColumn((name, column) =>
33
- {
34
- if (this.isChar(column.type))
35
- {
36
- if (name == "id")
37
- add(name, this.uuid);
38
- else if (name.endsWith("_id"))
39
- {
40
- try
41
- {
42
- let t = this.database.getTable(name.replace(/_id$/gm, "")) as BaseTable<D, any>;
43
- add(name, t.uuid);
44
- } catch (error)
45
- {
46
-
47
- }
48
- }
49
- }
50
- });
51
- return ans;
52
- }
53
- override getSecureColumns(): string[]
54
- {
55
- let columns = super.getSecureColumns();
56
- return ["deletedAt", "deleted_at", ...columns]
57
- }
58
- override getReadOnlyColumns(): string[]
59
- {
60
- let columns = super.getReadOnlyColumns();
61
- return ["id", "created_at", "updated_at", "createdAt", "updatedAt", ...columns];
62
- }
63
- private getModelAllAttributes()
64
- {
65
- let dateAttributes: BaseSequelizeModelAttributes<
66
- any,
67
- Attributes<any>
68
- > = {
69
- created_at: { type: DataTypes.DATE, allowNull: false },
70
- updated_at: { type: DataTypes.DATE, allowNull: false },
71
- };
72
- return { ... this.attributes, ...dateAttributes };
73
- }
74
- public override getColumnOption(name: string)
75
- {
76
- let att = this.getModelAllAttributes();
77
- return att[name] as BaseSequelizeModelAttributeColumnOptions;
78
- }
79
- public override forEachColumn(handler: (name: string, column: BaseSequelizeModelAttributeColumnOptions) => void)
80
- {
81
- let att = this.getModelAllAttributes();
82
- let keys = Object.keys(att);
83
- for (let i = 0; i < keys.length; i++)
84
- handler(keys[i], this.getColumnOption(keys[i]));
85
- }
86
- public override getColumn(name: string): BaseMetaColumn
87
- {
88
- let option = this.getColumnOption(name);
89
- let table_name = this.getName();
90
- let table = new BaseMetaTable(null, table_name, table_name);
91
- let type = option.type as any;
92
- try
93
- {
94
- if (typeof (type) == "function")
95
- type = type();
96
- type = type + "";
97
- } catch (error)
98
- {
99
- type = "Enum";
100
- }
101
- let column = new BaseMetaColumn(table, name, name, type, option.allowNull != true);
102
- return column;
103
- }
104
- protected override getTypeSchema(option: BaseSequelizeModelAttributeColumnOptions): BaseTypeSchema
105
- {
106
- let required = !(option.allowNull ?? true);
107
- let type = option.type as any;
108
- try
109
- {
110
- if (typeof (type) == "function")
111
- type = type();
112
- } catch (error)
113
- {
114
- }
115
- let type_name = "";
116
- try
117
- {
118
- type_name = type + "";
119
- } catch (error)
120
- {
121
- type_name = "Enum";
122
- }
123
- let min: number | null = (option.validate?.min ?? null) as number | null;
124
- let max: number | null = (option.validate?.max ?? null) as number | null;
125
- /* VariableType */
126
- if (type instanceof DataTypes.BOOLEAN)
127
- return new BoolSchema(required);
128
- else if (type instanceof DataTypes.TINYINT)
129
- return new TinyIntSchema(required, min, max);
130
- else if (type instanceof DataTypes.SMALLINT)
131
- return new SmallIntSchema(required, min, max);
132
- else if (type instanceof DataTypes.MEDIUMINT)
133
- return new MediumIntSchema(required, min, max);
134
- else if (type instanceof DataTypes.INTEGER)
135
- return new IntegerSchema(required, min, max);
136
- else if (type instanceof DataTypes.BIGINT)
137
- return new BigIntSchema(required, min, max);
138
- else if (this.isFloat(type))
139
- return new FloatSchema(required, type.options.decimals, min, max);
140
- else if (this.isDouble(type))
141
- return new DoubleSchema(required, type.options.decimals, min, max);
142
- else if (this.isDecimal(type))
143
- return new DecimalSchema(required, type.options.scale, min, max);
144
- else if (this.isReal(type))
145
- return new RealSchema(required, type.options.decimals, min, max);
146
- else if (this.isChar(type))
147
- return new StringSchema(required, type.options.length ?? type._length, type.options.length ?? type._length);
148
- else if (this.isString(type))
149
- return new StringSchema(required, null, type.options.length ?? type._length);
150
- else if (type instanceof DataTypes.TEXT)
151
- return new StringSchema(required, null, null);
152
- else if (type instanceof DataTypes.DATE || type_name == "TIMESTAMP")
153
- return new DateTimeSchema(required);
154
- else if (type instanceof DataTypes.DATEONLY)
155
- return new DateSchema(required);
156
- else if (type instanceof DataTypes.TIME)
157
- return new TimeSchema(required);
158
- else if (this.isEnum(type))
159
- {
160
- let name = NamingConvention.lower_case_underscore.convert(this.model.name + "_" + option.field, NamingConvention.Pascal_Case);
161
- return new EnumSchema(name, required, type.options.values);
162
- }
163
- else if (type instanceof DataTypes.JSON)
164
- {
165
- let tags_type = option.tags?.type;
166
- if (tags_type)
167
- {
168
- if (tags_type == "BaseTypeSchema")
169
- return new TypeSchema(required);
170
- if (tags_type == "BaseVariableSchema")
171
- return new VariableSchema(required);
172
- if (tags_type == "BaseTypeSchema[]")
173
- return new ArraySchema(required, [new TypeSchema(required)]);
174
- if (tags_type == "BaseVariableSchema[]")
175
- return new ArraySchema(required, [new VariableSchema(required)]);
176
- }
177
- return new AnySchema(required);
178
- }
179
- throw new Error("Unsupported datatype for schema: " + option.type);
180
- }
181
- protected isFloat(type: any): type is { options: { length: number, decimals: number } }
182
- {
183
- return type instanceof DataTypes.FLOAT;
184
- }
185
- protected isDouble(type: any): type is { options: { length: number, decimals: number } }
186
- {
187
- return type instanceof DataTypes.DOUBLE;
188
- }
189
- protected isDecimal(type: any): type is { options: { precision: number, scale: number } }
190
- {
191
- return type instanceof DataTypes.DECIMAL;
192
- }
193
- protected isReal(type: any): type is { options: { length: number, decimals: number } }
194
- {
195
- return type instanceof DataTypes.REAL;
196
- }
197
- protected isChar(type: any): type is { _length: number, options: { length: number } }
198
- {
199
- return type instanceof DataTypes.CHAR;
200
- }
201
- protected isString(type: any): type is { _length: number, options: { length: number } }
202
- {
203
- return type instanceof DataTypes.STRING;
204
- }
205
- protected isEnum(type: any): type is { options: { values: string[] } }
206
- {
207
- return type instanceof DataTypes.ENUM;
208
- }
209
- define(modelName: string, attributes: BaseSequelizeModelAttributes<M, Attributes<M>>, options?: ModelOptions<M>): void
210
- {
211
- this.database.addTable(modelName, this);
212
- this.attributes = attributes;
213
- if (!options)
214
- options = {};
215
- if (options.name == undefined)
216
- options.name = {
217
- plural: modelName,
218
- singular: modelName
219
- };
220
- if (options.paranoid == undefined)
221
- options.paranoid = true;
222
- if (options.freezeTableName == undefined)
223
- options.freezeTableName = true;
224
- if (options.tableName == undefined)
225
- options.tableName = modelName;
226
- if (options.underscored == undefined)
227
- options.underscored = true;
228
- if (options.timestamps == undefined)
229
- options.timestamps = true;
230
- if (options.paranoid == undefined)
231
- options.paranoid = true;
232
- if (options.createdAt == undefined)
233
- options.createdAt = 'created_at';
234
- if (options.updatedAt == undefined)
235
- options.updatedAt = 'updated_at';
236
- if (options.deletedAt == undefined)
237
- options.deletedAt = 'deleted_at';
238
-
239
- this.model = this.database.sequelize.define(modelName, attributes, options);
240
- }
241
- public addForeignKey(primary: BaseSequelizeTable<BaseSequelizeDatabase, BaseSequelizeModel>, name: string, allowNull?: boolean)
242
- {
243
- let schema = this.getSchema(true);
244
- let field = schema.fields?.find(x => x.name == name);
245
- if (field == null)
246
- throw new Error(`Column ${name} could not be found for relation between tables ${primary.getName()} and ${this.getName()}`);
247
-
248
- primary.model.hasMany(this.model, { foreignKey: { name, allowNull }, sourceKey: "id" });
249
- this.model.belongsTo(primary.model, { foreignKey: { name, allowNull }, targetKey: "id" });
250
- }
251
- async _getOrNull(options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<M | null>
252
- {
253
- options.transaction = trx;
254
- return await this.model.findOne<M>(options);
255
- }
256
- async _get(options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<M>
257
- {
258
- let value = await this._getOrNull(options, trx);
259
- if (value != null)
260
- return value;
261
- throw this.getNotFoundError(options.where);
262
- }
263
- async _list(where: WhereOptions<Attributes<M>>, pagination: { dont: true } | { page: number, size: number }, sorts: { dont: true } | SortItem[], options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<{ rows: M[], count: number }>
264
- {
265
- if (!('dont' in pagination))
266
- {
267
- let p = this.database.paginate(pagination.page, pagination.size);
268
- options.offset = p.offset;
269
- options.limit = p.limit;
270
- }
271
- if (!('dont' in sorts))
272
- options.order = this.database.getSortOptions(sorts);
273
- return await this.model.findAndCountAll({ ...options, where, distinct: true, subQuery: false, transaction: trx });
274
- }
1
+ import { BaseMetaColumn, BaseMetaTable, BaseUUID, NamingConvention, SortItem } from "namirasoft-core";
2
+ import { BaseTable } from "namirasoft-node";
3
+ import { AnySchema, ArraySchema, BaseTypeSchema, BigIntSchema, BoolSchema, DateSchema, DateTimeSchema, DecimalSchema, DoubleSchema, EnumSchema, FloatSchema, IntegerSchema, MediumIntSchema, RealSchema, SmallIntSchema, StringSchema, TimeSchema, TinyIntSchema, TypeSchema, VariableSchema } from "namirasoft-schema";
4
+ import { Attributes, DataTypes, FindOptions, ModelCtor, ModelOptions, Transaction, WhereOptions } from "sequelize";
5
+ import { BaseSequelizeDatabase } from "./BaseSequelizeDatabase";
6
+ import { BaseSequelizeModel } from "./BaseSequelizeModel";
7
+ import { BaseSequelizeModelAttributeColumnOptions } from "./BaseSequelizeModelAttributeColumnOptions";
8
+ import { BaseSequelizeModelAttributes } from "./BaseSequelizeModelAttributes";
9
+
10
+ export abstract class BaseSequelizeTable<D extends BaseSequelizeDatabase, M extends BaseSequelizeModel> extends BaseTable<D, BaseSequelizeModelAttributeColumnOptions>
11
+ {
12
+ model!: ModelCtor<M>;
13
+ attributes!: BaseSequelizeModelAttributes<M, Attributes<M>>;
14
+ constructor(database: D)
15
+ {
16
+ super(database);
17
+ }
18
+ override getName(): string
19
+ {
20
+ return this.model.name;
21
+ }
22
+ protected override getExamples()
23
+ {
24
+ let ans: { [name: string]: string } = super.getExamples();
25
+ let add = (name: string, uuid: BaseUUID) =>
26
+ {
27
+ if (uuid.short)
28
+ ans[name] = uuid.new();
29
+ };
30
+ this.forEachColumn((name, column) =>
31
+ {
32
+ if (this.isChar(column.type))
33
+ {
34
+ if (name == "id")
35
+ add(name, this.uuid);
36
+ else if (name.endsWith("_id"))
37
+ {
38
+ try
39
+ {
40
+ let t = this.database.getTable(name.replace(/_id$/gm, "")) as BaseTable<D, any>;
41
+ add(name, t.uuid);
42
+ } catch (error)
43
+ {
44
+
45
+ }
46
+ }
47
+ }
48
+ });
49
+ return ans;
50
+ }
51
+ override getSecureColumns(): string[]
52
+ {
53
+ let columns = super.getSecureColumns();
54
+ return ["deletedAt", "deleted_at", ...columns]
55
+ }
56
+ override getReadOnlyColumns(): string[]
57
+ {
58
+ let columns = super.getReadOnlyColumns();
59
+ return ["id", "created_at", "updated_at", "createdAt", "updatedAt", ...columns];
60
+ }
61
+ private getModelAllAttributes()
62
+ {
63
+ let dateAttributes: BaseSequelizeModelAttributes<
64
+ any,
65
+ Attributes<any>
66
+ > = {
67
+ created_at: { type: DataTypes.DATE, allowNull: false },
68
+ updated_at: { type: DataTypes.DATE, allowNull: false },
69
+ };
70
+ return { ... this.attributes, ...dateAttributes };
71
+ }
72
+ public override getColumnOption(name: string)
73
+ {
74
+ let att = this.getModelAllAttributes();
75
+ return att[name] as BaseSequelizeModelAttributeColumnOptions;
76
+ }
77
+ public override forEachColumn(handler: (name: string, column: BaseSequelizeModelAttributeColumnOptions) => void)
78
+ {
79
+ let att = this.getModelAllAttributes();
80
+ let keys = Object.keys(att);
81
+ for (let i = 0; i < keys.length; i++)
82
+ handler(keys[i], this.getColumnOption(keys[i]));
83
+ }
84
+ public override getColumn(name: string): BaseMetaColumn
85
+ {
86
+ let option = this.getColumnOption(name);
87
+ let table_name = this.getName();
88
+ let table = new BaseMetaTable(null, table_name, table_name);
89
+ let type = option.type as any;
90
+ try
91
+ {
92
+ if (typeof (type) == "function")
93
+ type = type();
94
+ type = type + "";
95
+ } catch (error)
96
+ {
97
+ type = "Enum";
98
+ }
99
+ let column = new BaseMetaColumn(table, name, name, type, option.allowNull != true);
100
+ return column;
101
+ }
102
+ protected override getTypeSchema(name: string, option: BaseSequelizeModelAttributeColumnOptions): BaseTypeSchema
103
+ {
104
+ let required = !(option.allowNull ?? true);
105
+ let type = option.type as any;
106
+ try
107
+ {
108
+ if (typeof (type) == "function")
109
+ type = type();
110
+ } catch (error)
111
+ {
112
+ }
113
+ let type_name = "";
114
+ try
115
+ {
116
+ type_name = type + "";
117
+ } catch (error)
118
+ {
119
+ type_name = "Enum";
120
+ }
121
+ let min: number | null = (option.validate?.min ?? null) as number | null;
122
+ let max: number | null = (option.validate?.max ?? null) as number | null;
123
+ /* VariableType */
124
+ if (type instanceof DataTypes.BOOLEAN)
125
+ return new BoolSchema(required);
126
+ else if (type instanceof DataTypes.TINYINT)
127
+ return new TinyIntSchema(required, min, max);
128
+ else if (type instanceof DataTypes.SMALLINT)
129
+ return new SmallIntSchema(required, min, max);
130
+ else if (type instanceof DataTypes.MEDIUMINT)
131
+ return new MediumIntSchema(required, min, max);
132
+ else if (type instanceof DataTypes.INTEGER)
133
+ return new IntegerSchema(required, min, max);
134
+ else if (type instanceof DataTypes.BIGINT)
135
+ return new BigIntSchema(required, min, max);
136
+ else if (this.isFloat(type))
137
+ return new FloatSchema(required, type.options.decimals, min, max);
138
+ else if (this.isDouble(type))
139
+ return new DoubleSchema(required, type.options.decimals, min, max);
140
+ else if (this.isDecimal(type))
141
+ return new DecimalSchema(required, type.options.scale, min, max);
142
+ else if (this.isReal(type))
143
+ return new RealSchema(required, type.options.decimals, min, max);
144
+ else if (this.isChar(type))
145
+ return new StringSchema(required, type.options.length ?? type._length, type.options.length ?? type._length);
146
+ else if (this.isString(type))
147
+ return new StringSchema(required, null, type.options.length ?? type._length);
148
+ else if (type instanceof DataTypes.TEXT)
149
+ return new StringSchema(required, null, null);
150
+ else if (type instanceof DataTypes.DATE || type_name == "TIMESTAMP")
151
+ return new DateTimeSchema(required);
152
+ else if (type instanceof DataTypes.DATEONLY)
153
+ return new DateSchema(required);
154
+ else if (type instanceof DataTypes.TIME)
155
+ return new TimeSchema(required);
156
+ else if (this.isEnum(type))
157
+ {
158
+ let _name = NamingConvention.lower_case_underscore.convert(this.model.name + "_" + option.field, NamingConvention.Pascal_Case);
159
+ return new EnumSchema(_name, required, type.options.values);
160
+ }
161
+ else if (type instanceof DataTypes.JSON)
162
+ {
163
+ let tags_type = option.tags?.type;
164
+ if (tags_type)
165
+ {
166
+ if (tags_type == "BaseTypeSchema")
167
+ return new TypeSchema(required);
168
+ if (tags_type == "BaseVariableSchema")
169
+ return new VariableSchema(required);
170
+ if (tags_type == "BaseTypeSchema[]")
171
+ return new ArraySchema(required, [new TypeSchema(required)]);
172
+ if (tags_type == "BaseVariableSchema[]")
173
+ return new ArraySchema(required, [new VariableSchema(required)]);
174
+ }
175
+ return new AnySchema(required);
176
+ }
177
+ throw new Error(`Unsupported datatype for name: '${name}' schema: '${option.type}'`);
178
+ }
179
+ protected isFloat(type: any): type is { options: { length: number, decimals: number } }
180
+ {
181
+ return type instanceof DataTypes.FLOAT;
182
+ }
183
+ protected isDouble(type: any): type is { options: { length: number, decimals: number } }
184
+ {
185
+ return type instanceof DataTypes.DOUBLE;
186
+ }
187
+ protected isDecimal(type: any): type is { options: { precision: number, scale: number } }
188
+ {
189
+ return type instanceof DataTypes.DECIMAL;
190
+ }
191
+ protected isReal(type: any): type is { options: { length: number, decimals: number } }
192
+ {
193
+ return type instanceof DataTypes.REAL;
194
+ }
195
+ protected isChar(type: any): type is { _length: number, options: { length: number } }
196
+ {
197
+ return type instanceof DataTypes.CHAR;
198
+ }
199
+ protected isString(type: any): type is { _length: number, options: { length: number } }
200
+ {
201
+ return type instanceof DataTypes.STRING;
202
+ }
203
+ protected isEnum(type: any): type is { options: { values: string[] } }
204
+ {
205
+ return type instanceof DataTypes.ENUM;
206
+ }
207
+ define(modelName: string, attributes: BaseSequelizeModelAttributes<M, Attributes<M>>, options?: ModelOptions<M>): void
208
+ {
209
+ this.database.addTable(modelName, this);
210
+ this.attributes = attributes;
211
+ if (!options)
212
+ options = {};
213
+ if (options.name == undefined)
214
+ options.name = {
215
+ plural: modelName,
216
+ singular: modelName
217
+ };
218
+ if (options.paranoid == undefined)
219
+ options.paranoid = true;
220
+ if (options.freezeTableName == undefined)
221
+ options.freezeTableName = true;
222
+ if (options.tableName == undefined)
223
+ options.tableName = modelName;
224
+ if (options.underscored == undefined)
225
+ options.underscored = true;
226
+ if (options.timestamps == undefined)
227
+ options.timestamps = true;
228
+ if (options.paranoid == undefined)
229
+ options.paranoid = true;
230
+ if (options.createdAt == undefined)
231
+ options.createdAt = 'created_at';
232
+ if (options.updatedAt == undefined)
233
+ options.updatedAt = 'updated_at';
234
+ if (options.deletedAt == undefined)
235
+ options.deletedAt = 'deleted_at';
236
+
237
+ this.model = this.database.sequelize.define(modelName, attributes, options);
238
+ }
239
+ public addForeignKey(primary: BaseSequelizeTable<BaseSequelizeDatabase, BaseSequelizeModel>, name: string, allowNull?: boolean)
240
+ {
241
+ let schema = this.getSchema(true);
242
+ let field = schema.fields?.find(x => x.name == name);
243
+ if (field == null)
244
+ throw new Error(`Column ${name} could not be found for relation between tables ${primary.getName()} and ${this.getName()}`);
245
+
246
+ primary.model.hasMany(this.model, { foreignKey: { name, allowNull }, sourceKey: "id" });
247
+ this.model.belongsTo(primary.model, { foreignKey: { name, allowNull }, targetKey: "id" });
248
+ }
249
+ async _getOrNull(options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<M | null>
250
+ {
251
+ options.transaction = trx;
252
+ return await this.model.findOne<M>(options);
253
+ }
254
+ async _get(options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<M>
255
+ {
256
+ let value = await this._getOrNull(options, trx);
257
+ if (value != null)
258
+ return value;
259
+ throw this.getNotFoundError(options.where);
260
+ }
261
+ async _list(where: WhereOptions<Attributes<M>>, pagination: { dont: true } | { page: number, size: number }, sorts: { dont: true } | SortItem[], options: FindOptions<Attributes<M>>, trx: Transaction | null): Promise<{ rows: M[], count: number }>
262
+ {
263
+ if (!('dont' in pagination))
264
+ {
265
+ let p = this.database.paginate(pagination.page, pagination.size);
266
+ options.offset = p.offset;
267
+ options.limit = p.limit;
268
+ }
269
+ if (!('dont' in sorts))
270
+ options.order = this.database.getSortOptions(sorts);
271
+ return await this.model.findAndCountAll({ ...options, where, distinct: true, subQuery: false, transaction: trx });
272
+ }
275
273
  }
@@ -1,13 +1,13 @@
1
- import { BaseSequelizeDatabase } from "./BaseSequelizeDatabase";
2
-
3
- export abstract class BaseSnowFlakeDatabase extends BaseSequelizeDatabase
4
- {
5
- constructor(host: string, port: number, name: string, user: string, pass: string, logging: boolean = false)
6
- {
7
- super('snowflake', host, port, name, user, pass, logging);
8
- }
9
- override getType()
10
- {
11
- return "SnowFlake";
12
- }
1
+ import { BaseSequelizeDatabase } from "./BaseSequelizeDatabase";
2
+
3
+ export abstract class BaseSnowFlakeDatabase extends BaseSequelizeDatabase
4
+ {
5
+ constructor(host: string, port: number, name: string, user: string, pass: string, logging: boolean = false)
6
+ {
7
+ super('snowflake', host, port, name, user, pass, logging);
8
+ }
9
+ override getType()
10
+ {
11
+ return "SnowFlake";
12
+ }
13
13
  }
package/src/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- export * from "./BaseDB2Database";
2
- export * from "./BaseFilterItemBuilderSequelize";
3
- export * from "./BaseMariaDBDatabase";
4
- export * from "./BaseMSSQLDatabase";
5
- export * from "./BaseMySqlDatabase";
6
- export * from "./BaseOracleDatabase";
7
- export * from "./BasePostgreSQLDatabase";
8
- export * from "./BaseSequelizeDatabase";
9
- export * from "./BaseSequelizeModel";
10
- export * from "./BaseSequelizeModelAttributeColumnOptions";
11
- export * from "./BaseSequelizeModelAttributes";
12
- export * from "./BaseSequelizeTable";
13
- export * from "./BaseSnowFlakeDatabase";
1
+ export * from "./BaseDB2Database";
2
+ export * from "./BaseFilterItemBuilderSequelize";
3
+ export * from "./BaseMariaDBDatabase";
4
+ export * from "./BaseMSSQLDatabase";
5
+ export * from "./BaseMySqlDatabase";
6
+ export * from "./BaseOracleDatabase";
7
+ export * from "./BasePostgreSQLDatabase";
8
+ export * from "./BaseSequelizeDatabase";
9
+ export * from "./BaseSequelizeModel";
10
+ export * from "./BaseSequelizeModelAttributeColumnOptions";
11
+ export * from "./BaseSequelizeModelAttributes";
12
+ export * from "./BaseSequelizeTable";
13
+ export * from "./BaseSnowFlakeDatabase";
14
14
  export * from "./BaseSQLiteDatabase";