Alternatively, you can use ``` npx @outerbase/studio ``` inside your cloudflare project to view D1 d
Alternatively, you can use
inside your cloudflare project to view D1 database
inside your cloudflare project to view D1 database
npx @outerbase/studio and It works perfectly for the local SQLite in the Wrangler project.npx @outerbase/studio --config="$pwd\d1-outerbase.config-local.json"
{
"driver": "sqlite",
"connection": {
"file": ".wrangler/state/v3/d1/miniflare-D1DatabaseObject/15c63002ced39d198237431f852a8e7204274c5a10e9861150529b8b00db0f6c.sqlite"
},
"port": 4000
}@outerbase/studio packagenpx @outerbase/studio --config="$pwd\d1-outerbase.config-remote.json"
{
"driver": "cloudflare-d1",
"connection": {
"accountId": "your-account-id",
"apiToken": "your-api-token",
"databaseId": "your-database-id"
},
"port": 4000
}


D1 Read token API token and then any writes would fail? Doesn't seem like there's a way to do this through workers APIconst db = drizzle({ connection: process.env.DATABASE_URL, casing: 'snake_case' })npx @outerbase/studio --config="$pwd\d1-outerbase.config-local.json"
{
"driver": "sqlite",
"connection": {
"file": ".wrangler/state/v3/d1/miniflare-D1DatabaseObject/15c63002ced39d198237431f852a8e7204274c5a10e9861150529b8b00db0f6c.sqlite"
},
"port": 4000
}npx @outerbase/studio --config="$pwd\d1-outerbase.config-remote.json"
{
"driver": "cloudflare-d1",
"connection": {
"accountId": "your-account-id",
"apiToken": "your-api-token",
"databaseId": "your-database-id"
},
"port": 4000
}// Row definition
type OrderRow = {
Id: string;
CustomerName: string;
OrderDate: number;
};
// Elsewhere in your application
const result = await env.MY_DB.prepare(
"SELECT Id, CustomerName, OrderDate FROM [Order] ORDER BY ShippedDate DESC LIMIT 100",
).run<OrderRow>();