datafusion_table_providers/
lib.rs

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