Yes, and this would work with Node, but Workers aren't Node and can't run Express.
Yes, and this would work with Node, but Workers aren't Node and can't run Express.
batch is the solution to this, but can I send 10k sql inserts in one batch? Is there a limit to batch?
-- Create a simple table
DROP TABLE IF EXISTS test_table;
CREATE TABLE IF NOT EXISTS test_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- Drop any existing trigger
DROP TRIGGER IF EXISTS test_trigger;
-- Create a simple trigger
CREATE TRIGGER test_trigger
AFTER UPDATE ON test_table
FOR EACH ROW
BEGIN
UPDATE test_table
SET updated_at = CURRENT_TIMESTAMP
WHERE id = OLD.id;
END;