inseryKiteQuery inserts the given kite, url and key to the kite.kite table
(kiteProt *protocol.Kite, url, keyId string)
| 362 | |
| 363 | // inseryKiteQuery inserts the given kite, url and key to the kite.kite table |
| 364 | func 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 |