WIP: remove the old database abstraction layer

remove such classes:
- DbBase
- DbConn
- DbTextStream
- Db

while here:
- remove: TextStream, SLog, TexTextStream
This commit is contained in:
2024-06-22 18:03:54 +02:00
parent 5d457f3d4b
commit 6aa100f12c
138 changed files with 6658 additions and 12402 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2010-2014, Tomasz Sowa
* Copyright (c) 2010-2024, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -37,49 +37,34 @@
#include <vector>
#include "ticket.h"
#include "db/dbbase.h"
#include "core/error.h"
#include "core/winixmodeldeprecated.h"
namespace Winix
namespace Winix::Ticket
{
namespace Ticket
{
class TDb : public DbBase
class TDb : public WinixModelDeprecated
{
public:
bool IsTicket(long file_id);
Error GetTicket(long file_id, Ticket & ticket);
Error GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab, bool clear_tab = true);
Error AddTicket(const Ticket & ticket);
Error RemoveAddTicket(const Ticket & ticket); // first removing and then adding a ticket
Error RemoveTicket(long file_id);
bool IsTicket(long file_id);
void GetTicket(long file_id, Ticket & ticket);
void GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab, bool clear_tab = true);
bool AddTicket(Ticket & ticket);
bool RemoveAddTicket(Ticket & ticket); // first removing and then adding a ticket
bool RemoveTicket(long file_id);
private:
DbTextStream query;
Ticket empty_ticket;
Ticket::TicketParam tic_par;
int cfileid;
int cparam;
int cintv;
int cdecv;
void SetTicketColumns(PGresult * r);
void ReadTicketPar(PGresult * r, Ticket::TicketParam & par, int row);
};
} // namespace
} // namespace Winix
}
#endif