Skip to content

Commit 2c3c378

Browse files
authored
fix(replication): Fix apply loop event conversion ordering (#291)
1 parent 32319cf commit 2c3c378

File tree

7 files changed

+422
-352
lines changed

7 files changed

+422
-352
lines changed

etl-postgres/src/tokio/test_utils.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,28 @@ impl<G: GenericClient> PgDatabase<G> {
6666
Ok(())
6767
}
6868

69+
pub async fn create_publication_for_all(
70+
&self,
71+
publication_name: &str,
72+
schema: Option<&str>,
73+
) -> Result<(), tokio_postgres::Error> {
74+
let create_publication_query = match schema {
75+
Some(schema_name) => format!(
76+
"create publication {} for tables in schema {}",
77+
publication_name, schema_name
78+
),
79+
None => format!("create publication {} for all tables", publication_name),
80+
};
81+
82+
self.client
83+
.as_ref()
84+
.unwrap()
85+
.execute(&create_publication_query, &[])
86+
.await?;
87+
88+
Ok(())
89+
}
90+
6991
/// Creates a new table with the given name and column definitions.
7092
///
7193
/// Optionally adds a primary key column named `id` of type `bigserial`.

0 commit comments

Comments
 (0)