I have a small Nuxt app using Nuxt auth utils to handle the OAuth stuff. This app needs a very small relational database, so I thought about choosing the free Vercel hosting tier with the free Supabase tier for my Postgres DB.
Since I don't need all the Supabase extra features I think I want to stick with the direct Postgres database connection string.
I tried the latest Nuxthub version ( v0.10.6 ) and AFAIK things are agnostic now
I started with a basic setup, the Nuxt configuration is
export default defineNuxtConfig({
// ...
modules: [
// ...
'@nuxthub/core',
],
// ...
hub: {
db: 'postgresql'
}
})
It seems Nuxthub runs a local database for dev mode. I don't have to connect to my Supabase instance right now.
But what is the correct way to do so for production mode?
The docs ( https://hub.nuxt.com/docs/database#advanced-configuration ) come up with the following example
export default defineNuxtConfig({
hub: {
db: {
dialect: 'postgresql',
driver: 'postgres-js', // Optional: explicitly choose driver
connection: {
connectionString: process.env.DATABASE_URL
}
}
}
})
but mention
For advanced use cases, you can explicitly configure the database connection
Is this an advanced usecase? What would be the non-advanced way to solve this?