Skip to content

Upload functionality#1

Draft
WesleyBatista wants to merge 3 commits intomainfrom
upload-functionality
Draft

Upload functionality#1
WesleyBatista wants to merge 3 commits intomainfrom
upload-functionality

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