#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(html_logo_url = "https://raw.githubusercontent.com/ifiokjr/gelx/main/setup/assets/logo.png")]
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/readme.md"))]
#![doc = document_features::document_features!()]
use cfg_if::cfg_if;
cfg_if! {
if #[cfg(feature = "query")] {
mod client;
pub use client::*;
}
}
cfg_if! {
if #[cfg(feature = "with_geo")] {
mod geometry;
pub use geometry::*;
pub use geo;
pub use geo_types;
pub use geo_traits;
pub use wkb;
}
}
#[macro_export]
macro_rules! gelx {
($module:ident, $query:literal) => {
$crate::exports::gelx_macros::gelx_raw!($module, query: $query);
};
($module:ident, file: $path:literal) => {
$crate::exports::gelx_macros::gelx_raw!($module, file: $path);
};
($module: ident) => {
$crate::exports::gelx_macros::gelx_raw!($module);
};
}
#[deprecated(
since = "0.5.0",
note = "use `gelx!(insert_user, file: \"queries/insert_user.edgeql\")` instead"
)]
#[macro_export]
macro_rules! gelx_file {
($module:ident, $path:literal) => {
$crate::exports::gelx_macros::gelx_raw!($module, file: $path);
};
}
pub mod exports {
pub use bytes;
use cfg_if::cfg_if;
#[cfg(feature = "query")]
#[cfg_attr(docsrs, doc(cfg(feature = "query")))]
pub use gel_derive;
pub use gel_errors;
pub use gel_protocol;
#[cfg(feature = "query")]
#[cfg_attr(docsrs, doc(cfg(feature = "query")))]
pub use gel_tokio;
pub use gelx_macros;
#[cfg(any(feature = "with_bigdecimal", feature = "with_bigint"))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "with_bigdecimal", feature = "with_bigint")))
)]
pub use num_bigint;
#[cfg(any(feature = "with_bigdecimal", feature = "with_bigint"))]
#[cfg_attr(
docsrs,
doc(cfg(any(feature = "with_bigdecimal", feature = "with_bigint")))
)]
pub use num_traits;
#[cfg(feature = "serde")]
#[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
pub use serde;
#[cfg(feature = "strum")]
#[cfg_attr(docsrs, doc(cfg(feature = "strum")))]
pub use strum;
#[cfg(feature = "builder")]
#[cfg_attr(docsrs, doc(cfg(feature = "builder")))]
pub use typed_builder;
pub use uuid;
cfg_if! {
if #[cfg(feature = "with_bigdecimal")] {
#[cfg_attr(docsrs, doc(cfg(feature = "with_bigdecimal")))]
pub use bigdecimal;
pub type DecimalAlias = bigdecimal::BigDecimal;
} else {
pub type DecimalAlias = gel_protocol::model::Decimal;
}
}
cfg_if! {
if #[cfg(feature = "with_chrono")] {
#[cfg_attr(docsrs, doc(cfg(feature = "with_chrono")))]
pub use chrono;
pub type DateTimeAlias = chrono::DateTime<chrono::Utc>;
pub type LocalDatetimeAlias = chrono::NaiveDateTime;
pub type LocalDateAlias = chrono::NaiveDate;
pub type LocalTimeAlias = chrono::NaiveTime;
} else {
pub type DateTimeAlias = gel_protocol::model::Datetime;
pub type LocalDatetimeAlias = gel_protocol::model::LocalDatetime;
pub type LocalTimeAlias = gel_protocol::model::LocalTime;
pub type LocalDateAlias = gel_protocol::model::LocalDate;
}
}
cfg_if! {
if #[cfg(feature = "with_bigint")] {
#[cfg_attr(docsrs, doc(cfg(feature = "with_bigint")))]
pub type BigIntAlias = num_bigint::BigInt;
} else {
pub type BigIntAlias = gel_protocol::model::BigInt;
}
}
cfg_if! {
if #[cfg(feature = "with_geo")] {
#[cfg_attr(docsrs, doc(cfg(feature = "with_geo")))]
pub use super::Geometry;
pub use super::Geography;
}
}
pub use super::check_scalar;
}