Add tests for loading the catalog

This commit is contained in:
eelke 2026-10-18 12:32:16 +02:00
parent 591573b6b8
commit a1ac545086
13 changed files with 203 additions and 32 deletions

View file

@ -0,0 +1,25 @@
#ifndef PGDATABASESIZES_H
#define PGDATABASESIZES_H
#include "Pgsql_Connection.h"
#include <libpq-fe.h>
#include <cstdint>
#include <vector>
class PgDatabaseSize {
public:
Oid oid;
int64_t totalBytes;
PgDatabaseSize()
: oid(InvalidOid)
, totalBytes(-1)
{}
};
using PgDatabaseSizes = std::vector<PgDatabaseSize>;
/// Returns the size of every database. The size is -1 when the current role has no CONNECT privilege.
PgDatabaseSizes loadDatabaseSizes(Pgsql::Connection &connection);
#endif // PGDATABASESIZES_H