Commit Graph

5 Commits

Author SHA1 Message Date
Tomasz Sowa 133a45c84b Added flag has_primary_key_set to Model
Now we know whether the primary key is defined or not
and we do not allow to make update/remove if the key is not defined.

And when doing insert/update we can put NULL if child models don't have
the primary key set (fields with has_foreign_key set to true).

Now in after_select() we should also set has_primary_key_set flag
or just call get_last_sequence_for_primary_key instead of get_last_sequence.

fixed: added prefix +00 when serializing PT::Date to PostgreSQL (time zone)
(for a column with a time zone there was a wrong value saved)
2021-03-09 18:10:34 +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 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 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