content icon indicating copy to clipboard operation
content copied to clipboard

Unable to use SQLite in-memory mode with `:memory:`

Open TotomInc opened this issue 4 months ago • 1 comments

Environment

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'

See relevant lines.

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:'

See relevant lines.

Additional context

No response

Logs


TotomInc avatar Sep 08 '25 13:09 TotomInc

Thanks for the issue @TotomInc , I see, it should be fixed if we change config.name = 'memory' to config.name = ':memory:'

farnabaz avatar Oct 27 '25 14:10 farnabaz

Closed in #3635

farnabaz avatar Dec 16 '25 14:12 farnabaz