Skip to content

Schema functions not applied when using surreal sql CLI #61

@ocombe

Description

@ocombe

Hello !
The database functions defined in schema/codegraph.surql fail to load when using the surreal CLI. After running surreal sql < schema/codegraph.surql, INFO FOR DB shows functions: {} (empty). (Also tried using ./apply-schema.sh but same issue).

The CLI produces parse errors for multiline function definitions:

Parse error: Unexpected end of file, expected an expression
--> [1:57926]

This causes agentic tools to fail at runtime with errors like:

  • The function 'fn::semantic_search_nodes_via_chunks' does not exist
  • The function 'fn::get_transitive_dependencies' does not exist

Affected functions: All DEFINE FUNCTION statements in codegraph.surql (at least 15+ functions).

Environment: SurrealDB 2.4.1, macOS

Workaround: Unknown: both surreal sql pipe input and HTTP API POST with --data-binary fail to apply the functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions