db: turn generated queries array into a simple hash table.

Since we have that functionality, let's use it.  Also, make table
const.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-11-15 04:33:46 +10:30
parent 53c9d9853d
commit fcf3d0ce6c
5 changed files with 44 additions and 27 deletions

View File

@@ -275,8 +275,8 @@ static bool db_postgres_vacuum(struct db *db)
struct db_config db_postgres_config = {
.name = "postgres",
.queries = db_postgres_queries,
.num_queries = DB_POSTGRES_QUERY_COUNT,
.query_table = db_postgres_queries,
.query_table_size = ARRAY_SIZE(db_postgres_queries),
.exec_fn = db_postgres_exec,
.query_fn = db_postgres_query,
.step_fn = db_postgres_step,