Skip to content

Commit 967e5d2

Browse files
NicolappsConvex, Inc.
authored and
Convex, Inc.
committed
Remove unused table filters from convex_api (#37312)
GitOrigin-RevId: fb8c986374d7695b436a9b41f11b817f75b74e7a
1 parent b7979b1 commit 967e5d2

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

crates/fivetran_source/src/convex_api.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ pub trait Source: Display + Send {
5151
&self,
5252
snapshot: Option<i64>,
5353
cursor: Option<ListSnapshotCursor>,
54-
table_name: Option<String>,
5554
) -> anyhow::Result<ListSnapshotResponse>;
5655

5756
/// See https://docs.convex.dev/http-api/#get-apidocument_deltas
5857
async fn document_deltas(
5958
&self,
6059
cursor: DocumentDeltasCursor,
61-
table_name: Option<String>,
6260
) -> anyhow::Result<DocumentDeltasResponse>;
6361

6462
/// Get a list of columns for each table on the Convex backend.
@@ -170,14 +168,13 @@ impl Source for ConvexApi {
170168
&self,
171169
snapshot: Option<i64>,
172170
cursor: Option<ListSnapshotCursor>,
173-
table_name: Option<String>,
174171
) -> anyhow::Result<ListSnapshotResponse> {
175172
self.post(
176173
"list_snapshot",
177174
ListSnapshotArgs {
178175
snapshot,
179176
cursor: cursor.map(|c| c.into()),
180-
table_name,
177+
table_name: None,
181178
component: None,
182179
format: Some("convex_encoded_json".to_string()),
183180
},
@@ -188,13 +185,12 @@ impl Source for ConvexApi {
188185
async fn document_deltas(
189186
&self,
190187
cursor: DocumentDeltasCursor,
191-
table_name: Option<String>,
192188
) -> anyhow::Result<DocumentDeltasResponse> {
193189
self.post(
194190
"document_deltas",
195191
DocumentDeltasArgs {
196192
cursor: Some(cursor.into()),
197-
table_name,
193+
table_name: None,
198194
component: None,
199195
format: Some("convex_encoded_json".to_string()),
200196
},

crates/fivetran_source/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async fn initial_sync(
171171
let snapshot = loop {
172172
let snapshot = checkpoint.as_ref().map(|c| c.0);
173173
let cursor = checkpoint.as_ref().map(|c| c.1.clone());
174-
let res = source.list_snapshot(snapshot, cursor.clone(), None).await?;
174+
let res = source.list_snapshot(snapshot, cursor.clone()).await?;
175175

176176
for value in res.values {
177177
if let Some(ref mut tables_seen) = tables_seen {
@@ -236,7 +236,7 @@ async fn delta_sync(
236236
let mut cursor = cursor;
237237
let mut has_more = true;
238238
while has_more {
239-
let response = source.document_deltas(cursor, None).await?;
239+
let response = source.document_deltas(cursor).await?;
240240

241241
for value in response.values {
242242
if let Some(ref mut tables_seen) = tables_seen {

crates/fivetran_source/src/tests.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,7 @@ impl Source for FakeSource {
182182
&self,
183183
snapshot: Option<i64>,
184184
cursor: Option<ListSnapshotCursor>,
185-
table_name: Option<String>,
186185
) -> anyhow::Result<ListSnapshotResponse> {
187-
if table_name.is_some() {
188-
panic!("Query by table is not supported by the fake");
189-
}
190-
191186
if snapshot.is_some() && snapshot != Some(self.changelog.len() as i64) {
192187
panic!("Unexpected snapshot value");
193188
}
@@ -222,12 +217,7 @@ impl Source for FakeSource {
222217
async fn document_deltas(
223218
&self,
224219
cursor: DocumentDeltasCursor,
225-
table_name: Option<String>,
226220
) -> anyhow::Result<DocumentDeltasResponse> {
227-
if table_name.is_some() {
228-
panic!("Per-table log not supported in fake");
229-
}
230-
231221
let results_per_page = 5;
232222
let values: Vec<DocumentDeltasValue> = self
233223
.changelog
@@ -550,21 +540,17 @@ impl Source for UnreliableSource {
550540
&self,
551541
snapshot: Option<i64>,
552542
cursor: Option<ListSnapshotCursor>,
553-
table_name: Option<String>,
554543
) -> anyhow::Result<ListSnapshotResponse> {
555544
self.maybe_fail()?;
556-
self.source
557-
.list_snapshot(snapshot, cursor, table_name)
558-
.await
545+
self.source.list_snapshot(snapshot, cursor).await
559546
}
560547

561548
async fn document_deltas(
562549
&self,
563550
cursor: DocumentDeltasCursor,
564-
table_name: Option<String>,
565551
) -> anyhow::Result<DocumentDeltasResponse> {
566552
self.maybe_fail()?;
567-
self.source.document_deltas(cursor, table_name).await
553+
self.source.document_deltas(cursor).await
568554
}
569555

570556
async fn get_tables_and_columns(&self) -> anyhow::Result<BTreeMap<TableName, Vec<FieldName>>> {

0 commit comments

Comments
 (0)