lakutata
Version:
An IoC-based universal application framework.
112 lines (105 loc) • 4.49 kB
TypeScript
import { IndexOptions, UniqueOptions } from './TypeDef.internal.68.js';
import './TypeDef.internal.30.js';
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(name: string, options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(name: string, options: {
synchronize: false;
}): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(name: string, fields: string[], options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(fields: string[], options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(fields: (object?: any) => any[] | {
[key: string]: number;
}, options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database index.
* Can be used on entity property or on entity.
* Can create indices with composite columns when used on entity.
*/
declare function Index(name: string, fields: (object?: any) => any[] | {
[key: string]: number;
}, options?: IndexOptions): ClassDecorator & PropertyDecorator;
/**
* Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.
*/
declare function Unique(name: string, fields: string[], options?: UniqueOptions): ClassDecorator & PropertyDecorator;
/**
* Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.
*/
declare function Unique(fields: string[], options?: UniqueOptions): ClassDecorator & PropertyDecorator;
/**
* Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.
*/
declare function Unique(fields: (object?: any) => any[] | {
[key: string]: number;
}, options?: UniqueOptions): ClassDecorator & PropertyDecorator;
/**
* Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.
*/
declare function Unique(name: string, fields: (object?: any) => any[] | {
[key: string]: number;
}, options?: UniqueOptions): ClassDecorator & PropertyDecorator;
/**
* Creates a database check.
* Can be used on entity property or on entity.
* Can create checks with composite columns when used on entity.
*/
declare function Check(expression: string): ClassDecorator & PropertyDecorator;
/**
* Creates a database check.
* Can be used on entity property or on entity.
* Can create checks with composite columns when used on entity.
*/
declare function Check(name: string, expression: string): ClassDecorator & PropertyDecorator;
/**
* Creates a database exclusion.
* Can be used on entity.
* Can create exclusions with composite columns when used on entity.
*/
declare function Exclusion(expression: string): ClassDecorator & PropertyDecorator;
/**
* Creates a database exclusion.
* Can be used on entity.
* Can create exclusions with composite columns when used on entity.
*/
declare function Exclusion(name: string, expression: string): ClassDecorator & PropertyDecorator;
/**
* Marks a column to generate a value on entity insertion.
* There are three types of generation strategy - increment, uuid and rowid (cockroachdb only).
* Increment uses a number which increases by one on each insertion.
* Uuid generates a special UUID token.
* Rowid supports only in CockroachDB and uses `unique_rowid()` function
*
* Note, some databases do not support non-primary generation columns.
*/
declare function Generated(strategy?: "increment" | "uuid" | "rowid"): PropertyDecorator;
export { Check, Exclusion, Generated, Index, Unique };