MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / deleteByPK

Method deleteByPK

plugins/destination/duckdb/client/write.go:106–119  ·  view source on GitHub ↗
(ctx context.Context, tmpTableName string, table *schema.Table)

Source from the content-addressed store, hash-verified

104}
105
106func (c *Client) deleteByPK(ctx context.Context, tmpTableName string, table *schema.Table) error {
107 var sb strings.Builder
108 sb.WriteString("delete from " + table.Name + " using " + tmpTableName + " where ")
109 for i, col := range table.PrimaryKeys() {
110 if i > 0 {
111 sb.WriteString(" and ")
112 }
113 sb.WriteString(table.Name + "." + sanitizeID(col))
114 sb.WriteString(" = ")
115 sb.WriteString(tmpTableName + "." + sanitizeID(col))
116 }
117
118 return c.exec(ctx, sb.String())
119}
120
121func (c *Client) copyFromFile(ctx context.Context, tableName string, fileName string, table *schema.Table) error {
122 return c.exec(ctx, "copy "+tableName+

Callers 1

deleteInsertMethod · 0.95

Calls 3

execMethod · 0.95
sanitizeIDFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected