fix(server): sslmode not working (#15587)

* parse db url before passing it to the driver

* don't be lazy

* simplify

* simplify

* add tests

* update sql sync script

* update mock

* remove unused import

* remove unused imports
This commit is contained in:
Mert
2025-01-24 14:01:55 -05:00
committed by GitHub
parent f5a3d7ba23
commit ba01b40e7c
6 changed files with 154 additions and 50 deletions

View File

@@ -1,4 +1,3 @@
import { PostgresJSDialect } from 'kysely-postgres-js';
import {
DatabaseExtension,
EXTENSION_NAMES,
@@ -62,8 +61,11 @@ describe(DatabaseService.name, () => {
database: {
config: {
kysely: {
dialect: expect.any(PostgresJSDialect),
log: ['error'],
host: 'database',
port: 5432,
user: 'postgres',
password: 'postgres',
database: 'immich',
},
typeorm: {
connectionType: 'parts',
@@ -298,8 +300,11 @@ describe(DatabaseService.name, () => {
database: {
config: {
kysely: {
dialect: expect.any(PostgresJSDialect),
log: ['error'],
host: 'database',
port: 5432,
user: 'postgres',
password: 'postgres',
database: 'immich',
},
typeorm: {
connectionType: 'parts',
@@ -328,8 +333,11 @@ describe(DatabaseService.name, () => {
database: {
config: {
kysely: {
dialect: expect.any(PostgresJSDialect),
log: ['error'],
host: 'database',
port: 5432,
user: 'postgres',
password: 'postgres',
database: 'immich',
},
typeorm: {
connectionType: 'parts',