mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 09:56:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			52 lines
		
	
	
		
			784 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			784 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const sqlite = {
 | |
|   client: 'sqlite',
 | |
|   connection: {
 | |
|     filename: '.tmp/data.db',
 | |
|   },
 | |
|   useNullAsDefault: true,
 | |
| };
 | |
| 
 | |
| const postgres = {
 | |
|   client: 'postgres',
 | |
|   connection: {
 | |
|     database: 'strapi',
 | |
|     user: 'strapi',
 | |
|     password: 'strapi',
 | |
|     port: 5432,
 | |
|     host: 'localhost',
 | |
|   },
 | |
| };
 | |
| 
 | |
| const mysql = {
 | |
|   client: 'mysql',
 | |
|   connection: {
 | |
|     database: 'strapi',
 | |
|     user: 'strapi',
 | |
|     password: 'strapi',
 | |
|     port: 3306,
 | |
|     host: 'localhost',
 | |
|   },
 | |
| };
 | |
| 
 | |
| const mariadb = {
 | |
|   client: 'mysql',
 | |
|   connection: {
 | |
|     database: 'strapi',
 | |
|     user: 'strapi',
 | |
|     password: 'strapi',
 | |
|     port: 3307,
 | |
|     host: 'localhost',
 | |
|   },
 | |
| };
 | |
| 
 | |
| const db = {
 | |
|   mysql,
 | |
|   sqlite,
 | |
|   postgres,
 | |
|   mariadb,
 | |
| };
 | |
| 
 | |
| module.exports = {
 | |
|   connection: process.env.DB ? db[process.env.DB] || db.sqlite : db.sqlite,
 | |
| };
 | 
