kite_sql 0.2.1

SQL as a Function for Rust
Documentation
# Helper variables (override on invocation if needed).
CARGO ?= cargo
WASM_PACK ?= wasm-pack
SQLLOGIC_PATH ?= tests/slt/**/*.slt
PYO3_PYTHON ?= /usr/bin/python3.12
TPCC_MEASURE_TIME ?= 15
TPCC_NUM_WARE ?= 1
TPCC_PPROF_OUTPUT ?= /tmp/tpcc_lmdb.svg
TPCC_SQLITE_PROFILE ?= balanced

.PHONY: test test-python test-wasm test-slt test-all wasm-build check tpcc tpcc-kitesql-rocksdb tpcc-kitesql-lmdb tpcc-lmdb-flamegraph tpcc-sqlite tpcc-sqlite-practical tpcc-sqlite-balanced tpcc-dual cargo-check build wasm-examples native-examples fmt clippy

## Run default Rust tests in the current environment (non-WASM).
test:
	$(CARGO) test --all

## Run Python binding API tests implemented with pyo3.
test-python:
	PYO3_PYTHON=$(PYO3_PYTHON) $(CARGO) test --features python test_python_

## Perform a `cargo check` across the workspace.
cargo-check:
	$(CARGO) check

## Build the workspace artifacts (debug).
build:
	$(CARGO) build

## Build the WebAssembly package (artifact goes to ./pkg).
wasm-build:
	$(WASM_PACK) build --release --target nodejs

## Execute wasm-bindgen tests under Node.js (wasm32 target).
test-wasm:
	$(WASM_PACK) test --node -- --package kite_sql --lib

## Run the sqllogictest harness against the configured .slt suite.
test-slt:
	$(CARGO) run -p sqllogictest-test -- --path '$(SQLLOGIC_PATH)'

## Convenience target to run every suite in sequence.
test-all: test test-wasm test-slt test-python

## Run formatting (check mode) across the workspace.
fmt:
	$(CARGO) fmt --all -- --check

## Execute clippy across all targets/features with warnings elevated to errors.
clippy:
	$(CARGO) clippy --all-targets --all-features -- -D warnings

## Run formatting (check mode) and clippy linting together.
check: fmt clippy

tpcc: tpcc-kitesql-lmdb

## Execute the TPCC workload on KiteSQL with RocksDB storage.
tpcc-kitesql-rocksdb:
	$(CARGO) run -p tpcc --release -- --backend kitesql-rocksdb

## Execute the TPCC workload on KiteSQL with LMDB storage.
tpcc-kitesql-lmdb:
	$(CARGO) run -p tpcc --release -- --backend kitesql-lmdb

## Execute TPCC on LMDB and emit a pprof flamegraph SVG.
tpcc-lmdb-flamegraph:
	CARGO_PROFILE_RELEASE_DEBUG=true $(CARGO) run -p tpcc --release --features pprof -- --backend kitesql-lmdb --measure-time $(TPCC_MEASURE_TIME) --num-ware $(TPCC_NUM_WARE) --pprof-output $(TPCC_PPROF_OUTPUT)

## Execute the TPCC workload on SQLite with the practical profile.
tpcc-sqlite:
	$(CARGO) run -p tpcc --release -- --backend sqlite --sqlite-profile $(TPCC_SQLITE_PROFILE) --path kite_sql_tpcc.sqlite

## Execute the TPCC workload on SQLite with the practical profile.
tpcc-sqlite-practical:
	$(MAKE) tpcc-sqlite TPCC_SQLITE_PROFILE=practical

## Execute the TPCC workload on SQLite with the balanced profile.
tpcc-sqlite-balanced:
	$(MAKE) tpcc-sqlite TPCC_SQLITE_PROFILE=balanced

## Execute TPCC while mirroring every statement to an in-memory SQLite instance for validation.
tpcc-dual:
	$(CARGO) run -p tpcc --release -- --backend dual --measure-time 60

## Run JavaScript-based Wasm example scripts.
wasm-examples:
	node examples/wasm_hello_world.test.mjs
	node examples/wasm_index_usage.test.mjs

## Run the native (non-Wasm) example binaries.
native-examples:
	$(CARGO) run --example hello_world
	$(CARGO) run --example transaction