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