Support database URLs
See original GitHub issueWe should be able to somehow support database URL’s
postgres://user:secret@localhost:5432/mydatabasename
We should be able to discuss the best way to approach this. Maybe we either have a function that returns the information in a correct format like:
# config/database.py
from masoniteorm.helpers import database_url
DATABASES = {
'mysql': database_url(env("DATABASE_URL"))
}
Maybe this returns a dictionary.
Another option is maybe just adding a URL attribute, and if it exists, use that instead of all the other config options:
# config/database.py
from masoniteorm.helpers import database_url
DATABASES = {
'mysql': {
"user": "..",
"password": "..",
"url": "mysql://user:secret@localhost:5432/mydatabasename"
}
}
If url is set, use that, if not then don’t use it?
Open for discussion. Can see how other libraries do this
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Database URLs - IBM
Database URLs specify the subprotocol (the database connectivity mechanism), the database or server identifier, and a list of properties. Your Embedded SQLJ ...
Read more >Products - Direct URLs - Gale Support
PRODUCT ID LINK
American Fiction, 1774‑1920 AMFN https://link.gale.com/apps/AMFN?u=
Archives of Sexuality and Gender AHSI https://link.gale.com/apps/AHSI?u=
Archives Unbound GDSC https://link.gale.com/apps/GDSC?u=
Read more >8 Data Sources and URLs - Oracle Help Center
This chapter discusses connecting applications to databases using Java Database Connectivity (JDBC) data sources, as well as the URLs that describe ...
Read more >Connection URLs (Reference) - Prisma
Learn about the format and syntax Prisma uses for defining database connection URLs for PostgreSQL, MySQL and SQLite.
Read more >How to create Direct Database URL's - ProQuest Support
1. Click on the database selection link at the top of the page - searching "XXXX databases" · 2. Hover over the database...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes django-environ is using dj-database-url internally 😉
I have give it a try, let me know what you think !