Created IndexModel for displaying the indexes on a table. Constraints can now show the SQL to drop and create them.
The keyword list is now directly based of the official keyword list from postgresql.
This commit is contained in:
parent
b436814eb5
commit
97d4e2a1a4
24 changed files with 754 additions and 228 deletions
|
|
@ -25,28 +25,9 @@ namespace Pgsql {
|
|||
|
||||
*/
|
||||
|
||||
// class ConnectionParams {
|
||||
// public:
|
||||
// std::string host;
|
||||
// std::string hostaddr;
|
||||
// unsigned short port = 5432;
|
||||
// std::string dbname;
|
||||
// std::string user;
|
||||
// std::string password;
|
||||
// int connect_timeout = -1; ///< -1 omit (ie uses default)
|
||||
// std::string application_name;
|
||||
|
||||
// };
|
||||
|
||||
|
||||
|
||||
class Result;
|
||||
class Params;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** \brief Wrapper for a cancel object from libpq.
|
||||
*/
|
||||
class Canceller {
|
||||
|
|
@ -80,16 +61,14 @@ namespace Pgsql {
|
|||
Connection(Connection &&rhs);
|
||||
Connection& operator=(Connection &&rhs);
|
||||
|
||||
// void connect(const ConnectionParams ¶ms);
|
||||
bool connect(const char *params);
|
||||
bool connect(const QString ¶ms)
|
||||
{
|
||||
return connect(params.toUtf8().data());
|
||||
}
|
||||
|
||||
bool connect(const char *const * keywords, const char* const * values, int expand_dbname);
|
||||
|
||||
bool connectStart(const char *params);
|
||||
|
||||
bool connectStart(const std::string ¶ms)
|
||||
{
|
||||
return connectStart(params.c_str());
|
||||
|
|
@ -99,6 +78,7 @@ namespace Pgsql {
|
|||
{
|
||||
return connectStart(params.toUtf8().data());
|
||||
}
|
||||
|
||||
bool connectStart(const char * const *keywords,
|
||||
const char * const *values);
|
||||
|
||||
|
|
@ -135,6 +115,11 @@ namespace Pgsql {
|
|||
bool isBusy();
|
||||
|
||||
void setNoticeReceiver(std::function<void(const PGresult *)> callback);
|
||||
|
||||
std::string escapeLiteral(const std::string_view &literal);
|
||||
QString escapeLiteral(const QString &literal);
|
||||
std::string escapeIdentifier(const std::string_view &ident);
|
||||
QString escapeIdentifier(const QString &ident);
|
||||
private:
|
||||
PGconn *conn = nullptr;
|
||||
std::function<void(const PGresult *)> notifyReceiver;
|
||||
|
|
@ -142,75 +127,6 @@ namespace Pgsql {
|
|||
static void notifyReceiveFunc(void *arg, const PGresult *result);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// class Field {
|
||||
// public:
|
||||
|
||||
// std::string getName() const;
|
||||
|
||||
// private:
|
||||
// //Tuples tuples;
|
||||
// int field;
|
||||
// //
|
||||
|
||||
// };
|
||||
|
||||
// class Tuples {
|
||||
// public:
|
||||
// int getRowCount() const;
|
||||
// int getColCount() const;
|
||||
|
||||
// Field getField(const std::string &fname);
|
||||
// Field getField(const int idx);
|
||||
|
||||
// class const_iterator {
|
||||
// public:
|
||||
// const_iterator& operator++();
|
||||
// };
|
||||
|
||||
// void rewind();
|
||||
|
||||
|
||||
// };
|
||||
|
||||
// class OkResult: public Result {
|
||||
// public:
|
||||
// /** If the result is a data result then returns an interface for processing this data.
|
||||
|
||||
// The returned interface remains valid as long as this OkResult exists.
|
||||
// */
|
||||
// Tuples* hasTuples();
|
||||
// };
|
||||
|
||||
// class ErrorResult: public Result {
|
||||
//
|
||||
// };
|
||||
|
||||
// class ITransaction {
|
||||
// public:
|
||||
//
|
||||
// Canceller Query(std::string query,
|
||||
// std::function<void(OkResult)> on_success,
|
||||
// std::function<void()> on_cancelled,
|
||||
// std::function<void(ErrorResult)> on_error);
|
||||
//
|
||||
// Canceller Query(std::string query,
|
||||
// std::function<void(OkResult)> on_success,
|
||||
// std::function<void()> on_cancelled,
|
||||
// std::function<void(ErrorResult)> on_error);
|
||||
//
|
||||
//
|
||||
// void Rollback(
|
||||
// std::function<void(OkResult)> on_success,
|
||||
// std::function<void(ErrorResult)> on_error);
|
||||
// void Commit(
|
||||
// std::function<void(OkResult)> on_success,
|
||||
// std::function<void()> on_cancelled,
|
||||
// std::function<void(ErrorResult)> on_error);
|
||||
//
|
||||
// };
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue