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

@@ -253,8 +253,8 @@ static bool db_sqlite3_vacuum(struct db *db)
struct db_config db_sqlite3_config = {
.name = "sqlite3",
.queries = db_sqlite3_queries,
.num_queries = DB_SQLITE3_QUERY_COUNT,
.query_table = db_sqlite3_queries,
.query_table_size = ARRAY_SIZE(db_sqlite3_queries),
.exec_fn = &db_sqlite3_exec,
.query_fn = &db_sqlite3_query,
.step_fn = &db_sqlite3_step,