meta: add infos about better-sqlite3 and typeorm config

This commit is contained in:
Xymorot 2020-11-09 20:30:28 +01:00
parent 8551c1ea6a
commit 588486f4da
3 changed files with 7 additions and 3 deletions

View File

@ -112,7 +112,7 @@ This project uses [Husky](https://github.com/typicode/husky) to define git hooks
### Database
The application uses [SQLite3](https://www.npmjs.com/package/sqlite3) as a database, with [TypeORM](https://typeorm.io) as an object-relation mapper.
The application uses [SQLite3](https://www.npmjs.com/package/better-sqlite3) as a database, with [TypeORM](https://typeorm.io) as an object-relation mapper.
#### Database Migrations

View File

@ -1,7 +1,8 @@
# this file is only meant to generate migrations via the cli
# keep it up to date with src/main/core/database.ts
library:
type: sqlite
type: better-sqlite3
database: ./test-paths/typeorm/library.db
cache: true
entities:
@ -12,7 +13,7 @@ library:
migrationsDir: ./src/main/migrations/library
store:
type: sqlite
type: better-sqlite3
database: ./test-paths/typeorm/store.db
cache: true
entities:

View File

@ -12,6 +12,9 @@ type MyConnectionOptions = { [key in Database]: BetterSqlite3ConnectionOptions }
const databaseDir = path.resolve(appPath, 'database');
/**
* @see ormconfig.yml in the root folder
*/
function getConnectionOptionsFor(database: Database): BetterSqlite3ConnectionOptions {
return {
name: database,