[workspace] members = ["."] exclude = ["fuzz", "tests/golden/gen/v7", "tests/golden/gen/v8"] resolver = "2" [package] name = "minigraf" version = "2.0.5" edition = "2024" rust-version = "1.89" description = "Zero-config, single-file, embedded graph database with bi-temporal Datalog queries" license = "MIT OR Apache-2.0" authors = ["Aditya Mukhopadhyay"] repository = "https://github.com/project-minigraf/minigraf" keywords = ["graph", "datalog", "bitemporal", "embedded", "database"] categories = ["database-implementations", "embedded"] readme = "README.md" documentation = "https://docs.rs/minigraf" [lib] crate-type = ["cdylib", "rlib"] [package.metadata.wasm-pack.profile.release] wasm-opt = false [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] serde = { version = "1.0", features = ["derive"] } postcard = { version = "1.0", features = ["alloc"] } crc32fast = "1.4" anyhow = "1.0" chrono = { version = "0.4", features = ["serde", "std"], default-features = false } uuid = { version = "1.0", features = ["v5", "serde"] } regex-lite = "0.1.9" serde_json = { version = "1.0", optional = true } [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] wasm-bindgen = { version = "0.2", optional = true } wasm-bindgen-futures = { version = "0.4", optional = true } js-sys = { version = "0.3", optional = true } web-sys = { version = "0.3", optional = true, features = [ "DomStringList", "Event", "IdbDatabase", "IdbFactory", "IdbIndex", "IdbObjectStore", "IdbOpenDbRequest", "IdbRequest", "IdbTransaction", "IdbTransactionMode", "Window", ] } [dev-dependencies] serde_json = "1.0" pest = "2" pest_derive = "2" pest_meta = "2" [target.'cfg(all(minigraf_shuttle, not(target_arch = "wasm32")))'.dev-dependencies] # #760 bounded prototype; used only with --cfg minigraf_shuttle in unit tests. shuttle = "=0.9.8" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] tempfile = "3" criterion = { version = "0.8", features = ["html_reports"] } wide = "1.4" proptest = "1" uuid = { version = "1.0", features = ["v4", "v5"] } [target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))'.dev-dependencies] uuid = { version = "1.0", features = ["v4"] } [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dev-dependencies] wasm-bindgen-test = "0.3" uuid = { version = "1.0", features = ["v4", "js"] } [[bench]] name = "minigraf_bench" harness = false # `cargo test` runs the envelope harness's unit tests (the -irregular fixture, #551). [[example]] name = "perf_envelope" test = true [features] default = [] # Deprecated, does nothing since v3.0.0: every build reorders query clauses # (#594, #596). Kept so that builds naming it still resolve. wasm = [] # Test-only switches for integration tests: clause reordering, `not`/`or` # body forms, transaction chunk size and its high-water mark (#596, #546, # #550; `minigraf::__reorder` and the rest). Tests only. test-hooks = [] browser = [ "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:web-sys", "dep:js-sys", "dep:serde_json", ] [profile.release] panic = "abort" lto = true codegen-units = 1 strip = "symbols" opt-level = "z" # uniffi-bindgen reads UNIFFI_META symbols from .symtab (not .dynsym). # examples/perf_envelope.rs (#394): opt-level 3, as an application's release # build compiles the library; `release` is tuned for the REPL binary's size. [profile.envelope] inherits = "release" opt-level = 3 strip = "none" [profile.bench] strip = "none" debug = true lto = true codegen-units = 1 panic = "unwind" # The profile that 'dist' will build with. It keeps release's full LTO, so the # shipped binaries are the ones binary-size.yml measures (#796). [profile.dist] inherits = "release" [lints] workspace = true [workspace.lints.rust] # Kani proof harnesses (#627): `cargo kani` sets cfg(kani). unexpected_cfgs = { level = "warn", check-cfg = ['cfg(kani)', 'cfg(minigraf_shuttle)'] } [workspace.lints.clippy] # Panic prevention — use Result/? or debug_assert! instead unwrap_used = "deny" expect_used = "deny" panic = "deny" todo = "deny" unimplemented = "deny" unreachable = "allow" # legitimate in exhaustive match arms; too noisy as warn # Numeric safety — critical for page offsets, checksums, byte sizes cast_possible_truncation = "deny" cast_possible_wrap = "deny" cast_sign_loss = "deny" arithmetic_side_effects = "allow" # too noisy for parser/evaluator index arithmetic # Bounds safety indexing_slicing = "deny" # API documentation missing_errors_doc = "allow" # too noisy; revisit when writing public API docs