D1_ERROR: Network connection lost. or D1_ERROR: D1 storage operation exceeded timeout which caused object to be reset. with 1k to 2.5k write request per day.CREATE TABLE IF NOT EXISTS using the D1 client api?idtimeFrom timeToqueud after a successfully publishing the event, then run a background process that can retry in case of failures.timeFrom or timeTo value is not a number, then ignore the client request on the worker side.bind() makes it safe:D1_ERROR: Network connection lost.D1_ERROR: D1 storage operation exceeded timeout which caused object to be reset.CREATE TABLE IF NOT EXISTStry{
const stmt = await env.soldb.prepare('CREATE TABLE IF NOT EXISTS Testing (blockId INTEGER PRIMARY KEY, blockTs INTEGER)').run()
console.log(stmt)
}
catch(err){
console.log(err)
}{
success: true,
meta: {
served_by: 'miniflare.db',
duration: 0,
changes: 0,
last_row_id: 0,
changed_db: false,
size_after: 3854336
},
results: []
}timeFromtimeFromtimeTotimeToqueudconst createTable = await env.db.prepare(`
CREATE TABLE IF NOT EXISTS ${tableName} (
id INTEGER PRIMARY KEY AUTOINCREMENT,
blockTs INTEGER,
value TEXT,
INDEX idx_blockTs (blockTs)
)
`).run();.bind()const createTable = await env.db.prepare(`
CREATE TABLE IF NOT EXISTS ?1 (
id INTEGER PRIMARY KEY AUTOINCREMENT,
blockTs INTEGER,
value TEXT,
INDEX idx_blockTs (blockTs)
)
`).bind(tableName).run();const createTable = await env.db.prepare(`
CREATE TABLE IF NOT EXISTS ${tableName} (
id INTEGER PRIMARY KEY AUTOINCREMENT,
blockTs INTEGER,
value TEXT,
INDEX idx_blockTs (blockTs)
)
`).run();