mirror of
https://github.com/maplibre/martin.git
synced 2024-12-18 20:31:54 +03:00
Add just prepare-sqlite
to simplify sqlite dev
This commit is contained in:
parent
f401152770
commit
278f46f772
8
justfile
8
justfile
@ -187,3 +187,11 @@ git-pre-push: stop start
|
||||
cargo --version
|
||||
just lint
|
||||
just test
|
||||
|
||||
# Update sqlite database schema. Install SQLX cli if not already installed.
|
||||
prepare-sqlite:
|
||||
if ! command -v cargo-sqlx &> /dev/null; then \
|
||||
echo "SQLX could not be found. Installing..." ;\
|
||||
cargo install sqlx-cli --no-default-features --features sqlite,native-tls ;\
|
||||
fi
|
||||
cd martin-mbtiles && cargo sqlx prepare --database-url sqlite://$PWD/../tests/fixtures/files/world_cities.mbtiles
|
||||
|
@ -1,9 +1,3 @@
|
||||
# Development
|
||||
|
||||
```bash
|
||||
# To update sqlx files, first install sqlx-cli:
|
||||
cargo install sqlx-cli --no-default-features --features sqlite,native-tls
|
||||
|
||||
# Prepare DB schema (from the ./mbtiles dir)
|
||||
cargo sqlx prepare --database-url sqlite://$PWD/fixtures/geography-class-jpg.mbtiles
|
||||
```
|
||||
Any changes to SQL commands require running of `just prepare-sqlite`. This will install `cargo sqlx` command if it is not already installed, and update the `./sqlx-data.json` file.
|
||||
|
Loading…
Reference in New Issue
Block a user