Files
zeekay f5aaeb712e Hanzo Graph — the engine, on zapdb, ZAP-native
Derived from Dgraph (github.com/dgraph-io/dgraph) at commit 64804bd2, Apache-2.0.
See NOTICE.

WHAT THIS IS. The graph engine as a Go library: posting lists, the DQL parser,
the type and tokenizer system, the index and schema layers, and the wire types.
39,170 lines of the upstream's 166,337.

THE STORE is github.com/luxfi/zapdb, a Badger fork that kept the package name,
the subpackages (options, pb, y) and the API — Open, OpenManaged, DB, Options —
so the 74 import sites are aliased rather than rewritten.

THE CODEC is ZAP. zapdb serializes with ZAP, not protobuf: its pb package builds
the ZAP types by default and the protobuf ones only under `-tags grpc`, a path
that does not compile (table/builder.go calls pb.Marshal, which that tag
removes). One call site in posting needed converting; every other type here is
Hanzo's own protobuf and is untouched.

NO TRANSPORT. An embedded engine dials nothing, so nothing here imports
google.golang.org/grpc. Removed: 20 transport functions in x, the generated
service stubs for Raft, Zero and Worker (1,657 lines), and the JWT helper —
identity belongs to IAM. The core called none of them.

NOT KEPT: worker, conn, raftwal, the cluster commands, the GraphQL layer and the
test harnesses. `query`, the DQL execution engine, went with them because it
depends on worker; parsing DQL is available here, executing it is not.

The history of the upstream project lives at github.com/dgraph-io/dgraph. This
repository begins at the derivation because three quarters of that history
describes code this fork does not carry.
2026-08-20 21:26:27 -07:00

58 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: © 2017-2026 Istari Digital, Inc.
# SPDX-License-Identifier: Apache-2.0
#
set -e
readonly PROTOCMINVER="3.6.1"
which protoc &>/dev/null || (
echo "Error: protoc not found" >&2
exit 1
)
PROTOCVER=$(protoc --version | awk '{printf $2}')
# CompareSemVer compares the minimum version minver against another version curver.
# If the version is below our min it will exit with non-zero to trigger error in make.
function CompareSemVer() {
local minver=(${1//./ })
local curver=(${2//./ })
echo -n "Checking protoc for semantic version $1 or newer... "
for i in 0 1 2; do
if [[ ${minver[${i}]} -gt ${curver[${i}]} ]]; then
echo "FAIL" >&2
echo "Error: version $2 is lower than the required version $1" >&2
exit 1
elif [[ ${curver[${i}]} -gt ${minver[${i}]} ]]; then
break
fi
done
}
function CheckProtobufIncludes() {
echo -n "Checking for directory /usr/include/google/protobuf or /usr/local/include/google/protobuf... "
if ! { [[ -d /usr/include/google/protobuf ]] || [[ -d /usr/local/include/google/protobuf ]] || [[ -d /opt/homebrew/include/google/protobuf ]]; }; then
echo "FAIL" >&2
echo "Missing protobuf headers in /usr/include/google/protobuf or /usr/local/include/google/protobuf:" \
"directory not found." >&2
echo "Download and install protoc and the protobuf headers by installing protoc via a package manager" \
"or downloading it from the protobuf releases page:" >&2
echo "https://github.com/protocolbuffers/protobuf/releases/" >&2
exit 1
fi
}
CompareSemVer "${PROTOCMINVER}" "${PROTOCVER}"
echo "OK"
CheckProtobufIncludes
echo "OK"
exit 0