@cheetah.js/orm
Version:
A simple ORM for Cheetah.js
50 lines (49 loc) • 3.19 kB
TypeScript
import { ColDiff, ConnectionSettings, DriverInterface, ForeignKeyInfo, SnapshotConstraintInfo, SnapshotIndexInfo, SnapshotTable, Statement } from './driver.interface';
import { BunDriverBase } from './bun-driver.base';
export declare class BunMysqlDriver extends BunDriverBase implements DriverInterface {
readonly dbType: "mysql";
constructor(options: ConnectionSettings);
protected getProtocol(): string;
protected getIdentifierQuote(): string;
protected buildAutoIncrementType(colDiff: ColDiff): string;
protected buildEnumType(schema: string | undefined, tableName: string, colDiff: ColDiff): {
beforeSql: string;
columnType: string;
};
protected appendReturningClause(sql: string, statement: Statement<any>): string;
protected handleInsertReturn(statement: Statement<any>, result: any, sql: string, startTime: number): Promise<{
query: any;
startTime: number;
sql: string;
}>;
protected buildLimitAndOffsetClause(statement: Statement<any>): string;
getCreateTableInstruction(schema: string | undefined, tableName: string, creates: ColDiff[]): string;
getAlterTableFkInstruction(schema: string | undefined, tableName: string, colDiff: ColDiff, fk: ForeignKeyInfo): string;
getCreateIndex(index: {
name: string;
properties: string[];
}, schema: string | undefined, tableName: string): string;
getAddColumn(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff, colDiffInstructions: string[]): void;
getDropColumn(colDiffInstructions: string[], schema: string | undefined, tableName: string, colName: string): void;
getDropIndex(index: {
name: string;
properties?: string[];
}, schema: string | undefined, tableName: string): string;
getAlterTableType(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff): string;
getAlterTableDefaultInstruction(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff): string;
getAlterTablePrimaryKeyInstruction(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff): string;
getDropConstraint(param: {
name: string;
}, schema: string | undefined, tableName: string): string;
getAddUniqueConstraint(schema: string | undefined, tableName: string, colName: string): string;
getAlterTableDropNullInstruction(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff): string;
getAlterTableDropNotNullInstruction(schema: string | undefined, tableName: string, colName: string, colDiff: ColDiff): string;
getAlterTableEnumInstruction(schema: string, tableName: string, colName: string, colDiff: ColDiff): string;
getDropTypeEnumInstruction(param: {
name: string;
}, schema: string | undefined, tableName: string): string;
snapshot(tableName: string, options: any): Promise<SnapshotTable | undefined>;
private parseEnumValues;
index(tableName: string, options: any): Promise<SnapshotIndexInfo[] | undefined>;
constraints(tableName: string, options: any): Promise<SnapshotConstraintInfo[] | undefined>;
}