Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on postgresql connector is missleading #3091

Open
UngererFabien opened this issue Feb 13, 2025 · 0 comments
Open

Documentation on postgresql connector is missleading #3091

UngererFabien opened this issue Feb 13, 2025 · 0 comments

Comments

@UngererFabien
Copy link
Contributor

export default defineNuxtConfig({
  nitro: {
    database: {
      default: {
        connector: 'sqlite',
        options: { name: 'db' }
      },
      users: {
        connector: 'postgresql',
        url: 'postgresql://username:password@hostname:port/database_name'
      }
    }
  }
})

This exemple shows a url params. I think it requires a options object with a url key.

It did worked for me once I changed to:

export default defineNuxtConfig({
  nitro: {
    database: {
      default: {
        connector: 'sqlite',
        options: { name: 'db' }
      },
      users: {
        connector: 'postgresql',
        options: { url: 'postgresql://username:password@hostname:port/database_name' }
      }
    }
  }
})

I found the solution looking at this file: https://github.com/nitrojs/nitro/blob/v2/src/runtime/internal/database.ts#L3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant