curl -X POST -H "Content-Type: text/plain" --data-binary @path/to/your/file.tsv http://localhost:8080/anvil/upload-tsv
To set up a local development database, follow these steps:
-
Run the
docker-compose.postgres.yml
file to start the required services:docker-compose -f docker-compose.postgres.yml up --build -d
-
Execute the
db/schema.sql
script to create thedict
schema and all necessary database tables. -
(Optional) If you have a dump file generated with
pg_dump
, you can restore it usingpg_restore
. If the backup is from ourBDC
database, the following command will work:pg_restore \ --host="localhost" \ --port="5432" \ --username="username" \ --dbname="dictionary_db" \ --jobs=10 \ --verbose \ --no-owner \ ./dictionary_db.sql
You will be prompted to enter the database password after executing this command.
-
Now you can run the Spring Boot application with
dev
as the active profile.
If you do not have pg_restore
and pg_dump
, you can install them by following these steps:
-
Install
postgresql@16
, which includes bothpg_restore
andpg_dump
:brew install postgresql@16
-
Link the installed PostgreSQL version:
brew link postgresql@16
-
Add PostgreSQL to your
zshrc
orbash
profile. Forzshrc
, use the following command:echo 'export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"' >> ~/.zshrc
-
Verify the versions of
pg_dump
andpg_restore
:pg_dump --version pg_restore --version
If the command doesn’t work immediately, you may need to restart your terminal.