Reference
Environment
Environment variables and runtime config the module reads or sets.
Environment variables
| Variable | Read by | |
|---|---|---|
DATABASE_URL | your code | Set by the development socket to its URL in nuxt dev, unless already set. What is exported follows socket.env and socket.provider. |
NETLIFY_DB_URL, NETLIFY_DB_DRIVER | your code, @netlify/database, drizzle-orm/netlify-db | Set by the development socket with provider: 'netlify', to its URL and server, unless already set. |
NUXT_PGLITE_DATA_DIR | the server instance, at runtime | Overrides its data directory, over nuxt.config.ts and the config file. Relative to the working directory. Not read by the socket. |
NUXT_PGLITE_URL | useRuntimeConfig().pglite.url | Nuxt's usual runtime-config override; the socket sets the value itself in nuxt dev. |
A test database served over the socket, from createTestDatabase or definePGliteGlobalSetup, exports the same variables as the development socket, resolved from its own socket.env and socket.provider and under the same rule: only those still unset, and only while it is open. exportEnv: false exports none; db.env holds them either way.
Runtime config
The module adds a private (server-only) key:
useRuntimeConfig().pglite
// { url: string, dataDir: string }
| Key | |
|---|---|
url | The development socket's URL while it runs, otherwise empty. |
dataDir | The runtime data-directory override (NUXT_PGLITE_DATA_DIR), otherwise empty. |