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

Function db_postgres_column_u64

db/db_postgres.c:168–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168static u64 db_postgres_column_u64(struct db_stmt *stmt, int col)
169{
170 PGresult *res = (PGresult*)stmt->inner_stmt;
171 be64 bin;
172 size_t expected = sizeof(bin), actual = PQgetlength(res, stmt->row, col);
173
174 if (expected != actual)
175 db_fatal(stmt->db,
176 "u64 field doesn't match size: expected %zu, actual %zu\n",
177 expected, actual);
178
179 memcpy(&bin, PQgetvalue(res, stmt->row, col), sizeof(bin));
180 return be64_to_cpu(bin);
181}
182
183static s64 db_postgres_column_int(struct db_stmt *stmt, int col)
184{

Callers

nothing calls this directly

Calls 2

db_fatalFunction · 0.85
be64_to_cpuFunction · 0.85

Tested by

no test coverage detected