wallet: db column manipulation helpers.

Removing columns and renaming them is easy in Postgres, hard in
sqlite3.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-11-15 04:34:46 +10:30
parent fcf3d0ce6c
commit 6c34e522dd
4 changed files with 375 additions and 0 deletions

View File

@@ -151,6 +151,13 @@ struct db_config {
void (*teardown_fn)(struct db *db);
bool (*vacuum_fn)(struct db *db);
bool (*rename_column)(struct db *db,
const char *tablename,
const char *from, const char *to);
bool (*delete_columns)(struct db *db,
const char *tablename,
const char **colnames, size_t num_cols);
};
/* Provide a way for DB backends to register themselves */