MCPcopy Create free account
hub / github.com/electric-sql/electric / updateTodo

Function updateTodo

examples/write-patterns/shared/backend/api.js:50–59  ·  view source on GitHub ↗
(id, completed, write_id)

Source from the content-addressed store, hash-verified

48}
49
50const updateTodo = async (id, completed, write_id) => {
51 const sql = `
52 UPDATE todos SET completed = $1, write_id = $2
53 WHERE id = $3
54 `
55
56 const params = [completed ? `1` : `0`, write_id || null, id]
57
58 await pool.query(sql, params)
59}
60
61const deleteTodo = async (id) => {
62 const sql = `DELETE from todos where id = $1`

Callers 1

api.jsFile · 0.70

Calls 1

queryMethod · 0.80

Tested by

no test coverage detected