home_schema

Generic Description

Returns session, schema, graph, or null-handling metadata inside the query. It is documented separately because execution context, graph context, and null-handling helpers can change how assistant-generated queries are validated.

Simple example:

RETURN home_schema()

Consumer-Level Explanation

Use it when the query should expose execution context or normalize nullable values explicitly. Prefer this function when the query needs explicit context or null behavior instead of relying on an implicit client default.

More Detailed Explanation

home_schema should be understood by the value shape it expects and the row shape it returns. It composes with MATCH, WHERE, WITH, RETURN, and procedure output, so planner-facing documentation should describe both the immediate value transformation and why it belongs in the database query.

Advanced Example

This example uses home_schema inside a named row pipeline so the value shape is clear to both the planner and reviewers.

MATCH (u:User)-[e:VIEWED]->(d:Document)
TIME e.ts BETWEEN datetime('2025-01-01T00:00:00Z') AND datetime('2025-02-01T00:00:00Z')
WITH u, e, d,
     unpivot(properties(d.metadata)) AS metadata_rows,
     date_trunc('day', e.ts) AS day_bucket,
     home_schema(current_graph()) AS focused_value
RETURN u.user_id, d.title, day_bucket, metadata_rows, focused_value
LIMIT 10

Real Use Cases

Real Limitations And Tradeoffs