|
1 | 1 | package main
|
2 | 2 |
|
3 |
| -//go:generate depstubber -vendor github.com/Masterminds/squirrel "" Select,Expr |
| 3 | +//go:generate depstubber -vendor github.com/Masterminds/squirrel DeleteBuilder,InsertBuilder,SelectBuilder,UpdateBuilder Delete,Expr,Insert,Select,Update |
4 | 4 |
|
5 | 5 | import (
|
6 | 6 | "context"
|
@@ -43,9 +43,43 @@ func test(db *sql.DB, ctx context.Context) {
|
43 | 43 | }
|
44 | 44 |
|
45 | 45 | func squirrelTest(querypart string) {
|
46 |
| - squirrel.Select("*").From("users").Where(squirrel.Expr(querypart)) // $ querystring=querypart |
47 |
| - squirrel.Select("*").From("users").Where(querypart) // $ querystring=querypart |
48 |
| - squirrel.Select("*").From("users").Suffix(querypart) // $ querystring=querypart |
| 46 | + squirrel.Expr(querypart) // $ querystring=querypart |
| 47 | + deleteBuilder := squirrel.Delete(querypart) // $ querystring=querypart |
| 48 | + deleteBuilder.From(querypart) // $ querystring=querypart |
| 49 | + deleteBuilder.OrderBy(querypart) // $ querystring=[]type{args} |
| 50 | + deleteBuilder.Prefix(querypart) // $ querystring=querypart |
| 51 | + deleteBuilder.Suffix(querypart) // $ querystring=querypart |
| 52 | + deleteBuilder.Where(querypart) // $ querystring=querypart |
| 53 | + |
| 54 | + insertBuilder := squirrel.Insert(querypart) // $ querystring=querypart |
| 55 | + insertBuilder.Columns(querypart) // $ querystring=[]type{args} |
| 56 | + insertBuilder.Options(querypart) // $ querystring=[]type{args} |
| 57 | + insertBuilder.Prefix(querypart) // $ querystring=querypart |
| 58 | + insertBuilder.Suffix(querypart) // $ querystring=querypart |
| 59 | + insertBuilder.Into(querypart) // $ querystring=querypart |
| 60 | + |
| 61 | + selectBuilder := squirrel.Select(querypart) // $ querystring=[]type{args} |
| 62 | + selectBuilder.Columns(querypart) // $ querystring=[]type{args} |
| 63 | + selectBuilder.From(querypart) // $ querystring=querypart |
| 64 | + selectBuilder.Options(querypart) // $ querystring=[]type{args} |
| 65 | + selectBuilder.OrderBy(querypart) // $ querystring=[]type{args} |
| 66 | + selectBuilder.Prefix(querypart) // $ querystring=querypart |
| 67 | + selectBuilder.Suffix(querypart) // $ querystring=querypart |
| 68 | + selectBuilder.Where(querypart) // $ querystring=querypart |
| 69 | + selectBuilder.CrossJoin(querypart) // $ querystring=querypart |
| 70 | + selectBuilder.GroupBy(querypart) // $ querystring=[]type{args} |
| 71 | + selectBuilder.InnerJoin(querypart) // $ querystring=querypart |
| 72 | + selectBuilder.LeftJoin(querypart) // $ querystring=querypart |
| 73 | + selectBuilder.RightJoin(querypart) // $ querystring=querypart |
| 74 | + |
| 75 | + updateBuilder := squirrel.Update(querypart) // $ querystring=querypart |
| 76 | + updateBuilder.From(querypart) // $ querystring=querypart |
| 77 | + updateBuilder.OrderBy(querypart) // $ querystring=[]type{args} |
| 78 | + updateBuilder.Prefix(querypart) // $ querystring=querypart |
| 79 | + updateBuilder.Suffix(querypart) // $ querystring=querypart |
| 80 | + updateBuilder.Where(querypart) // $ querystring=querypart |
| 81 | + updateBuilder.Set(querypart, "") // $ querystring=querypart |
| 82 | + updateBuilder.Table(querypart) // $ querystring=querypart |
49 | 83 | }
|
50 | 84 |
|
51 | 85 | func test2(tx *sql.Tx, query string, ctx context.Context) {
|
|
0 commit comments