mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Sql: Sql::Attach/Detach, SetSession
git-svn-id: svn://ultimatepp.org/upp/trunk@4304 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6f8c3327b9
commit
418c76a798
2 changed files with 13 additions and 4 deletions
|
|
@ -551,8 +551,8 @@ bool Sql::Update(Fields nf, SqlId table) {
|
|||
return Update(nf, (const char *)~table);
|
||||
}
|
||||
|
||||
void Sql::Assign(SqlSource& s) {
|
||||
if(cn) delete cn;
|
||||
void Sql::SetSession(SqlSource& s) {
|
||||
Detach();
|
||||
cn = s.CreateConnection();
|
||||
}
|
||||
|
||||
|
|
@ -624,6 +624,13 @@ void Sql::Detach()
|
|||
{
|
||||
if(cn) delete cn;
|
||||
cn = NULL;
|
||||
param.Clear();
|
||||
}
|
||||
|
||||
void Sql::Attach(SqlConnection *connection)
|
||||
{
|
||||
Detach();
|
||||
cn = connection;
|
||||
}
|
||||
|
||||
Sql::~Sql() {
|
||||
|
|
|
|||
|
|
@ -92,12 +92,14 @@ class Sql {
|
|||
friend Sql& AppCursorR();
|
||||
|
||||
Value Select0(const String& what);
|
||||
void Assign(SqlSource& src);
|
||||
void Detach();
|
||||
enum _NULLSQL { NULLSQL };
|
||||
Sql(_NULLSQL) { cn = NULL; }
|
||||
|
||||
public:
|
||||
void SetSession(SqlSource& src);
|
||||
void Attach(SqlConnection *connection);
|
||||
void Detach();
|
||||
|
||||
String Compile(const SqlStatement& s);
|
||||
|
||||
void Clear();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue