Skip to main content

diesel/internal/
sql_functions.rs

1#[doc(hidden)]
2pub use crate::expression::functions::aggregate_expressions::{
3    FunctionFragment, IsAggregateFunction, IsWindowFunction, Order, OverClause,
4    WindowFunctionFragment,
5};
6
7#[doc(hidden)]
8pub use crate::expression::functions::arguments::FunctionParameter;
9
10#[macro_export]
11#[doc(hidden)]
12#[cfg(feature = "__sqlite-shared")]
13macro_rules! expand_sqlite_function {
14    ([], $($tt:tt)*) => {$($tt)*};
15    ([$t:ident, $($ts:ident,)*], $($tt:tt)*) => {
16        expand_sqlite_function!($t, [$($ts,)*], $($tt)*);
17    };
18    // explicitly match allowed types
19    (Integer, [$($ts:ident,)*], $($tt:tt)*) => {
20        expand_sqlite_function!([$($ts,)*], $($tt)*);
21    };
22    (BigInt, [$($ts:ident,)*], $($tt:tt)*) => {
23        expand_sqlite_function!([$($ts,)*], $($tt)*);
24    };
25    (Binary, [$($ts:ident,)*], $($tt:tt)*) => {
26        expand_sqlite_function!([$($ts,)*], $($tt)*);
27    };
28    (Bool, [$($ts:ident,)*], $($tt:tt)*) => {
29        expand_sqlite_function!([$($ts,)*], $($tt)*);
30    };
31    (Date, [$($ts:ident,)*], $($tt:tt)*) => {
32        expand_sqlite_function!([$($ts,)*], $($tt)*);
33    };
34    (Double, [$($ts:ident,)*], $($tt:tt)*) => {
35        expand_sqlite_function!([$($ts,)*], $($tt)*);
36    };
37    (Float, [$($ts:ident,)*], $($tt:tt)*) => {
38        expand_sqlite_function!([$($ts,)*], $($tt)*);
39    };
40    (Numeric, [$($ts:ident,)*], $($tt:tt)*) => {
41        expand_sqlite_function!([$($ts,)*], $($tt)*);
42    };
43    (SmallInt, [$($ts:ident,)*], $($tt:tt)*) => {
44        expand_sqlite_function!([$($ts,)*], $($tt)*);
45    };
46    (Text, [$($ts:ident,)*], $($tt:tt)*) => {
47        expand_sqlite_function!([$($ts,)*], $($tt)*);
48    };
49    (Time, [$($ts:ident,)*], $($tt:tt)*) => {
50        expand_sqlite_function!([$($ts,)*], $($tt)*);
51    };
52    (Timestamp, [$($ts:ident,)*], $($tt:tt)*) => {
53        expand_sqlite_function!([$($ts,)*], $($tt)*);
54    };
55    // ignore any other type
56    ($t:ident, [$($ts:ident,)*], $($tt:tt)*) => {};
57}
58
59#[doc(hidden)]
60#[macro_export]
61#[cfg(not(feature = "__sqlite-shared"))]
62macro_rules! expand_sqlite_function {
63    ([$($ts:ty,)*], $($tt:tt)*) => {};
64}
65
66#[doc(hidden)]
67pub use crate::{expand_mariadb, expand_mysql, expand_pg, expand_sqlite};
68#[doc(hidden)]
69pub use expand_sqlite_function;