Sign inSign up

hxhroniegss/knex

By hxhroniegss

•Updated over 7 years ago

Image
0

1.2K

hxhroniegss/knex repository overview

⁠KnexJS Image

Knex is an SQL query builder in both Node.js and the browser https://knexjs.org/⁠.

⁠Usage

First prepare a knexfile.js in the root of your project directory with the following settings:

module.exports = {

  development: {
    client: 'mysql',
    connection: {
        host : process.env.DB_HOST,
        user : process.env.DB_USERNAME,
        password : process.env.DB_PASSWORD,
        database : process.env.DB_NAME,
    }
  }
}

At the root of your project directory, run the following command in your terminal:

docker run --rm -v ${root_dir}:/src 
    --network ${network_used_by_your_mysql_and_node_project} hxhroniegss/knex 
    /bin/ash -c "knex migrate:make create-sample-table"

NOTE For running mysql and node/reactjs, you can use these images:

Tag summary

Content type

Image

Digest

Size

25.7 MB

Last updated

over 7 years ago

docker pull hxhroniegss/knex