datafusion_table_providers/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg))]
2
3use serde::{Deserialize, Serialize};
4use snafu::prelude::*;
5
6pub mod common;
7pub mod sql;
8pub mod util;
9
10#[cfg(feature = "clickhouse")]
11pub mod clickhouse;
12#[cfg(feature = "duckdb")]
13pub mod duckdb;
14#[cfg(feature = "flight")]
15pub mod flight;
16#[cfg(feature = "mysql")]
17pub mod mysql;
18#[cfg(feature = "odbc")]
19pub mod odbc;
20#[cfg(feature = "postgres")]
21pub mod postgres;
22#[cfg(feature = "sqlite")]
23pub mod sqlite;
24
25#[derive(Debug, Snafu)]
26pub enum Error {
27    #[snafu(display("The database file path is not within the current directory: {path}"))]
28    FileNotInDirectory { path: String },
29    #[snafu(display("The database file is a symlink: {path}"))]
30    FileIsSymlink { path: String },
31    #[snafu(display("Error reading file: {source}"))]
32    FileReadError { source: std::io::Error },
33}
34
35#[derive(PartialEq, Eq, Clone, Copy, Default, Debug, Serialize, Deserialize)]
36#[serde(rename_all = "lowercase")]
37pub enum UnsupportedTypeAction {
38    /// Refuse to create the table if any unsupported types are found
39    #[default]
40    Error,
41    /// Log a warning for any unsupported types
42    Warn,
43    /// Ignore any unsupported types (i.e. skip them)
44    Ignore,
45    /// Attempt to convert any unsupported types to a string
46    String,
47}