pi0 / nitro-cloudflare-dev

Enable access to the Cloudflare runtime bindings in development server of Nitro and Nuxt
MIT License
73 stars 4 forks source link

How to fix d1 db name? #25

Closed cosbgn closed 4 months ago

cosbgn commented 4 months ago

I would like to use drizzle for migrations. I need to setup my drizzle.config.local to something like this:

import { defineConfig } from 'drizzle-kit'

export default defineConfig({
  dbCredentials: {
    url: '', // 👈 this could also be a path to the local sqlite file
  }
})

The issue I have is that the db name changes anytime I simply delete it (often in dev). Is there a way to set a fixed db name or somehow get the db name easily?

cosbgn commented 4 months ago

Looks like a hash from the binding: https://gist.github.com/KyGuy2002/1c70a5129042f1b037c56fe0b70b066e