meta: add infos about better-sqlite3 and typeorm config
This commit is contained in:
parent
8551c1ea6a
commit
588486f4da
|
@ -112,7 +112,7 @@ This project uses [Husky](https://github.com/typicode/husky) to define git hooks
|
||||||
|
|
||||||
### Database
|
### 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
|
#### Database Migrations
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# this file is only meant to generate migrations via the cli
|
# this file is only meant to generate migrations via the cli
|
||||||
|
# keep it up to date with src/main/core/database.ts
|
||||||
|
|
||||||
library:
|
library:
|
||||||
type: sqlite
|
type: better-sqlite3
|
||||||
database: ./test-paths/typeorm/library.db
|
database: ./test-paths/typeorm/library.db
|
||||||
cache: true
|
cache: true
|
||||||
entities:
|
entities:
|
||||||
|
@ -12,7 +13,7 @@ library:
|
||||||
migrationsDir: ./src/main/migrations/library
|
migrationsDir: ./src/main/migrations/library
|
||||||
|
|
||||||
store:
|
store:
|
||||||
type: sqlite
|
type: better-sqlite3
|
||||||
database: ./test-paths/typeorm/store.db
|
database: ./test-paths/typeorm/store.db
|
||||||
cache: true
|
cache: true
|
||||||
entities:
|
entities:
|
||||||
|
|
|
@ -12,6 +12,9 @@ type MyConnectionOptions = { [key in Database]: BetterSqlite3ConnectionOptions }
|
||||||
|
|
||||||
const databaseDir = path.resolve(appPath, 'database');
|
const databaseDir = path.resolve(appPath, 'database');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ormconfig.yml in the root folder
|
||||||
|
*/
|
||||||
function getConnectionOptionsFor(database: Database): BetterSqlite3ConnectionOptions {
|
function getConnectionOptionsFor(database: Database): BetterSqlite3ConnectionOptions {
|
||||||
return {
|
return {
|
||||||
name: database,
|
name: database,
|
||||||
|
|
Loading…
Reference in New Issue