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

Function db_postgres_delete_columns

db/db_postgres.c:288–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288static bool db_postgres_delete_columns(struct db *db,
289 const char *tablename,
290 const char **colnames, size_t num_cols)
291{
292 char *cmd;
293
294 cmd = tal_fmt(tmpctx, "ALTER TABLE %s ", tablename);
295 for (size_t i = 0; i < num_cols; i++) {
296 if (i != 0)
297 tal_append_fmt(&cmd, ", ");
298 tal_append_fmt(&cmd, "DROP %s", colnames[i]);
299 }
300 tal_append_fmt(&cmd, ";");
301
302 db_exec_prepared_v2(take(db_prepare_untranslated(db, cmd)));
303 return true;
304}
305
306struct db_config db_postgres_config = {
307 .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