Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload functionality #1

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Upload functionality #1

wants to merge 3 commits into from

Conversation

WesleyBatista
Copy link
Owner

Upload to a database for running queries/analysis on top of the tickercsv data.

@WesleyBatista WesleyBatista self-assigned this Dec 8, 2020
@WesleyBatista
Copy link
Owner Author

WesleyBatista commented Dec 8, 2020

Setup Postgres with Docker for testing

  1. store the password somewhere in your local file system, for example $HOME/postgres/root_password;
  2. run the following command to create a postgres container:
    $ docker run --restart always -d -p 5432:5432 -v $HOME/postgres/root_password:/run/secrets/postgres-passwd -v $HOME/postgres/data:/var/lib/postgresql/data -e="POSTGRES_PASSWORD_FILE=/run/secrets/postgres-passwd" --name postgres postgres:12
    
  3. run $ docker exec -it postgres bash to access the container and create the user b3user and the database b3data (remember to set the ownership for the database for b3user)
    CREATE USER b3user IDENTIFIED WITH sha256_password BY 'your_password_goes_here'

...

After ingesting a file, you can quickly verify it worked comparing the count from file and database:

$ docker exec -it postgres su postgres -c "psql -U b3user -d b3data -c 'select count(0) from tickercsv'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant