Coder Social home page Coder Social logo

Comments (7)

rubenv avatar rubenv commented on June 14, 2024 1

from sql-migrate.

paulwalker avatar paulwalker commented on June 14, 2024

It seems a bit strange that the migrations can be accessed via bindata, but then a config file is still required?

from sql-migrate.

rubenv avatar rubenv commented on June 14, 2024

@paulwalker please open a different issue when asking a different question.

from sql-migrate.

sbrudz avatar sbrudz commented on June 14, 2024

I was able to use environment variables within the dbconfig.yml file:

development:
    dialect: mysql
    datasource: ${DBUSER}:${DBPASS}@tcp(${DBHOST}:${DBPORT})/${DBNAME}?parseTime=true
    dir: migrations
    table: migrations

from sql-migrate.

risentveber avatar risentveber commented on June 14, 2024

Add docs to readme for this in #143
@rubenv @sbrudz

from sql-migrate.

chakrit avatar chakrit commented on June 14, 2024

@sbrudz @risentveber That is not the same as using env vars directly. See the Factor III. in Twelve Factor App.

Quoting:

Another approach to config is the use of config files which are not checked into revision control, such as config/database.yml in Rails. This is a huge improvement over using constants which are checked into the code repo, but still has weaknesses: it’s easy to mistakenly check in a config file to the repo; there is a tendency for config files to be scattered about in different places and different formats, making it hard to see and manage all the config in one place. Further, these formats tend to be language- or framework-specific.

Emphasis mine.

Personally environment variables are better because it's much easier to set with tools like the shell scripts, docker env vars, kubernetes manifest, heroku settings page etc. Requiring there to be a file on disk creates a dependency on the file system, meaning for each place we deploy (container image, prod servers, staging servers etc.) we need to add code to place this file at the right place and at the right time before things will actually work.

This also prevent deploying a standalone fat Go binary with everything inside it. Which is one of the main advantages of using Go in the first place.

from sql-migrate.

chakrit avatar chakrit commented on June 14, 2024

@rubenv ah ok, thanks for clarifying. so the primary use case is actually to embed and roll our own cmds.

from sql-migrate.

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.