nitrojs / nitrojs/nitro

Support env variables in DB config

Open
#2,271 4 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

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

Currently we define pgsql connection information in a configuration file.
I think it's dangerous to expose connection information in config files

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or entry points. Start by locating Nitro's database configuration handling for the shown SQLite and PostgreSQL connectors; done means connection values can be supplied through environment variables without exposing them in the configuration file.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, sqlite, typescript
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.