content
content copied to clipboard
Unable to use SQLite in-memory mode with `:memory:`
Environment
- Operating System:
Darwin - Node Version:
v24.4.1 - Nuxt Version:
4.1.1 - CLI Version:
3.28.0 - Nitro Version:
2.12.5 - Package Manager:
[email protected] - Builder:
- - User Config:
compatibilityDate,modules,devtools,css,content,nitro,icon,image,i18n,routeRules - Runtime Modules:
@nuxt/[email protected],@nuxt/[email protected],@nuxt/[email protected],@nuxtjs/[email protected] - Build Modules:
-
Version
v3.6.3
Reproduction
See below, for all the technical details and links to potentially failing parts of Nuxt Content and db0 node-sqlite connector.
Description
Using Node v22.5.0+ which has support for native SQLite.
// nuxt.config.ts
export default defineNuxtConfig({
content: {
experimental: { sqliteConnector: "native" },
database: {
type: "sqlite",
filename: ":memory:",
},
},
});
Inside src/runtime/internal/database.server.ts, the refineDatabaseConfig method is renaming
config.filename = ':memory:'
to
config.name = 'memory'
This renaming applied at configuration-level by Nuxt-Content, makes in-memory SQLite not working because of the db0/node-sqlite connector which expects a
opts.name === ':memory:'
Additional context
No response
Logs
Thanks for the issue @TotomInc ,
I see, it should be fixed if we change config.name = 'memory' to config.name = ':memory:'
Closed in #3635