eduproj/compile-database/db.ts

14 lines
288 B
TypeScript

import { Sequelize, Model, DataTypes } from "sequelize";
class Page extends Model {}
export async function init(path: string) {
let sequelize = new Sequelize(`sqlite:${path}`);
Page.init({
}, { sequelize, modelName: "page" });
await sequelize.sync();
return sequelize;
}