I am able to query the DB and get info back but when I try to insert a row in an SQLite DB , I get an empty response.
My query that returns something:
const response = await sql('SELECT * FROM work_orders ORDER BY CASE WHEN status = "OPEN" THEN 1 WHEN status = "CLOSED" THEN 2 ELSE 3 END')
and the insertion that won't work:
const response = await sql('INSERT INTO work_orders (name, status) VALUES (?, "OPEN")', workOrderName);
return res.status(201).json({ response });
What could I be missing?
the table was created with id INTEGER PRIMARY KEY AUTOINCREMENT
.schema <table>you will get the definition. Also which sql library are you using with node?'name' varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL