-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
35 lines (28 loc) · 1.21 KB
/
justfile
File metadata and controls
35 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Dioxus Fullstack justfile
# Install just: cargo install just
set dotenv-load := true
default:
@just --list
# ============================================================================
# DATABASE
# ============================================================================
# Reset database (drop, create, migrate)
reset_db:
@echo "Terminating all connections to database: $POSTGRES_DATABASE"
psql -h 127.0.0.1 -U "$POSTGRES_USER" -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '$POSTGRES_DATABASE';"
@echo "Dropping database: $POSTGRES_DATABASE"
psql -h 127.0.0.1 -U "$POSTGRES_USER" -d postgres -c "DROP DATABASE IF EXISTS $POSTGRES_DATABASE;"
@echo "Creating database: $POSTGRES_DATABASE"
psql -h 127.0.0.1 -U "$POSTGRES_USER" -d postgres -c "CREATE DATABASE $POSTGRES_DATABASE;"
@echo "Running migrations with sqlx"
sqlx migrate run
@echo "Done!"
# ============================================================================
# DEV
# ============================================================================
# Run web dev server (requires pnpm css running in another terminal)
dev:
dx serve
# Run Tailwind in watch mode
css:
pnpm css