UNPKG

1.73 kBMarkdownView Raw
1The package has been configured successfully. The database configuration stored inside `config/database.ts` file relies on the following environment variables and hence we recommend validating them.
2
3**Open the `env.ts` file and paste the following code inside the `Env.rules` object.**
4
5```ts
6DB_CONNECTION: Env.schema.string(),
7```
8
9## Variables for the MYSQL driver
10
11```ts
12MYSQL_HOST: Env.schema.string({ format: 'host' }),
13MYSQL_PORT: Env.schema.number(),
14MYSQL_USER: Env.schema.string(),
15MYSQL_PASSWORD: Env.schema.string.optional(),
16MYSQL_DB_NAME: Env.schema.string(),
17```
18
19- The `MYSQL_HOST` should always be present and formatted as a valid `host`.
20- The `MYSQL_PORT` should always be present and a valid number.
21- The `MYSQL_USER` and `MYSQL_PASSWORD` are required to authenticate with the database server. The password is marked as optional since many local database servers are configured to work without passwords.
22- The `MYSQL_DB_NAME` is the database name you want to connect with.
23
24## Variables for the PostgreSQL driver
25
26```ts
27PG_HOST: Env.schema.string({ format: 'host' }),
28PG_PORT: Env.schema.number(),
29PG_USER: Env.schema.string(),
30PG_PASSWORD: Env.schema.string.optional(),
31PG_DB_NAME: Env.schema.string(),
32```
33
34## Variables for the MSSQL driver
35
36```ts
37MSSQL_SERVER: Env.schema.string({ format: 'host' }),
38MSSQL_PORT: Env.schema.number(),
39MSSQL_USER: Env.schema.string(),
40MSSQL_PASSWORD: Env.schema.string.optional(),
41MSSQL_DB_NAME: Env.schema.string(),
42```
43
44## Variables for the OracleDB driver
45
46```ts
47ORACLE_HOST: Env.schema.string({ format: 'host' }),
48ORACLE_PORT: Env.schema.number(),
49ORACLE_USER: Env.schema.string(),
50ORACLE_PASSWORD: Env.schema.string.optional(),
51ORACLE_DB_NAME: Env.schema.string(),
52```