Hi quick question, can you somehow access production (remote) D1 outside Worker? Maybe via REST + Au
Hi quick question, can you somehow access production (remote) D1 outside Worker? Maybe via REST + Auth token?
.csv exports from D1 database and Worker is running "out of resources" while trying to process that data (expected). So my current plan is to make node server that will dump it without any limitations and provide final csv file.D1_ERROR: Network connection lost.. The cron executes every minute. * * * * *. Is it expected to get those errors from time to time? I wasn't really monitoring that worker before so I don't know how long it's been happening, in the last 24 hours it only happened 5 times so it's not a big deal for me either (since the worker execute every minute). Just wondering if there may be something I'm doing wrong that's causing these errors.undefined as null I think, otherwise we have to use value || null for each field. For example, the description throw an error when undefinedundefined would have any relation to null. You would need to handle these specifically yourself.|| operator works on falsy/truthy. null, NaN, 0, "" and undefined would all end as null in your example above."" or "0" null.description is optional fields, so I need to insert null if no value provided."0" is not "no value"|| on string type fields only"0" == false, therefore "0" || null is nullcampaign.is_enabled ? 1 : 0campaign.description === undefined ? null : campaign.descriptionfunction bindWrap( ...args)
wrangler d1 export, the SQL file cannot be imported again using wrangler d1 execute --file ..., because in the sql the tables are being created in the wrong order. That results in logs of no such table error messages because CONSTRAINT FOREIGN KEYS come before the respective CREATE TABLE...campaign.description ?? null work the same but more concise and easy to read?postgres=# INSERT INTO foo VALUES ('bar');
INSERT 0 1
postgres=# INSERT INTO foo VALUES ('bar') RETURNING *;
bar
-----
bar
(1 row)
INSERT 0 1.csv* * * * *value || null await env.DB.prepare(
`UPDATE Campaigns SET name = ?, description = ? WHERE campaign_id = ?`
)
.bind(
campaign.name,
campaign.description || null,
campaign.campaign_id
)
.run();NaN"0""0""0" == false"0" || nullcampaign.is_enabled ? 1 : 0campaign.description === undefined ? null : campaign.descriptionfunction bindWrap( ...args)wrangler d1 execute --file ...no such tableCONSTRAINT FOREIGN KEYSCREATE TABLEcampaign.description ?? null