Skip to content

Commit f5a92bf

Browse files
committed
missing entites + acceptance tests
1 parent 4f79b92 commit f5a92bf

File tree

2 files changed

+2236
-1
lines changed

2 files changed

+2236
-1
lines changed

src/raw_parse.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,14 @@ unsafe fn convert_node(node_ptr: *mut bindings_raw::Node) -> Option<protobuf::No
969969
let jaa = node_ptr as *mut bindings_raw::JsonArrayAgg;
970970
Some(protobuf::node::Node::JsonArrayAgg(Box::new(convert_json_array_agg(&*jaa))))
971971
}
972+
bindings_raw::NodeTag_T_ReplicaIdentityStmt => {
973+
let ris = node_ptr as *mut bindings_raw::ReplicaIdentityStmt;
974+
Some(protobuf::node::Node::ReplicaIdentityStmt(convert_replica_identity_stmt(&*ris)))
975+
}
976+
bindings_raw::NodeTag_T_GroupingFunc => {
977+
let gf = node_ptr as *mut bindings_raw::GroupingFunc;
978+
Some(protobuf::node::Node::GroupingFunc(Box::new(convert_grouping_func(&*gf))))
979+
}
972980
_ => {
973981
// For unhandled node types, return None
974982
// In the future, we could add more node types here
@@ -1509,6 +1517,20 @@ unsafe fn convert_string(s: &bindings_raw::String) -> protobuf::String {
15091517
protobuf::String { sval: convert_c_string(s.sval) }
15101518
}
15111519

1520+
unsafe fn convert_replica_identity_stmt(ris: &bindings_raw::ReplicaIdentityStmt) -> protobuf::ReplicaIdentityStmt {
1521+
protobuf::ReplicaIdentityStmt { identity_type: String::from_utf8_lossy(&[ris.identity_type as u8]).to_string(), name: convert_c_string(ris.name) }
1522+
}
1523+
1524+
unsafe fn convert_grouping_func(gf: &bindings_raw::GroupingFunc) -> protobuf::GroupingFunc {
1525+
protobuf::GroupingFunc {
1526+
xpr: None,
1527+
args: convert_list_to_nodes(gf.args),
1528+
refs: convert_list_to_nodes(gf.refs),
1529+
agglevelsup: gf.agglevelsup,
1530+
location: gf.location,
1531+
}
1532+
}
1533+
15121534
unsafe fn convert_locking_clause(lc: &bindings_raw::LockingClause) -> protobuf::LockingClause {
15131535
protobuf::LockingClause {
15141536
locked_rels: convert_list_to_nodes(lc.lockedRels),
@@ -2519,7 +2541,7 @@ unsafe fn convert_alter_object_depends_stmt(aods: &bindings_raw::AlterObjectDepe
25192541
object_type: aods.objectType as i32 + 1,
25202542
relation: if aods.relation.is_null() { None } else { Some(convert_range_var(&*aods.relation)) },
25212543
object: convert_node_boxed(aods.object),
2522-
extname: Some(protobuf::String { sval: convert_c_string(aods.extname as *mut c_char) }),
2544+
extname: if aods.extname.is_null() { None } else { Some(convert_string(&*aods.extname)) },
25232545
remove: aods.remove,
25242546
}
25252547
}

0 commit comments

Comments
 (0)