@nocobase/database
Advanced tools
Comparing version 0.7.0-alpha.23 to 0.7.0-alpha.24
@@ -19,2 +19,3 @@ import { ArrayFieldOptions } from './array-field'; | ||
import { UidFieldOptions } from './uid-field'; | ||
import { UUIDFieldOptions } from './uuid-field'; | ||
import { VirtualFieldOptions } from './virtual-field'; | ||
@@ -40,3 +41,4 @@ export * from './array-field'; | ||
export * from './uid-field'; | ||
export * from './uuid-field'; | ||
export * from './virtual-field'; | ||
export declare type FieldOptions = BaseFieldOptions | StringFieldOptions | IntegerFieldOptions | FloatFieldOptions | DecimalFieldOptions | DoubleFieldOptions | RealFieldOptions | JsonFieldOptions | JsonbFieldOptions | BooleanFieldOptions | RadioFieldOptions | SortFieldOptions | TextFieldOptions | VirtualFieldOptions | ArrayFieldOptions | TimeFieldOptions | DateFieldOptions | UidFieldOptions | PasswordFieldOptions | ContextFieldOptions | BelongsToFieldOptions | HasOneFieldOptions | HasManyFieldOptions | BelongsToManyFieldOptions; | ||
export declare type FieldOptions = BaseFieldOptions | StringFieldOptions | IntegerFieldOptions | FloatFieldOptions | DecimalFieldOptions | DoubleFieldOptions | RealFieldOptions | JsonFieldOptions | JsonbFieldOptions | BooleanFieldOptions | RadioFieldOptions | SortFieldOptions | TextFieldOptions | VirtualFieldOptions | ArrayFieldOptions | TimeFieldOptions | DateFieldOptions | UidFieldOptions | UUIDFieldOptions | PasswordFieldOptions | ContextFieldOptions | BelongsToFieldOptions | HasOneFieldOptions | HasManyFieldOptions | BelongsToManyFieldOptions; |
@@ -20,3 +20,4 @@ export * from './array-field'; | ||
export * from './uid-field'; | ||
export * from './uuid-field'; | ||
export * from './virtual-field'; | ||
//# sourceMappingURL=index.js.map |
@@ -19,2 +19,3 @@ import { ArrayFieldOptions } from './array-field'; | ||
import { UidFieldOptions } from './uid-field'; | ||
import { UUIDFieldOptions } from './uuid-field'; | ||
import { VirtualFieldOptions } from './virtual-field'; | ||
@@ -40,3 +41,4 @@ export * from './array-field'; | ||
export * from './uid-field'; | ||
export * from './uuid-field'; | ||
export * from './virtual-field'; | ||
export declare type FieldOptions = BaseFieldOptions | StringFieldOptions | IntegerFieldOptions | FloatFieldOptions | DecimalFieldOptions | DoubleFieldOptions | RealFieldOptions | JsonFieldOptions | JsonbFieldOptions | BooleanFieldOptions | RadioFieldOptions | SortFieldOptions | TextFieldOptions | VirtualFieldOptions | ArrayFieldOptions | TimeFieldOptions | DateFieldOptions | UidFieldOptions | PasswordFieldOptions | ContextFieldOptions | BelongsToFieldOptions | HasOneFieldOptions | HasManyFieldOptions | BelongsToManyFieldOptions; | ||
export declare type FieldOptions = BaseFieldOptions | StringFieldOptions | IntegerFieldOptions | FloatFieldOptions | DecimalFieldOptions | DoubleFieldOptions | RealFieldOptions | JsonFieldOptions | JsonbFieldOptions | BooleanFieldOptions | RadioFieldOptions | SortFieldOptions | TextFieldOptions | VirtualFieldOptions | ArrayFieldOptions | TimeFieldOptions | DateFieldOptions | UidFieldOptions | UUIDFieldOptions | PasswordFieldOptions | ContextFieldOptions | BelongsToFieldOptions | HasOneFieldOptions | HasManyFieldOptions | BelongsToManyFieldOptions; |
@@ -32,3 +32,4 @@ "use strict"; | ||
__exportStar(require("./uid-field"), exports); | ||
__exportStar(require("./uuid-field"), exports); | ||
__exportStar(require("./virtual-field"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@nocobase/database", | ||
"version": "0.7.0-alpha.23", | ||
"version": "0.7.0-alpha.24", | ||
"description": "", | ||
@@ -20,3 +20,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@nocobase/utils": "0.7.0-alpha.23", | ||
"@nocobase/utils": "0.7.0-alpha.24", | ||
"async-mutex": "^0.3.2", | ||
@@ -33,3 +33,3 @@ "deepmerge": "^4.2.2", | ||
}, | ||
"gitHead": "32ce4ea85201140eeb78f33f443038dfffb02083" | ||
"gitHead": "1fb2dd884c4f2d2167f5dde40a15012a752e53ab" | ||
} |
@@ -5,3 +5,12 @@ import { applyMixins, AsyncEmitter } from '@nocobase/utils'; | ||
import lodash from 'lodash'; | ||
import { ModelCtor, Op, Options, QueryInterfaceDropAllTablesOptions, Sequelize, SyncOptions, Utils } from 'sequelize'; | ||
import { | ||
ModelCtor, | ||
Op, | ||
Options, | ||
QueryInterfaceDropAllTablesOptions, | ||
QueryOptions, | ||
Sequelize, | ||
SyncOptions, | ||
Utils | ||
} from 'sequelize'; | ||
import { Collection, CollectionOptions, RepositoryType } from './collection'; | ||
@@ -252,2 +261,25 @@ import { ImporterReader, ImportFileExtension } from './collection-importer'; | ||
async auth(options: QueryOptions & { repeat?: number } = {}) { | ||
const { repeat = 10, ...others } = options; | ||
const delay = (ms) => new Promise((yea) => setTimeout(yea, ms)); | ||
let count = 0; | ||
const authenticate = async () => { | ||
try { | ||
await this.sequelize.authenticate(others); | ||
console.log('Connection has been established successfully.'); | ||
return true; | ||
} catch (error) { | ||
console.log('reconnecting...', count); | ||
if (count >= repeat) { | ||
throw error; | ||
} | ||
++count; | ||
await delay(500); | ||
return await authenticate(); | ||
} | ||
}; | ||
return await authenticate(); | ||
} | ||
async reconnect() { | ||
@@ -254,0 +286,0 @@ if (this.isSqliteMemory()) { |
@@ -25,2 +25,3 @@ import { ArrayFieldOptions } from './array-field'; | ||
import { UidFieldOptions } from './uid-field'; | ||
import { UUIDFieldOptions } from './uuid-field'; | ||
import { VirtualFieldOptions } from './virtual-field'; | ||
@@ -47,2 +48,3 @@ | ||
export * from './uid-field'; | ||
export * from './uuid-field'; | ||
export * from './virtual-field'; | ||
@@ -69,2 +71,3 @@ | ||
| UidFieldOptions | ||
| UUIDFieldOptions | ||
| PasswordFieldOptions | ||
@@ -71,0 +74,0 @@ | ContextFieldOptions |
@@ -30,3 +30,3 @@ import lodash from 'lodash'; | ||
for (const arg of hookArgs) { | ||
if (arg instanceof Model) { | ||
if (arg?._previousDataValues) { | ||
return (<Model>arg).constructor.name; | ||
@@ -33,0 +33,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1246769
431
20462
+ Added@nocobase/utils@0.7.0-alpha.24(transitive)
- Removed@nocobase/utils@0.7.0-alpha.23(transitive)