Commit Graph

98 Commits

Author SHA1 Message Date
Tomasz Sowa 074be938ca added 'samples' directory for samples and tests
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1202 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-21 15:59:03 +00:00
Tomasz Sowa 265197ce47 fixed: update/insert for child models generated an incorrect query (blocked for a while)
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1201 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-21 12:15:55 +00:00
Tomasz Sowa f8d88d1459 fixed: in Model::generate_insert_query there was not ModelEnv set (was a null pointer)
similarly in generate_update_query and generate_remove_query
added: support std::vector<> in Model::field() methods
added: serializing std::vector and std::list for non-model classes in BaseExpression




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1200 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-08-20 15:49:37 +00:00
Tomasz Sowa 0a324a38ce merge from branches/join_models
(added possibility to fetch Model objects when they are used as a field in a Model class)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1196 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-07-20 18:04:37 +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 958e89fb02 some work in branches/join_models
- added FinderHelper class - used as a global object for the whole model tree in Finder
  (some fields moved from ModelData)
- added CursorHelper class - used as a global object for the whole model tree in Cursor
  (some fields moved from ModelData)







git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1192 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-05-21 15:51:13 +00:00
Tomasz Sowa b37a577713 some work in branches/join_models
added: ModelEnv class - now Model has a pointer to ModelEnv
       and ModelEnv has a pointer to ModelData, model_connector_mode, table_index and doc_field_pointer
       



git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1191 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-05-13 17:59:28 +00:00
Tomasz Sowa 34ddf11351 some work in branches/join_models
git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1190 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-05-13 03:12:31 +00:00
Tomasz Sowa 6d9b9045fe fixed: generating a correct table names with indices for JOIN statements and column prefixes
git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1188 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-31 20:21: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 9c7a0f3d7e added: support for generating LEFT JOIN statement in Finder
(the primary key should consist of only one column at the moment)



git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1186 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-26 18:34:07 +00:00
Tomasz Sowa 440f56e376 creating branch branches/join_models
git-svn-id: svn://ttmath.org/publicrep/morm/branches/join_models@1185 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-26 18:22:21 +00:00
Tomasz Sowa 79f9522708 used PT::Log::logsave in postgresqlconnector in some places
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1181 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-19 17:54:33 +00:00
Tomasz Sowa 48b04fb5de fixed in Finder: in select(ModelConnector & model_connector) there was not an out_stream set
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1177 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-08 18:32:58 +00:00
Tomasz Sowa cf0a0c96fe changed: ModelData moved outside Model
added:   using ModelData in BaseExpression so Model::to_text() functions can use a ModelData object now





git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1175 e52654a7-88a9-db11-a3e9-0013d4bc506e
2019-03-07 18:02:29 +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 8c5eaacadb changed: testing result status in do_query() in PostgreSQLConnector
renamed: some fields in QueryResult and PostgreSQLQueryResult




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1142 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-11-15 08:50:10 +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 011d8f96e8 fixed: in Finder: we should set model_data to nullptr after fetching an object
model_data points often to a local object (on the stack) so it would be incorrect
       to use it in the future



git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1131 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-10-24 16:28:19 +00:00
Tomasz Sowa 346fe193f3 start working on generating documentation from a model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1124 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-15 22:36:04 +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 d6e428d929 removed: set_connector_for_childs from ModelConnector
changed: model connector is propagated to childs when needed
         (when update, insert, save, to_text is called or in finder)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1120 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-04 13:52:40 +00:00
Tomasz Sowa 08cd621d41 changed: some methods from ModelConnector moved to Model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1119 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-07-04 11:34:49 +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 6fc4e23e44 changed: don't use column prefix in add_field_for_select()
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1107 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-05-02 12:55:00 +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 98206fdb7a added: field_model() method to Model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1103 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-26 18:58:31 +00:00
Tomasz Sowa 3da8d1f411 fixed: finder.get() didn't check whether the resultset had exactly one item
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1098 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-23 19:02:38 +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 fd1cc7debe added: Model::ModelData base class to use with Finder, Model.update(), Model.insert() and Model.remove()
added: Model.add_field_for_select() method 




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1092 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-22 21:04:50 +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 925017300b PT::Date is serializing in the form YYYY-MM-DDTHH:MM:SSZ (eg: 1990-02-12T13:05:39Z) to JSON
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1090 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-20 09:41:41 +00:00
Tomasz Sowa c7bd935a80 added: Model::get_connector_mode() method
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1088 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-19 15:21:51 +00:00
Tomasz Sowa 5bccb056d7 poprawka: get_value() z postgresqlconnector zamienione na get_value_from_result()
w klasie bazowej mamy virtualne get_value() z innymi parametrami
(ostrzeżenie kompilatora)




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1087 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-19 11:37:10 +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 7bae5224e5 temporarily changed the way how PT::Date is escaped
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1084 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-17 16:01:14 +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 b1af7b8d25 changed: esc() function for bool uses now 'true' and 'false' strings
added:  esc() for PT::Date




git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1078 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-04-12 16:05:14 +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
Tomasz Sowa de7fc912bb set svn:ignore to eclipse files
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1073 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-13 22:24:06 +00:00
Tomasz Sowa c7327750bd start creating a new project: Micro ORM
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1072 e52654a7-88a9-db11-a3e9-0013d4bc506e
2018-03-13 22:22:17 +00:00