mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
✨ Add MariaDB support
This commit is contained in:
@@ -60,12 +60,12 @@ export DB_POSTGRESDB_SCHEMA=n8n
|
|||||||
n8n start
|
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:
|
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_DATABASE` (default: 'n8n')
|
||||||
- `DB_MYSQLDB_HOST` (default: 'localhost')
|
- `DB_MYSQLDB_HOST` (default: 'localhost')
|
||||||
- `DB_MYSQLDB_PORT` (default: 3306)
|
- `DB_MYSQLDB_PORT` (default: 3306)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const config = convict({
|
|||||||
database: {
|
database: {
|
||||||
type: {
|
type: {
|
||||||
doc: 'Type of database to use',
|
doc: 'Type of database to use',
|
||||||
format: ['sqlite', 'mongodb', 'mysqldb', 'postgresdb'],
|
format: ['sqlite', 'mariadb', 'mongodb', 'mysqldb', 'postgresdb'],
|
||||||
default: 'sqlite',
|
default: 'sqlite',
|
||||||
env: 'DB_TYPE'
|
env: 'DB_TYPE'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -63,11 +63,12 @@ export async function init(synchronize?: boolean): Promise<IDatabaseCollections>
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'mariadb':
|
||||||
case 'mysqldb':
|
case 'mysqldb':
|
||||||
dbNotExistError = 'does not exist';
|
dbNotExistError = 'does not exist';
|
||||||
entities = MySQLDb;
|
entities = MySQLDb;
|
||||||
connectionOptions = {
|
connectionOptions = {
|
||||||
type: 'mysql',
|
type: dbType === 'mysqldb' ? 'mysql' : 'mariadb',
|
||||||
database: await GenericHelpers.getConfigValue('database.mysqldb.database') as string,
|
database: await GenericHelpers.getConfigValue('database.mysqldb.database') as string,
|
||||||
entityPrefix: await GenericHelpers.getConfigValue('database.tablePrefix') as string,
|
entityPrefix: await GenericHelpers.getConfigValue('database.tablePrefix') as string,
|
||||||
host: await GenericHelpers.getConfigValue('database.mysqldb.host') as string,
|
host: await GenericHelpers.getConfigValue('database.mysqldb.host') as string,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export interface ICredentialsDecryptedResponse extends ICredentialsDecryptedDb {
|
|||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DatabaseType = 'mongodb' | 'postgresdb' | 'mysqldb' | 'sqlite';
|
export type DatabaseType = 'mariadb' | 'mongodb' | 'postgresdb' | 'mysqldb' | 'sqlite';
|
||||||
export type SaveExecutionDataType = 'all' | 'none';
|
export type SaveExecutionDataType = 'all' | 'none';
|
||||||
|
|
||||||
export interface IExecutionBase {
|
export interface IExecutionBase {
|
||||||
|
|||||||
Reference in New Issue
Block a user