🔀 Merge branch 'postgres-schema-support' of https://github.com/richteri/n8n into richteri-postgres-schema-support

This commit is contained in:
Jan Oberhauser 2020-03-18 22:54:21 +01:00
commit d1d94eab6d
5 changed files with 13 additions and 0 deletions

View file

@ -156,6 +156,7 @@ Replace the following placeholders with the actual data:
- <POSTGRES_PASSWORD>
- <POSTGRES_PORT>
- <POSTGRES_USER>
- <POSTGRES_SCHEMA>
```
docker run -it --rm \
@ -166,6 +167,7 @@ docker run -it --rm \
-e DB_POSTGRESDB_HOST=<POSTGRES_HOST> \
-e DB_POSTGRESDB_PORT=<POSTGRES_PORT> \
-e DB_POSTGRESDB_USER=<POSTGRES_USER> \
-e DB_POSTGRESDB_SCHEMA=<POSTGRES_SCHEMA> \
-e DB_POSTGRESDB_PASSWORD=<POSTGRES_PASSWORD> \
-v ~/.n8n:/root/.n8n \
n8nio/n8n \
@ -214,6 +216,7 @@ The following environment variables support file input:
- DB_POSTGRESDB_PASSWORD_FILE
- DB_POSTGRESDB_PORT_FILE
- DB_POSTGRESDB_USER_FILE
- DB_POSTGRESDB_SCHEMA_FILE
- N8N_BASIC_AUTH_PASSWORD_FILE
- N8N_BASIC_AUTH_USER_FILE

View file

@ -38,6 +38,7 @@ To use PostgresDB as database you can provide the following environment variable
- `DB_POSTGRESDB_PORT` (default: 5432)
- `DB_POSTGRESDB_USER` (default: 'root')
- `DB_POSTGRESDB_PASSWORD` (default: empty)
- `DB_POSTGRESDB_SCHEMA` (default: 'public')
```bash
@ -47,6 +48,7 @@ export DB_POSTGRESDB_HOST=postgresdb
export DB_POSTGRESDB_PORT=5432
export DB_POSTGRESDB_USER=n8n
export DB_POSTGRESDB_PASSWORD=n8n
export DB_POSTGRESDB_SCHEMA=n8n
n8n start
```

View file

@ -13,5 +13,6 @@ The following environment variables support file input:
- DB_POSTGRESDB_PASSWORD_FILE
- DB_POSTGRESDB_PORT_FILE
- DB_POSTGRESDB_USER_FILE
- DB_POSTGRESDB_SCHEMA_FILE
- N8N_BASIC_AUTH_PASSWORD_FILE
- N8N_BASIC_AUTH_USER_FILE

View file

@ -51,6 +51,12 @@ const config = convict({
default: 'root',
env: 'DB_POSTGRESDB_USER'
},
schema: {
doc: 'PostgresDB Schema',
format: String,
default: 'public',
env: 'DB_POSTGRESDB_SCHEMA'
},
},
mysqldb: {
database: {

View file

@ -57,6 +57,7 @@ export async function init(synchronize?: boolean): Promise<IDatabaseCollections>
password: await GenericHelpers.getConfigValue('database.postgresdb.password') as string,
port: await GenericHelpers.getConfigValue('database.postgresdb.port') as number,
username: await GenericHelpers.getConfigValue('database.postgresdb.user') as string,
schema: await GenericHelpers.getConfigValue('database.postgresdb.schema') as string,
};
break;