aeb02f82b1changed the way how we get a specific field value - now we do not use expressions (BaseExpression), to get the raw value we don't need an expression object: - removed MORM_WORK_MODE_GET_SPECIFIC_FIELD_VALUE from expression work mode - removed: void BaseExpression::field(const wchar_t * field_name, void (Model::*getter_method)(pt::TextStream &), const FT & field_type, ModelEnv * model_env) - removed from BaseExpression: template<typename FunInfoStreamType> void field(const wchar_t * field_name, void (Model::*fun)(Ezc::FunInfo<FunInfoStreamType> &), const FT & field_type, ModelEnv * model_env) - removed: void FlatConnector::to_text(const wchar_t * flat_field_name, pt::TextStream & stream, Model & model) - renamed/changed: Model::put_field_value(...) -> Model::get_raw_value()Tomasz Sowa2021-06-16 14:01:07 +02:00
dd01fafa40- added support for calling member functions (setters/getters) from Models those functions can be used with databases and flat files - removed support for calling static function - if MORM_HAS_EZC_LIBRARY macro is defined then we can call a function which has a first argument Ezc::FunInfo<>& object (only for generating flat files)Tomasz Sowa2021-06-01 19:34:34 +02:00
515e806a50start adding support for Ezc library - Ezc::Generator is able to get variable value and call a static functionTomasz Sowa2021-05-31 18:40:28 +02:00
284cbc5c66Merge pull request 'winix_fullmorm' (#4) from winix_fullmorm into masterTomasz Sowa2021-05-27 10:49:46 +02:00
2f72bd29ecfixed: has_primary_key_set was always set to false in Model::insert() and this prevented to insert a model which had a primary key set by handTomasz Sowa2021-05-21 22:36:04 +02:00
e0e3465673fixed: such field types: no_insertable, no_updatable were not taken into account on Model child objects added: field type: no_removable - it is used only with child Models objectsTomasz Sowa2021-05-21 22:12:10 +02:00
fcd2c4775bupdated to the new pikotools api: snake_case names of methods from SpaceParserTomasz Sowa2021-05-21 04:51:12 +02:00
9598cc4defupdated to the new pikotools api: SpaceParser::SetSpace(...) methods have been removedTomasz Sowa2021-05-21 01:35:16 +02:00
0ff900f626updated to the new pikotools api: changed utf8 functions PascalCase to snake_caseTomasz Sowa2021-05-21 00:32:29 +02:00
b12037a7e5added basic support for making migrationsTomasz Sowa2021-05-14 03:24:53 +02:00
de4abeb91cadded to Finder: methods eq() and similar with table_name as an argument Finder<ModelClass> & eq(const wchar_t * table_name, const wchar_t * field_name, const FieldValue & field_value) Finder<ModelClass> & eq(const wchar_t * table_name, int table_index, const wchar_t * field_name, const FieldValue & field_value) and similar for neq(), lt(), gt(), le(), ge() and in()Tomasz Sowa2021-05-13 19:32:31 +02:00
6eaa9088e5renamed in Model: map_fields() to fields(), prepare_table() to table()Tomasz Sowa2021-05-13 03:27:21 +02:00
2ad6c8c258changed the way how to quote schemas, tables and field names, added escaping table names in insert/update/removeTomasz Sowa2021-05-13 02:32:03 +02:00
a1537cf8d5BaseExpression: removed methods: put_long_field_name() and put_short_field_name() now method put_field_name() is not making a test whether field_name is in long format and only puts the field name (without table name), this allows us to have a dot in the column name (field_name)Tomasz Sowa2021-05-13 00:19:22 +02:00
179be2864fchange FT field_type in PostgreSQLConnectorTomasz Sowa2021-05-12 05:39:31 +02:00
aadc5be350FT field_type changed to const FT & field_type in functions argumentsTomasz Sowa2021-05-12 04:53:23 +02:00
c7797ff2f1fixed#2: escape tables/columns names in Finder left join queries some methods moved from model.h to model.cpp and from baseexpression.h to baseexpression.cppTomasz Sowa2021-05-12 00:27:35 +02:00
009955a0fdadded support for hex strings and binary strings added FT::hexadecimal, FT::binary and FT::dont_use_utf8Tomasz Sowa2021-05-11 22:11:31 +02:00
2afe111c57escape table names in Finder (select sql statement)Tomasz Sowa2021-04-30 01:23:22 +02:00
c87afb40d2use prepare_table() only with a database and not for flat stringsTomasz Sowa2021-04-14 17:46:19 +02:00
1c5d32551afixed: a null was printed for id when serializing lists/vectors in BaseExpression::put_field_value_list(): has_primary_key_set flag was not copied to model_envTomasz Sowa2021-04-14 16:21:10 +02:00
9a4fd9b050fixed: add_field_for_select from Model incorrectly escaped a field string (column name) fixed: Finder didn't use full table name (schema.table) in "from" clauseTomasz Sowa2021-04-12 18:53:55 +02:00
7bef1d5eadadded support for PT::Space as a field in a ModelTomasz Sowa2021-03-11 18:40:32 +01:00
f7490594adchanged the way how the table name is set in a Model - added prepare_table() methodTomasz Sowa2021-03-11 12:22:37 +01:00
fcf1d28b18added FT class which is used in Model::field() methodsTomasz Sowa2021-03-10 16:20:11 +01:00
133a45c84bAdded flag has_primary_key_set to ModelTomasz Sowa2021-03-09 18:10:34 +01:00
ff551a64b8in BaseExpression: changed the way how field names are escaped: methods removed: virtual void before_field_name(); virtual void after_field_name(); methods added: virtual void before_short_field_name(); virtual void after_short_field_name(); they are used for escaping column names in a case when using short form - just only column_name e.g.: [before_short_field_name]column_name[after_short_field_name] methods added: 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(); they are used for escaping column names in a case when using long form: table_name.column_name e.g.: [before_first_part_long_field_name]table_name[after_first_part_long_field_name].[before_second_part_long_field_name]column_name[after_second_part_long_field_name] methods added: virtual void esc(wchar_t val, PT::TextStream & stream);Tomasz Sowa2021-02-24 01:15:17 +01:00
0843e384ebadded get_connector() method to ModelTomasz Sowa2021-02-23 16:58:45 +01:00
b672b67e5cadded get_vector() methods to Finder and Cursor bool get_vector(std::vector<ModelClass> & result, bool clear_list = true); std::vector<ModelClass> get_vector();Tomasz Sowa2021-02-23 16:55:28 +01:00
c18bb48cc8fixed: incorrect query was created when using neq() method with finder - there was no and or or conjunctionTomasz Sowa2021-02-23 16:51:43 +01:00
b0a277c0ebadded 'using FlatExpression::esc' to JSONExpression in order to suppress clang warning: 'morm::JSONExpression::esc' hides overloaded virtual function [-Woverloaded-virtual]Tomasz Sowa2021-02-17 18:01:37 +01:00
ac67f0079afixed: in Model::remove(ModelData & model_data, bool remove_whole_tree) we didn't use remove_whole_tree parameter fixed: compilation erorr when inserting/updating a Model object which has child lists without Model objects such as std::list<int> added: to Model: methods insert, update, remove and save with one argument: bool save_whole_treeTomasz Sowa2019-09-25 16:20:37 +00:00
334201fe15fixed: a parent key was not properly set to simple childs (insert statements) fixed: a parent key was not set in list of childs (insert statements)Tomasz Sowa2019-09-24 17:08:45 +00:00
cff4c1518eadded support for UPDATE, INSERT and REMOVE for lists childs (need some testing)Tomasz Sowa2019-09-24 11:09:11 +00:00
a5d5a81a57removed: doc functionality (generating documentation from a model) we can use our own class (based on FlatConnector and FlatExpression) to generate documentationTomasz Sowa2019-09-18 15:55:42 +00:00
bb3f69fe8drefactoring: ModelEnv::model_connector_mode renamed to model_work_mode ModelEnv::model_connector_submode renamed to model_work_submode and similarly macros MORM_MODEL_CONNECTOR_MODE.* -> MORM_MODEL_WORK_MODE_* MORM_MODEL_CONNECTOR_SUBMODE.* -> MORM_MODEL_WORK_SUBMODE_*Tomasz Sowa2019-09-18 15:28:06 +00:00
3d73a64f23rafactoring in Model class (in field_generic and field_model methods) added: ModelEnv::model_connector_submode (used in iterating through childs)Tomasz Sowa2019-09-18 14:36:13 +00:00
ba5f702257fixed: in 'left join' statements there were not table indices used added: now we set flag save_mode = DO_NOTHING_ON_SAVE for objects for which all fields from a database result set are nullTomasz Sowa2019-09-18 12:29:20 +00:00
afce2234c3fixed: get_value_by_field_name() is able to correctly take values when we do not use auto generated 'select' and when we are using prefixes for columnsTomasz Sowa2019-09-17 17:55:39 +00:00
057d879b4cadded: to Model::to_text() methods added dump_mode (bool) parameter an additional field (model_save_mode) is printed changed: if there is no an object the Cursor returns a Model with DO_NOTHING_ON_SAVE flag now (DO_INSERT_ON_SAVE was beforehand) fixed: when reading a result from db: for auto generated select there should be used get_value_by_field_index() method instead of get_value_by_field_name() changed: flat string (json) is generated only if a model has DO_INSERT_ON_SAVE or DO_UPDATE_ON_SAVE or is dump_mode turn onTomasz Sowa2019-09-13 18:17:02 +00:00
c133e949cechanged: SetFieldValueHelper -> FieldValueHelper it's a much simpler structure now removed: FieldValueBase and FieldValueContainerTomasz Sowa2019-09-11 18:16:22 +00:00
0be9feda44added support in Model for removing the whole tree (without lists/vectors at the moment yet)Tomasz Sowa2019-09-05 16:32:35 +00:00
d2f851faf9now Model.update() and Model.insert() can update/insert the whole tree with child models (at the moment without lists/vectors only model childs)Tomasz Sowa2019-09-04 16:02:18 +00:00
7ff05f493cadded: to Model: virtual void set_parent_key_in_childs() for setting a parent key id in child models, it is called after after_insert() method added: SetFieldValueHelper class used for storing primary key values from a parent modelTomasz Sowa2019-08-22 18:33:35 +00:00
52422d929estart adding support for inserting child modelsTomasz Sowa2019-08-21 17:42:50 +00:00
074be938caadded 'samples' directory for samples and testsTomasz Sowa2019-08-21 15:59:03 +00:00
265197ce47fixed: update/insert for child models generated an incorrect query (blocked for a while)Tomasz Sowa2019-08-21 12:15:55 +00:00
f8d88d1459fixed: 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 BaseExpressionTomasz Sowa2019-08-20 15:49:37 +00:00
0a324a38cemerge from branches/join_models (added possibility to fetch Model objects when they are used as a field in a Model class)Tomasz Sowa2019-07-20 18:04:37 +00:00
2533b18cfdfixed: 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 DbConnectorTomasz Sowa2019-06-17 10:59:39 +00:00
b6fbe29805added 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)Tomasz Sowa2019-05-31 18:28:09 +00:00
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_indexTomasz Sowa2019-05-21 17:24:12 +00:00
958e89fb02some 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)Tomasz Sowa2019-05-21 15:51:13 +00:00
b37a577713some 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_pointerTomasz Sowa2019-05-13 17:59:28 +00:00
6d9b9045fefixed: generating a correct table names with indices for JOIN statements and column prefixesTomasz Sowa2019-03-31 20:21:12 +00:00
ab54a3fc3esome work: we need a different way of naming tables for joinsTomasz Sowa2019-03-26 20:35:05 +00:00
9c7a0f3d7eadded: support for generating LEFT JOIN statement in Finder (the primary key should consist of only one column at the moment)Tomasz Sowa2019-03-26 18:34:07 +00:00
79f9522708used PT::Log::logsave in postgresqlconnector in some placesTomasz Sowa2019-03-19 17:54:33 +00:00
48b04fb5defixed in Finder: in select(ModelConnector & model_connector) there was not an out_stream setTomasz Sowa2019-03-08 18:32:58 +00:00
cf0a0c96fechanged: ModelData moved outside Model added: using ModelData in BaseExpression so Model::to_text() functions can use a ModelData object nowTomasz Sowa2019-03-07 18:02:29 +00:00
eb3703c323updated to the new pikotools api (Logger -> Log)Tomasz Sowa2018-11-23 17:13:50 +00:00
8c5eaacadbchanged: testing result status in do_query() in PostgreSQLConnector renamed: some fields in QueryResult and PostgreSQLQueryResultTomasz Sowa2018-11-15 08:50:10 +00:00
011d8f96e8fixed: 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 futureTomasz Sowa2018-10-24 16:28:19 +00:00
346fe193f3start working on generating documentation from a modelTomasz Sowa2018-07-15 22:36:04 +00:00
fdc44c56ebadded: a new class Clearer with clear_value() methods moved from DbConnectorTomasz Sowa2018-07-05 11:15:16 +00:00
38b85722b8Model and BaseExpression: changed the template taking a container to std::listTomasz Sowa2018-07-05 09:51:26 +00:00
d6e428d929removed: 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)Tomasz Sowa2018-07-04 13:52:40 +00:00
08cd621d41changed: some methods from ModelConnector moved to ModelTomasz Sowa2018-07-04 11:34:49 +00:00
f85f03a889some work in morm now in Model we have field() methods for other Model or std::list<Model> (code not tested)Tomasz Sowa2018-07-03 16:55:06 +00:00
6fc4e23e44changed: don't use column prefix in add_field_for_select()Tomasz Sowa2018-05-02 12:55:00 +00:00
e25b6d9a29added: Finder::prefix() method code not thoroughly testedTomasz Sowa2018-05-01 23:22:32 +00:00
3da8d1f411fixed: finder.get() didn't check whether the resultset had exactly one itemTomasz Sowa2018-04-23 19:02:38 +00:00
cc2230001cadded support for PT::Logger to DbConnector and PostgreSQLConnectorTomasz Sowa2018-04-23 15:46:21 +00:00
fd1cc7debeadded: Model::ModelData base class to use with Finder, Model.update(), Model.insert() and Model.remove() added: Model.add_field_for_select() methodTomasz Sowa2018-04-22 21:04:50 +00:00
4c0d203fc8added: removing objects saving objects (either insert or update or remove)Tomasz Sowa2018-04-22 01:26:46 +00:00
925017300bPT::Date is serializing in the form YYYY-MM-DDTHH:MM:SSZ (eg: 1990-02-12T13:05:39Z) to JSONTomasz Sowa2018-04-20 09:41:41 +00:00
5bccb056d7poprawka: get_value() z postgresqlconnector zamienione na get_value_from_result() w klasie bazowej mamy virtualne get_value() z innymi parametrami (ostrzeżenie kompilatora)Tomasz Sowa2018-04-19 11:37:10 +00:00
476e5de292added support for 'in()' statement in 'select'Tomasz Sowa2018-04-18 17:52:09 +00:00
ffb7ac85a6added: QueryResult stack to PostgreSQLConnector this allowes us to call query() recursively (from after_select() callback)Tomasz Sowa2018-04-18 10:22:01 +00:00
7bae5224e5temporarily changed the way how PT::Date is escapedTomasz Sowa2018-04-17 16:01:14 +00:00
72b2622d08some work in morm - support for fetching rows from db - support for inserting/updating rowsTomasz Sowa2018-04-16 22:46:25 +00:00