2019-06-18 18:33:53 +02:00
|
|
|
const sqlite = {
|
2019-09-20 12:44:24 +02:00
|
|
|
connector: 'bookshelf',
|
2019-06-18 18:33:53 +02:00
|
|
|
settings: {
|
|
|
|
client: 'sqlite',
|
|
|
|
filename: '.tmp/data.db',
|
|
|
|
},
|
|
|
|
options: {
|
2019-07-09 18:20:36 +02:00
|
|
|
// debug: true,
|
2019-06-18 18:33:53 +02:00
|
|
|
useNullAsDefault: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const postgres = {
|
2019-09-20 12:44:24 +02:00
|
|
|
connector: 'bookshelf',
|
2019-06-18 18:33:53 +02:00
|
|
|
settings: {
|
|
|
|
client: 'postgres',
|
|
|
|
database: 'strapi',
|
|
|
|
username: 'strapi',
|
|
|
|
password: 'strapi',
|
|
|
|
port: 5432,
|
|
|
|
host: 'localhost',
|
|
|
|
},
|
|
|
|
options: {},
|
|
|
|
};
|
|
|
|
|
2019-07-09 14:39:59 +02:00
|
|
|
const mysql = {
|
2019-09-20 12:44:24 +02:00
|
|
|
connector: 'bookshelf',
|
2019-07-09 14:39:59 +02:00
|
|
|
settings: {
|
|
|
|
client: 'mysql',
|
|
|
|
database: 'strapi',
|
|
|
|
username: 'strapi',
|
|
|
|
password: 'strapi',
|
|
|
|
port: 3306,
|
|
|
|
host: 'localhost',
|
|
|
|
},
|
|
|
|
options: {},
|
|
|
|
};
|
|
|
|
|
2019-06-18 18:33:53 +02:00
|
|
|
const mongo = {
|
2019-09-20 12:44:24 +02:00
|
|
|
connector: 'mongoose',
|
2019-06-18 18:33:53 +02:00
|
|
|
settings: {
|
|
|
|
database: 'strapi',
|
|
|
|
username: 'root',
|
|
|
|
password: 'strapi',
|
|
|
|
port: 27017,
|
|
|
|
host: 'localhost',
|
|
|
|
},
|
|
|
|
options: {},
|
|
|
|
};
|
|
|
|
|
|
|
|
const db = {
|
2019-07-09 14:39:59 +02:00
|
|
|
mysql,
|
2019-06-18 18:33:53 +02:00
|
|
|
sqlite,
|
|
|
|
postgres,
|
|
|
|
mongo,
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
defaultConnection: 'default',
|
|
|
|
connections: {
|
|
|
|
default: process.env.DB ? db[process.env.DB] || db.sqlite : db.sqlite,
|
|
|
|
},
|
|
|
|
};
|