{ "artifact_policy": { "authoritative_source": "PostgreSQL source tables", "incompatible_action": "fail_closed_and_rebuild", "silent_reinterpretation": false }, "diagnostics": [ { "diagnostic": "PG000", "sqlstate": "XX000", "variant": "Internal" }, { "diagnostic": "PG001", "sqlstate": "53200", "variant": "Oom" }, { "diagnostic": "PG002", "sqlstate": "42501", "variant": "AclDenied" }, { "diagnostic": "PG003", "sqlstate": "55000", "variant": "NotBuilt" }, { "diagnostic": "PG004", "sqlstate": "54000", "variant": "EdgeTypeLimit" }, { "diagnostic": "PG005", "sqlstate": "22023", "variant": "InvalidFilter" }, { "diagnostic": "PG006", "sqlstate": "55P03", "variant": "BuildLocked" }, { "diagnostic": "PG007", "sqlstate": "54000", "variant": "ResourceLimit" }, { "diagnostic": "PG008", "sqlstate": "54000", "variant": "EdgeBufferFull" }, { "diagnostic": "PG009", "sqlstate": "XX001", "variant": "CorruptFile" }, { "diagnostic": "PG010", "sqlstate": "P0002", "variant": "NodeNotFound" }, { "diagnostic": "PG011", "sqlstate": "0A000", "variant": "IncompatibleVersion" }, { "diagnostic": "PG012", "sqlstate": "55000", "variant": "ReadOnly" }, { "diagnostic": "PG013", "sqlstate": "42601", "variant": "GqlSyntax" }, { "diagnostic": "PG014", "sqlstate": "0A000", "variant": "GqlUnsupported" }, { "diagnostic": "PG015", "sqlstate": "22023", "variant": "GqlSemantic" }, { "diagnostic": "PG016", "sqlstate": "22023", "variant": "GqlParameter" }, { "diagnostic": "PG017", "sqlstate": "22000", "variant": "GqlExecution" }, { "diagnostic": "PG018", "sqlstate": "0A000", "variant": "UnsupportedOperation" }, { "diagnostic": "PG019", "sqlstate": "54000", "variant": "OverlayLimit" }, { "diagnostic": "PG020", "sqlstate": "55000", "variant": "Disabled" }, { "diagnostic": "PG021", "sqlstate": "55000", "variant": "RlsTopologyBoundary" }, { "diagnostic": "PG022", "sqlstate": "55000", "variant": "SyncLogPruned" } ], "distribution": { "containers": [ "linux/amd64", "linux/arm64" ], "source": [ "PGXN", "GitHub release archive" ] }, "gql_implementation_sha256": "512ed6932e03345e87ccba38fd3c63bcd7d9a07542c5f6510a7c3a0fa7c95baa", "gql_profile": { "assurance_profiles": { "read": { "documentation": [ { "path": "docs/user_guide/querying.mdx", "symbol": "## GQL" } ], "implementation": [ { "path": "graph/src/gql/parser.rs", "stage": "parser", "symbol": "pub(crate) fn parse(" }, { "path": "graph/src/query/semantics.rs", "stage": "binder", "symbol": "pub(crate) fn bind(" }, { "path": "graph/src/query/execute.rs", "stage": "executor", "symbol": "pub(crate) fn execute_governed(" } ], "tests": { "acl_rls": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_hydration_fails_closed_when_source_row_is_not_visible" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_unsupported_profile_corpus_has_stable_diagnostics" } ], "operator_bounds": [ { "path": "graph/src/query/value.rs", "symbol": "distinct_checks_elapsed_budget_while_draining_rows" }, { "path": "graph/src/query/value.rs", "symbol": "grouping_checks_elapsed_budget_while_scanning_rows" }, { "path": "graph/src/query/value.rs", "symbol": "sort_checks_elapsed_budget_during_comparisons" }, { "path": "graph/src/query/tests.rs", "symbol": "wildcard_path_variable_length_reports_row_cap_exhaustion" }, { "path": "graph/src/query/tests.rs", "symbol": "executor_enforces_hard_row_cap_before_projection" }, { "path": "graph/src/query/tests.rs", "symbol": "relationship_node_projection_errors_when_required_hydration_is_missing" } ], "resource": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_statement_memory_limit_is_shared_across_read_phases" } ] } }, "write": { "documentation": [ { "path": "docs/user_guide/querying.mdx", "symbol": "### GQL Writes" } ], "implementation": [ { "path": "graph/src/gql/parser.rs", "stage": "parser", "symbol": "pub(crate) fn parse_statement(" }, { "path": "graph/src/query/semantics.rs", "stage": "binder", "symbol": "pub(crate) fn bind_statement(" }, { "path": "graph/src/sql_facade/gql.rs", "stage": "executor", "symbol": "fn execute_statement_governed(" } ], "tests": { "acl_rls": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_node_preserves_source_table_rls" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_node_rejects_unregistered_label" } ], "resource": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_node_delta_limit_aborts_statement_before_source_insert" } ], "source_of_truth": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_respects_partition_routing_constraints_and_user_triggers" } ], "transaction": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_relationship_can_use_transaction_created_nodes" } ], "write_recheck": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_delete_edge_write_recheck_rejects_stale_endpoint_predicate" } ] } } }, "capabilities": [ { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_single_directed_match_matches_traverse_fixture" } ], "id": "match" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_optional_match_matches_left_outer_sql" } ], "id": "optional_match_single_relationship" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_optional_match_filters_orders_and_paginates_null_rows" } ], "id": "where_node_properties" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_with_projection_scope_aliases_and_shadows" } ], "id": "with" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_defaults_to_hydrated_nodes_and_projects_ids_explicitly" } ], "id": "return_projection" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_distinct_matches_sql_distinct_counts" } ], "id": "distinct" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_optional_match_filters_orders_and_paginates_null_rows" } ], "id": "order_limit_offset" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_aggregates_match_sql_grouping_and_numeric_results" } ], "id": "aggregates" }, { "assurance_profile": "read", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_path_values_and_functions_have_stable_shape" } ], "id": "bounded_paths_and_path_functions" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_node_inserts_mapped_row_and_records_delta" } ], "id": "mapped_single_node_create" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_create_relationship_inserts_edge_row_and_records_delta" } ], "id": "mapped_single_relationship_create" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_set_property_updates_source_row_and_filter_index" }, { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_remove_typed_property_sets_source_column_null_idempotently" } ], "id": "mapped_single_node_set_remove" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_delete_edge_removes_source_row_and_tombstones_neighbors" } ], "id": "mapped_single_relationship_delete" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_detach_delete_removes_incident_edges_before_node" } ], "id": "mapped_single_node_detach_delete" }, { "assurance_profile": "write", "evidence": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_merge_node_inserts_then_updates_mapped_row" } ], "id": "mapped_single_node_merge" } ], "claim": "documented_pggraph_1x_subset", "full_iso_gql": false, "full_opencypher": false, "public_sql_pgq": false, "unsupported_corpus": "release/v1-gql-unsupported.json" }, "guc_source_sha256": "7a0573d08e1ee261a654afa03d75d082f0d79de59b08648fab025586a4e49ffb", "gucs": [ "graph.allow_rls_tables", "graph.auto_load", "graph.build_batch_size", "graph.build_scan_mode", "graph.compaction_threshold", "graph.data_dir", "graph.default_case_sensitive", "graph.default_hydrate", "graph.default_max_depth", "graph.default_projection_mode", "graph.default_search_mode", "graph.edge_buffer_size", "graph.enabled", "graph.enforce_tenant_scope", "graph.hot_eager_load", "graph.idle_unload_secs", "graph.low_memory_build", "graph.maintenance_memory_mb", "graph.max_exact_path_count", "graph.max_frontier", "graph.max_loaded_graphs_per_backend", "graph.max_nodes", "graph.max_overlay_memory_mb", "graph.max_tx_delta_edges", "graph.max_tx_delta_nodes", "graph.memory_limit_mb", "graph.mutable_enabled", "graph.oom_action", "graph.operation_timeout_ms", "graph.persist_on_build", "graph.projection_retention_generations", "graph.query_freshness", "graph.query_memory_mb", "graph.query_work_limit", "graph.spill_disk_limit_mb", "graph.sync_batch_size", "graph.sync_mode", "graph.tenant_setting", "graph.vacuum_interval_secs" ], "internal_sql_functions": [ "_max_sync_log_id_for_current_role", "_pending_sync_rows_for_current_role", "_selected_graph_id_for_current_role", "test_enabled" ], "postgresql": { "default_test_major": 17, "playground_reference_major": 17, "supported_majors": [ 14, 15, 16, 17, 18 ] }, "public_sql_functions": [ "active_generation_count", "add_edge", "add_edge_to_graph", "add_filter_column", "add_filter_column_to_graph", "add_sync_policy", "add_table", "add_table_to_graph", "aggregate", "all", "alter_edge", "alter_graph", "alter_job", "alter_sync_policy", "apply_sync", "at_least", "at_most", "auto_discover", "auto_discover_tables", "between", "build", "build_async_graph", "build_graph", "build_resource_status", "build_status", "build_status_for_graph", "component", "component_stats", "components", "connected_components", "connection", "contains_text", "create_graph", "create_row_predicate_subgraph", "current_graph", "cypher", "cypher_compatibility", "cypher_explain", "drop_graph", "drop_sync_policy", "enable_sync", "eq", "equals", "estimate", "expand", "find", "find_related", "format_path", "get_neighbors", "get_node", "gql", "gql_explain", "grant_graph", "graph_map", "graph_privileges", "graph_quota_usage", "graph_quotas", "graph_runtime_status", "greater_than", "gt", "gte", "in", "ingest_projection", "is_not_null", "is_null", "isolated_nodes", "job_runs", "job_stats", "jobs", "largest_component", "less_than", "list_edges", "list_graphs", "load_graph", "loaded_graphs", "lt", "lte", "maintenance", "maintenance_graph", "maintenance_status", "maintenance_status_for_graph", "memory_profile", "neighborhood", "neq", "node_ref", "node_ref_string", "not_equals", "not_in", "on_node", "path", "path_count_estimate", "pgq", "prefix_text", "preview_discover", "preview_discover_tables", "projection_compact", "projection_gc", "projection_repair", "projection_status", "registered_edges", "registered_edges_for_graph", "registered_tables", "registered_tables_for_graph", "remove_edge", "remove_edge_from_graph", "remove_job", "remove_table", "remove_table_from_graph", "rename_edge", "reset", "resource_status", "revoke_graph", "run_due_jobs", "run_due_jobs_async", "run_job", "run_scheduled_maintenance", "run_sync_policy", "search", "search_nodes", "select_graph", "set_current_graph", "set_graph_quota", "set_graph_residency", "shortest_path", "status", "sync_health", "sync_policy_status", "transfer_graph_ownership", "traverse", "traverse_search", "unload_graph", "vacuum", "vacuum_graph", "weighted_shortest_path" ], "release_line": "1.x", "schema_version": 2, "sql_profile": { "default_disposition": "supported", "function_dispositions": { "create_row_predicate_subgraph": "intentional_rejection", "cypher": "bounded_compatibility", "cypher_compatibility": "bounded_compatibility", "cypher_explain": "bounded_compatibility", "pgq": "intentional_rejection" }, "groups": [ { "documentation": [ { "path": "docs/user_guide/administration-and-security.mdx", "symbol": "Named graphs" } ], "function_patterns": [ "^(create_graph|drop_graph|alter_graph|list_graphs|current_graph|select_graph|set_current_graph|grant_graph|revoke_graph|transfer_graph_ownership|graph_privileges|graph_quotas|graph_quota_usage|set_graph_quota|set_graph_residency|graph_runtime_status|graph_map|reset)$" ], "id": "graph_administration", "tests": { "authorization": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "graph_grants_gate_visibility_queries_and_builds" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "drop_graph_rejects_non_empty_graph_with_pggraph_sqlstate" } ], "positive": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "default_graph_compatibility_workflow_still_uses_legacy_sql_surface" } ], "resource": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "graph_quotas_block_named_graph_creation_before_catalog_state" } ] } }, { "documentation": [ { "path": "docs/user_guide/schema-registration.mdx", "symbol": "graph.add_table" } ], "function_patterns": [ "^(add_table|add_table_to_graph|remove_table|remove_table_from_graph|add_edge|add_edge_to_graph|alter_edge|remove_edge|remove_edge_from_graph|rename_edge|add_filter_column|add_filter_column_to_graph|registered_tables|registered_tables_for_graph|registered_edges|registered_edges_for_graph|list_edges|auto_discover|auto_discover_tables|preview_discover|preview_discover_tables|create_row_predicate_subgraph|estimate)$" ], "id": "registration_discovery", "tests": { "authorization": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "relationship_management_requires_graph_admin" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/registration_search.rs", "symbol": "add_table_identifier_validation_rejects_nullable_unique_and_non_unique_columns" } ], "positive": [ { "path": "graph/src/pg_tests/registration_search.rs", "symbol": "public_add_edge_supports_fk_style_registered_source_tables" } ], "transaction": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "admin_remove_apis_update_catalog_side_effects" } ] } }, { "documentation": [ { "path": "docs/user_guide/build-and-persistence.mdx", "symbol": "graph.build()" } ], "function_patterns": [ "^(build|build_graph|build_async_graph|build_status|build_status_for_graph|build_resource_status|load_graph|unload_graph|loaded_graphs|status|memory_profile|resource_status|active_generation_count|projection_status|projection_compact|projection_gc|projection_repair|vacuum|vacuum_graph)$" ], "id": "build_persistence", "tests": { "authorization": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "graph_grants_gate_visibility_queries_and_builds" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/sync_config_build.rs", "symbol": "build_fails_closed_when_sync_checkpoint_read_fails" } ], "positive": [ { "path": "graph/src/pg_tests/sync_config_build.rs", "symbol": "persisted_direct_build_matches_owned_build_for_public_queries" } ], "recovery": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "full_rebuild_restores_valid_projection_generation" } ], "resource": [ { "path": "graph/src/pg_tests/sync_config_build.rs", "symbol": "every_oom_action_rejects_over_budget_build_before_allocation" } ] } }, { "documentation": [ { "path": "docs/user_guide/sync-and-maintenance.mdx", "symbol": "graph.apply_sync()" } ], "function_patterns": [ "^(add_sync_policy|alter_sync_policy|drop_sync_policy|enable_sync|apply_sync|sync_health|sync_policy_status|run_sync_policy|maintenance|maintenance_graph|maintenance_status|maintenance_status_for_graph|run_scheduled_maintenance|ingest_projection|jobs|job_runs|job_stats|alter_job|remove_job|run_job|run_due_jobs|run_due_jobs_async)$" ], "id": "sync_maintenance_jobs", "tests": { "authorization": [ { "path": "graph/src/pg_tests/named_graphs.rs", "symbol": "sync_policies_run_through_visible_durable_jobs" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "failed_apply_sync_rows_remain_buffered" } ], "positive": [ { "path": "graph/src/pg_tests/sync_config_build.rs", "symbol": "trigger_sync_adds_edge_overlay_after_explicit_apply_sync" } ], "resource": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "edge_buffer_overflow_from_sql_sync_enters_read_only_mode" } ], "transaction": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "cross_backend_committed_write_visible_without_full_rebuild" } ] } }, { "documentation": [ { "path": "docs/user_guide/querying.mdx", "symbol": "graph.traverse(" } ], "function_patterns": [ "^(traverse|traverse_search|shortest_path|weighted_shortest_path|aggregate|path_count_estimate|component|components|component_stats|connected_components|largest_component|isolated_nodes|all|at_least|at_most|between|contains_text|eq|equals|greater_than|gt|gte|in|is_not_null|is_null|less_than|lt|lte|neq|not_equals|not_in|on_node|prefix_text|node_ref|node_ref_string)$" ], "id": "query_predicates_analytics", "tests": { "acl_rls": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "tenant_scope_filters_search_and_traversal" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/filters.rs", "symbol": "traverse_rejects_raw_jsonb_filters_outside_registered_catalog_contract" } ], "positive": [ { "path": "graph/src/pg_tests/traversal_api.rs", "symbol": "traversal_helpers_edge_path_and_composition_apis_work" }, { "path": "graph/src/pg_tests/filters.rs", "symbol": "filter_constructor_surface_has_stable_shapes_and_aliases" } ], "resource": [ { "path": "graph/src/pg_tests/sync_config_build.rs", "symbol": "traversal_work_limit_returns_stable_resource_diagnostic_and_status" } ] } }, { "documentation": [ { "path": "docs/user_guide/querying.mdx", "symbol": "graph.find()" } ], "function_patterns": [ "^(find|find_related|expand|search|search_nodes|get_neighbors|get_node|path|format_path|connection|neighborhood)$" ], "id": "workflow_search", "tests": { "acl_rls": [ { "path": "graph/src/pg_tests/maintenance_admin.rs", "symbol": "tenant_scope_filters_search_and_traversal" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/workflow_validation.rs", "symbol": "workflow_rejects_negative_limits_and_offsets" } ], "positive": [ { "path": "graph/src/pg_tests/workflow_search_api.rs", "symbol": "workflow_find_returns_hydrated_ranked_rows_with_aliases" } ], "resource": [ { "path": "graph/src/pg_tests/workflow_relationship_api.rs", "symbol": "public_workflows_share_the_low_query_memory_budget_end_to_end" } ] } }, { "documentation": [ { "path": "docs/user_guide/querying.mdx", "symbol": "openCypher Compatibility" } ], "function_patterns": [ "^(gql|gql_explain|cypher|cypher_explain|cypher_compatibility|pgq)$" ], "id": "gql_compatibility", "tests": { "acl_rls": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_hydration_fails_closed_when_source_row_is_not_visible" } ], "negative_diagnostics": [ { "path": "graph/src/pg_tests/cypher.rs", "symbol": "cypher_rejects_unsupported_cypher_only_syntax" }, { "path": "graph/src/pg_tests/cypher.rs", "symbol": "pgq_public_endpoint_is_permanently_rejected" } ], "positive": [ { "path": "graph/src/pg_tests/cypher.rs", "symbol": "cypher_matches_gql_for_supported_read_subset" } ], "resource": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_statement_memory_limit_is_shared_across_read_phases" } ], "transaction": [ { "path": "graph/src/pg_tests/gql.rs", "symbol": "gql_reads_transaction_delta_edge_overlay" } ] } } ], "profile": "pgGraph 1.0 SQL API", "schema_version": 1 }, "sql_schema": { "entity_block_count": 157, "function_contract_count": 155, "function_contracts_sha256": "62fc32cfc44fe3084f36d8516b39e9eb81088932044961645eb435939046afff", "normalized_sha256": "0c55186efdc45ad0802bd4e0cca97381b2d6b55de550e44d83262496bf1df46e" }, "sql_signatures": [ { "declaration": "-- graph::sql_facade::admin::active_generation_count CREATE FUNCTION graph.\"active_generation_count\"() RETURNS INT STRICT LANGUAGE c;", "name": "active_generation_count" }, { "declaration": "-- graph::sql_facade::admin::add_edge CREATE FUNCTION graph.\"add_edge\"( \"from_table\" oid, \"from_column\" TEXT, \"to_table\" oid, \"to_column\" TEXT, \"label\" TEXT, \"bidirectional\" bool DEFAULT true, \"weight_column\" TEXT DEFAULT NULL, \"label_column\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_edge" }, { "declaration": "-- graph::sql_facade::admin::add_edge_to_graph CREATE FUNCTION graph.\"add_edge_to_graph\"( \"graph_name\" TEXT, \"from_table\" oid, \"from_column\" TEXT, \"to_table\" oid, \"to_column\" TEXT, \"label\" TEXT, \"bidirectional\" bool DEFAULT true, \"weight_column\" TEXT DEFAULT NULL, \"label_column\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_edge_to_graph" }, { "declaration": "-- graph::sql_facade::admin::add_filter_column CREATE FUNCTION graph.\"add_filter_column\"( \"table_name\" oid, \"column_name\" TEXT, \"column_type\" TEXT DEFAULT 'numeric' ) RETURNS void STRICT LANGUAGE c;", "name": "add_filter_column" }, { "declaration": "-- graph::sql_facade::admin::add_filter_column_to_graph CREATE FUNCTION graph.\"add_filter_column_to_graph\"( \"graph_name\" TEXT, \"table_name\" oid, \"column_name\" TEXT, \"column_type\" TEXT DEFAULT 'numeric', \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "add_filter_column_to_graph" }, { "declaration": "-- graph::sql_facade::admin::add_sync_policy CREATE FUNCTION graph.\"add_sync_policy\"( \"graph_name\" TEXT, \"schedule_interval_secs\" bigint DEFAULT 60, \"max_sync_lag_rows\" bigint DEFAULT NULL, \"enabled\" bool DEFAULT true, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"policy_id\" TEXT, \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"enabled\" bool, \"schedule_interval_secs\" bigint, \"max_sync_lag_rows\" bigint, \"next_run_at\" timestamp with time zone, \"last_status\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_sync_policy" }, { "declaration": "-- graph::sql_facade::admin::add_table CREATE FUNCTION graph.\"add_table\"( \"table_name\" oid, \"id_column\" TEXT, \"columns\" TEXT[] DEFAULT NULL, \"tenant_column\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_table" }, { "declaration": "-- graph::sql_facade::admin::add_table CREATE FUNCTION graph.\"add_table\"( \"table_name\" oid, \"id_columns\" TEXT[], \"columns\" TEXT[] DEFAULT NULL, \"tenant_column\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_table" }, { "declaration": "-- graph::sql_facade::admin::add_table_to_graph CREATE FUNCTION graph.\"add_table_to_graph\"( \"graph_name\" TEXT, \"table_name\" oid, \"id_column\" TEXT, \"columns\" TEXT[] DEFAULT NULL, \"tenant_column\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_table_to_graph" }, { "declaration": "-- graph::sql_facade::admin::add_table_to_graph CREATE FUNCTION graph.\"add_table_to_graph\"( \"graph_name\" TEXT, \"table_name\" oid, \"id_columns\" TEXT[], \"columns\" TEXT[] DEFAULT NULL, \"tenant_column\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "add_table_to_graph" }, { "declaration": "-- graph::sql_facade::traversal::aggregate CREATE FUNCTION graph.\"aggregate\"( \"traversal\" jsonb, \"aggregations\" jsonb, \"scope\" TEXT DEFAULT 'returned_nodes', \"path_limit\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.max_exact_path_count', true), '')::int, 100000) ) RETURNS jsonb STRICT LANGUAGE c;", "name": "aggregate" }, { "declaration": "-- graph::sql_facade::admin::all CREATE FUNCTION graph.\"all\"( \"filters\" jsonb[] ) RETURNS jsonb STRICT LANGUAGE c;", "name": "all" }, { "declaration": "-- graph::sql_facade::admin::alter_edge CREATE FUNCTION graph.\"alter_edge\"( \"graph_name\" TEXT, \"label\" TEXT, \"bidirectional\" bool DEFAULT NULL, \"weight_column\" TEXT DEFAULT NULL, \"label_column\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "alter_edge" }, { "declaration": "-- graph::sql_facade::admin::alter_graph CREATE FUNCTION graph.\"alter_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL, \"graph_kind\" TEXT DEFAULT NULL, \"residency\" TEXT DEFAULT NULL, \"materialization\" TEXT DEFAULT NULL, \"projection_mode\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "alter_graph" }, { "declaration": "-- graph::sql_facade::admin::alter_job CREATE FUNCTION graph.\"alter_job\"( \"job_id\" TEXT, \"enabled\" bool DEFAULT NULL, \"schedule_interval_secs\" bigint DEFAULT NULL, \"max_runtime_secs\" bigint DEFAULT NULL, \"max_retries\" INT DEFAULT NULL ) RETURNS TABLE ( \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"enabled\" bool, \"schedule_interval_secs\" bigint, \"max_runtime_secs\" bigint, \"max_retries\" INT, \"next_run_at\" timestamp with time zone, \"last_status\" TEXT ) LANGUAGE c;", "name": "alter_job" }, { "declaration": "-- graph::sql_facade::admin::alter_sync_policy CREATE FUNCTION graph.\"alter_sync_policy\"( \"policy_id\" TEXT, \"schedule_interval_secs\" bigint DEFAULT NULL, \"max_sync_lag_rows\" bigint DEFAULT NULL, \"enabled\" bool DEFAULT NULL ) RETURNS TABLE ( \"policy_id\" TEXT, \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"enabled\" bool, \"schedule_interval_secs\" bigint, \"max_sync_lag_rows\" bigint, \"next_run_at\" timestamp with time zone, \"last_status\" TEXT ) LANGUAGE c;", "name": "alter_sync_policy" }, { "declaration": "-- graph::sql_facade::admin::apply_sync CREATE FUNCTION graph.\"apply_sync\"() RETURNS TABLE ( \"inserts_applied\" bigint, \"updates_applied\" bigint, \"deletes_applied\" bigint ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "apply_sync" }, { "declaration": "-- graph::sql_facade::admin::at_least CREATE FUNCTION graph.\"at_least\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "at_least" }, { "declaration": "-- graph::sql_facade::admin::at_most CREATE FUNCTION graph.\"at_most\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "at_most" }, { "declaration": "-- graph::sql_facade::discovery::auto_discover CREATE FUNCTION graph.\"auto_discover\"( \"schema_name\" TEXT DEFAULT 'public', \"graph_name\" TEXT DEFAULT NULL, \"build\" bool DEFAULT true, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"item_type\" TEXT, \"item_name\" TEXT, \"details\" TEXT ) LANGUAGE c;", "name": "auto_discover" }, { "declaration": "-- graph::sql_facade::discovery::auto_discover_tables CREATE FUNCTION graph.\"auto_discover_tables\"( \"tables\" oid[], \"tenant_column\" TEXT DEFAULT NULL, \"graph_name\" TEXT DEFAULT NULL, \"build\" bool DEFAULT true, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"item_type\" TEXT, \"item_name\" TEXT, \"details\" TEXT ) LANGUAGE c;", "name": "auto_discover_tables" }, { "declaration": "-- graph::sql_facade::admin::between CREATE FUNCTION graph.\"between\"( \"column_name\" TEXT, \"lower\" jsonb, \"upper\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "between" }, { "declaration": "-- graph::sql_facade::admin::build CREATE FUNCTION graph.\"build\"( \"concurrently\" bool ) RETURNS TABLE ( \"build_id\" TEXT, \"status\" TEXT, \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT ) STRICT LANGUAGE c;", "name": "build" }, { "declaration": "-- graph::sql_facade::admin::build CREATE FUNCTION graph.\"build\"( \"mode\" TEXT ) RETURNS TABLE ( \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT ) STRICT LANGUAGE c;", "name": "build" }, { "declaration": "-- graph::sql_facade::admin::build CREATE FUNCTION graph.\"build\"() RETURNS TABLE ( \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "build" }, { "declaration": "-- graph::sql_facade::admin::build_async_graph CREATE FUNCTION graph.\"build_async_graph\"( \"graph_name\" TEXT, \"projection_mode\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"build_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT ) LANGUAGE c;", "name": "build_async_graph" }, { "declaration": "-- graph::sql_facade::admin::build_graph CREATE FUNCTION graph.\"build_graph\"( \"graph_name\" TEXT, \"force_persist\" bool DEFAULT false, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "build_graph" }, { "declaration": "-- graph::sql_facade::admin::build_resource_status CREATE FUNCTION graph.\"build_resource_status\"() RETURNS TABLE ( \"budget_bytes\" bigint, \"peak_bytes\" bigint, \"peak_phase\" TEXT, \"pressure_events\" bigint ) STRICT LANGUAGE c;", "name": "build_resource_status" }, { "declaration": "-- graph::sql_facade::admin::build_status CREATE FUNCTION graph.\"build_status\"( \"build_id\" TEXT ) RETURNS TABLE ( \"build_id\" TEXT, \"status\" TEXT, \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"progress_phase\" TEXT, \"progress_message\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone, \"error\" TEXT ) STRICT LANGUAGE c;", "name": "build_status" }, { "declaration": "-- graph::sql_facade::admin::build_status_for_graph CREATE FUNCTION graph.\"build_status_for_graph\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50 ) RETURNS TABLE ( \"build_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"nodes_loaded\" bigint, \"edges_loaded\" bigint, \"build_time_ms\" double precision, \"memory_used_mb\" double precision, \"sync_mode\" TEXT, \"projection_mode\" TEXT, \"progress_phase\" TEXT, \"progress_message\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone, \"error\" TEXT ) LANGUAGE c;", "name": "build_status_for_graph" }, { "declaration": "-- graph::sql_facade::components::component CREATE FUNCTION graph.\"component\"( \"component_id\" bigint, \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"component_id\" bigint, \"node_table\" oid, \"node_id\" TEXT, \"node\" jsonb ) STRICT LANGUAGE c;", "name": "component" }, { "declaration": "-- graph::sql_facade::components::component_stats CREATE FUNCTION graph.\"component_stats\"() RETURNS TABLE ( \"num_components\" INT, \"largest_component\" INT, \"num_isolated_nodes\" INT, \"total_active_nodes\" INT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "component_stats" }, { "declaration": "-- graph::sql_facade::components::components CREATE FUNCTION graph.\"components\"( \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0 ) RETURNS TABLE ( \"component_id\" bigint, \"component_size\" bigint, \"rank\" INT ) STRICT LANGUAGE c;", "name": "components" }, { "declaration": "-- graph::sql_facade::components::connected_components CREATE FUNCTION graph.\"connected_components\"() RETURNS TABLE ( \"node_table\" oid, \"node_id\" TEXT, \"component_id\" bigint, \"component_size\" INT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "connected_components" }, { "declaration": "-- graph::sql_facade::workflow::connection CREATE FUNCTION graph.\"connection\"( \"source_key\" TEXT, \"source_value\" TEXT, \"target_key\" TEXT, \"target_value\" TEXT, \"source_table\" oid DEFAULT NULL, \"target_table\" oid DEFAULT NULL, \"source_k\" INT DEFAULT 3, \"target_k\" INT DEFAULT 3, \"search_mode\" TEXT DEFAULT 'contains', \"max_depth\" INT DEFAULT 6 ) RETURNS TABLE ( \"source_table_name\" TEXT, \"source_id\" TEXT, \"target_table_name\" TEXT, \"target_id\" TEXT, \"hop_count\" INT, \"step\" INT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"edge_label\" TEXT, \"readable_path\" TEXT, \"node\" jsonb ) LANGUAGE c;", "name": "connection" }, { "declaration": "-- graph::sql_facade::admin::contains_text CREATE FUNCTION graph.\"contains_text\"( \"column_name\" TEXT, \"value\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "contains_text" }, { "declaration": "-- graph::sql_facade::admin::create_graph CREATE FUNCTION graph.\"create_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL, \"graph_kind\" TEXT DEFAULT 'user', \"residency\" TEXT DEFAULT 'hot', \"materialization\" TEXT DEFAULT 'shared', \"projection_mode\" TEXT DEFAULT 'csr_readonly' ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "create_graph" }, { "declaration": "-- graph::sql_facade::discovery::create_row_predicate_subgraph CREATE FUNCTION graph.\"create_row_predicate_subgraph\"( \"graph_name\" TEXT, \"row_predicate\" jsonb, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "create_row_predicate_subgraph" }, { "declaration": "-- graph::sql_facade::admin::current_graph CREATE FUNCTION graph.\"current_graph\"() RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "current_graph" }, { "declaration": "-- graph::sql_facade::cypher::cypher CREATE FUNCTION graph.\"cypher\"( \"query\" TEXT, \"params\" jsonb DEFAULT NULL, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"row\" jsonb ) VOLATILE COST 1000 LANGUAGE c;", "name": "cypher" }, { "declaration": "-- graph::sql_facade::cypher::cypher_compatibility CREATE FUNCTION graph.\"cypher_compatibility\"() RETURNS TABLE ( \"feature\" TEXT, \"status\" TEXT, \"notes\" TEXT ) STRICT LANGUAGE c;", "name": "cypher_compatibility" }, { "declaration": "-- graph::sql_facade::cypher::cypher_explain CREATE FUNCTION graph.\"cypher_explain\"( \"query\" TEXT ) RETURNS TEXT STRICT LANGUAGE c;", "name": "cypher_explain" }, { "declaration": "-- graph::sql_facade::admin::drop_graph CREATE FUNCTION graph.\"drop_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "drop_graph" }, { "declaration": "-- graph::sql_facade::admin::drop_sync_policy CREATE FUNCTION graph.\"drop_sync_policy\"( \"policy_id\" TEXT ) RETURNS TABLE ( \"policy_id\" TEXT, \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"dropped\" bool ) STRICT LANGUAGE c;", "name": "drop_sync_policy" }, { "declaration": "-- graph::sql_facade::admin::enable_sync CREATE FUNCTION graph.\"enable_sync\"() RETURNS void STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "enable_sync" }, { "declaration": "-- graph::sql_facade::admin::eq CREATE FUNCTION graph.\"eq\"( \"column_name\" TEXT, \"value\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "eq" }, { "declaration": "-- graph::sql_facade::admin::eq CREATE FUNCTION graph.\"eq\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "eq" }, { "declaration": "-- graph::sql_facade::admin::eq CREATE FUNCTION graph.\"eq\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "eq" }, { "declaration": "-- graph::sql_facade::admin::equals CREATE FUNCTION graph.\"equals\"( \"column_name\" TEXT, \"value\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "equals" }, { "declaration": "-- graph::sql_facade::admin::equals CREATE FUNCTION graph.\"equals\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "equals" }, { "declaration": "-- graph::sql_facade::admin::equals CREATE FUNCTION graph.\"equals\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "equals" }, { "declaration": "-- graph::sql_facade::admin::estimate CREATE FUNCTION graph.\"estimate\"() RETURNS TABLE ( \"estimated_nodes\" bigint, \"estimated_edges\" bigint, \"estimated_memory_mb\" double precision, \"memory_limit_mb\" INT, \"fits_in_memory\" bool ) STRICT LANGUAGE c;", "name": "estimate" }, { "declaration": "-- graph::sql_facade::workflow::expand CREATE FUNCTION graph.\"expand\"( \"seed_table\" oid, \"seed_id\" TEXT, \"max_depth\" INT DEFAULT current_setting('graph.default_max_depth')::int, \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"target_table\" oid DEFAULT NULL, \"target_tables\" oid[] DEFAULT NULL, \"where_node\" jsonb DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50, \"row_offset\" INT DEFAULT 0, \"include_start\" bool DEFAULT false ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"root_table_name\" TEXT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"depth\" INT, \"rank\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"readable_path\" TEXT, \"node\" jsonb, \"truncated\" bool ) LANGUAGE c;", "name": "expand" }, { "declaration": "-- graph::sql_facade::workflow::find CREATE FUNCTION graph.\"find\"( \"property_key\" TEXT, \"property_value\" TEXT, \"table_name\" oid DEFAULT NULL, \"mode\" TEXT DEFAULT 'contains', \"case_sensitive\" bool DEFAULT false, \"max_rows\" INT DEFAULT 20, \"row_offset\" INT DEFAULT 0, \"tenant\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"match_type\" TEXT, \"score\" real, \"verified\" bool, \"rank\" INT, \"node\" jsonb ) LANGUAGE c;", "name": "find" }, { "declaration": "-- graph::sql_facade::workflow::find_related CREATE FUNCTION graph.\"find_related\"( \"property_key\" TEXT, \"property_value\" TEXT, \"source_table\" oid DEFAULT NULL, \"search_mode\" TEXT DEFAULT COALESCE(NULLIF(current_setting('graph.default_search_mode'), ''), 'contains'), \"case_sensitive\" bool DEFAULT current_setting('graph.default_case_sensitive')::boolean, \"search_max_rows\" INT DEFAULT 1, \"search_row_offset\" INT DEFAULT 0, \"max_depth\" INT DEFAULT current_setting('graph.default_max_depth')::int, \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"target_table\" oid DEFAULT NULL, \"target_tables\" oid[] DEFAULT NULL, \"where_node\" jsonb DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 20, \"row_offset\" INT DEFAULT 0, \"include_counts\" bool DEFAULT false, \"candidate_limit\" INT DEFAULT 10000, \"include_start\" bool DEFAULT false ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"root_table_name\" TEXT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"depth\" INT, \"score\" real, \"rank\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"readable_path\" TEXT, \"node\" jsonb, \"candidate_count\" bigint, \"filtered_count\" bigint, \"truncated\" bool ) LANGUAGE c;", "name": "find_related" }, { "declaration": "-- graph::sql_facade::admin::format_path CREATE FUNCTION graph.\"format_path\"( \"path\" jsonb, \"edge_path\" jsonb, \"separator\" TEXT DEFAULT ' | ' ) RETURNS TEXT STRICT LANGUAGE c;", "name": "format_path" }, { "declaration": "-- graph::sql_facade::traversal::get_neighbors CREATE FUNCTION graph.\"get_neighbors\"( \"graph_name\" TEXT, \"label\" TEXT, \"id\" TEXT, \"direction\" TEXT DEFAULT 'any', \"edge_types\" TEXT[] DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"hydrate\" bool DEFAULT true, \"max_rows\" INT DEFAULT 1000, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"node_table\" oid, \"node_id\" TEXT, \"depth\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"node\" jsonb, \"root_table_name\" TEXT, \"node_table_name\" TEXT, \"capped\" bool ) COST 1000 LANGUAGE c;", "name": "get_neighbors" }, { "declaration": "-- graph::sql_facade::traversal::get_node CREATE FUNCTION graph.\"get_node\"( \"graph_name\" TEXT, \"label\" TEXT, \"id\" TEXT, \"hydrate\" bool DEFAULT true, \"tenant\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"node_idx\" bigint, \"node\" jsonb ) COST 100 LANGUAGE c;", "name": "get_node" }, { "declaration": "-- graph::sql_facade::gql::gql CREATE FUNCTION graph.\"gql\"( \"query\" TEXT, \"params\" jsonb DEFAULT NULL, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"row\" jsonb ) VOLATILE COST 1000 LANGUAGE c;", "name": "gql" }, { "declaration": "-- graph::sql_facade::gql::gql_explain CREATE FUNCTION graph.\"gql_explain\"( \"query\" TEXT ) RETURNS TEXT STRICT LANGUAGE c;", "name": "gql_explain" }, { "declaration": "-- graph::sql_facade::admin::grant_graph CREATE FUNCTION graph.\"grant_graph\"( \"graph_name\" TEXT, \"grantee\" TEXT, \"privilege\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"grantee\" oid, \"privilege\" TEXT, \"grantor\" oid, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "grant_graph" }, { "declaration": "-- graph::sql_facade::admin::graph_map CREATE FUNCTION graph.\"graph_map\"( \"graph_name\" TEXT, \"format\" TEXT DEFAULT 'json', \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS jsonb LANGUAGE c;", "name": "graph_map" }, { "declaration": "-- graph::sql_facade::admin::graph_privileges CREATE FUNCTION graph.\"graph_privileges\"( \"graph_name\" TEXT DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"grantee\" oid, \"privilege\" TEXT, \"grantor\" oid, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "graph_privileges" }, { "declaration": "-- graph::sql_facade::admin::graph_quota_usage CREATE FUNCTION graph.\"graph_quota_usage\"() RETURNS TABLE ( \"scope_type\" TEXT, \"scope_key\" TEXT, \"dimension\" TEXT, \"limit_value\" bigint, \"usage_value\" bigint, \"enforcement\" TEXT, \"exceeded\" bool ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "graph_quota_usage" }, { "declaration": "-- graph::sql_facade::admin::graph_quotas CREATE FUNCTION graph.\"graph_quotas\"() RETURNS TABLE ( \"scope_type\" TEXT, \"scope_key\" TEXT, \"dimension\" TEXT, \"limit_value\" bigint, \"enforcement\" TEXT, \"updated_by\" oid, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "graph_quotas" }, { "declaration": "-- graph::sql_facade::runtime::graph_runtime_status CREATE FUNCTION graph.\"graph_runtime_status\"() RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"residency\" TEXT, \"loaded\" bool, \"artifact_exists\" bool, \"artifact_bytes\" bigint, \"node_count\" bigint, \"edge_count\" bigint, \"memory_used_mb\" double precision, \"projection_mode\" TEXT, \"last_access_unix_micros\" bigint ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "graph_runtime_status" }, { "declaration": "-- graph::sql_facade::admin::greater_than CREATE FUNCTION graph.\"greater_than\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "greater_than" }, { "declaration": "-- graph::sql_facade::admin::greater_than CREATE FUNCTION graph.\"greater_than\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "greater_than" }, { "declaration": "-- graph::sql_facade::admin::gt CREATE FUNCTION graph.\"gt\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "gt" }, { "declaration": "-- graph::sql_facade::admin::gt CREATE FUNCTION graph.\"gt\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "gt" }, { "declaration": "-- graph::sql_facade::admin::gte CREATE FUNCTION graph.\"gte\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "gte" }, { "declaration": "-- graph::sql_facade::admin::gte CREATE FUNCTION graph.\"gte\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "gte" }, { "declaration": "-- graph::sql_facade::admin::in CREATE FUNCTION graph.\"in\"( \"column_name\" TEXT, \"values\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "in" }, { "declaration": "-- graph::sql_facade::admin::ingest_projection CREATE FUNCTION graph.\"ingest_projection\"( \"max_rows\" bigint DEFAULT NULL, \"max_bytes\" bigint DEFAULT NULL ) RETURNS TABLE ( \"rows_ingested\" bigint, \"segments_published\" bigint, \"sync_watermark\" bigint ) LANGUAGE c;", "name": "ingest_projection" }, { "declaration": "-- graph::sql_facade::admin::is_not_null CREATE FUNCTION graph.\"is_not_null\"( \"column_name\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "is_not_null" }, { "declaration": "-- graph::sql_facade::admin::is_null CREATE FUNCTION graph.\"is_null\"( \"column_name\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "is_null" }, { "declaration": "-- graph::sql_facade::components::isolated_nodes CREATE FUNCTION graph.\"isolated_nodes\"( \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"component_id\" bigint, \"node_table\" oid, \"node_id\" TEXT, \"node\" jsonb ) STRICT LANGUAGE c;", "name": "isolated_nodes" }, { "declaration": "-- graph::sql_facade::admin::job_runs CREATE FUNCTION graph.\"job_runs\"( \"job_id\" TEXT DEFAULT NULL, \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50 ) RETURNS TABLE ( \"run_id\" TEXT, \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"rows_applied\" bigint, \"retry_count\" INT, \"execution_mode\" TEXT, \"sqlstate\" TEXT, \"error\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "job_runs" }, { "declaration": "-- graph::sql_facade::admin::job_stats CREATE FUNCTION graph.\"job_stats\"( \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"job_count\" bigint, \"run_count\" bigint, \"completed_runs\" bigint, \"failed_runs\" bigint, \"last_run_at\" timestamp with time zone ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "job_stats" }, { "declaration": "-- graph::sql_facade::admin::jobs CREATE FUNCTION graph.\"jobs\"( \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50 ) RETURNS TABLE ( \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"enabled\" bool, \"schedule_interval_secs\" bigint, \"max_runtime_secs\" bigint, \"max_retries\" INT, \"next_run_at\" timestamp with time zone, \"last_run_at\" timestamp with time zone, \"last_status\" TEXT, \"last_error\" TEXT, \"last_sqlstate\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "jobs" }, { "declaration": "-- graph::sql_facade::components::largest_component CREATE FUNCTION graph.\"largest_component\"( \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"component_id\" bigint, \"node_table\" oid, \"node_id\" TEXT, \"node\" jsonb ) STRICT LANGUAGE c;", "name": "largest_component" }, { "declaration": "-- graph::sql_facade::admin::less_than CREATE FUNCTION graph.\"less_than\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "less_than" }, { "declaration": "-- graph::sql_facade::admin::list_edges CREATE FUNCTION graph.\"list_edges\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"from_table\" TEXT, \"from_column\" TEXT, \"to_table\" TEXT, \"to_column\" TEXT, \"label\" TEXT, \"bidirectional\" bool, \"weight_column\" TEXT, \"label_column\" TEXT ) LANGUAGE c;", "name": "list_edges" }, { "declaration": "-- graph::sql_facade::admin::list_graphs CREATE FUNCTION graph.\"list_graphs\"() RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "list_graphs" }, { "declaration": "-- graph::sql_facade::runtime::load_graph CREATE FUNCTION graph.\"load_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"loaded\" bool, \"node_count\" bigint, \"edge_count\" bigint, \"memory_used_mb\" double precision, \"projection_mode\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "load_graph" }, { "declaration": "-- graph::sql_facade::runtime::loaded_graphs CREATE FUNCTION graph.\"loaded_graphs\"() RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"residency\" TEXT, \"node_count\" bigint, \"edge_count\" bigint, \"memory_used_mb\" double precision, \"projection_mode\" TEXT, \"last_access_unix_micros\" bigint ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "loaded_graphs" }, { "declaration": "-- graph::sql_facade::admin::lt CREATE FUNCTION graph.\"lt\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "lt" }, { "declaration": "-- graph::sql_facade::admin::lt CREATE FUNCTION graph.\"lt\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "lt" }, { "declaration": "-- graph::sql_facade::admin::lte CREATE FUNCTION graph.\"lte\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "lte" }, { "declaration": "-- graph::sql_facade::admin::lte CREATE FUNCTION graph.\"lte\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "lte" }, { "declaration": "-- graph::sql_facade::admin::maintenance CREATE FUNCTION graph.\"maintenance\"( \"concurrently\" bool DEFAULT false ) RETURNS TABLE ( \"job_id\" TEXT, \"status\" TEXT, \"sync_rows_applied\" bigint, \"nodes_after\" bigint, \"edges_after\" bigint, \"vacuum_time_ms\" double precision, \"error\" TEXT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "maintenance" }, { "declaration": "-- graph::sql_facade::admin::maintenance_graph CREATE FUNCTION graph.\"maintenance_graph\"( \"graph_name\" TEXT, \"concurrently\" bool DEFAULT false, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"sync_rows_applied\" bigint, \"nodes_after\" bigint, \"edges_after\" bigint, \"vacuum_time_ms\" double precision, \"error\" TEXT ) LANGUAGE c;", "name": "maintenance_graph" }, { "declaration": "-- graph::sql_facade::admin::maintenance_status CREATE FUNCTION graph.\"maintenance_status\"( \"job_id\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"job_id\" TEXT, \"status\" TEXT, \"sync_rows_applied\" bigint, \"nodes_after\" bigint, \"edges_after\" bigint, \"vacuum_time_ms\" double precision, \"progress_phase\" TEXT, \"progress_message\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone, \"error\" TEXT ) LANGUAGE c;", "name": "maintenance_status" }, { "declaration": "-- graph::sql_facade::admin::maintenance_status_for_graph CREATE FUNCTION graph.\"maintenance_status_for_graph\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50 ) RETURNS TABLE ( \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"sync_rows_applied\" bigint, \"nodes_after\" bigint, \"edges_after\" bigint, \"vacuum_time_ms\" double precision, \"progress_phase\" TEXT, \"progress_message\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone, \"error\" TEXT ) LANGUAGE c;", "name": "maintenance_status_for_graph" }, { "declaration": "-- graph::sql_facade::admin::memory_profile CREATE FUNCTION graph.\"memory_profile\"( \"concurrent_backends\" INT DEFAULT 1 ) RETURNS TABLE ( \"active_backend_private_mb\" double precision, \"active_backend_shared_mb\" double precision, \"active_backend_total_mb\" double precision, \"estimated_instance_private_mb\" double precision, \"estimated_instance_shared_mb\" double precision, \"estimated_instance_total_mb\" double precision, \"memory_limit_mb\" INT, \"assumed_concurrent_backends\" INT ) STRICT LANGUAGE c;", "name": "memory_profile" }, { "declaration": "-- graph::sql_facade::workflow::neighborhood CREATE FUNCTION graph.\"neighborhood\"( \"property_key\" TEXT, \"property_value\" TEXT, \"source_table\" oid DEFAULT NULL, \"search_mode\" TEXT DEFAULT 'contains', \"search_max_rows\" INT DEFAULT 1, \"max_depth\" INT DEFAULT 4, \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"tenant\" TEXT DEFAULT NULL, \"sample_k\" INT DEFAULT 5, \"node_limit\" INT DEFAULT 10000 ) RETURNS TABLE ( \"depth\" INT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_count\" bigint, \"sample_nodes\" jsonb, \"truncated\" bool ) LANGUAGE c;", "name": "neighborhood" }, { "declaration": "-- graph::sql_facade::admin::neq CREATE FUNCTION graph.\"neq\"( \"column_name\" TEXT, \"value\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "neq" }, { "declaration": "-- graph::sql_facade::admin::neq CREATE FUNCTION graph.\"neq\"( \"column_name\" TEXT, \"value\" bigint ) RETURNS jsonb STRICT LANGUAGE c;", "name": "neq" }, { "declaration": "-- graph::sql_facade::admin::neq CREATE FUNCTION graph.\"neq\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "neq" }, { "declaration": "-- requires: -- auto_discover -- graph extension bootstrap SQL -- Creates catalog tables for storing registered tables and edges. DO $$ BEGIN CREATE TYPE graph.node_ref AS ( node_table REGCLASS, node_id TEXT ); EXCEPTION WHEN duplicate_object THEN NULL; END $$; CREATE OR REPLACE FUNCTION graph.node_ref(node_table REGCLASS, node_id TEXT) RETURNS graph.node_ref LANGUAGE sql IMMUTABLE PARALLEL SAFE;", "name": "node_ref" }, { "declaration": "-- graph::sql_facade::admin::node_ref_string CREATE FUNCTION graph.\"node_ref_string\"( \"table_name\" oid, \"node_id\" TEXT ) RETURNS TEXT STRICT LANGUAGE c;", "name": "node_ref_string" }, { "declaration": "-- graph::sql_facade::admin::not_equals CREATE FUNCTION graph.\"not_equals\"( \"column_name\" TEXT, \"value\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "not_equals" }, { "declaration": "-- graph::sql_facade::admin::not_in CREATE FUNCTION graph.\"not_in\"( \"column_name\" TEXT, \"values\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "not_in" }, { "declaration": "-- graph::sql_facade::admin::on_node CREATE FUNCTION graph.\"on_node\"( \"filter\" jsonb ) RETURNS jsonb STRICT LANGUAGE c;", "name": "on_node" }, { "declaration": "-- graph::sql_facade::workflow::path CREATE FUNCTION graph.\"path\"( \"source_table\" oid, \"source_id\" TEXT, \"target_table\" oid, \"target_id\" TEXT, \"max_depth\" INT DEFAULT 20 ) RETURNS TABLE ( \"step\" INT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"edge_label\" TEXT, \"readable_path\" TEXT, \"node\" jsonb ) STRICT LANGUAGE c;", "name": "path" }, { "declaration": "-- graph::sql_facade::traversal::path_count_estimate CREATE FUNCTION graph.\"path_count_estimate\"( \"traversal\" jsonb ) RETURNS TABLE ( \"estimated_paths\" bigint, \"exact\" bool, \"capped\" bool ) STRICT LANGUAGE c;", "name": "path_count_estimate" }, { "declaration": "-- graph::sql_facade::pgq::pgq CREATE FUNCTION graph.\"pgq\"( \"_query\" TEXT ) RETURNS void STRICT LANGUAGE c;", "name": "pgq" }, { "declaration": "-- graph::sql_facade::admin::prefix_text CREATE FUNCTION graph.\"prefix_text\"( \"column_name\" TEXT, \"value\" TEXT ) RETURNS jsonb STRICT LANGUAGE c;", "name": "prefix_text" }, { "declaration": "-- graph::sql_facade::discovery::preview_discover CREATE FUNCTION graph.\"preview_discover\"( \"schema_name\" TEXT DEFAULT 'public', \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"item_type\" TEXT, \"item_name\" TEXT, \"details\" TEXT ) LANGUAGE c;", "name": "preview_discover" }, { "declaration": "-- graph::sql_facade::discovery::preview_discover_tables CREATE FUNCTION graph.\"preview_discover_tables\"( \"tables\" oid[], \"tenant_column\" TEXT DEFAULT NULL, \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"item_type\" TEXT, \"item_name\" TEXT, \"details\" TEXT ) LANGUAGE c;", "name": "preview_discover_tables" }, { "declaration": "-- graph::sql_facade::admin::projection_compact CREATE FUNCTION graph.\"projection_compact\"( \"max_rows\" INT DEFAULT 10000, \"max_bytes\" bigint DEFAULT NULL, \"max_segments\" INT DEFAULT 1000, \"dirty_chunk_segment_threshold\" INT DEFAULT NULL ) RETURNS TABLE ( \"manifest_generation\" bigint, \"segments_compacted\" INT, \"chunks_rewritten\" INT, \"segment_count\" INT, \"dirty_chunk_count\" INT, \"sync_watermark\" bigint ) LANGUAGE c;", "name": "projection_compact" }, { "declaration": "-- graph::sql_facade::admin::projection_gc CREATE FUNCTION graph.\"projection_gc\"() RETURNS TABLE ( \"valid_generations_scanned\" INT, \"retained_generations\" bigint[], \"active_generations\" bigint[], \"obsolete_candidates\" INT, \"protected_candidates\" INT, \"deleted_files\" INT, \"deleted_bytes\" bigint ) STRICT LANGUAGE c;", "name": "projection_gc" }, { "declaration": "-- graph::sql_facade::admin::projection_repair CREATE FUNCTION graph.\"projection_repair\"() RETURNS TABLE ( \"action\" TEXT, \"generation_id\" bigint, \"rebuilt\" bool, \"chunks_rewritten\" INT, \"reason\" TEXT ) STRICT LANGUAGE c;", "name": "projection_repair" }, { "declaration": "-- graph::sql_facade::admin::projection_status CREATE FUNCTION graph.\"projection_status\"() RETURNS TABLE ( \"manifest_generation\" bigint, \"manifest_watermark\" bigint, \"pending_durable_rows\" bigint, \"base_artifact_bytes\" bigint, \"manifest_bytes\" bigint, \"artifact_bytes\" bigint, \"segment_count\" INT, \"segment_bytes\" bigint, \"segment_fanout\" INT, \"read_amplification\" INT, \"l0_segment_count\" INT, \"l1_segment_count\" INT, \"l2_segment_count\" INT, \"edge_segment_count\" INT, \"node_segment_count\" INT, \"dirty_chunk_count\" INT, \"dirty_chunk_bytes\" bigint, \"tombstone_ratio\" double precision, \"compaction_backlog\" INT, \"obsolete_file_count\" INT, \"obsolete_bytes\" bigint, \"active_generation_count\" INT, \"artifact_validation_state\" TEXT, \"last_ingestion_unix_micros\" bigint, \"last_compaction_unix_micros\" bigint, \"last_gc_unix_micros\" bigint, \"last_repair_unix_micros\" bigint, \"ingest_recommended\" bool, \"compaction_recommended\" bool, \"gc_recommended\" bool, \"repair_recommended\" bool ) STRICT LANGUAGE c;", "name": "projection_status" }, { "declaration": "-- graph::sql_facade::admin::registered_edges CREATE FUNCTION graph.\"registered_edges\"() RETURNS TABLE ( \"from_table\" TEXT, \"from_column\" TEXT, \"to_table\" TEXT, \"to_column\" TEXT, \"label\" TEXT, \"bidirectional\" bool, \"weight_column\" TEXT, \"label_column\" TEXT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "registered_edges" }, { "declaration": "-- graph::sql_facade::admin::registered_edges_for_graph CREATE FUNCTION graph.\"registered_edges_for_graph\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"from_table\" TEXT, \"from_column\" TEXT, \"to_table\" TEXT, \"to_column\" TEXT, \"label\" TEXT, \"bidirectional\" bool, \"weight_column\" TEXT, \"label_column\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "registered_edges_for_graph" }, { "declaration": "-- graph::sql_facade::admin::registered_tables CREATE FUNCTION graph.\"registered_tables\"() RETURNS TABLE ( \"table_name\" TEXT, \"id_columns\" TEXT[], \"columns\" TEXT[], \"tenant_column\" TEXT ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "registered_tables" }, { "declaration": "-- graph::sql_facade::admin::registered_tables_for_graph CREATE FUNCTION graph.\"registered_tables_for_graph\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"table_name\" TEXT, \"id_columns\" TEXT[], \"columns\" TEXT[], \"tenant_column\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "registered_tables_for_graph" }, { "declaration": "-- graph::sql_facade::admin::remove_edge CREATE FUNCTION graph.\"remove_edge\"( \"graph_name\" TEXT, \"label\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "remove_edge" }, { "declaration": "-- graph::sql_facade::admin::remove_edge CREATE FUNCTION graph.\"remove_edge\"( \"label\" TEXT ) RETURNS void STRICT LANGUAGE c;", "name": "remove_edge" }, { "declaration": "-- graph::sql_facade::admin::remove_edge_from_graph CREATE FUNCTION graph.\"remove_edge_from_graph\"( \"graph_name\" TEXT, \"label\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "remove_edge_from_graph" }, { "declaration": "-- graph::sql_facade::admin::remove_job CREATE FUNCTION graph.\"remove_job\"( \"job_id\" TEXT ) RETURNS TABLE ( \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"removed\" bool ) STRICT LANGUAGE c;", "name": "remove_job" }, { "declaration": "-- graph::sql_facade::admin::remove_table CREATE FUNCTION graph.\"remove_table\"( \"table_name\" oid ) RETURNS void STRICT LANGUAGE c;", "name": "remove_table" }, { "declaration": "-- graph::sql_facade::admin::remove_table_from_graph CREATE FUNCTION graph.\"remove_table_from_graph\"( \"graph_name\" TEXT, \"table_name\" oid, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "remove_table_from_graph" }, { "declaration": "-- graph::sql_facade::admin::rename_edge CREATE FUNCTION graph.\"rename_edge\"( \"graph_name\" TEXT, \"old_label\" TEXT, \"new_label\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS void LANGUAGE c;", "name": "rename_edge" }, { "declaration": "-- graph::sql_facade::runtime::reset CREATE FUNCTION graph.\"reset\"() RETURNS void STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "reset" }, { "declaration": "-- graph::sql_facade::admin::resource_status CREATE FUNCTION graph.\"resource_status\"() RETURNS TABLE ( \"operation\" TEXT, \"memory_budget_bytes\" bigint, \"memory_peak_bytes\" bigint, \"memory_peak_phase\" TEXT, \"disk_peak_bytes\" bigint, \"rows\" bigint, \"work_units\" bigint ) STRICT LANGUAGE c;", "name": "resource_status" }, { "declaration": "-- graph::sql_facade::admin::revoke_graph CREATE FUNCTION graph.\"revoke_graph\"( \"graph_name\" TEXT, \"grantee\" TEXT, \"privilege\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"grantee\" oid, \"privilege\" TEXT, \"grantor\" oid, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "revoke_graph" }, { "declaration": "-- graph::sql_facade::admin::run_due_jobs CREATE FUNCTION graph.\"run_due_jobs\"( \"max_jobs\" INT DEFAULT 64 ) RETURNS TABLE ( \"job_id\" TEXT, \"run_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"status\" TEXT, \"rows_applied\" bigint, \"error\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "run_due_jobs" }, { "declaration": "-- graph::sql_facade::admin::run_due_jobs_async CREATE FUNCTION graph.\"run_due_jobs_async\"( \"max_jobs\" INT DEFAULT 64 ) RETURNS bool STRICT LANGUAGE c;", "name": "run_due_jobs_async" }, { "declaration": "-- graph::sql_facade::admin::run_job CREATE FUNCTION graph.\"run_job\"( \"job_id\" TEXT ) RETURNS TABLE ( \"job_id\" TEXT, \"run_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"policy_kind\" TEXT, \"status\" TEXT, \"rows_applied\" bigint, \"error\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "run_job" }, { "declaration": "-- graph::sql_facade::admin::run_scheduled_maintenance CREATE FUNCTION graph.\"run_scheduled_maintenance\"() RETURNS TABLE ( \"applied_sync\" bool, \"maintenance_started\" bool, \"maintenance_job_id\" TEXT, \"pending_sync_rows\" bigint, \"edge_buffer_used\" INT, \"message\" TEXT ) STRICT LANGUAGE c;", "name": "run_scheduled_maintenance" }, { "declaration": "-- graph::sql_facade::admin::run_sync_policy CREATE FUNCTION graph.\"run_sync_policy\"( \"policy_id\" TEXT ) RETURNS TABLE ( \"policy_id\" TEXT, \"job_id\" TEXT, \"run_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"status\" TEXT, \"rows_applied\" bigint, \"error\" TEXT, \"started_at\" timestamp with time zone, \"finished_at\" timestamp with time zone ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "run_sync_policy" }, { "declaration": "-- graph::sql_facade::search::search CREATE FUNCTION graph.\"search\"( \"property_key\" TEXT, \"property_value\" TEXT, \"table_filter\" oid DEFAULT NULL, \"mode\" TEXT DEFAULT 'contains', \"case_sensitive\" bool DEFAULT false, \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0, \"tenant\" TEXT DEFAULT NULL, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"node_table\" oid, \"node_id\" TEXT, \"match_type\" TEXT, \"score\" real, \"verified\" bool, \"node\" jsonb, \"node_table_name\" TEXT ) LANGUAGE c;", "name": "search" }, { "declaration": "-- graph::sql_facade::search::search_nodes CREATE FUNCTION graph.\"search_nodes\"( \"property_key\" TEXT, \"property_value\" TEXT, \"table_filter\" oid DEFAULT NULL, \"mode\" TEXT DEFAULT 'contains', \"case_sensitive\" bool DEFAULT false, \"max_rows\" INT DEFAULT 100, \"row_offset\" INT DEFAULT 0, \"tenant\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"node_table\" oid, \"node_id\" TEXT, \"match_type\" TEXT, \"score\" real, \"verified\" bool, \"node_table_name\" TEXT ) LANGUAGE c;", "name": "search_nodes" }, { "declaration": "-- graph::sql_facade::runtime::select_graph CREATE FUNCTION graph.\"select_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"loaded\" bool ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "select_graph" }, { "declaration": "-- graph::sql_facade::admin::set_current_graph CREATE FUNCTION graph.\"set_current_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "set_current_graph" }, { "declaration": "-- graph::sql_facade::admin::set_graph_quota CREATE FUNCTION graph.\"set_graph_quota\"( \"scope_type\" TEXT, \"dimension\" TEXT, \"limit_value\" bigint, \"scope_key\" TEXT DEFAULT NULL, \"enforcement\" TEXT DEFAULT 'hard' ) RETURNS TABLE ( \"scope_type\" TEXT, \"scope_key\" TEXT, \"dimension\" TEXT, \"limit_value\" bigint, \"enforcement\" TEXT, \"updated_by\" oid, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "set_graph_quota" }, { "declaration": "-- graph::sql_facade::admin::set_graph_residency CREATE FUNCTION graph.\"set_graph_residency\"( \"graph_name\" TEXT, \"residency\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "set_graph_residency" }, { "declaration": "-- graph::sql_facade::traversal::shortest_path CREATE FUNCTION graph.\"shortest_path\"( \"source_table\" oid, \"source_id\" TEXT, \"target_table\" oid, \"target_id\" TEXT, \"max_depth\" INT DEFAULT 20, \"hydrate\" bool DEFAULT true ) RETURNS TABLE ( \"step\" INT, \"node_table\" oid, \"node_id\" TEXT, \"edge_label\" TEXT, \"node\" jsonb, \"node_table_name\" TEXT ) STRICT LANGUAGE c;", "name": "shortest_path" }, { "declaration": "-- graph::sql_facade::admin::status CREATE FUNCTION graph.\"status\"() RETURNS TABLE ( \"node_count\" INT, \"edge_count\" INT, \"memory_used_mb\" double precision, \"memory_limit_mb\" INT, \"sync_mode\" TEXT, \"sync_status\" TEXT, \"last_build\" timestamp with time zone, \"last_vacuum\" timestamp with time zone, \"edge_types\" TEXT[], \"edge_buffer_used\" INT, \"has_unidirectional_edges\" bool, \"schema_status\" TEXT, \"sync_lag\" bigint, \"pending_edge_deltas\" INT, \"needs_vacuum\" bool, \"needs_rebuild\" bool, \"applied_sync_id\" bigint, \"pending_sync_rows\" bigint, \"invalid_reason\" TEXT, \"disabled_trigger_count\" INT, \"read_only\" bool, \"read_only_reason\" TEXT, \"projection_mode\" TEXT, \"overlay_tombstone_count\" INT, \"overlay_memory_bytes\" bigint, \"compaction_recommended\" bool, \"tx_delta_dirty\" bool, \"tx_delta_added_nodes\" INT, \"tx_delta_deleted_nodes\" INT, \"tx_delta_added_edges\" INT, \"tx_delta_deleted_edges\" INT, \"tx_delta_memory_bytes\" bigint ) STRICT LANGUAGE c;", "name": "status" }, { "declaration": "-- graph::sql_facade::admin::sync_health CREATE FUNCTION graph.\"sync_health\"() RETURNS TABLE ( \"sync_mode\" TEXT, \"query_freshness\" TEXT, \"sync_batch_size\" INT, \"applied_sync_id\" bigint, \"max_sync_log_id\" bigint, \"pending_sync_rows\" bigint, \"disabled_trigger_count\" INT, \"edge_buffer_used\" INT, \"edge_buffer_size\" INT, \"needs_vacuum\" bool, \"needs_rebuild\" bool, \"read_only\" bool, \"read_only_reason\" TEXT, \"projection_mode\" TEXT, \"overlay_tombstone_count\" INT, \"overlay_memory_bytes\" bigint, \"compaction_recommended\" bool, \"tx_delta_dirty\" bool, \"tx_delta_added_nodes\" INT, \"tx_delta_deleted_nodes\" INT, \"tx_delta_added_edges\" INT, \"tx_delta_deleted_edges\" INT, \"tx_delta_memory_bytes\" bigint, \"apply_sync_recommended\" bool, \"maintenance_recommended\" bool, \"durable_ingest_recommended\" bool, \"durable_compaction_recommended\" bool, \"durable_gc_recommended\" bool, \"durable_repair_recommended\" bool, \"sync_log_retention_floor\" bigint, \"sync_log_prune_recommended\" bool, \"active_sync_watermark_backends\" INT ) STRICT LANGUAGE c;", "name": "sync_health" }, { "declaration": "-- graph::sql_facade::admin::sync_policy_status CREATE FUNCTION graph.\"sync_policy_status\"( \"graph_name\" TEXT DEFAULT NULL, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL, \"max_rows\" INT DEFAULT 50 ) RETURNS TABLE ( \"policy_id\" TEXT, \"job_id\" TEXT, \"graph_id\" TEXT, \"graph_name\" TEXT, \"enabled\" bool, \"schedule_interval_secs\" bigint, \"max_sync_lag_rows\" bigint, \"next_run_at\" timestamp with time zone, \"last_run_at\" timestamp with time zone, \"last_status\" TEXT, \"last_error\" TEXT ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "sync_policy_status" }, { "declaration": "-- graph::sql_facade::admin::transfer_graph_ownership CREATE FUNCTION graph.\"transfer_graph_ownership\"( \"graph_name\" TEXT, \"new_owner\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"owner_role\" oid, \"created_by\" oid, \"tenant\" TEXT, \"namespace\" TEXT, \"graph_kind\" TEXT, \"residency\" TEXT, \"materialization\" TEXT, \"projection_mode\" TEXT, \"created_at\" timestamp with time zone, \"updated_at\" timestamp with time zone ) LANGUAGE c;", "name": "transfer_graph_ownership" }, { "declaration": "-- graph::sql_facade::traversal::traverse CREATE FUNCTION graph.\"traverse\"( \"seed_table\" oid, \"seed_id\" TEXT, \"max_depth\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.default_max_depth', true), '')::int, 5), \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"node_tables\" oid[] DEFAULT NULL, \"filter\" jsonb DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"strategy\" TEXT DEFAULT 'bfs', \"uniqueness\" TEXT DEFAULT 'node_global', \"include_start\" bool DEFAULT true, \"hydrate\" bool DEFAULT true, \"max_rows\" INT DEFAULT 1000, \"row_offset\" INT DEFAULT 0, \"max_nodes\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.max_nodes', true), '')::int, 100000), \"max_frontier\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.max_frontier', true), '')::int, 100000) ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"node_table\" oid, \"node_id\" TEXT, \"depth\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"node\" jsonb, \"root_table_name\" TEXT, \"node_table_name\" TEXT, \"capped\" bool ) SECURITY DEFINER COST 1000 SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "traverse" }, { "declaration": "-- graph::sql_facade::traversal::traverse CREATE FUNCTION graph.\"traverse\"( \"start_tables\" oid[], \"start_ids\" TEXT[], \"max_depth\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.default_max_depth', true), '')::int, 5), \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"node_tables\" oid[] DEFAULT NULL, \"filter\" jsonb DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"strategy\" TEXT DEFAULT 'bfs', \"uniqueness\" TEXT DEFAULT 'node_global', \"include_start\" bool DEFAULT true, \"hydrate\" bool DEFAULT true, \"max_rows\" INT DEFAULT 1000, \"row_offset\" INT DEFAULT 0, \"max_nodes\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.max_nodes', true), '')::int, 100000), \"max_frontier\" INT DEFAULT COALESCE(NULLIF(current_setting('graph.max_frontier', true), '')::int, 100000) ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"node_table\" oid, \"node_id\" TEXT, \"depth\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"node\" jsonb, \"root_table_name\" TEXT, \"node_table_name\" TEXT, \"capped\" bool ) COST 1000 LANGUAGE c;", "name": "traverse" }, { "declaration": "-- graph::sql_facade::search::traverse_search CREATE FUNCTION graph.\"traverse_search\"( \"property_key\" TEXT, \"property_value\" TEXT, \"table_filter\" oid DEFAULT NULL, \"search_mode\" TEXT DEFAULT COALESCE(NULLIF(current_setting('graph.default_search_mode'), ''), 'contains'), \"case_sensitive\" bool DEFAULT current_setting('graph.default_case_sensitive')::boolean, \"search_max_rows\" INT DEFAULT 100, \"search_row_offset\" INT DEFAULT 0, \"max_depth\" INT DEFAULT current_setting('graph.default_max_depth')::int, \"edge_types\" TEXT[] DEFAULT NULL, \"direction\" TEXT DEFAULT 'any', \"node_tables\" oid[] DEFAULT NULL, \"filter\" jsonb DEFAULT NULL, \"tenant\" TEXT DEFAULT NULL, \"strategy\" TEXT DEFAULT 'bfs', \"uniqueness\" TEXT DEFAULT 'node_per_root', \"include_start\" bool DEFAULT true, \"hydrate\" bool DEFAULT current_setting('graph.default_hydrate')::boolean, \"max_rows\" INT DEFAULT 1000, \"row_offset\" INT DEFAULT 0 ) RETURNS TABLE ( \"root_table\" oid, \"root_id\" TEXT, \"node_table\" oid, \"node_id\" TEXT, \"depth\" INT, \"path\" jsonb, \"edge_path\" jsonb, \"node\" jsonb, \"root_table_name\" TEXT, \"node_table_name\" TEXT, \"capped\" bool ) LANGUAGE c;", "name": "traverse_search" }, { "declaration": "-- graph::sql_facade::runtime::unload_graph CREATE FUNCTION graph.\"unload_graph\"( \"graph_name\" TEXT, \"tenant\" TEXT DEFAULT NULL, \"namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"graph_id\" TEXT, \"graph_name\" TEXT, \"unloaded\" bool ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "unload_graph" }, { "declaration": "-- graph::sql_facade::admin::vacuum CREATE FUNCTION graph.\"vacuum\"() RETURNS TABLE ( \"nodes_before\" bigint, \"nodes_after\" bigint, \"tombstones_removed\" bigint, \"edges_rebuilt\" bigint, \"vacuum_time_ms\" double precision ) STRICT SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "vacuum" }, { "declaration": "-- graph::sql_facade::admin::vacuum_graph CREATE FUNCTION graph.\"vacuum_graph\"( \"graph_name\" TEXT, \"graph_tenant\" TEXT DEFAULT NULL, \"graph_namespace\" TEXT DEFAULT NULL ) RETURNS TABLE ( \"nodes_before\" bigint, \"nodes_after\" bigint, \"tombstones_removed\" bigint, \"edges_rebuilt\" bigint, \"vacuum_time_ms\" double precision ) SECURITY DEFINER SET search_path TO pg_catalog, pg_temp LANGUAGE c;", "name": "vacuum_graph" }, { "declaration": "-- graph::sql_facade::traversal::weighted_shortest_path CREATE FUNCTION graph.\"weighted_shortest_path\"( \"source_table\" oid, \"source_id\" TEXT, \"target_table\" oid, \"target_id\" TEXT ) RETURNS TABLE ( \"step\" INT, \"node_table\" oid, \"node_table_name\" TEXT, \"node_id\" TEXT, \"edge_label\" TEXT, \"edge_weight\" bigint, \"step_cost\" bigint, \"total_cost\" bigint ) STRICT LANGUAGE c;", "name": "weighted_shortest_path" } ] }