tspace-mysql
Version:
Tspace MySQL is a promise-based ORM for Node.js, designed with modern TypeScript and providing type safety for schema databases.
31 lines (26 loc) • 589 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Model = (model, npm, schema) => {
return `import { Model , Blueprint , type T } from '${npm}'
const schema = ${schema}
type TS = T.Schema<typeof schema>
type TR = T.Relation<{
// ... name your relationship
}>
class ${model} extends Model<TS,TR> {
constructor(){
super()
/**
*
* @Schema table
*
*/
this.useSchema(schema)
}
}
export { ${model} }
export default ${model}
`;
};
exports.default = Model;
//# sourceMappingURL=model.js.map