ionic-orm-2
Version:
Data-mapper ORM for Ionic WebSQL and SQLite
19 lines • 757 B
JavaScript
import { getMetadataArgsStorage } from "../../../index";
/**
* This decorator is used to mark classes that will be a tables. Database schema will be created for all classes
* decorated with it, and Repository can be retrieved and used for it.
*/
export function Table(name, options) {
return function (target) {
const args = {
target: target,
name: name,
type: "regular",
orderBy: options && options.orderBy ? options.orderBy : undefined,
engine: options && options.engine ? options.engine : undefined,
skipSchemaSync: !!(options && options.skipSchemaSync === true)
};
getMetadataArgsStorage().tables.add(args);
};
}
//# sourceMappingURL=Table.js.map