removing objects
saving objects (either insert or update or remove)





git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1091 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-04-22 01:26:46 +00:00
parent 925017300b
commit 4c0d203fc8
12 changed files with 542 additions and 151 deletions

View File

@@ -47,6 +47,7 @@ namespace morm
class PostgreSQLConnector : public DbConnector
{
public:
PostgreSQLConnector();
virtual ~PostgreSQLConnector();
@@ -54,10 +55,16 @@ public:
void clear_last_query_result();
// give me a better names
virtual size_t last_select_size(); // was: last_select_size
virtual size_t last_select_size();
virtual ExecStatusType last_query_status();
virtual bool is_last_result(ExecStatusType t); // was: is_last_result
virtual std::wstring get_last_query_error_msg();
virtual void set_last_query_error_msg(const char * error_msg);
virtual void set_last_query_error_msg(const wchar_t * error_msg);
virtual bool was_error_in_last_query();
virtual void set_was_error_in_last_query(bool was_error);
void set_log_queries(bool log_queries);
@@ -68,10 +75,12 @@ public:
bool query_select(const char * query_str);
bool query_update(const char * query_str);
bool query_insert(const char * query_str);
bool query_remove(const char * query_str);
bool query_select(const PT::TextStream & stream);
bool query_update(const PT::TextStream & stream);
bool query_insert(const PT::TextStream & stream);
bool query_remove(const PT::TextStream & stream);
// give me a better name
@@ -134,6 +143,8 @@ protected:
size_t result_rows; // how many rows in the result query
ExecStatusType status;
size_t cur_row; // used for reading
bool was_error;
std::wstring error_msg;
QueryResult()
{
@@ -141,6 +152,7 @@ protected:
result_rows = 0;
status = PGRES_EMPTY_QUERY;
cur_row = 0;
was_error = false;
}
};
@@ -154,6 +166,7 @@ protected:
virtual const char * get_field_string_value(const wchar_t * field_name);
const char * query_last_sequence(const wchar_t * sequence_table_name);
};