mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-02 06:46:06 -04:00
docs: update sqlx script and add ci
- upgrades sqlx to 0.6 - fixes sqlite_dev_setup.sh script - adds ci to test the script
This commit is contained in:
parent
f0e28b1bc6
commit
f0e059c814
7 changed files with 166 additions and 114 deletions
16
swap/sqlite_dev_setup.sh
Normal file → Executable file
16
swap/sqlite_dev_setup.sh
Normal file → Executable file
|
@ -1,6 +1,14 @@
|
|||
# crated temporary DB
|
||||
# run the migration scripts to create the tables
|
||||
# prepare the sqlx-data.json rust mappings
|
||||
#!/bin/bash
|
||||
|
||||
# run this script from the swap dir
|
||||
# make sure you have sqlx-cli installed: cargo install sqlx-cli
|
||||
|
||||
# this script creates a temporary sqlite database
|
||||
# then runs the migration scripts to create the tables (migrations folder)
|
||||
# then it prepares the offline sqlx-data.json rust mappings
|
||||
DATABASE_URL=sqlite:tempdb cargo sqlx database create
|
||||
DATABASE_URL=sqlite:tempdb cargo sqlx migrate run
|
||||
DATABASE_URL=sqlite:./swap/tempdb cargo sqlx prepare -- --bin swap
|
||||
# needs the absolute path here
|
||||
# https://github.com/launchbadge/sqlx/issues/1399
|
||||
DB_PATH=$(readlink -f tempdb)
|
||||
DATABASE_URL="sqlite:$DB_PATH" cargo sqlx prepare -- --bin swap
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue