forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.js
63 lines (58 loc) · 1011 Bytes
/
database.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const sqlite = {
connector: 'bookshelf',
settings: {
client: 'sqlite',
filename: '.tmp/data.db',
},
options: {
// debug: true,
useNullAsDefault: true,
},
};
const postgres = {
connector: 'bookshelf',
settings: {
client: 'postgres',
database: 'strapi',
username: 'strapi',
password: 'strapi',
port: 5432,
host: 'localhost',
},
options: {},
};
const mysql = {
connector: 'bookshelf',
settings: {
client: 'mysql',
database: 'strapi',
username: 'strapi',
password: 'strapi',
port: 3306,
host: 'localhost',
},
options: {},
};
const mongo = {
connector: 'mongoose',
settings: {
database: 'strapi',
username: 'root',
password: 'strapi',
port: 27017,
host: 'localhost',
},
options: {},
};
const db = {
mysql,
sqlite,
postgres,
mongo,
};
module.exports = {
defaultConnection: 'default',
connections: {
default: process.env.DB ? db[process.env.DB] || db.sqlite : db.sqlite,
},
};