An attempt to make a less strongly-typed database abstraction layer for Rust.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4KB

  1. //! # StringQB
  2. //!
  3. //! A query builder using mostly strings, with methods following common SQL syntax
  4. //!
  5. //!
  6. //! ```no_run
  7. //! use stringqb::prelude::*;
  8. //!
  9. //! // Create a QueryBuilder object, with the chosen database driver
  10. //! let mut qb = QueryBuilder::new(PostgresDriver::new("postgresql://user@localhost"));
  11. //!
  12. //! ```
  13. //!
  14. //! Drivers include:
  15. //! * `PostgresDriver` - for PostgreSQL databases
  16. //! * `MySQLDriver` - for MySQL/MariaDB databases
  17. //! * `SQLiteDriver` - for SQLite databases
  18. #![warn(missing_docs)]
  19. #[macro_use]
  20. extern crate lazy_static;
  21. #[cfg(feature = "sqlite")]
  22. #[macro_use]
  23. extern crate slite;
  24. pub mod drivers;
  25. pub mod fns;
  26. pub mod query_builder;
  27. pub mod types;
  28. pub mod prelude {
  29. //! Re-exports important traits and types.
  30. //!
  31. //! This includes enum types, traits,
  32. //! the Query Builder, and individual database drivers.
  33. pub use crate::drivers::DatabaseDriver;
  34. pub use crate::query_builder::{JoinType, LikeWildcard, OrderDirection, QueryBuilder};
  35. #[cfg(feature = "postgres")]
  36. /// Postgres Driver
  37. pub use crate::drivers::postgres::PostgresDriver;
  38. #[cfg(feature = "sqlite")]
  39. /// SQLite Driver
  40. pub use crate::drivers::sqlite::SQLiteDriver;
  41. #[cfg(feature = "mysql")]
  42. /// MySQL Driver
  43. pub use crate::drivers::mysql::MySQLDriver;
  44. // MSSQL is missing on purpose, as it is not a real priority to actually implement
  45. }