Skip to content

Commit 23aa159

Browse files
fix: DeleteStale from relational tables as well (#5143)
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> #### Summary Won't compile until cloudquery/plugin-sdk#443 is merged. <!-- Use the following steps to ensure your PR is ready to be reviewed - [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md) 🧑‍🎓 - [ ] Test locally on your own infrastructure - [ ] Run `go fmt` to format your code 🖊 - [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint [here](https://golangci-lint.run/usage/install/#local-installation)) - [ ] Update or add tests 🧪 - [ ] Ensure the status checks below are successful ✅ ---> Co-authored-by: Yevgeny Pats <yev.pats@gmail.com>
1 parent 9a01b6c commit 23aa159

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/destination/postgresql/client/deletestale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error {
1414
batch := &pgx.Batch{}
15-
for _, table := range tables {
15+
for _, table := range tables.FlattenTables() {
1616
var sb strings.Builder
1717
sb.WriteString("delete from ")
1818
sb.WriteString(pgx.Identifier{table.Name}.Sanitize())

plugins/destination/snowflake/client/deletestale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error {
12-
for _, table := range tables {
12+
for _, table := range tables.FlattenTables() {
1313
var sb strings.Builder
1414
sb.WriteString("delete from ")
1515
sb.WriteString(table.Name)

plugins/destination/sqlite/client/deletestale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error {
12-
for _, table := range tables {
12+
for _, table := range tables.FlattenTables() {
1313
var sb strings.Builder
1414
sb.WriteString("delete from ")
1515
sb.WriteString(`"` + table.Name + `"`)

0 commit comments

Comments
 (0)