Skip to content

Commit

Permalink
fix: set suggested configs as optional
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne-bechara committed Apr 21, 2021
1 parent 871bc5d commit 198d454
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/orm/orm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,38 @@ import { IsIn, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validato
@Injectable()
export class OrmConfig {

@IsOptional()
@InjectSecret()
@IsIn(Object.values(AppEnvironment))
public readonly NODE_ENV: AppEnvironment;

@IsOptional()
@InjectSecret()
@IsIn([ 'mongo', 'mysql', 'mariadb', 'postgresql', 'sqlite' ])
public readonly ORM_TYPE: 'mongo' | 'mysql' | 'mariadb' | 'postgresql' | 'sqlite';

@IsOptional()
@InjectSecret()
@IsString() @IsNotEmpty()
public readonly ORM_HOST: string;

@IsOptional()
@InjectSecret()
@Transform((o) => Number.parseInt(o.value))
@IsNumber()
public readonly ORM_PORT: number;

@IsOptional()
@InjectSecret()
@IsString() @IsNotEmpty()
public readonly ORM_USERNAME: string;

@InjectSecret()
@IsOptional()
@InjectSecret()
@IsString() @IsNotEmpty()
public readonly ORM_PASSWORD: string;

@IsOptional()
@InjectSecret()
@IsString() @IsNotEmpty()
public readonly ORM_DATABASE: string;
Expand Down

0 comments on commit 198d454

Please sign in to comment.