操作数据库,支持多种数据库
yarn add pg
{
"dbconfig":{
"client": "mysql",
"connection": {
"host": "127.0.0.1",
"user": "your_database_user",
"password": "your_database_password",
"database": "myapp_test"
}
}
}
{
"dbconfig":{
"client": "pg",
"connection": "pgconnectstring",
"searchPath": [
"knex",
"public"
]
}
}
{
"dbconfig":{
"client": "pg",
"version": "7.2",
"connection": {
"host": "127.0.0.1",
"user": "your_database_user",
"password": "your_database_password",
"database": "myapp_test"
}
}
}
yarn add mysql2
or
yarn add mysql
mm.json
{
"dbconfig":{
"client": "mysql",
"version": "5.7",
"connection": {
"host": "127.0.0.1",
"user": "your_database_user",
"password": "your_database_password",
"database": "myapp_test"
}
}
}
{
"dbconfig":{
"client": "mysql",
"connection": {
"host": "127.0.0.1",
"user": "your_database_user",
"password": "your_database_password",
"database": "myapp_test"
},
"userParams": {
"userParam1": "451"
}
}
}
{
"dbconfig":{
"client": "mysql",
"connection": {
"host": "127.0.0.1",
"user": "your_database_user",
"password": "your_database_password",
"database": "myapp_test"
},
"pool": {
"min": 0,
"max": 7
}
}
}
yarn add oracledb
{
"dbconfig":{
"client": "oracledb",
"connection": {},
"fetchAsString": [
"number",
"clob"
]
}
}
yarn add sqlite3
{
"dbconfig":{
"client": "sqlite3",
"connection": {
"filename": "./mydb.sqlite"
}
}
}
yarn add mssql
{
"dbconfig":{
"client": "mssql",
"connection": {
}
}
}