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

Method addColumn

plugins/destination/sqlite/client/migrate.go:191–197  ·  view source on GitHub ↗
(ctx context.Context, tableName string, columnName string, columnType string)

Source from the content-addressed store, hash-verified

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)
193 if _, err := c.db.ExecContext(ctx, sql); err != nil {
194 return fmt.Errorf("failed to add column %s on table %s: %w", columnName, tableName, err)
195 }
196 return nil
197}
198
199func (c *Client) createTableIfNotExist(table *schema.Table) error {
200 var sb strings.Builder

Callers 1

autoMigrateTableMethod · 0.95

Calls 2

ErrorfMethod · 0.80
identifierFunction · 0.70

Tested by

no test coverage detected