Skip to content

Commit

Permalink
Support PostgreSQL Extra Connection options (#4970)
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored and syuilo committed May 23, 2019
1 parent f54cd10 commit 6de08d0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ db:
user: example-misskey-user
pass: example-misskey-pass

# Extra Connection options
#extra:
# ssl: true

# ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────

Expand Down
1 change: 1 addition & 0 deletions src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type Source = {
db: string;
user: string;
pass: string;
extra?: { [x: string]: string };
};
redis: {
host: string;
Expand Down
1 change: 1 addition & 0 deletions src/db/postgre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export function initDb(justBorrow = false, sync = false, log = false) {
username: config.db.user,
password: config.db.pass,
database: config.db.db,
extra: config.db.extra,
synchronize: process.env.NODE_ENV === 'test' || sync,
dropSchema: process.env.NODE_ENV === 'test' && !justBorrow,
logging: log,
Expand Down
1 change: 1 addition & 0 deletions src/ormconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const json = {
username: config.db.user,
password: config.db.pass,
database: config.db.db,
extra: config.db.extra,
entities: ['src/models/entities/*.ts'],
migrations: ['migration/*.ts'],
cli: {
Expand Down

0 comments on commit 6de08d0

Please sign in to comment.