Debian Codegraph @

src/database.rs

raw symbols SCIP
1 use crate::arguments::PgArgumentBuffer;
2 use crate::value::{PgValue, PgValueRef};
3 use crate::{
4 PgArguments, PgColumn, PgConnection, PgQueryResult, PgRow, PgStatement, PgTransactionManager,
5 PgTypeInfo,
6 };
7
8 pub(crate) use sqlx_core::database::{Database, HasStatementCache};
9
10 /// PostgreSQL database driver.
11 #[derive(Debug)]
12 pub struct Postgres;
13
14 impl Database for Postgres {
15 type Connection = PgConnection;
16
17 type TransactionManager = PgTransactionManager;
18
19 type Row = PgRow;
20
21 type QueryResult = PgQueryResult;
22
23 type Column = PgColumn;
24
25 type TypeInfo = PgTypeInfo;
26
27 type Value = PgValue;
28 type ValueRef<'r> = PgValueRef<'r>;
29
30 type Arguments<'q> = PgArguments;
31 type ArgumentBuffer<'q> = PgArgumentBuffer;
32
33 type Statement<'q> = PgStatement<'q>;
34
35 const NAME: &'static str = "PostgreSQL";
36
37 const URL_SCHEMES: &'static [&'static str] = &["postgres", "postgresql"];
38 }
39
40 impl HasStatementCache for Postgres {}