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

Function db_prepare_core

db/utils.c:68–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68static struct db_stmt *db_prepare_core(struct db *db,
69 const char *location,
70 const struct db_query *db_query)
71{
72 struct db_stmt *stmt = tal(db, struct db_stmt);
73 size_t num_slots = db_query->placeholders;
74
75 /* Allocate the slots for placeholders/bindings, zeroed next since
76 * that sets the type to DB_BINDING_UNINITIALIZED for later checks. */
77 stmt->bindings = tal_arrz(stmt, struct db_binding, num_slots);
78 stmt->location = location;
79 stmt->error = NULL;
80 stmt->db = db;
81 stmt->query = db_query;
82 stmt->executed = false;
83 stmt->inner_stmt = NULL;
84 stmt->cols_used = NULL;
85 stmt->bind_pos = -1;
86
87 tal_add_destructor(stmt, db_stmt_free);
88 list_add(&db->pending_statements, &stmt->list);
89
90 return stmt;
91}
92
93struct db_stmt *db_prepare_v2_(const char *location, struct db *db,
94 const char *query_id)

Callers 2

db_prepare_v2_Function · 0.85
db_prepare_untranslatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected