Skip to main content

rudb_functions/
lib.rs

1//! The scalar, aggregate and window function library.
2//!
3//! Rank 7 in the layer rule. See `xtask/layers.toml` and `spec/18-package-layout.md`.
4//!
5//! Most of what is here is the signature half: given a name and the types of the arguments, which
6//! function is that and what does it return. The implementations are separate work and they go
7//! behind the same names, so the binder does not change when they arrive.
8//!
9//! [`mod@file`] is the exception and it reads a file. A table function that scans a Parquet file cannot
10//! be resolved from a table of names, because its columns are in the file, so resolving one means
11//! opening it. That is the only I/O in this crate and it is the reason `rudb-io` and `rudb-parquet`
12//! are dependencies of it.
13
14#![forbid(unsafe_code)]
15
16pub mod entrycatalog;
17pub mod file;
18pub mod functioncatalog;
19pub mod settingcatalog;
20pub mod signature;
21pub mod table;
22pub mod typecatalog;
23
24pub use entrycatalog::{
25    DUCKDB, canonical, column_fields, database_fields, numeric_facts, schema_fields, table_fields,
26    view_fields,
27};
28pub use file::{
29    csv_fields, csv_given, files, is_file, is_pattern, open_csv, open_parquet, parquet_fields,
30};
31pub use functioncatalog::{
32    CONSISTENT, FUNCTION_CATALOG, FUNCTION_SCHEMA, FunctionEntry, function_entries, function_fields,
33};
34pub use rudb_csv::Given;
35pub use settingcatalog::{
36    GLOBAL, SETTINGS, SettingEntry, setting_fields, setting_named, unknown_setting,
37};
38pub use signature::{
39    FunctionKind, FunctionRow, Resolved, function_rows, kind_of, part_type, resolve,
40};
41pub use table::{
42    Columns, FILE_ROW_NUMBER, ResolvedTable, TableFunction, database_size_fields, dialect_fields,
43    extension_fields, grammar_extension_fields, keyword_categories, keyword_fields,
44    optimizer_fields, platform_fields, resolve_pragma, resolve_table, series, series_length,
45    strategy_fields, user_agent_fields, version_fields,
46};
47pub use typecatalog::{
48    Signature, TYPE_NAMES, TypeEntry, representative, sort_key, type_category, type_fields,
49    type_oid, type_size,
50};