Commit Graph

28 Commits

Author SHA1 Message Date
Tomasz Sowa 34274ca230 namespace PT renamed to pt 2021-05-20 16:25:01 +02:00
Tomasz Sowa b12037a7e5 added basic support for making migrations 2021-05-14 03:24:53 +02:00
Tomasz Sowa 2ad6c8c258 changed the way how to quote schemas, tables and field names,
added escaping table names in insert/update/remove

removed methods from BaseExpression:
virtual void before_short_field_name();
virtual void after_short_field_name();
virtual void before_first_part_long_field_name();
virtual void after_first_part_long_field_name();
virtual void before_second_part_long_field_name();
virtual void after_second_part_long_field_name();

added methods to BaseExpression:
virtual void schema_table_separator();
virtual void table_field_separator();
virtual void before_schema_name();
virtual void after_schema_name();
virtual void before_table_name();
virtual void after_table_name();
virtual void before_field_name();
virtual void after_field_name();
2021-05-13 02:32:03 +02:00
Tomasz Sowa aadc5be350 FT field_type changed to const FT & field_type in functions arguments 2021-05-12 04:53:23 +02:00
Tomasz Sowa 009955a0fd added support for hex strings and binary strings
added FT::hexadecimal, FT::binary and FT::dont_use_utf8
2021-05-11 22:11:31 +02:00
Tomasz Sowa c85165b442 updated to the new api of Space from pikotools 2021-04-08 17:21:12 +02:00
Tomasz Sowa 7bef1d5ead added support for PT::Space as a field in a Model
methods before_field_value_string() and after_field_value_string() moved
from DbExpression and JsonExpression to BaseExpression and made virtual
and now methods before_field_value(const std::wstring &) and after_field_value(const std::wstring &)
(and the rest of them with string arguments) can be removed from DbExpression, PostgreSqlExpression and JsonExpression
2021-03-11 18:40:32 +01:00
Tomasz Sowa f7490594ad changed the way how the table name is set in a Model - added prepare_table() method
removed from Model:
virtual void table_name(PT::TextStream & stream);

added to Model:
virtual void prepare_table();
virtual void table(const wchar_t * table_name);
virtual void table(const wchar_t * schema_name, const wchar_t * table_name);
2021-03-11 12:22:37 +01:00
Tomasz Sowa 52422d929e start adding support for inserting child models
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1203 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-21 17:42:50 +00:00
Tomasz Sowa 2533b18cfd fixed: in cursor in add_models_to_list(): added_model.model_env should be set after added_model.clear()
fixed: when generating: insert, update or remove statements we have used prefixes for columns
       but the table name was not set in ModelEnv (now we do not use prefixes in such statements)
changed: log_queries field moved from PostgreSQLConnector to DbConnector





git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1195 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-06-17 10:59:39 +00:00
Tomasz Sowa b6fbe29805 added BaseExpression::is_long_field_name()
added BaseExpression::need_to_add_field_prefix()
      now the fields() methods don't take add_column_prefix parameter
      but the field_name (wchar_t*) is tested whether is it a long (with a period) or short name
added BaseExpression::save_foreign_key() (code moved from field())
removed some default method arguments from BaseExpression
added neq() method for Finder
added DbExpression::prepare_short_table_name(const PT::TextStream & table_name, PT::TextStream & short_table_name)




git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1194 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-05-31 18:28:09 +00:00
Tomasz Sowa a1d18735b0 - removed prefix() method from Finder
(this was for a custom prefix)
- removed column_prefix and column_prefix_index from BaseExpression
  now we have a pointer to ModelEnv passed in field() method
- to ModelEnv: added table_name, table_name_simple and table_index





git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1193 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-05-21 17:24:12 +00:00
Tomasz Sowa ab54a3fc3e some work: we need a different way of naming tables for joins
git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1187 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-26 20:35:05 +00:00
Tomasz Sowa 41684eb969 Makefile.dep
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1165 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-01-07 04:33:31 +00:00
Tomasz Sowa eb3703c323 updated to the new pikotools api
(Logger -> Log)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1150 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-23 17:13:50 +00:00
Tomasz Sowa 1f9e4ee70a added Cursor class
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1140 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-14 17:14:26 +00:00
Tomasz Sowa fdc44c56eb added: a new class Clearer with clear_value() methods moved from DbConnector
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1122 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-05 11:15:16 +00:00
Tomasz Sowa 38b85722b8 Model and BaseExpression: changed the template taking a container to std::list
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1121 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-05 09:51:26 +00:00
Tomasz Sowa f85f03a889 some work in morm
now in Model we have field() methods for other Model or std::list<Model>
(code not tested)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1118 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-03 16:55:06 +00:00
Tomasz Sowa e25b6d9a29 added: Finder::prefix() method
code not thoroughly tested



git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1106 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-05-01 23:22:32 +00:00
Tomasz Sowa cc2230001c added support for PT::Logger to DbConnector and PostgreSQLConnector
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1097 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-23 15:46:21 +00:00
Tomasz Sowa 4c0d203fc8 added:
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
2018-04-22 01:26:46 +00:00
Tomasz Sowa 476e5de292 added support for 'in()' statement in 'select'
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1086 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-18 17:52:09 +00:00
Tomasz Sowa ffb7ac85a6 added: QueryResult stack to PostgreSQLConnector
this allowes us to call query() recursively (from after_select() callback)



git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1085 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-18 10:22:01 +00:00
Tomasz Sowa 72b2622d08 some work in morm
- support for fetching rows from db
- support for inserting/updating rows



git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1081 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-16 22:46:25 +00:00
Tomasz Sowa 09f31b2803 some work in morm (select statement)
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1079 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-15 23:00:17 +00:00
Tomasz Sowa fceec43d07 some work for SELECT statement
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1077 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-30 19:34:45 +00:00
Tomasz Sowa d84ca900c3 reorganizing class hierarchy
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1075 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-23 19:26:57 +00:00