mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-24 16:50:26 +01:00
initital commit
This commit is contained in:
69
config/database.ts
Normal file
69
config/database.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Config source: https://git.io/JesV9
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this config
|
||||
* file.
|
||||
*/
|
||||
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import { OrmConfig } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { DatabaseConfig } from '@ioc:Adonis/Lucid/Database'
|
||||
|
||||
const databaseConfig: DatabaseConfig & { orm: Partial<OrmConfig> } = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The primary connection for making database queries across the application
|
||||
| You can use any key from the `connections` object defined in this same
|
||||
| file.
|
||||
|
|
||||
*/
|
||||
connection: Env.get('DB_CONNECTION'),
|
||||
|
||||
connections: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| MySQL config
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configuration for MySQL database. Make sure to install the driver
|
||||
| from npm when using this connection
|
||||
|
|
||||
| npm i mysql
|
||||
|
|
||||
*/
|
||||
mysql: {
|
||||
client: 'mysql',
|
||||
connection: {
|
||||
host: Env.get('MYSQL_HOST'),
|
||||
port: Env.get('MYSQL_PORT'),
|
||||
user: Env.get('MYSQL_USER'),
|
||||
password: Env.get('MYSQL_PASSWORD', ''),
|
||||
database: Env.get('MYSQL_DB_NAME'),
|
||||
charset: 'utf8mb4'
|
||||
},
|
||||
healthCheck: true,
|
||||
debug: false,
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| ORM Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Following are some of the configuration options to tweak the conventional
|
||||
| settings of the ORM. For example:
|
||||
|
|
||||
| - Define a custom function to compute the default table name for a given model.
|
||||
| - Or define a custom function to compute the primary key for a given model.
|
||||
|
|
||||
*/
|
||||
orm: {
|
||||
},
|
||||
}
|
||||
|
||||
export default databaseConfig
|
||||
Reference in New Issue
Block a user