MCPcopy Index your code
hub / github.com/koding/kite / insertKiteQuery

Function insertKiteQuery

kontrol/postgres.go:364–388  ·  view source on GitHub ↗

inseryKiteQuery inserts the given kite, url and key to the kite.kite table

(kiteProt *protocol.Kite, url, keyId string)

Source from the content-addressed store, hash-verified

362
363// inseryKiteQuery inserts the given kite, url and key to the kite.kite table
364func insertKiteQuery(kiteProt *protocol.Kite, url, keyId string) (string, []interface{}, error) {
365 psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar)
366
367 kiteValues := kiteProt.Values()
368 values := make([]interface{}, len(kiteValues))
369
370 for i, kiteVal := range kiteValues {
371 values[i] = kiteVal
372 }
373
374 values = append(values, url)
375 values = append(values, keyId)
376
377 return psql.Insert("kite.kite").Columns(
378 "username",
379 "environment",
380 "kitename",
381 "version",
382 "region",
383 "hostname",
384 "id",
385 "url",
386 "key_id",
387 ).Values(values...).ToSql()
388}
389
390/*
391

Callers 2

UpsertMethod · 0.85
AddMethod · 0.85

Calls 1

ValuesMethod · 0.80

Tested by

no test coverage detected