Skip to content

Commit

Permalink
add day3
Browse files Browse the repository at this point in the history
  • Loading branch information
geektutu committed Mar 7, 2020
1 parent f96bf94 commit 5093770
Show file tree
Hide file tree
Showing 9 changed files with 370 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gee-orm/day3-save-query/clause/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func _insert(values ...interface{}) (string, []interface{}) {
}

func _values(values ...interface{}) (string, []interface{}) {
// VALUES ($v1), (&v2), ...
// VALUES ($v1), ($v2), ...
var bindStr string
var sql strings.Builder
var vars []interface{}
Expand Down
2 changes: 1 addition & 1 deletion gee-orm/day4-chain-operation/clause/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func _insert(values ...interface{}) (string, []interface{}) {
}

func _values(values ...interface{}) (string, []interface{}) {
// VALUES ($v1), (&v2), ...
// VALUES ($v1), ($v2), ...
var bindStr string
var sql strings.Builder
var vars []interface{}
Expand Down
2 changes: 1 addition & 1 deletion gee-orm/day5-hooks/clause/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func _insert(values ...interface{}) (string, []interface{}) {
}

func _values(values ...interface{}) (string, []interface{}) {
// VALUES ($v1), (&v2), ...
// VALUES ($v1), ($v2), ...
var bindStr string
var sql strings.Builder
var vars []interface{}
Expand Down
2 changes: 1 addition & 1 deletion gee-orm/day6-transaction/clause/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func _insert(values ...interface{}) (string, []interface{}) {
}

func _values(values ...interface{}) (string, []interface{}) {
// VALUES ($v1), (&v2), ...
// VALUES ($v1), ($v2), ...
var bindStr string
var sql strings.Builder
var vars []interface{}
Expand Down
2 changes: 1 addition & 1 deletion gee-orm/day7-migrate/clause/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func _insert(values ...interface{}) (string, []interface{}) {
}

func _values(values ...interface{}) (string, []interface{}) {
// VALUES ($v1), (&v2), ...
// VALUES ($v1), ($v2), ...
var bindStr string
var sql strings.Builder
var vars []interface{}
Expand Down
2 changes: 1 addition & 1 deletion gee-orm/doc/geeorm-day1.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,4 @@ func main() {

- [Go 语言简明教程](https://geektutu.com/post/quick-golang.html)
- [Go Test 单元测试简明教程](https://geektutu.com/post/quick-go-test.html)
- [SQLite 常用命令](https://geektutu.com/post/cheat-sheet-sqlite.html)
- [SQLite 常用命令速查表](https://geektutu.com/post/cheat-sheet-sqlite.html)
6 changes: 3 additions & 3 deletions gee-orm/doc/geeorm-day2.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func TestParse(t *testing.T) {
}
```

## Session
## 3 Session

Session 的核心功能是与数据库进行交互。因此,我们将数据库表的增/删操作实现在子包 session 中。在此之前,Session 的结构需要做一些调整。

Expand Down Expand Up @@ -332,7 +332,7 @@ func TestSession_CreateTable(t *testing.T) {
}
```

## Engine
## 4 Engine

因为 Session 构造函数增加了对 dialect 的依赖,Engine 需要作一些细微的调整。

Expand Down Expand Up @@ -384,4 +384,4 @@ func (engine *Engine) NewSession() *session.Session {

- [Go 语言简明教程](https://geektutu.com/post/quick-golang.html)
- [Go Test 单元测试简明教程](https://geektutu.com/post/quick-go-test.html)
- [SQLite 常用命令](https://geektutu.com/post/cheat-sheet-sqlite.html)
- [SQLite 常用命令速查表](https://geektutu.com/post/cheat-sheet-sqlite.html)
Loading

0 comments on commit 5093770

Please sign in to comment.