mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-23 18:41:48 -08:00
✨ Add MariaDB support
This commit is contained in:
parent
7ab616f6bc
commit
303062623b
|
@ -60,12 +60,12 @@ export DB_POSTGRESDB_SCHEMA=n8n
|
|||
n8n start
|
||||
```
|
||||
|
||||
## MySQL
|
||||
## MySQL / MariaDB
|
||||
|
||||
The compatibility with MySQL was tested, even so, it is advisable to observe the operation of the application with this DB, as it is a new option, recently added. If you spot any problems, feel free to submit a PR.
|
||||
The compatibility with MySQL/MariaDB was tested, even so, it is advisable to observe the operation of the application with this DB, as it is a new option, recently added. If you spot any problems, feel free to submit a PR.
|
||||
|
||||
To use MySQL as database you can provide the following environment variables:
|
||||
- `DB_TYPE=mysqldb`
|
||||
- `DB_TYPE=mysqldb` or `DB_TYPE=mariadb`
|
||||
- `DB_MYSQLDB_DATABASE` (default: 'n8n')
|
||||
- `DB_MYSQLDB_HOST` (default: 'localhost')
|
||||
- `DB_MYSQLDB_PORT` (default: 3306)
|
||||
|
|
|
@ -8,7 +8,7 @@ const config = convict({
|
|||
database: {
|
||||
type: {
|
||||
doc: 'Type of database to use',
|
||||
format: ['sqlite', 'mongodb', 'mysqldb', 'postgresdb'],
|
||||
format: ['sqlite', 'mariadb', 'mongodb', 'mysqldb', 'postgresdb'],
|
||||
default: 'sqlite',
|
||||
env: 'DB_TYPE'
|
||||
},
|
||||
|
|
|
@ -63,11 +63,12 @@ export async function init(synchronize?: boolean): Promise<IDatabaseCollections>
|
|||
};
|
||||
break;
|
||||
|
||||
case 'mariadb':
|
||||
case 'mysqldb':
|
||||
dbNotExistError = 'does not exist';
|
||||
entities = MySQLDb;
|
||||
connectionOptions = {
|
||||
type: 'mysql',
|
||||
type: dbType === 'mysqldb' ? 'mysql' : 'mariadb',
|
||||
database: await GenericHelpers.getConfigValue('database.mysqldb.database') as string,
|
||||
entityPrefix: await GenericHelpers.getConfigValue('database.tablePrefix') as string,
|
||||
host: await GenericHelpers.getConfigValue('database.mysqldb.host') as string,
|
||||
|
|
|
@ -87,7 +87,7 @@ export interface ICredentialsDecryptedResponse extends ICredentialsDecryptedDb {
|
|||
id: string;
|
||||
}
|
||||
|
||||
export type DatabaseType = 'mongodb' | 'postgresdb' | 'mysqldb' | 'sqlite';
|
||||
export type DatabaseType = 'mariadb' | 'mongodb' | 'postgresdb' | 'mysqldb' | 'sqlite';
|
||||
export type SaveExecutionDataType = 'all' | 'none';
|
||||
|
||||
export interface IExecutionBase {
|
||||
|
|
Loading…
Reference in a new issue