wip: add db classes; can't load SQLite driver.
This commit is contained in:
parent
36f7b82806
commit
fdae502ec7
14 changed files with 3443 additions and 33 deletions
15
apps/vdb-backend/src/config/dbconfig.ts
Normal file
15
apps/vdb-backend/src/config/dbconfig.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "reflect-metadata"
|
||||
import { DataSource } from "typeorm"
|
||||
import {Lemma, WordForm, Media, Example, Definition, Comment, PartOfSpeech, Lect} from "../db/dbmodel.js"
|
||||
|
||||
const persistent_path = process.env.VI_DB_PERSISTENT_PATH || "./res";
|
||||
|
||||
export const appDataSource = new DataSource({
|
||||
type: "sqlite",
|
||||
database:`${persistent_path}/dev.sqlite`,
|
||||
synchronize: true,
|
||||
logging: false,
|
||||
entities: [Lemma, WordForm, Example, Media, Definition, Comment, PartOfSpeech, Lect],
|
||||
migrations: [],
|
||||
subscribers: [],
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue