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