Skip to content

Commit a675e08

Browse files
Add tests
1 parent de8f0c3 commit a675e08

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/sqlparser_postgres.rs

+27
Original file line numberDiff line numberDiff line change
@@ -5959,3 +5959,30 @@ fn parse_varbit_datatype() {
59595959
_ => unreachable!(),
59605960
}
59615961
}
5962+
5963+
#[test]
5964+
fn parse_alter_table_replica_identity() {
5965+
match pg_and_generic().verified_stmt("ALTER TABLE foo REPLICA IDENTITY FULL") {
5966+
Statement::AlterTable { operations, .. } => {
5967+
assert_eq!(
5968+
operations,
5969+
vec![AlterTableOperation::ReplicaIdentity {
5970+
identity: ReplicaIdentity::Full
5971+
}]
5972+
);
5973+
}
5974+
_ => unreachable!(),
5975+
}
5976+
5977+
match pg_and_generic().verified_stmt("ALTER TABLE foo REPLICA IDENTITY USING INDEX foo_idx") {
5978+
Statement::AlterTable { operations, .. } => {
5979+
assert_eq!(
5980+
operations,
5981+
vec![AlterTableOperation::ReplicaIdentity {
5982+
identity: ReplicaIdentity::Index("foo_idx".into())
5983+
}]
5984+
);
5985+
}
5986+
_ => unreachable!(),
5987+
}
5988+
}

0 commit comments

Comments
 (0)