orm update docs
This commit is contained in:
34
orm/docs/zh/Test.md
Normal file
34
orm/docs/zh/Test.md
Normal file
@@ -0,0 +1,34 @@
|
||||
## Test ORM
|
||||
|
||||
测试代码参见
|
||||
|
||||
```bash
|
||||
models_test.go // 表定义
|
||||
orm_test.go // 测试用例
|
||||
```
|
||||
|
||||
#### MySQL
|
||||
```bash
|
||||
mysql -u root -e 'create database orm_test;'
|
||||
export ORM_DRIVER=mysql
|
||||
export ORM_SOURCE="root:@/orm_test?charset=utf8"
|
||||
go test -v github.com/astaxie/beego/orm
|
||||
```
|
||||
|
||||
|
||||
#### Sqlite3
|
||||
```bash
|
||||
touch /path/to/orm_test.db
|
||||
export ORM_DRIVER=sqlite3
|
||||
export ORM_SOURCE=/path/to/orm_test.db
|
||||
go test -v github.com/astaxie/beego/orm
|
||||
```
|
||||
|
||||
|
||||
#### PostgreSQL
|
||||
```bash
|
||||
psql -c 'create database orm_test;' -U postgres
|
||||
export ORM_DRIVER=postgres
|
||||
export ORM_SOURCE="user=postgres dbname=orm_test sslmode=disable"
|
||||
go test -v github.com/astaxie/beego/orm
|
||||
```
|
||||
Reference in New Issue
Block a user