Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit 145c996

Browse files
BetaCat0lunny
authored andcommitted
Update Readme (#33)
* add more test cases & replace some err in errors.New(...) style & add some built-in err types * update From & related test cases * add test cases & fix bug * fix issues * update readme
1 parent eddf455 commit 145c996

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ sql, args, err := Select("c, d").From("table1").Where(Eq{"a": 1}).ToSQL()
2424
sql, args, err = Select("c, d").From("table1").LeftJoin("table2", Eq{"table1.id": 1}.And(Lt{"table2.id": 3})).
2525
RightJoin("table3", "table2.id = table3.tid").Where(Eq{"a": 1}).ToSQL()
2626
// From sub query
27-
sql, args, err := Select("sub.id").From("sub", Select("c").From("table1").Where(Eq{"a": 1})).Where(Eq{"b": 1}).ToSQL()
27+
sql, args, err := Select("sub.id").From(Select("c").From("table1").Where(Eq{"a": 1}), "sub").Where(Eq{"b": 1}).ToSQL()
2828
// From union query
29-
sql, args, err = Select("sub.id").From("sub",
30-
Select("id").From("table1").Where(Eq{"a": 1}).
31-
Union("all", Select("id").From("table1").Where(Eq{"a": 2}))).Where(Eq{"b": 1}).ToSQL()
29+
sql, args, err = Select("sub.id").From(
30+
Select("id").From("table1").Where(Eq{"a": 1}).Union("all", Select("id").From("table1").Where(Eq{"a": 2})),"sub").
31+
Where(Eq{"b": 1}).ToSQL()
3232
// With order by
3333
sql, args, err = Select("a", "b", "c").From("table1").Where(Eq{"f1": "v1", "f2": "v2"}).
3434
OrderBy("a ASC").ToSQL()

0 commit comments

Comments
 (0)