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

Method recreateTable

plugins/destination/sqlite/client/migrate.go:183–189  ·  view source on GitHub ↗
(ctx context.Context, table *schema.Table)

Source from the content-addressed store, hash-verified

181}
182
183func (c *Client) recreateTable(ctx context.Context, table *schema.Table) error {
184 sql := "drop table if exists " + identifier(table.Name)
185 if _, err := c.db.ExecContext(ctx, sql); err != nil {
186 return fmt.Errorf("failed to drop table %s: %w", table.Name, err)
187 }
188 return c.createTableIfNotExist(table)
189}
190
191func (c *Client) addColumn(ctx context.Context, tableName string, columnName string, columnType string) error {
192 sql := "alter table " + identifier(tableName) + " add column " + identifier(columnName) + " " + identifier(columnType)

Callers 1

MigrateTablesMethod · 0.95

Calls 3

createTableIfNotExistMethod · 0.95
ErrorfMethod · 0.80
identifierFunction · 0.70

Tested by

no test coverage detected