當前位置: 首頁>>代碼示例>>Golang>>正文


Golang builder.Extend函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。