1pub const CREATE_GRAPH: &str = "SELECT * FROM create_graph($1)";
2pub const DROP_GRAPH: &str = "SELECT * FROM drop_graph($1, true)";
3pub const CQ_NO_ARG: &str = "";
4pub const CQ_ARG: &str = ", $1";
5pub const LOAD_AGE: &str = "LOAD 'age'";
6pub const SET_AGE: &str = "SET search_path = ag_catalog, \"$user\", public";
7pub const GRAPH_EXISTS: &str = "SELECT COUNT(name) FROM ag_graph WHERE name = $1";
8
9macro_rules! cypher_query {
10 () => {
11 "SELECT * FROM cypher('{}', $$ {} $${}) as (v agtype)"
12 };
13}
14
15macro_rules! constraint {
16 () => {
17 "ALTER TABLE \"{}\".\"{}\" ADD CONSTRAINT \"{}\" CHECK({})"
18 };
19}
20
21macro_rules! unique_index {
22 () => {
23 "CREATE UNIQUE INDEX \"{}\" ON \"{}\".\"{}\"(agtype_access_operator(properties, '\"{}\"'))"
24 };
25}
26
27macro_rules! required_constraint {
28 () => {
29 "agtype_access_operator(properties, '\"{}\"') IS NOT NULL"
30 };
31}