Closed cvng closed 11 months ago
thanks @cvng! for an easier review, could you always put the output from libpg_query into the pr? I added the respective log in #64. I will also create a pr template for it. example for a different statement:
CreateDomainStmt(
CreateDomainStmt {
domainname: [
Node {
node: Some(
String(
String {
sval: "us_postal_code",
},
),
),
},
],
type_name: Some(
TypeName {
names: [
Node {
node: Some(
String(
String {
sval: "text",
},
),
),
},
],
type_oid: 0,
setof: false,
pct_type: false,
typmods: [],
typemod: -1,
array_bounds: [],
location: 32,
},
),
coll_clause: None,
constraints: [
Node {
node: Some(
Constraint(
Constraint {
contype: ConstrCheck,
conname: "",
deferrable: false,
initdeferred: false,
location: 37,
is_no_inherit: false,
raw_expr: Some(
Node {
node: Some(
NullTest(
NullTest {
xpr: None,
arg: Some(
Node {
node: Some(
ColumnRef(
ColumnRef {
fields: [
Node {
node: Some(
String(
String {
sval: "value",
},
),
),
},
],
location: 44,
},
),
),
},
),
nulltesttype: IsNotNull,
argisrow: false,
location: 50,
},
),
),
},
),
cooked_expr: "",
generated_when: "",
nulls_not_distinct: false,
keys: [],
including: [],
exclusions: [],
options: [],
indexname: "",
indexspace: "",
reset_default_tblspc: false,
access_method: "",
where_clause: None,
pktable: None,
fk_attrs: [],
pk_attrs: [],
fk_matchtype: "",
fk_upd_action: "",
fk_del_action: "",
fk_del_set_cols: [],
old_conpfeqop: [],
old_pktable_oid: 0,
skip_validation: false,
initially_valid: true,
},
),
),
},
],
},
),
sure! I will rebase once #64 merged. +1 for a pr template
What kind of change does this PR introduce?
In the continuation of #61 & #51. Ultimately, being able to parse most of the DDL statements would be nice
What is the current behavior?
Parser panics:
What is the new behavior?
Parser returns:
Additional context
Add any other context or screenshots.