Giter Site home page Giter Site logo

Comments (8)

jxs avatar jxs commented on July 21, 2024

Hi, what would the idea be? at the moment you can set the db_host and db_port via Config

from refinery.

c410-f3r avatar c410-f3r commented on July 21, 2024

It is easier to set a variable for dev, test or qa instead of having 3 different files that are a bit harder to maintain.
Another thing that may annoy embedded deploying is the additional dependencies for someone that is using a different runtime like async-std.

from refinery.

jxs avatar jxs commented on July 21, 2024

It is easier to set a variable for dev, test or qa instead of having 3 different files that are a bit harder to maintain.

yeah, I can understand that, i was asking what the purposed API would be

Another thing that may annoy embedded deploying is the additional dependencies for someone that is using a different runtime like async-std.

how so? both of the async drivers are coupled to tokio

from refinery.

c410-f3r avatar c410-f3r commented on July 21, 2024

yeah, I can understand that, i was asking what the purposed API would be

I see now. Well, something like: Look for config file, if not, look for DATABASE_URL, if not, then fail.
Not sure if this approach is realistic within the current architecture. Maybe, with enough free-time, I will provide a PR to demonstrate this strategy.

how so? both of the async drivers are coupled to tokio

Although not very idiomatic in some cases, I personally prefer to send an ephemeral compiled CLI binary along side the application as part of a deploying script. This is just me and it isn't related.

from refinery.

jxs avatar jxs commented on July 21, 2024

I see now. Well, something like: Look for config file, if not, look for DATABASE_URL, if not, then fail.
Not sure if this approach is realistic within the current architecture. Maybe, with enough free-time, I will provide a PR to demonstrate this strategy.

what if there was a method on Config to instantiate from environment variables?

from refinery.

c410-f3r avatar c410-f3r commented on July 21, 2024

Looks good! A from_env_var doesn't seem much different from from_file_location.

from refinery.

jxs avatar jxs commented on July 21, 2024

ok great! do you want to give it a go then?

from refinery.

c410-f3r avatar c410-f3r commented on July 21, 2024

@jxs #103

from refinery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.