Skip to main content

fraiseql_functions/
lib.rs

1//! FraiseQL serverless functions runtime.
2//!
3//! This crate provides the core infrastructure for executing serverless functions
4//! in FraiseQL, with support for multiple runtimes (WASM, Deno, etc.).
5//!
6//! # Architecture
7//!
8//! - `FunctionRuntime`: Trait for implementing function execution backends
9//! - `WasmRuntime`: WASM component model executor (feature: `runtime-wasm`)
10//! - `DenoRuntime`: JavaScript/TypeScript executor via V8 (feature: `runtime-deno`)
11//! - `FunctionObserver`: Integrates with fraiseql-observers for trigger execution
12
13pub mod host;
14pub mod migrations;
15pub mod observer;
16pub mod runtime;
17pub mod store;
18pub mod triggers;
19pub mod types;
20
21pub use host::{HostContext, NoopHostContext};
22pub use observer::FunctionObserver;
23pub use runtime::{FunctionRuntime, SendFunctionRuntime};
24pub use store::{FunctionRecord, FunctionStatus, FunctionStore, memory::InMemoryFunctionStore};
25pub use triggers::{
26    cron::{CronScheduler, CronSchedulerHandle, CronTrigger},
27    mutation::{
28        AfterMutationTrigger, BeforeMutationChain, BeforeMutationResult, BeforeMutationTrigger,
29        EntityEvent, EventKind, TriggerMatcher,
30    },
31    registry::TriggerRegistry,
32};
33pub use types::{
34    EventPayload, FunctionDefinition, FunctionModule, FunctionResult, LogEntry, LogLevel,
35    ResourceLimits, RuntimeType,
36};
37
38#[cfg(test)]
39mod tests;