2018-03-22 11:36:25 +01:00
|
|
|
#ifndef LIGHTNING_WALLET_DB_H
|
|
|
|
#define LIGHTNING_WALLET_DB_H
|
2017-05-12 20:24:18 +02:00
|
|
|
#include "config.h"
|
2018-03-07 01:06:07 +01:00
|
|
|
|
2020-07-29 03:20:30 +02:00
|
|
|
struct ext_key;
|
2019-02-24 06:12:09 +01:00
|
|
|
struct lightningd;
|
2019-07-25 22:45:02 +02:00
|
|
|
struct db_stmt;
|
2019-07-23 20:45:06 +02:00
|
|
|
struct db;
|
2019-07-17 18:11:19 +02:00
|
|
|
|
2017-05-12 20:24:18 +02:00
|
|
|
/**
|
|
|
|
* db_setup - Open a the lightningd database and update the schema
|
|
|
|
*
|
|
|
|
* Opens the database, creating it if necessary, and applying
|
|
|
|
* migrations until the schema is updated to the current state.
|
2017-11-01 02:21:56 +01:00
|
|
|
* Calls fatal() on error.
|
2017-05-12 20:24:18 +02:00
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* @ctx: the tal_t context to allocate from
|
2019-03-01 23:18:40 +01:00
|
|
|
* @ld: the lightningd context to hand to upgrade functions.
|
2020-07-29 03:20:30 +02:00
|
|
|
* @bip32_base: the base all of our pubkeys are constructed on
|
2017-05-12 20:24:18 +02:00
|
|
|
*/
|
2020-07-29 03:20:30 +02:00
|
|
|
struct db *db_setup(const tal_t *ctx, struct lightningd *ld,
|
|
|
|
const struct ext_key *bip32_base);
|
2017-05-12 20:24:18 +02:00
|
|
|
|
2018-03-22 11:36:25 +01:00
|
|
|
#endif /* LIGHTNING_WALLET_DB_H */
|