MCPcopy Create free account
hub / github.com/koding/kite / Update

Method Update

kontrol/postgres.go:311–325  ·  view source on GitHub ↗
(kiteProt *protocol.Kite, value *kontrolprotocol.RegisterValue)

Source from the content-addressed store, hash-verified

309}
310
311func (p *Postgres) Update(kiteProt *protocol.Kite, value *kontrolprotocol.RegisterValue) error {
312 // check that the incoming url is valid to prevent malformed input
313 _, err := url.Parse(value.URL)
314 if err != nil {
315 return err
316 }
317
318 // TODO: also consider just using WHERE id = kiteProt.ID, see how it's
319 // performs out
320 _, err = p.DB.Exec(`UPDATE kite.kite SET url = $1, updated_at = (now() at time zone 'utc')
321 WHERE id = $2`,
322 value.URL, kiteProt.ID)
323
324 return err
325}
326
327func (p *Postgres) Delete(kiteProt *protocol.Kite) error {
328 deleteKite := `DELETE FROM kite.kite WHERE id = $1`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected