Commit Graph

15 Commits

Author SHA1 Message Date
Tomasz Sowa a4a1acebeb add Finder::like(...) and ilike(...) methods 2022-12-05 06:36:13 +01:00
Tomasz Sowa 1ad3d89d52 change headerfile_morm_* macros to headerfile_morm_src_* 2022-06-30 13:28:38 +02:00
Tomasz Sowa 0bdabfc7b4 fix: put 'char' type directly to the output stream
Char type was converted to wchar_t and then was serialized as utf-8 stream.
Let char type will always be one char, of course it need to be a valid utf-8 sequence.

Let FT::dont_use_utf8 apply only to wchar_t and std::wstring
but ignore it if FT::hexadecimal or FT::binary are defined.

Now we have bool BaseExpression::esc_char(wchar_t val, pt::TextStream & stream) method
which (in most cases) will be used in derived classes.

Let wchar_t (and std::wstring) will be stored as 8 hex digits when using FT::hexadecimal
or FT::binary (and ignore FT::dont_use_utf8 in such a case).
2022-02-08 12:47:34 +01:00
Tomasz Sowa 48d515ea64 if pt::Space has FT::json type then let JSONExpression serialize it as json and not string 2022-02-03 11:18:01 +01:00
Tomasz Sowa 34274ca230 namespace PT renamed to pt 2021-05-20 16:25:01 +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 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 ff551a64b8 in 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);
2021-02-24 01:15:17 +01:00
Tomasz Sowa b0a277c0eb added 'using FlatExpression::esc' to JSONExpression in order to suppress clang warning:
'morm::JSONExpression::esc' hides overloaded virtual function [-Woverloaded-virtual]
2021-02-17 18:01:37 +01: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 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 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 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