Skip to main content

chain_builder/dialect/
postgres.rs

1//! PostgreSQL dialect marker.
2
3use super::Dialect;
4
5/// PostgreSQL dialect marker.
6#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub struct Postgres;
8
9impl Dialect for Postgres {
10    fn quote_char() -> char {
11        '"'
12    }
13
14    fn write_placeholder(out: &mut String, n: usize) {
15        out.push('$');
16        out.push_str(&n.to_string());
17    }
18
19    fn supports_returning() -> bool {
20        true
21    }
22
23    fn supports_distinct_on() -> bool {
24        true
25    }
26
27    fn ilike_is_native() -> bool {
28        true
29    }
30}