Code Monkey home page Code Monkey logo

postgres_database's Introduction

postgres_database

Usage:

First, the docker can be downladed with the following command in the Docker terminal as:

$ docker pull vitecde/postgres-database

In order to star the docker, the following command is used:

$ docker run -v /c/Users/myDir:/home -p 8000:5432 -e "POSTGRES_PASSWORD=toor1" -it --rm vitecde/postgres_database

where:

/c/Users/myDir -> example of a directory where the file with the data to populate the data base can be copied.

POSTGRES_PASSWORD=toor1 -> environment variable to define the password of the database. Note that the standard name of the database and the standard user is "postgres". To set a custom name and user please refer to https://hub.docker.com/_/postgres/

As example to test the database, two files are provided in the /example directory: "tables2.sql" and "example_M.csv".

"tables2.sql" -> defines the structure of a table which is used to create the database as it is initialized. As shown in the Dockerfile, this file is added when the docker is created: ADD ./example/tables2.sql /docker-entrypoint-initdb.d

"example_M.csv" -> is an example of data which can be written to the database. As mentioned above, a directory is mounted to the /home directory for this example.

Then, a sql command can be sent by a client application to the database to populate the database with this file :

COPY customer_reviews FROM '/home/example_M.csv' WITH CSV;

postgres_database's People

Contributors

marcochavarria avatar

Watchers

 avatar  avatar

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.