Skip to content

Latest commit

 

History

History

batch_insert

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

tool: insert data from csv into database

  • insert data into users table of the database.

ready

  1. install direnv

usage

  1. create .env file following .env.template
  2. run direnv allow . in this directory.
  3. check environment variable DSN is setted by running echo $DSN.
  4. create your *.csv file following example.csv file. and check comment.
  5. run your database by docker compose up -d in root directory of this repository.
  6. run go run main.go ${path_to_your_csv_file} in this directory.
    • e.g. go run main.go example.csv