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