rest/README.md

31 lines
559 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 数据库组件
组件提供了操作`mysql`一些相关的内容,通过组件可以方便的实现怎删改查的接口
## 插件
### 主键插件
主键插件是指的是用于生成数据库主键的插件非自增长的ID主键插件使用方式
```go
db.Use(&identified.Identify{})
```
### 数据校验插件
数据校验插件用户增改的时候对数据格式进行校验,使用方式
```go
db.Use(validate.New())
```
### 分表插件
分表插件提供了自动分表的功能,使用方式
```go
db.Use(sharding.New())
```