mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 15:44:45 -04:00
refactor(db-config): Use typeorm-style options
TypeORM does not use a separate config option for the path to the SQLite file. Additionally, the "dialect" is called "type." This commit adjusts our config to follow the upstream convention to reduce confusion. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
40c23acd49
commit
cd5256da7f
6 changed files with 34 additions and 43 deletions
|
@ -10,7 +10,7 @@ import session from 'express-session';
|
|||
import { Repository } from 'typeorm';
|
||||
|
||||
import { AuthConfig } from '../config/auth.config';
|
||||
import { DatabaseDialect } from '../config/database-dialect.enum';
|
||||
import { DatabaseType } from '../config/database-type.enum';
|
||||
import { DatabaseConfig } from '../config/database.config';
|
||||
import { Session } from '../users/session.entity';
|
||||
|
||||
|
@ -36,7 +36,7 @@ export function setupSessionMiddleware(
|
|||
saveUninitialized: false,
|
||||
store: new TypeormStore({
|
||||
cleanupLimit: 2,
|
||||
limitSubquery: dbConfig.dialect !== DatabaseDialect.MARIADB,
|
||||
limitSubquery: dbConfig.type !== DatabaseType.MARIADB,
|
||||
}).connect(app.get<Repository<Session>>(getRepositoryToken(Session))),
|
||||
}),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue