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

Function db_postgres_column_int

db/db_postgres.c:183–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static s64 db_postgres_column_int(struct db_stmt *stmt, int col)
184{
185 PGresult *res = (PGresult*)stmt->inner_stmt;
186 be32 bin;
187 size_t expected = sizeof(bin), actual = PQgetlength(res, stmt->row, col);
188
189 if (expected != actual)
190 db_fatal(stmt->db,
191 "s32 field doesn't match size: expected %zu, actual %zu\n",
192 expected, actual);
193
194 memcpy(&bin, PQgetvalue(res, stmt->row, col), sizeof(bin));
195 return be32_to_cpu(bin);
196}
197
198static size_t db_postgres_column_bytes(struct db_stmt *stmt, int col)
199{

Callers

nothing calls this directly

Calls 2

db_fatalFunction · 0.85
be32_to_cpuFunction · 0.85

Tested by

no test coverage detected