25#include <QStandardPaths>
27#include "flightlog/Flight.h"
29using namespace Qt::Literals::StringLiterals;
68 [[nodiscard]]
auto loadAll() -> QList<Flight>;
123 void quarantineFile(
const QString& fileName,
const QString& reason);
128 void reportError(
const QString& message);
131 static void bindFlight(QSqlQuery& query,
const Flight& flight);
133 QString m_databaseConnectionName;
135 const QString m_dbFileName {QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + u
"/userdata.db"_s};
void saveError(const QString &message)
Emitted when a database operation fails.
bool upsertMany(const QList< Flight > &flights)
Insert or update multiple flights, in one transaction.
auto loadAll() -> QList< Flight >
Load all flights from the database.
bool upsert(const Flight &flight)
Insert a flight, or update it if its uuid already exists.
bool removeMany(const QList< QUuid > &uuids)
Delete multiple flights by uuid, in one transaction.
bool removeAll()
Delete every flight.
FlightLogStorage(QObject *parent)
Standard constructor.
bool remove(const QUuid &uuid)
Delete a flight by uuid.
~FlightLogStorage() override
Standard destructor.
A single flight log entry.