Skip to main content

Crate fsqlite_func

Crate fsqlite_func 

Source
Expand description

Built-in SQL function and extension trait surfaces.

This crate defines open, user-implementable traits for:

  • scalar, aggregate, and window functions
  • virtual table modules/cursors
  • collation callbacks
  • authorizer callbacks

It also provides a small in-memory FunctionRegistry for registering and resolving scalar/aggregate/window functions by (name, num_args) key with variadic fallback.

Re-exports§

pub use agg_builtins::register_aggregate_builtins;
pub use aggregate::AggregateAdapter;
pub use aggregate::AggregateFunction;
pub use authorizer::AuthAction;
pub use authorizer::AuthResult;
pub use authorizer::Authorizer;
pub use authorizer::AuthorizerAction;
pub use authorizer::AuthorizerDecision;
pub use builtins::ChangeTrackingState;
pub use builtins::get_last_changes;
pub use builtins::get_last_insert_rowid;
pub use builtins::get_total_changes;
pub use builtins::register_builtins;
pub use builtins::reset_total_changes;
pub use builtins::set_change_tracking_state;
pub use builtins::set_last_changes;
pub use builtins::set_last_insert_rowid;
pub use collation::BinaryCollation;
pub use collation::CollationAnnotation;
pub use collation::CollationFunction;
pub use collation::CollationRegistry;
pub use collation::CollationSource;
pub use collation::NoCaseCollation;
pub use collation::RtrimCollation;
pub use collation::resolve_collation;
pub use datetime::register_datetime_builtins;
pub use math::register_math_builtins;
pub use scalar::ScalarFunction;
pub use vtab::ColumnContext;
pub use vtab::ConstraintOp;
pub use vtab::IndexConstraint;
pub use vtab::IndexConstraintUsage;
pub use vtab::IndexInfo;
pub use vtab::IndexOrderBy;
pub use vtab::VirtualTable;
pub use vtab::VirtualTableCursor;
pub use window::WindowAdapter;
pub use window::WindowFunction;
pub use window_builtins::register_window_builtins;

Modules§

agg_builtins
Built-in aggregate functions (§13.4).
aggregate
Aggregate function trait with type-erased state adapter.
authorizer
Authorizer callback trait (§9.4).
builtins
Built-in core scalar functions (§13.1).
collation
Collation callback trait, built-in collations, and registry (§9.4, §13.6).
datetime
SQLite date/time functions (§13.3).
math
SQLite 3.35+ math functions (§13.2).
scalar
Scalar (row-level) function trait.
vtab
Virtual table and cursor traits (§9.3).
window
Window function trait with sliding-window support.
window_builtins
Built-in window functions (S13.5, bd-14i6).

Structs§

FuncMetricsSnapshot
Snapshot of function evaluation metrics.
FunctionKey
Composite lookup key for functions: (UPPERCASE name, num_args).
FunctionRegistry
Registry for scalar, aggregate, and window functions, keyed by (name, num_args).

Functions§

func_metrics_snapshot
Read a point-in-time snapshot of function evaluation metrics.
record_func_call
Record a function call for metrics (called from VDBE engine).
record_func_call_count_only
Record a function call count only, without timing (fast path).
record_udf_registered
Record a UDF registration event.
reset_func_metrics
Reset function metrics to zero (tests/diagnostics).
reset_udf_metrics
Reset UDF registration counter (tests/diagnostics).
udf_registered_count
Current count of UDF registrations.

Type Aliases§

ErasedAggregateFunction
Type-erased aggregate function object used by the registry.
ErasedWindowFunction
Type-erased window function object used by the registry.