const { PG_HOST, PG_PORT, PG_DATABASE, PG_USERNAME, PG_PASSWORD, PG_USE_SSL } =
Schema.parseSync(
Schema.struct({
PG_HOST: Schema.string.pipe(Schema.default('db')),
PG_PORT: Schema.int()(Schema.NumberFromString).pipe(Schema.default(5432)),
PG_DATABASE: Schema.string.pipe(Schema.default('postgres')),
PG_USERNAME: Schema.string.pipe(Schema.default('postgres')),
PG_PASSWORD: Schema.string.pipe(Schema.default('topsecret')),
PG_USE_SSL: BooleanFromString.pipe(Schema.default(true)),
})
)(process.env);
const { PG_HOST, PG_PORT, PG_DATABASE, PG_USERNAME, PG_PASSWORD, PG_USE_SSL } =
Schema.parseSync(
Schema.struct({
PG_HOST: Schema.string.pipe(Schema.default('db')),
PG_PORT: Schema.int()(Schema.NumberFromString).pipe(Schema.default(5432)),
PG_DATABASE: Schema.string.pipe(Schema.default('postgres')),
PG_USERNAME: Schema.string.pipe(Schema.default('postgres')),
PG_PASSWORD: Schema.string.pipe(Schema.default('topsecret')),
PG_USE_SSL: BooleanFromString.pipe(Schema.default(true)),
})
)(process.env);