ts-db-helper
Version:
Simple ORM based on TypeScript
44 lines (43 loc) • 2.01 kB
TypeScript
import { IDbLogger } from './interfaces/db-logger';
import { QueryConnector } from './interfaces/query-connector.interface';
import { ModelMigration } from './interfaces/model-migration.interface';
/**
* @class DbHelperModuleConfig is a config model for the module.
*
* @author Olivier Margarit
* @since 0.1
*/
export declare class DbHelperModuleConfig {
/**
* @property version, the model version
*/
version: string;
/**
* @property autoIncrementVersion, flag to auto increment version with the number of
* model declared, this is a trick for developpement issues due to compilator import
* optimisation. Your model, even if it is define will not be imported in the project
* until it is used.
* To prevent misunderstanding of what is happening this option aim to automatically
* call model migration on model use and mange new table creation without manually
* increment the model version.
*/
autoIncrementVersion: boolean;
/**
* @property queryConnector, the connector which the module delegate rdb queries with
* sqlite standards and more.
* You can use your own or use a predefine one of the module that allow you to use
* cordova-sqlite-storage or websql or both depending on the javascript engine support.
* See {@link MixedCordovaSqliteWebsqlConnector}, {@link CordovaSqliteConnector} or
* {@link WebsqlConnector} for requirement and usage.
*/
queryConnector: QueryConnector;
/**
* @property modelMigration, is a callback for model migration and creation. Module
* connectors have their own logic and it could be overrided from the connector config.
* By default you can use module connectors as model migration managers.
* See {@link MixedCordovaSqliteWebsqlConnector}, {@link CordovaSqliteConnector} or
* {@link WebsqlConnector} for usage.
*/
modelMigration: ModelMigration;
logger?: IDbLogger;
}