rustorm/
lib.rs

1#![deny(warnings)]
2#![deny(clippy::all)]
3//!
4//! ## Rustorm
5//!
6//! [![Latest Version](https://img.shields.io/crates/v/rustorm.svg)](https://crates.io/crates/rustorm)
7//! [![Build Status](https://travis-ci.org/ivanceras/rustorm.svg?branch=master)](https://travis-ci.org/ivanceras/rustorm)
8//! [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
9//!
10//! Rustorm is an SQL-centered ORM with focus on ease of use on conversion of database types to
11//! their appropriate rust type.
12//!
13//! Selecting records
14//!
15
16use cfg_if::cfg_if;
17
18cfg_if! {if #[cfg(feature = "with-postgres")]{
19    extern crate r2d2_postgres;
20    extern crate postgres;
21    #[macro_use]
22    extern crate postgres_shared;
23    mod pg;
24}}
25cfg_if! {if #[cfg(feature = "with-sqlite")]{
26    extern crate r2d2_sqlite;
27    extern crate rusqlite;
28    mod sqlite;
29}}
30cfg_if! {if #[cfg(feature = "with-mysql")]{
31    mod my;
32}}
33
34pub mod column;
35pub mod common;
36mod dao_manager;
37mod database;
38#[cfg(feature = "db-auth")]
39mod db_auth;
40mod entity;
41pub mod error;
42mod platform;
43pub mod pool;
44pub mod table;
45pub mod types;
46
47pub mod util;
48
49pub use chrono;
50pub use column::ColumnDef;
51pub use dao_manager::DaoManager;
52pub use database::{Database, DatabaseName};
53pub use entity::EntityManager;
54pub use error::{DataError, DbError};
55pub use platform::DBPlatform;
56pub use pool::Pool;
57pub use table::TableDef;
58pub use uuid::{self, Uuid};
59
60// we export the traits that has a derived proc macro
61// this are used in the apps
62pub use codegen::{FromDao, ToColumnNames, ToDao, ToTableName};
63
64pub use rustorm_dao::{
65    self, Array, ColumnName, ConvertError, Dao, FromValue, Rows, TableName, ToValue, Value,
66};
67
68/// Wrap the rustorm_dao exports to avoid name conflict with the rustorm_codegen
69pub mod dao {
70    pub use rustorm_dao::{FromDao, ToColumnNames, ToDao, ToTableName};
71}
72
73/// Wrap the rustorm_codegen exports to avoid name conflict with the rustorm_dao
74pub mod codegen {
75    pub use rustorm_codegen::{FromDao, ToColumnNames, ToDao, ToTableName};
76}
77
78#[macro_use]
79extern crate log;