Skip to content

Add type-safe support for user-defined functions and API endpoints#16

Merged
tobiemh merged 1 commit intomainfrom
tobiemh/define-fn-api
Feb 15, 2026
Merged

Add type-safe support for user-defined functions and API endpoints#16
tobiemh merged 1 commit intomainfrom
tobiemh/define-fn-api

Conversation

@tobiemh
Copy link
Copy Markdown
Member

@tobiemh tobiemh commented Feb 15, 2026

Adds two new features to Surqlize:

  • fn() for defining user-defined SurrealDB functions (DEFINE FUNCTION) that can be called both inside queries (WHERE, RETURN) and standalone via db.run()
  • api() for defining custom API endpoints (DEFINE API) with a type-safe ApiClient wrapping the SDK's SurrealApi, accessible via db.api().

Both features integrate with the existing t.* type system for full TypeScript inference and runtime validation.

@tobiemh tobiemh merged commit 9d989b6 into main Feb 15, 2026
11 checks passed
@tobiemh tobiemh deleted the tobiemh/define-fn-api branch February 15, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant