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 pragmacatalog;
20pub mod settingcatalog;
21pub mod signature;
22pub mod table;
23pub mod typecatalog;
24
25pub use entrycatalog::{
26    DUCKDB, canonical, column_fields, database_fields, numeric_facts, schema_fields,
27    show_database_fields, show_expanded_fields, show_table_fields, table_fields, view_fields,
28};
29pub use file::{
30    csv_fields, csv_given, files, is_file, is_pattern, open_csv, open_parquet, parquet_fields,
31};
32pub use functioncatalog::{
33    CONSISTENT, FUNCTION_CATALOG, FUNCTION_SCHEMA, FunctionEntry, function_entries, function_fields,
34};
35pub use pragmacatalog::{PRAGMAS, PragmaEntry, pragma_named};
36pub use rudb_csv::Given;
37pub use settingcatalog::{
38    Behaviour, GLOBAL, LOCAL, SETTINGS, SettingEntry, UNSET, setting_fields, setting_named,
39    unknown_setting,
40};
41pub use signature::{
42    FunctionKind, FunctionRow, Resolved, function_rows, kind_of, part_type, resolve,
43};
44pub use table::{
45    Columns, FILE_ROW_NUMBER, ResolvedTable, TableFunction, database_size_fields, dialect_fields,
46    extension_fields, grammar_extension_fields, keyword_categories, keyword_fields,
47    optimizer_fields, platform_fields, resolve_pragma, resolve_table, series, series_length,
48    strategy_fields, user_agent_fields, version_fields,
49};
50pub use typecatalog::{
51    Signature, TYPE_NAMES, TypeEntry, representative, sort_key, type_category, type_fields,
52    type_oid, type_size,
53};