Reference

Environment

Environment variables and runtime config the module reads or sets.

Environment variables

VariableRead by
DATABASE_URLyour codeSet 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_DRIVERyour code, @netlify/database, drizzle-orm/netlify-dbSet by the development socket with provider: 'netlify', to its URL and server, unless already set.
NUXT_PGLITE_DATA_DIRthe server instance, at runtimeOverrides its data directory, over nuxt.config.ts and the config file. Relative to the working directory. Not read by the socket.
NUXT_PGLITE_URLuseRuntimeConfig().pglite.urlNuxt'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
urlThe development socket's URL while it runs, otherwise empty.
dataDirThe runtime data-directory override (NUXT_PGLITE_DATA_DIR), otherwise empty.