MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_datastore_first

Function db_datastore_first

wallet/datastore.c:140–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140struct db_stmt *db_datastore_first(const tal_t *ctx,
141 struct db *db,
142 const char **startkey,
143 const char ***key,
144 const u8 **data,
145 u64 *generation)
146{
147 struct db_stmt *stmt;
148
149 if (startkey) {
150 stmt = db_prepare_v2(db,
151 SQL("SELECT key, data, generation"
152 " FROM datastore"
153 " WHERE key >= ?"
154 " ORDER BY key;"));
155 db_bind_datastore_key(stmt, startkey);
156 } else {
157 stmt = db_prepare_v2(db,
158 SQL("SELECT key, data, generation"
159 " FROM datastore"
160 " ORDER BY key;"));
161 }
162 db_query_prepared(stmt);
163
164 return db_datastore_next(ctx, stmt, startkey, key, data, generation);
165}
166
167void db_datastore_update(struct db *db, const char **key, const u8 *data)
168{

Callers 2

wallet_datastore_firstFunction · 0.70
downgrade_askrene_layersFunction · 0.50

Calls 3

db_query_preparedFunction · 0.85
db_bind_datastore_keyFunction · 0.70
db_datastore_nextFunction · 0.70

Tested by

no test coverage detected