MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_postgres_delete_columns

Function db_postgres_delete_columns

db/db_postgres.c:286–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286static 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
304struct db_config db_postgres_config = {
305 .name = "postgres",

Callers

nothing calls this directly

Calls 3

tal_append_fmtFunction · 0.85
db_exec_prepared_v2Function · 0.85
db_prepare_untranslatedFunction · 0.85

Tested by

no test coverage detected