本文整理汇总了Golang中github.com/lann/builder.Extend函数的典型用法代码示例。如果您正苦于以下问题:Golang Extend函数的具体用法?Golang Extend怎么用?Golang Extend使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Extend函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Columns
// Columns adds result columns to the query.
func (b SelectBuilder) Columns(columns ...string) SelectBuilder {
var parts []interface{}
for _, str := range columns {
parts = append(parts, newPart(str))
}
return builder.Extend(b, "Columns", parts).(SelectBuilder)
}
开发者ID:zenododobird,项目名称:horizon,代码行数:8,代码来源:select.go
示例2: TestExtendNil
func TestExtendNil(t *testing.T) {
b := builder.Extend(FooBuilder, "Add", nil)
_, ok := builder.Get(b, "X")
if ok {
t.Fatalf("key %v set unexpectedly", "Add")
}
}
开发者ID:zenododobird,项目名称:horizon,代码行数:7,代码来源:builder_test.go
示例3: TestExtendPanic
func TestExtendPanic(t *testing.T) {
var panicVal *reflect.ValueError
func() {
defer func() { panicVal = recover().(*reflect.ValueError) }()
builder.Extend(FooBuilder, "Add", Foo{})
}()
if panicVal == nil {
t.Errorf("expected panic, didn't")
}
}
开发者ID:zenododobird,项目名称:horizon,代码行数:10,代码来源:builder_test.go
示例4: Columns
// Columns adds insert columns to the query.
func (b InsertBuilder) Columns(columns ...string) InsertBuilder {
return builder.Extend(b, "Columns", columns).(InsertBuilder)
}
开发者ID:zenododobird,项目名称:horizon,代码行数:4,代码来源:insert.go
示例5: Options
// Options adds keyword options before the INTO clause of the query.
func (b InsertBuilder) Options(options ...string) InsertBuilder {
return builder.Extend(b, "Options", options).(InsertBuilder)
}
开发者ID:zenododobird,项目名称:horizon,代码行数:4,代码来源:insert.go
示例6: OrderBy
// OrderBy adds ORDER BY expressions to the query.
func (b UpdateBuilder) OrderBy(orderBys ...string) UpdateBuilder {
return builder.Extend(b, "OrderBys", orderBys).(UpdateBuilder)
}
开发者ID:nancyandrews,项目名称:MobileMainStreet,代码行数:4,代码来源:update.go
示例7: OrderBy
// OrderBy adds ORDER BY expressions to the query.
func (b DeleteBuilder) OrderBy(orderBys ...string) DeleteBuilder {
return builder.Extend(b, "OrderBys", orderBys).(DeleteBuilder)
}
开发者ID:nizsheanez,项目名称:squirrel,代码行数:4,代码来源:delete.go
示例8: OrderBy
// OrderBy adds ORDER BY expressions to the query.
func (b SelectBuilder) OrderBy(orderBys ...string) SelectBuilder {
return builder.Extend(b, "OrderBys", orderBys).(SelectBuilder)
}
开发者ID:zenododobird,项目名称:horizon,代码行数:4,代码来源:select.go
示例9: GroupBy
// GroupBy adds GROUP BY expressions to the query.
func (b SelectBuilder) GroupBy(groupBys ...string) SelectBuilder {
return builder.Extend(b, "GroupBys", groupBys).(SelectBuilder)
}
开发者ID:zenododobird,项目名称:horizon,代码行数:4,代码来源:select.go
示例10: Options
// Options adds select option to the query
func (b SelectBuilder) Options(options ...string) SelectBuilder {
return builder.Extend(b, "Options", options).(SelectBuilder)
}
开发者ID:stellar,项目名称:bridge-server,代码行数:4,代码来源:select.go
示例11: Having
// Having adds an expression to the HAVING clause of the query.
//
// See Where.
func (b SelectBuilder) Having(pred interface{}, rest ...interface{}) SelectBuilder {
return builder.Extend(b, "HavingParts", newWhereParts(pred, rest...)).(SelectBuilder)
}
开发者ID:josephyzhou,项目名称:squirrel,代码行数:6,代码来源:select.go
示例12: Where
// Where adds an expression to the WHERE clause of the query.
//
// Expressions are ANDed together in the generated SQL.
//
// Where accepts several types for its pred argument:
//
// nil OR "" - ignored.
//
// string - SQL expression.
// If the expression has SQL placeholders then a set of arguments must be passed
// as well, one for each placeholder.
//
// map[string]interface{} OR Eq - map of SQL expressions to values. Each key is
// transformed into an expression like "<key> = ?", with the corresponding value
// bound to the placeholder. If the value is nil, the expression will be "<key>
// IS NULL". If the value is an array or slice, the expression will be "<key> IN
// (?,?,...)", with one placeholder for each item in the value. These expressions
// are ANDed together.
//
// Where will panic if pred isn't any of the above types.
func (b SelectBuilder) Where(pred interface{}, args ...interface{}) SelectBuilder {
return builder.Extend(b, "WhereParts", newWhereParts(pred, args...)).(SelectBuilder)
}
开发者ID:josephyzhou,项目名称:squirrel,代码行数:23,代码来源:select.go
示例13: Columns
// Columns adds result columns to the query.
func (b SelectBuilder) Columns(columns ...string) SelectBuilder {
return builder.Extend(b, "Columns", columns).(SelectBuilder)
}
开发者ID:josephyzhou,项目名称:squirrel,代码行数:4,代码来源:select.go
注:本文中的github.com/lann/builder.Extend函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论