1pub mod dialect;
14pub mod introspect;
15pub mod pool;
16pub mod types;
17
18pub use dialect::Dialect;
19pub use introspect::{introspect, ColumnFacts, DbSnapshot};
20pub use types::{
21 active_cast_name, parse_canonical, type_category, type_category_from_cast, CanonicalType,
22 TypeCategory, TypeSupport,
23};
24
25#[cfg(feature = "postgres")]
26pub mod postgres;
27#[cfg(feature = "postgres")]
28pub use postgres::PostgresDialect;
29
30#[cfg(feature = "mysql")]
31pub mod mysql;
32#[cfg(feature = "mysql")]
33pub use mysql::MySqlDialect;
34
35#[cfg(feature = "sqlite")]
36pub mod sqlite;
37#[cfg(feature = "sqlite")]
38pub use sqlite::SqliteDialect;
39
40pub fn active_dialect() -> std::sync::Arc<dyn Dialect> {
43 _active_dialect_impl()
44}
45
46#[cfg(feature = "postgres")]
47fn _active_dialect_impl() -> std::sync::Arc<dyn Dialect> {
48 std::sync::Arc::new(PostgresDialect)
49}
50
51#[cfg(feature = "mysql")]
52fn _active_dialect_impl() -> std::sync::Arc<dyn Dialect> {
53 std::sync::Arc::new(MySqlDialect)
54}
55
56#[cfg(feature = "sqlite")]
57fn _active_dialect_impl() -> std::sync::Arc<dyn Dialect> {
58 std::sync::Arc::new(SqliteDialect)
59}
60
61#[cfg(not(any(feature = "postgres", feature = "mysql", feature = "sqlite")))]
62fn _active_dialect_impl() -> std::sync::Arc<dyn Dialect> {
63 panic!("No database dialect feature enabled. Enable one of: postgres, mysql, sqlite.");
64}