ServerWindow shows list of databases.
This commit is contained in:
parent
e71ef2e6df
commit
612b524151
15 changed files with 307 additions and 172 deletions
|
|
@ -14,66 +14,6 @@
|
|||
|
||||
namespace Pgsql {
|
||||
|
||||
const Oid oid_bool = 16;
|
||||
const Oid oid_int2 = 21;
|
||||
const Oid oid_int4 = 23;
|
||||
const Oid oid_int8 = 20;
|
||||
const Oid oid_float4 = 700;
|
||||
const Oid oid_float8 = 701;
|
||||
const Oid oid_numeric = 1700;
|
||||
const Oid oid_oid = 26;
|
||||
const Oid oid_varchar = 1043;
|
||||
|
||||
|
||||
|
||||
class Params {
|
||||
public:
|
||||
Params();
|
||||
Params(const Params& rhs);
|
||||
Params& operator=(const Params& rhs);
|
||||
Params(const Params&& rhs);
|
||||
~Params();
|
||||
|
||||
// template <typename T>
|
||||
// Params& add(const T& val, Oid oid = InvalidOid)
|
||||
// {
|
||||
|
||||
// fmt::FormatInt(
|
||||
// int idx = i-1;
|
||||
// m_strings[idx] = value_to_dbstring(val);
|
||||
// m_paramValues[idx] = m_strings[idx].c_str();
|
||||
|
||||
// return *this;
|
||||
// }
|
||||
|
||||
|
||||
/** \brief Add a parameter to the list.
|
||||
*
|
||||
* The class takes ownership of data and will try to delete[] it.
|
||||
*/
|
||||
void addText(const char *data, Oid oid);
|
||||
void add(const QString &s, Oid oid);
|
||||
void addBinary(const char *data, int length, Oid oid);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
using t_paramValues = std::vector<const char *>;
|
||||
|
||||
void deleteValues()
|
||||
{
|
||||
for (auto e : m_paramValues)
|
||||
delete[] e;
|
||||
}
|
||||
|
||||
/* Assumes other lists already have been copied */
|
||||
void copyValues(const t_paramValues &r);
|
||||
|
||||
std::vector<Oid> m_paramTypes;
|
||||
t_paramValues m_paramValues;
|
||||
std::vector<int> m_paramLengths; ///< postgresql ignores lengths for text parameters but we will it anyway for efficient copying
|
||||
std::vector<int> m_paramFormats;
|
||||
};
|
||||
|
||||
class Connection;
|
||||
/*
|
||||
This library has multiple layers.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue