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

Function createTodo

examples/write-patterns/shared/backend/api.js:39–48  ·  view source on GitHub ↗
(id, title, created_at, write_id)

Source from the content-addressed store, hash-verified

37// using the `db` client.
38
39const createTodo = async (id, title, created_at, write_id) => {
40 const sql = `
41 INSERT INTO todos (id, title, completed, created_at, write_id)
42 VALUES ($1, $2, false, $3, $4)
43 `
44
45 const params = [id, title, created_at, write_id || null]
46
47 await pool.query(sql, params)
48}
49
50const updateTodo = async (id, completed, write_id) => {
51 const sql = `

Callers 1

api.jsFile · 0.70

Calls 1

queryMethod · 0.80

Tested by

no test coverage detected