2023-07-29 18:47:25 +00:00
|
|
|
DEV_FEATURES ?= storage-mem,http,scripting
|
|
|
|
SURREAL_LOG ?= trace
|
|
|
|
SURREAL_USER ?= root
|
|
|
|
SURREAL_PASS ?= root
|
|
|
|
SURREAL_AUTH ?= true
|
|
|
|
SURREAL_PATH ?= memory
|
|
|
|
SURREAL_NAMESPACE ?= test
|
|
|
|
SURREAL_DATABASE ?= test
|
|
|
|
|
|
|
|
SHELL := env SURREAL_PATH=$(SURREAL_PATH) SURREAL_LOG=$(SURREAL_LOG) SURREAL_AUTH=$(SURREAL_AUTH) SURREAL_USER=$(SURREAL_USER) SURREAL_PASS=$(SURREAL_PASS) $(SHELL)
|
2023-04-19 08:27:53 +00:00
|
|
|
|
2022-04-09 12:38:45 +00:00
|
|
|
.PHONY: default
|
|
|
|
default:
|
|
|
|
@echo "Choose a Makefile target:"
|
|
|
|
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print " - " $$1}}' | sort
|
|
|
|
|
2022-07-18 23:14:46 +00:00
|
|
|
.PHONY: setup
|
|
|
|
setup:
|
2022-09-26 00:29:38 +00:00
|
|
|
cargo upgrade --pinned
|
2022-08-10 22:45:13 +00:00
|
|
|
cargo update
|
2022-07-18 23:14:46 +00:00
|
|
|
|
2022-05-03 23:39:58 +00:00
|
|
|
.PHONY: docs
|
|
|
|
docs:
|
2023-05-31 12:35:41 +00:00
|
|
|
cargo doc --open --no-deps --package surrealdb --features rustls,native-tls,protocol-ws,protocol-http,kv-mem,kv-indxdb,kv-speedb,kv-rocksdb,kv-tikv,http,scripting
|
2022-05-03 23:39:58 +00:00
|
|
|
|
2022-04-09 12:38:45 +00:00
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
cargo test --workspace
|
|
|
|
|
2022-05-03 23:40:18 +00:00
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
cargo check --workspace
|
2023-06-19 22:35:19 +00:00
|
|
|
cargo fmt --all --check
|
|
|
|
cargo fmt --all --check -- ./lib/tests/**/*.rs ./lib/src/kvs/tests/*.rs
|
2023-06-21 07:45:39 +00:00
|
|
|
cargo clippy --all-targets --all-features -- -D warnings
|
2022-05-03 23:40:18 +00:00
|
|
|
|
2022-04-09 12:38:45 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2022-05-09 22:58:56 +00:00
|
|
|
cargo clean
|
2022-04-09 12:38:45 +00:00
|
|
|
|
2023-05-23 06:13:47 +00:00
|
|
|
.PHONY: bench
|
|
|
|
bench:
|
|
|
|
cargo bench --package surrealdb --no-default-features --features kv-mem,http,scripting
|
|
|
|
|
2022-04-09 12:38:45 +00:00
|
|
|
.PHONY: serve
|
|
|
|
serve:
|
2023-07-29 18:47:25 +00:00
|
|
|
cargo run --no-default-features --features $(DEV_FEATURES) -- start
|
2022-04-09 12:38:45 +00:00
|
|
|
|
2022-09-14 23:39:44 +00:00
|
|
|
.PHONY: sql
|
|
|
|
sql:
|
2023-07-29 18:47:25 +00:00
|
|
|
cargo run --no-default-features --features $(DEV_FEATURES) -- sql --conn ws://0.0.0.0:8000 --multi --pretty
|
2022-09-14 23:39:44 +00:00
|
|
|
|
2022-04-09 12:38:45 +00:00
|
|
|
.PHONY: quick
|
|
|
|
quick:
|
|
|
|
cargo build
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
2022-08-26 22:16:13 +00:00
|
|
|
cargo build --release
|