| 284 | } |
| 285 | |
| 286 | static bool db_postgres_delete_columns(struct db *db, |
| 287 | const char *tablename, |
| 288 | const char **colnames, size_t num_cols) |
| 289 | { |
| 290 | char *cmd; |
| 291 | |
| 292 | cmd = tal_fmt(tmpctx, "ALTER TABLE %s ", tablename); |
| 293 | for (size_t i = 0; i < num_cols; i++) { |
| 294 | if (i != 0) |
| 295 | tal_append_fmt(&cmd, ", "); |
| 296 | tal_append_fmt(&cmd, "DROP %s", colnames[i]); |
| 297 | } |
| 298 | tal_append_fmt(&cmd, ";"); |
| 299 | |
| 300 | db_exec_prepared_v2(take(db_prepare_untranslated(db, cmd))); |
| 301 | return true; |
| 302 | } |
| 303 | |
| 304 | struct db_config db_postgres_config = { |
| 305 | .name = "postgres", |
nothing calls this directly
no test coverage detected