Compare commits

..

1 Commits

Author SHA1 Message Date
Morten Olsen
ddb3c79657 fix pg db 2025-08-11 15:00:06 +02:00
3 changed files with 4 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ const postgresDatabaseSecretSchema = z.object({
port: z.string(),
user: z.string(),
password: z.string(),
database: z.string().optional(),
});
const postgresDatabaseConnectionSecretSchema = z.object({

View File

@@ -146,6 +146,7 @@ class PostgresDatabaseResource extends CustomResource<typeof postgresDatabaseSpe
const database = postgresService.get({
...connectionSecretData.data,
port: connectionSecretData.data.port ? Number(connectionSecretData.data.port) : 5432,
database: connectionSecretData.data.database,
});
await database.upsertRole({
name: secretData.data.user,

View File

@@ -10,6 +10,7 @@ type PostgresInstanceOptions = {
port?: number;
user: string;
password: string;
database?: string;
};
class PostgresInstance {
@@ -23,6 +24,7 @@ class PostgresInstance {
user: process.env.FORCE_PG_USER ?? options.user,
password: process.env.FORCE_PG_PASSWORD ?? options.password,
port: process.env.FORCE_PG_PORT ? parseInt(process.env.FORCE_PG_PORT) : options.port,
database: options.database,
},
});
}