mssql-change-tracking
Version:
MS SQL server change tracking functions
34 lines (33 loc) • 1.48 kB
TypeScript
import sql from "mssql";
interface MinValidVersionByTableName {
pool: sql.ConnectionPool;
dbName?: string;
schema?: string;
tableName: string;
tableId?: never;
}
interface MinValidVersionByTableId {
pool: sql.ConnectionPool;
tableId: string;
dbName?: string;
schema?: never;
tableName?: never;
}
declare type CtMinValidVersion = MinValidVersionByTableName | MinValidVersionByTableId;
/**
* @note this function accept table name or table ID
* @description This function is used to obtain the minimum valid version that a client can have and still obtain valid results from CHANGETABLE(). The client should check the last synchronization version against the value that is returned by this function. If the last synchronization version is less than the version returned by this function, the client will be unable to obtain valid results from CHANGETABLE() and will have to reinitialize.
*/
export declare function ctMinValidVersion(input: CtMinValidVersion): Promise<string | null>;
declare type TableNameQueryInput = {
schema?: string;
dbName?: string;
tableName: string;
};
export declare function ctMinValidVersionByTableNameQuery({ tableName, dbName, schema, }: TableNameQueryInput): string;
declare type TableIdQueryInput = {
tableId: string;
dbName?: string;
};
export declare function ctMinValidVersionByTableIdQuery({ dbName, tableId, }: TableIdQueryInput): string;
export {};