question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support database URLs

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
girardinsamuelcommented, Jan 21, 2021

Yes django-environ is using dj-database-url internally 😉

0reactions
girardinsamuelcommented, Dec 22, 2021

I have give it a try, let me know what you think !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found