with the code above i do not need to use `preview_database_id`
with the code above i do not need to use
preview_database_idpersistTo to a different temporary path works. In the docs above if an user would run tests with preview_database_id set but not a custom persistTo they would mess up their development databasepreview_database_id to interact w/ programmatic testing here./tmp/<some random ID> file that gets thrown away by your OS. That way, if you have a larger DB, we don't eat all of your CI containers' memory D1 sqlite? I was using bun sqlite where I create a local db.sqlite file and interact with it using the imported client. In the case of Cloudflare & wrangler, I'm a little confused as to how I can create and seed a local sqlitedev commandwrangler.json--persist-to=/path/to/file to persist data to a specific location but no luck and on seeding I couldn't find any relevant info.prestart script that runs a ts file to init local sqlite and seed itwrangler d1 migrations, you can use a migration to seed the database or if you want a more programatic approach scroll up a bit, we had a discussion about possibilites just a few hours ago--persist-to=/path/to/filepreview_database_id (per https://developers.cloudflare.com/d1/platform/migrations/#wrangler-customizations) and use wrangler d1 migrations apply <db-name> --local -> you can apply migrations locally to seed the DB. As above, you can also do that programatically via your test harness
name.sqlite file?wrangler d1 migrations inside your tests: the example shows that.db. Is there a way to change that by just changing binding in wrangler config?wrangler d1 execute --local --comand="SELECT NOTHING"Error: statement too long
NO_D1_WARNING=true ./node_modules/.bin/wrangler dev --persist-to=./tokens.sqlite --experimental-json-config{
"$schema": "https://gist.githubusercontent.com/o-az/d298a1776165407ba63ee763d32f7a89/raw/7f87871dd9a5efb9d3cc147fac0174ebdc9858fa/wrangler.json",
"name": "tokens",
"workers_dev": true,
"main": "./src/index.ts",
"compatibility_date": "2023-05-18",
"compatibility_flags": [ "nodejs_compat" ],
"placement": { "mode": "smart" },
"d1_databases": [
{
"binding": "database",
"database_name": "tokens",
"preview_database_id": "local-tokens-sqlite"
}
]
}⛅️ wrangler 3.1.0 (update available 3.1.1)wrangler d1 execute --local --comand="SELECT NOTHING"Error: statement too long