Repository navigation
Release v0.6.2
[0.6.2] - 2026-11-08
Correctness release: comparisons, nulls and operands of the wrong kind follow ISO GQL and openCypher more closely, a refused permission has its own code, a session can be kept from reading local files, and a graph cleared and written back keeps its size. Results that change on upgrade: a string never equals a number, {k: NULL} in a pattern finds nothing, an operator given a value of the wrong kind raises 22G12 where it answered null, and a file database checkpoints by itself (Changed lists each). Plus join orders from sampled degrees, cycles closed by intersection and lookups that need no index.
Performance
- Planner: comma patterns pick their join order from sampled degrees, cycles close by lookup or intersection, and same-type chains up to 6 hops count without listing paths. Common queries stay at their speed; the first plan of a comma pattern costs a little more.
- Pinned far nodes and
IN: a hop to a pinned node starts at that end when it costs less, a key on several nodes reads the shorter side, and a long constantINlist is a set. - Lookups with no index: an equality on a property reads its column directly, a
LIMITstops early, and reopened columns skip chunks by their stored bounds. - Typed graphs: a read no longer pays for a graph type's checks, which only a write needs.
- Constraints:
UNIQUEandNODE KEYbuild an index on their first property, so an insert under one no longer reads the whole label. - Weighted algorithms: Dijkstra, SSSP, A*, Bellman-Ford, Floyd-Warshall, Kruskal, Prim,
max_flowandmin_cost_max_flowread each edge's weight directly instead of loading the whole edge; Dijkstra takes about a third fewer instructions. - Smaller default builds: the
walfeature no longer pulls in tokio; onlyasync-storageandserverdo.
Changed
Queries that ran in 0.6.1 and now fail or behave differently.
CREATE INDEXholds its label only: writes on other labels no longer pay for it. A query on another label scans, with the same rows and a note inEXPLAIN; a query with no label reads the label indexes and scans only the rows they do not cover. Existing indexes stay as they are, andcreate_property_indexstill covers every label. A 0.6.1 release opens such a file with the same rows, without those indexes, and a checkpoint there drops them.- Closed graph types:
REMOVEfails withG2000when it would take a node's last label or the label that declares a property it holds, and so does removing a label an edge type's endpoints need, wherever that rule applies.import_tsv,import_tsv_strandimport_mmiofail the same way when the graph's rules refuse_Importednodes or the edge, as does dropping or replacing a property that nodes or edges still hold.DROP NODE TYPEandDROP EDGE TYPEare refused while a closed graph type bound to a graph lists the type. Files already holding such data still open. - Writes:
|,!,%and parentheses in the labels of anINSERTor a single-nodeMERGEare an error naming the statement, as they name no labels. - Rules: a rule added over data that breaks it fails with
GRAFEO-V001, and so does a commit whose writes break a rule added since the transaction began. - Graph types: a type a graph type lists applies only in graphs bound to it, so its rules and defaults no longer reach other graphs;
validate()reports affected types, and Python warns at open. Dropping a graph type drops the types only it listed, and a second, different declaration of a type is refused. See the upgrade note. - Transactions:
START TRANSACTION,COMMITandROLLBACKon a per-callexecuteare refused,CREATE GRAPH ... AS COPY OFis refused in a transaction, and no SPARQL statement runs after a SPARQL graph operation until the commit. - A string and a number are never equal:
'5' = 5is false and'5' <> 5true, in GQL and Cypher, also in indexes, joins,IN,MERGEand upserts;id(n) = '5'finds nothing. In GQL, a node compared with=to another kind of value is false instead of an error. - Lists and records containing a null can compare as unknown:
[null] = [null]and[1] = [null]drop the row in aWHERE, while a definite mismatch such as[1, 2] = [null, 3]is false. A value containing a null matches nothing in a join or a lookup.DISTINCT, grouping andUNIQUEstill treat nulls as one value. - Comparing values of two kinds with
<,<=,>and>=: GQL orders them as ORDER BY does (a string before every number, a boolean before every number), with or without an index; Cypher and Gremlin answer null; SQL/PGQ raises 22G04, as do its=,<>andIN, whichever plan reads them (an index or key-column read returned rows where the scan raised). - Wrong kinds: an operator or list index given an operand of a kind it does not take (
true + 1,-'a',[1, 2, 3][1.5]) raises invalid value type (22G12) instead of answering null; a sign on a non-number reports 22G12 rather than 22G03. A null operand still gives null. +of a string and another kind in GQL raises invalid value type (22G12) in either order, for any non-null value that is not a string ('x' + 3gave'x3','is:' + truegave'is:true').- Procedure arguments: a value outside what an argument allows raises invalid parameter value (22023), in CALL (the load procedures included) and in the Python
db.algorithmsmethods;grafeo.pagerank(2.0), a negativemax_iterations, a NaN tolerance or a negativekran with meaningless results or clamped values (in Python,pagerank(damping=2.0)returned scores like 39,602,142,754). A missing required argument, or null for it, raises 22023 too, naming the argument and its type (it raised 22000). In the Python algorithm methods,Nonefor an optional argument means its default, andNonefor a required one raisesGrafeoError22023 instead ofTypeError. The load procedures take their arguments in the map or the positional form (path, thenlabels, ortype,sourceandtarget), raise 22023 for a delimiter that is not one character, an unknown column type, a wrong key insourceortarget(an unknown key was ignored) or aprojection(it was ignored), and 22G03 for an argument of the wrong type. - Edge weights: weighted algorithms refuse an edge value they cannot use and name the edge and property: a non-number raises 22G12 (it read as 1.0); NaN, an infinity, or a negative weight in Dijkstra, A*, SSSP or a flow capacity raises 22023.
- Procedure timeouts: graph algorithm, search, schema and CSV load procedures, and the Python algorithm methods, stop at the query timeout with the usual timeout error, never a partial answer; a run used to hold its thread until it ended.
grafeo.max_flowandgrafeo.min_cost_max_flowrows: one row per edge that carries flow, so parallel edges each get a row; they gave one row per node pair.grafeo.topological_sorton a graph with a cycle raises a data exception (22000) naming one cycle, such as3 -> 5 -> 8 -> 3; it returned a row in an undocumentederrorcolumn. The Python method still returnsNonefor a cycle.- Minimum spanning trees of equal weight:
grafeo.kruskalandgrafeo.primreturn the one with the lowest edge ids (it depended on the order edges were read). - A WAL with an empty segment, which a crash in 0.6.1 could leave while starting one, is refused at open with an error naming
wal_salvage: reopen it once withwal_salvage, which sets the empty file aside and loses no commit (#725). - Incremental backups that cannot continue their chain fail with
GRAFEO-S005, naming the cause: no backup cursor, a chain behind the cursor, or log that was removed. Some of these raised an invalid-input error. A new full backup starts a new chain (#673). - Automatic checkpoints are on: a file database checkpoints by itself once its WAL holds 256 MiB past the last checkpoint, on a background thread that starts when it first has work; turn it off with
checkpoint_wal_size=None(Python),checkpointWalSize: null(Node.js) orConfig::without_checkpoint_wal_size(). The WAL's segment size is a setting (wal_segment_size, 1 MiB to 1 GiB, 64 MiB by default), and a checkpoint size below 1 MiB is refused. - The default memory limit follows the process's real ceiling (#751): 75% of the smaller of the machine's memory and any cgroup (Linux, at the process's cgroup or a parent) or job-object (Windows) limit. Windows and macOS now read their memory instead of assuming 1 GiB; WASM keeps 768 MiB.
Config::with_memory_limitis enforced (#751): every write that grows the store (a node, edge or value write in GQL, Cypher, the direct API, a bulk load or a CALL, an RDF triple in each form, a property, text or vector index build) is granted against the limit, with an eviction pass that spills what it can first, and one that passes it is refused withGRAFEO-S001; reads that fit their query-memory budget still run. A database file above its limit opens with a warning (MEMORY_LIMIT_PASSED) and replays regardless of it, so its first write is refused. Under pressure a file database spills its older row groups' indexed embedding columns and keeps the newest's; a write into a spilled column needs no room for it.- A per-query memory limit,
Config::with_query_memory_limit(#751): it caps what one statement's operators hold, defaults to the memory limit and never exceeds it; a sort or grouping past it spills first and, where it cannot spill, fails withGRAFEO-S001naming the limit and changes nothing.memory_usage()reports it asquery_limit_bytes, in every binding. Config::with_memory_fractionapplies per open: it is taken of the memory detected when the database opens, and a database file no longer stores its bytes;with_memory_limitis stored as before.file:URLs follow RFC 8089: inLOAD CSV,LOAD DATAand the load procedures,file:///srv/data.csvandfile://localhost/srv/data.csvname the absolute path/srv/data.csv(file:///was stripped and the rest read as a relative path), and afile:URL with another host is refused.- Permission refusals have their own codes: GQLSTATUS
42501, withGRAFEO-Q007for a write, DDL or writing procedure that the session's role or graph grants refuse andGRAFEO-Q008for a statement that reaches outside the database on a session without external access; both wereGRAFEO-Q002with42000. Python raisesGrafeoPermissionError, a subclass ofGrafeoError. memory_usage()reports what the store holds: its store, index, version and string-pool figures are the counted bytes, kept as each write grows them, instead of estimates.- A negative
SKIPorLIMITafter a GQLCALLraises 22G02, as in every otherRETURN; 0.6.1 ignored the count. TierOverride::ForceDiskis refused on sections that cannot spill: onlyVectorStorecan move to disk, soForceDiskon another section (TextIndex,PropertyIndex,LpgStore,RdfRing,CompactStoreand the rest) now failsConfig::validate, where it was accepted and did nothing.- Temporal literal cleanup: a
LOCAL DATETIMEproperty refusesDATETIME '...'with an offset, and a schema error names the value as the query writes it (DATETIME '...', offset kept).
Added
- Graph procedures:
CALL grafeo.ktruss()andgrafeo.ktruss(k),grafeo.total_triangles()andgrafeo.subgraph_isomorphism(pattern_edges, pattern_nodes), and the Python methodsktruss(k=None)andsubgraph_isomorphism_count(pattern_edges, pattern_nodes). - Query warnings: a statement that uses a deprecated form or has something worth knowing returns its rows with warnings, each with a GQLSTATUS code (class 01), a kind and a message. They are on
QueryResult::warningsand on streaming results, in every binding (Python also raises them throughwarnings.warn), and the CLI prints them on stderr. Experimental. - SQL/PGQ
||concatenates strings and lists. - Procedures in every build:
CALL grafeo.procedures()and the CSV load procedures are listed in every build, with each argument's type, default and allowed values where it declares them. A call of a procedure this build leaves out fails withGRAFEO-Q004, naming the feature that brings it, instead of as an unknown name. - Sessions without external access:
Identity::with_external_access(false)refuses every statement that reads or writes outside the database, such as the CSV loads, before it runs. - The memory limit and spill settings at open, from every binding (#751): C (
GrafeoOptionswithgrafeo_open_with_options), Node.js, Python, Go, C# and Dart take the settingsConfigtakes, and WASM takesDatabaseOptions.memoryLimitandhistoryRetention;memory_usage()reads them back in each binding (C reports them and the open's warnings as JSON,MEMORY_LIMIT_PASSEDamong them), an open past the limit warns and still reads, and a snapshot import takes them too (Database.importSnapshot(data, options)in WASM,GrafeoDB::import_snapshot_with_configin Rust). - Sessions in the bindings:
db.session(read_only=..., external_access=...)in Python,db.session({ readOnly, externalAccess })in Node.js andgrafeo_session_openin C run queries with those limits;external_access=Falserefuses every statement that reads or writes outside the database. - The procedure listing says what each procedure does:
CALL grafeo.procedures()lists whether it writes the graph (writes, a BOOLEAN) and what it reaches outside the database (external_access:'none','reads'or'writes'). grafeo.pagerankwarns (01Y01) when it runs out of iterations before its scores settle withintolerance.- WAL retention limit: after a backup, checkpoints keep the WAL the next incremental backup needs, up to
Config::with_wal_retention_limit(1 GiB by default; Pythonwal_retention_limit, NodewalRetentionLimit). Past the limit the oldest log is removed with a warning, and the next incremental backup fails withGRAFEO-S005.release_backup_cursor()(Rust, Python, Node, C, C#) stops keeping log for backups (#673).
Deprecated
ZONED DATETIME '...'andZONED TIME '...'literals: writeDATETIME '...'orTIME '...'with an offset. They warn with 01X01 and 01X03, and 0.7.0 refuses them.+on two lists in GQL and SQL/PGQ: use||. It warns with 01X02, and 0.7.0 refuses it.
Fixed
- Label expressions on a path's first node:
IS,&,|,!,%and parentheses were ignored there, soMATCH (x IS A)-[:R]->(t)also matched nodes withoutA, and aSET,REMOVEorDELETEafter it changed them. All GQL and SQL/PGQ path patterns now check them (#736). - Label expressions in writes:
INSERT (n IS Person),INSERT (n:A&B)andMERGE (n IS Person)created a node with no labels;IS AandA & Bnow set those labels. Databases written before this may hold such nodes, and nodes changed or deleted by the query above, which no fix can recover: find unlabelled nodes withMATCH (n) WHERE size(labels(n)) = 0 RETURN n. UNIQUErefuses0.0and-0.0as duplicates whether or not the property has an index.UNIQUE,NODE KEYandMERGEtreat1,1.0e0and the decimal1.0, and[1]and[1.0], as one value, andUNIQUEandNODE KEYcount every NaN, of either sign, as one value.- SPARQL joins: fixed a slowdown in multi-way joins from 0.6.1.
- SPARQL parsing: a
.after aFILTER,OPTIONAL,MINUS,GRAPHor nested group parses again (#737). - SPARQL subqueries and paths: a sub-select inside
GRAPH ?gbinds?g(#739),BIND(EXISTS {...} AS ?v)evaluates (#740), andEXISTSandNOT EXISTSread each row's values, as the SPARQL 1.2 draft says.?s :p? :owith a constant object returns:oand the subjects that reach it, each once (it returned every subject of:p, repeated), a subquery with an aggregate gives all its rows, and nested groups keep their rows. - SPARQL graphs: inside
GRAPH ?g { ... },?gis bound only after the group, as SPARQL says: aFILTERon?g,?gused as a term, and a nestedGRAPH ?ginsideEXISTS,NOT EXISTS,OPTIONALorMINUSno longer see it bound early, which gave missing or extra rows.GRAPH <iri>over a graph the dataset does not hold gives no row (#738),FROMover two graphs returns a shared triple once, andFROMwithoutFROM NAMEDexposes no named graphs. A variable repeated within one triple pattern holds the same term in each position (?x :r ?x,?g ?p ?ginsideGRAPH ?g, any pairing of subject, predicate, object and graph, also insideOPTIONAL); every matching triple was returned, andCOUNT(*)counted them all. - Booleans:
<,<=,>and>=order false below true in every plan; they could return null and lose rows. - Comparing lists:
<,<=,>and>=on two lists or two paths compare element by element in GQL and Cypher;[1] < [1]is false (it was null). - Lists: GQL
||concatenates lists, and Cypher+appends or prepends a single value to a list, a null included ([1, 2] + 3,[1, 2] + null); both gave null before. +with a string in Cypher: a number and a string join in either order (1 + 'a'is'1a', written astoString()writes it; it was null).- Grouping by a parameter: a grouping key built from a parameter (
RETURN $p + 1 AS x, count(*),$m.k,$list[0],size($list)) no longer fails with an undefined variable. - Schema statements roll back with their transaction, also across a crash (#727).
- Conditions that can fail, such as
100 / n.age > 0, no longer fail on rows a label or an earlier condition rejects. - Graph type patterns: naming an existing type no longer wipes its properties, and several patterns of one edge type no longer lose all but the last.
- Closed graph types in a schema: a node or edge type added with
ALTER GRAPH TYPE ... ADDis held like one listed byCREATE GRAPH TYPE, soDROP NODE TYPEandDROP EDGE TYPErefuse it while listed, andALTER GRAPH TYPE ... DROPtakes it out, in files written by 0.6.1 too. - Backups: a restore checks the full backup's checksum, as it does an incremental backup's, and refuses a damaged file by name before it writes anything (#744); incremental backups and restores of a large WAL stream the log a segment and a frame at a time instead of reading it into memory (#673).
- A null optional procedure argument, however computed, takes the parameter's default instead of failing.
grafeo.min_cost_max_flowgives each parallel edge its own capacity and cost (two edges costing 1 and 5 reported 50 where 30 is right), and refuses a negative-cost cycle the source reaches (22023), where the call never returned.grafeo.kruskalandgrafeo.primtake the lightest of the edges between two nodes, in either direction, andgrafeo.primfrom a start node returns the whole tree; Kruskal kept the first edge it met and Prim missed a lighter edge pointing back, both reporting a heavier tree, and Prim followed only outgoing edges.grafeo.topological_sortgives the same order on every run (the lexicographically smallest by node id).- GQL statements after
CALL ... YIELD: a statement that starts with a procedure call goes on with any clause,MATCH,OPTIONAL MATCH,FILTER,LET,FOR,ORDER BY, anotherCALL,SETorINSERT, as ISO GQL allows (14.3); onlyRETURNwas accepted, and a followingMATCHwas a syntax error. - GQL
NEXTthenCALL: a procedure call afterNEXTkept the earlier statement's columns, grouping the result by them; it now returns only its own columns, and the incoming fields stay in scope. SKIPandLIMITafter a GQLCALL:SKIP $nandLIMIT $nin theRETURNafter a procedure call take effect; they were ignored.HAVINGandFINISHafter a GQLCALLare accepted; they were a syntax error.- SQL/PGQ
CALL ... LIMIT $ntakes its limit; it was ignored. - Stored procedures run in builds without the graph algorithms (the
lpgandedgeprofiles, the CLI):CREATE PROCEDUREsucceeded there and itsCALLsaid the procedure was unknown. - A null in a property map (
MATCH (n {k: NULL}), also on an edge, in GQL, Cypher and SQL/PGQ) finds nothing, as an equality with null does; it found the elements without the key. A null in aMERGEpattern still matches an absent property. - A
DATETIMEliteral keeps its offset:DATETIME '2024-01-01T10:00:00+01:00'is a ZONED DATETIME at+01:00andZis+00:00, as theZONED DATETIME '...'deprecation names it; 0.6.1 gave the UTC time without the offset. Without an offset it stays a local datetime. - SQL/PGQ
EXPLAINreturns the plan; it ran the statement and returned its rows, in Python'sexplain_sqltoo. INTERSECTandEXCEPTinsideCALL { }: the columns they return are visible after the call, as withUNIONandOTHERWISE; reading them raised "Undefined variable".- A
MERGEafter anOTHERWISEbody inCALL { }uses the node the body returns; it raised "Variable already declared outside the CALL subquery". YIELD: a column a procedure does not have is refused when the call is planned, naming its columns; it failed only after the algorithm had run (4.5 s on 4,000 nodes).- WAL segments: a panic while the WAL started a new segment no longer makes every later checkpoint fail until a reopen (#725).
- Checkpoints check free disk space first and fail with a clear error naming the space needed and available, changing nothing; a checkpoint that fails partway gives back the disk space it took (#726).
- Go and C# bindings: a database, transaction, graph, stream or point-in-time view could be freed by the garbage collector while a call on it was still running, which could crash the process (for example on the last
Nextof a stream in Go); every native call now keeps its handle alive. In C#, an async call on a database disposed meanwhile throwsObjectDisposedException. - WASM
importRdfis in every build with the RDF store, thefullpackage (@grafeo-db/wasm) included; it was missing there. - Vector search with a filter on a quantized index could return fewer than
kresults, or none, when the allowed nodes lay far from the query; it now searches among the allowed nodes. - Opening and closing without writes leaves the file unchanged:
close()checkpoints only when something changed since the last checkpoint, so a database opened only for reads keeps its file byte for byte (its header was rewritten on every close). - The C header declares the backup functions:
grafeo_backup_full,grafeo_backup_incremental,grafeo_restore_to_epochandgrafeo_clear_plan_cache, exported since earlier releases, are now declared ingrafeo.h. - A crashed query's spill files are removed at open: the next read-write open deletes the
<file>.spill/query_*directories a crash left, with the vector cache, before it measures the spill volume. - A graph cleared and written back keeps its size: the slots of deleted rows (edge ends, property values, adjacency offsets) go back once a whole vector of 2,048 rows below the live ones is gone, in a session and across reopens. In 0.6.1 each clear and rewrite of 2,400 nodes and 4,800 edges added about 500 KB within a session.
Security
- Queries can be kept from reading local files: a session without external access refuses
LOAD CSV,LOAD DATA, the CSV load procedures and SPARQLLOADbefore any file is opened; through a server, give remote sessions none.
Contributors
What's Changed
- Update pypi.yml by @StevenBtw in #721
- deps(rust): bump base64 from 0.22.1 to 0.23.1 in the rust-dependencies group by @dependabot[bot] in #722
- Release 0.6.2 by @StevenBtw in #728
- deps(python): bump grafeo-cli from 0.6.0 to 0.6.1 in /crates/bindings/python by @dependabot[bot] in #745
- deps(actions): bump crate-ci/typos from 1.51.1 to 1.52.0 by @dependabot[bot] in #746
- deps(python): update pytest-benchmark requirement from >=5.3.0 to >=5.3.1 in /crates/bindings/python by @dependabot[bot] in #747
- deps(python): bump the python-tooling group across 2 directories with 11 updates by @dependabot[bot] in #749
- deps(rust): bump crc32fast from 1.5.3 to 1.5.4 in the rust-dependencies group by @dependabot[bot] in #750
- Release 0.6.2 by @StevenBtw in #748
- Release cleanup 0.6.2 by @StevenBtw in #753
Full Changelog: v0.6.1...v0.6.2