wallet: Add tooling to extract SQL queries and generate driver info

This is the counterpart of the annotations we did in the last few commits. It
extracts queries, passes them through a driver-specific query rewriter and
dumps them into a driver-specific query-list, along with some metadata to
facilitate processing later on. The generated query list is then registered as
a `db_config` and will be loaded by the driver upon instantiation.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-07-24 18:29:03 +02:00
committed by Rusty Russell
parent 803007ecdf
commit e4ab98459c
11 changed files with 215 additions and 4 deletions

13
wallet/db_sqlite3.c Normal file
View File

@@ -0,0 +1,13 @@
#include <wallet/db_common.h>
#include "gen_db_sqlite3.c"
#if HAVE_SQLITE3
struct db_config db_sqlite3_config = {
.name = "sqlite3",
.queries = db_sqlite3_queries,
.num_queries = DB_SQLITE3_QUERY_COUNT,
};
AUTODATA(db_backends, &db_sqlite3_config);
#endif