BUN := $(shell command -v bun 2>/dev/null || echo "$(HOME)/.bun/bin/bun")
INSPECTOR := apps/inspector
WEBSITE := apps/website
EXTENSION := apps/vscode-forgedb
BENCH := benchmarks/Cargo.toml
BENCH_VARIANTS := default fsync_never replication_on compaction_off compaction_low changefeed_small
.PHONY: inspector-install inspector inspector-build inspector-typecheck \
inspector-app inspector-app-build \
website-install website website-build website-typecheck website-secrets \
website-rewrite website-rewrite-watch changelog roadmap \
extension-install extension-build extension-typecheck extension-package \
bench bench-forgedb bench-sqlite bench-redb bench-duckdb bench-postgres \
bench-pglite bench-matrix bench-regen bench-regen-matrix \
bench-footprint bench-concurrency
bench:
cargo bench --manifest-path $(BENCH) \
--bench forgedb_bench --bench sqlite_bench --bench redb_bench --bench duckdb_bench
bench-forgedb:
cargo bench --manifest-path $(BENCH) --bench forgedb_bench
bench-sqlite:
cargo bench --manifest-path $(BENCH) --bench sqlite_bench
bench-redb:
cargo bench --manifest-path $(BENCH) --bench redb_bench
bench-duckdb:
cargo bench --manifest-path $(BENCH) --bench duckdb_bench
bench-postgres:
devbox run -- benchmarks/scripts/pg_run.sh
bench-pglite:
($(BUN) install --cwd benchmarks/js && $(BUN) run --cwd benchmarks/js bench.ts)
bench-footprint:
cargo run --manifest-path $(BENCH) --example footprint --release
bench-concurrency:
cargo run --manifest-path $(BENCH) --example concurrency --release
bench-matrix:
cargo bench --manifest-path $(BENCH) --bench matrix_bench
bench-regen:
cargo run -- generate rust --schema benchmarks/bench.forge --output benchmarks/gen --force
bench-regen-matrix:
@for v in $(BENCH_VARIANTS); do \
echo "regen $$v"; \
cargo run -q -- generate rust --force \
--config benchmarks/configs/$$v.toml \
--schema benchmarks/bench.forge \
--output benchmarks/gen/$$v || exit 1; \
done
inspector-install:
cd $(INSPECTOR) && $(BUN) install
inspector:
cd $(INSPECTOR) && $(BUN) run dev
inspector-build:
cd $(INSPECTOR) && $(BUN) run build
inspector-typecheck:
cd $(INSPECTOR) && $(BUN) run typecheck
inspector-app:
cd $(INSPECTOR) && $(BUN) run tauri dev
inspector-app-build:
cd $(INSPECTOR) && $(BUN) run tauri build
website-install:
cd $(WEBSITE) && $(BUN) install
website:
cd $(WEBSITE) && $(BUN) run dev
website-build:
cd $(WEBSITE) && $(BUN) scripts/website-build.ts
website-typecheck:
cd $(WEBSITE) && $(BUN) run typecheck
changelog:
git-cliff --config cliff.toml --output CHANGELOG.md
@echo "✓ CHANGELOG.md regenerated — review the diff before committing."
roadmap:
cd $(WEBSITE) && $(BUN) run roadmap
website-rewrite:
cd $(WEBSITE) && $(BUN) run rewrite:dev
website-rewrite-watch:
cd $(WEBSITE) && $(BUN) run rewrite:watch
website-secrets:
@op read "op://Private/forgedb.dev deploy/posthog project key" | gh secret set NEXT_PUBLIC_POSTHOG_KEY
@op read "op://Private/forgedb.dev deploy/vercel token" | gh secret set VERCEL_TOKEN
@op read "op://Private/forgedb.dev deploy/vercel org id" | gh secret set VERCEL_ORG_ID
@op read "op://Private/forgedb.dev deploy/vercel project id" | gh secret set VERCEL_PROJECT_ID
@echo "✓ Pushed NEXT_PUBLIC_POSTHOG_KEY, VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID to GitHub Actions"
extension-install:
cd $(EXTENSION) && $(BUN) install
extension-build:
cd $(EXTENSION) && $(BUN) install && $(BUN) run compile
extension-typecheck:
cd $(EXTENSION) && $(BUN) install && $(BUN) x tsc --noEmit -p ./
extension-package:
cd $(EXTENSION) && $(BUN) install && $(BUN) run package
@echo "Packaged: $(EXTENSION)/forgedb-*.vsix"
.PHONY: crash-test
crash-test:
cargo test --test crash_recovery_test -- --ignored --nocapture