Support env variables in DB config
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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