[feature]:支持Sqlite数据库 (#1467)

* add sqlite3 support

* 修改gorm.io/driver/sqlite 为 github.com/glebarez/sqlite 适配windows用户无cgo环境

---------

Co-authored-by: Kafumio <linzehong1_2020@qq.com>
Co-authored-by: Kafumio <73083337+Kafumio@users.noreply.github.com>
Co-authored-by: sliverhorn <sliver_horn@qq.com>
This commit is contained in:
奇淼(piexlmax
2023-06-30 19:18:20 +08:00
committed by GitHub
co-authored by Kafumio Kafumio sliverhorn
parent 7ababb626b
commit bd3931d62d
17 changed files with 366 additions and 33 deletions
+61
View File
@@ -5124,6 +5124,64 @@
}
}
},
"config.Sqlite": {
"type": "object",
"properties": {
"config": {
"description": "高级配置",
"type": "string"
},
"db-name": {
"description": "数据库名",
"type": "string"
},
"engine": {
"description": "数据库引擎,默认InnoDB",
"type": "string",
"default": "InnoDB"
},
"log-mode": {
"description": "是否开启Gorm全局日志",
"type": "string"
},
"log-zap": {
"description": "是否通过zap写入日志文件",
"type": "boolean"
},
"max-idle-conns": {
"description": "空闲中的最大连接数",
"type": "integer"
},
"max-open-conns": {
"description": "打开到数据库的最大连接数",
"type": "integer"
},
"password": {
"description": "数据库密码",
"type": "string"
},
"path": {
"description": "服务器地址:端口",
"type": "string"
},
"port": {
"description": ":端口",
"type": "string"
},
"prefix": {
"description": "全局表前缀,单独定义TableName则不生效",
"type": "string"
},
"singular": {
"description": "是否开启全局禁用复数,true表示开启",
"type": "boolean"
},
"username": {
"description": "数据库用户名",
"type": "string"
}
}
},
"config.Qiniu": {
"type": "object",
"properties": {
@@ -5245,6 +5303,9 @@
"pgsql": {
"$ref": "#/definitions/config.Pgsql"
},
"sqlite": {
"$ref": "#/definitions/config.Sqlite"
},
"qiniu": {
"$ref": "#/definitions/config.Qiniu"
},