Skip to content

Commit

Permalink
fix: DeleteStale from relational tables as well (#5143)
Browse files Browse the repository at this point in the history
<!-- 🎉 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>
  • Loading branch information
shimonp21 and yevgenypats committed Nov 29, 2022
1 parent 9a01b6c commit 23aa159
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/destination/postgresql/client/deletestale.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error {
batch := &pgx.Batch{}
for _, table := range tables {
for _, table := range tables.FlattenTables() {
var sb strings.Builder
sb.WriteString("delete from ")
sb.WriteString(pgx.Identifier{table.Name}.Sanitize())
Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/snowflake/client/deletestale.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source string, syncTime time.Time) error {
for _, table := range tables {
for _, table := range tables.FlattenTables() {
var sb strings.Builder
sb.WriteString("delete from ")
sb.WriteString(table.Name)
Expand Down
2 changes: 1 addition & 1 deletion plugins/destination/sqlite/client/deletestale.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

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

0 comments on commit 23aa159

Please sign in to comment.