Tomasz Sowa
25a91168ac
fix: correctly use a table name when a Select::no_auto_generated_columns flag is used
2023-05-08 10:26:31 +02:00
Tomasz Sowa
86177889af
add a CSVConnector/CSVExpression classes to serialize to csv format
...
Current limitation: list/vectors are not serialized.
while here:
- move the output_type flag from the DbExpression to BaseExpression class
- add Model::to_text(...) methods with an Export parameter
2023-04-12 17:20:29 +02:00
Tomasz Sowa
d61fc31b5c
allow to set a custom name for the auto generated rows counter column
2023-02-28 09:51:05 +01:00
Tomasz Sowa
c56bae57ca
fix: propagate the model_data in the cursor
...
model_data can be used in Model::fields() method
2023-02-28 09:48:44 +01:00
Tomasz Sowa
1821c562f7
add a Select::distinct flag
2023-02-28 03:37:20 +01:00
Tomasz Sowa
dee48ea2b5
use an <item> field when serializing a table to xml
2023-02-27 00:29:51 +01:00
Tomasz Sowa
cf377204a9
improve the xml serializer
...
while here:
- do some refactoring in BaseExpression
2023-02-26 22:19:46 +01:00
Tomasz Sowa
0fbd988eda
serialize a model to flat string even when a DO_NOTHING_ON_SAVE flag is set
...
while here:
- add FT::serialize_to_null_if_null and FT::do_not_serialize_if_null flags
2023-02-26 18:28:16 +01:00
Tomasz Sowa
d1c86c84cf
fix: allow to use a minus sign in strings with FT::numeric flag
2023-01-11 23:06:27 +01:00
Tomasz Sowa
794051fa15
add basic support for serializing objects to xml
2022-12-16 02:48:07 +01:00
Tomasz Sowa
a3c337355d
fix: correctly read a date from a database if a date_only flag is set
2022-12-15 17:33:46 +01:00
Tomasz Sowa
a4a1acebeb
add Finder::like(...) and ilike(...) methods
2022-12-05 06:36:13 +01:00
Tomasz Sowa
dfc631dd06
add more Finder::esc(...) and raw(...) methods
2022-12-02 13:26:30 +01:00
Tomasz Sowa
2ac8769d3a
add Finder::esc(...) methods
2022-12-02 11:45:19 +01:00
Tomasz Sowa
7f4deaf847
update to the new pikotools api: change converting functions to the snake case
2022-11-14 03:38:27 +01:00
Tomasz Sowa
0ce05850b3
add FT::date_only, FT::time_only and FT::no_time_zone flags
2022-10-22 16:29:40 +02:00
Tomasz Sowa
38e790c2ac
fix: correctly delete child objects - use the original value from save_mode
2022-08-17 07:43:58 +02:00
Tomasz Sowa
bc92654be9
let Finder::page() takes a page number and not an offset
2022-08-04 14:54:04 +02:00
Tomasz Sowa
c54a5bed05
add Model::get_logger()
2022-08-01 03:58:07 +02:00
Tomasz Sowa
8373f9e9d8
make depend
2022-07-30 03:32:33 +02:00
Tomasz Sowa
43dfbd5d5a
add possibility of calculating how many rows there were before LIMIT was applied
...
The Finder has get_rows_counter() method which returns how many rows there were
before LIMIT clause was applied. The select(...) method should be called with
Select::with_rows_counter flag in such a case.
while here:
- change the semantic of Finder, now the select(...) method takes a morm::Select flags,
and we have such flags:
- Select::no_auto_generated_columns - do not generate columns from models
- with_rows_counter - add an additional column for the rows counter
- remove Finder::prepare_to_select() - now use select(...) with no_auto_generated_columns flag
2022-07-11 17:48:13 +02:00
Tomasz Sowa
4e8f3af8fc
(finder): take pt::TextStream by const ref in raw(...) method
2022-07-08 22:02:02 +02:00
Tomasz Sowa
128f43482a
make depend
2022-07-05 19:48:17 +02:00
Tomasz Sowa
3ddeb78c97
add LICENSE file
2022-07-03 11:01:14 +02:00
Tomasz Sowa
ea6f9fd13e
remove empty src/outstream.h file
2022-06-30 13:30:06 +02:00
Tomasz Sowa
1ad3d89d52
change headerfile_morm_* macros to headerfile_morm_src_*
2022-06-30 13:28:38 +02:00
Tomasz Sowa
576d537177
add src/version.h with macros: MORM_VERSION_MAJOR, MORM_VERSION_MINOR, MORM_VERSION_PATCH
...
Let the version be 0.7.0.
2022-06-30 13:19:55 +02:00
Tomasz Sowa
c89d4f76bc
add global Makefile
...
src/Makefile uses now 'find' for looking for *.cpp files
and we don't need Makefile.o.dep anymore
2022-06-26 06:15:19 +02:00
Tomasz Sowa
fc50c8ca5e
fixed: in Finder::select(PT::TextStream & out_stream, ModelConnector & model_connector)
...
and Finder::select(PT::TextStream & out_stream, ModelConnector * model_connector)
there was 'out_stream' parameter ignored
merged from 0890f27fe5
2022-06-25 18:30:53 +02:00
Tomasz Sowa
1ace47266d
fix: correctly escape output stream buffer for models getters
2022-05-31 01:45:27 +02:00
Tomasz Sowa
21117e24c0
do Transaction::commit/rollback only on the same group for which a begin was called
2022-05-27 00:06:56 +02:00
Tomasz Sowa
dd04ee84b7
capitalize INSERT/UPDATE/DELETE sql statements
2022-05-26 20:19:05 +02:00
Tomasz Sowa
1d4de8abe2
add support for nested transactions
...
while here:
- don't allow to copy/move DbConnector
2022-05-26 20:14:14 +02:00
Tomasz Sowa
907f10671d
do not allow to copy/move transactions objects
2022-05-26 00:45:49 +02:00
Tomasz Sowa
c5cf4a2672
add Transaction class as a wrapper for transactions
2022-05-26 00:34:17 +02:00
Tomasz Sowa
b32917afe7
use pikotools Log::put_multiline() method when printing PostgreSQL error messages
2022-05-25 19:58:13 +02:00
Tomasz Sowa
0ce7578de3
fix: the way how we test if there is a connection issue
...
If there is a connection issue then PQexec returns a resultset now
- older versions of PostgreSQL returned null pointer.
2022-05-25 19:11:42 +02:00
Tomasz Sowa
12232bf722
propagate status from childs in Model::insert, Model::update, Model::remove and Model::save
2022-05-24 23:27:07 +02:00
Tomasz Sowa
1ad4cb4fbd
trim white lines after PostgreSQL error message
2022-05-24 20:06:06 +02:00
Tomasz Sowa
56cbebad4f
add FT::numeric to be applied on string types
2022-05-16 13:42:51 +02:00
Tomasz Sowa
3bde64e033
add possibility to set save status for the whole tree
...
add method:
void Model::set_save_mode2(SaveMode save_mode, bool update_whole_tree = true)
in the future it may be renamed to set_save_mode()
2022-05-12 00:21:42 +02:00
Tomasz Sowa
df44296c04
fix: only insert primary keys from the first descendant childs
2022-05-11 23:18:25 +02:00
Tomasz Sowa
469294502e
allow specify how many times we can try to connect to the database
2022-04-29 05:56:02 +02:00
Tomasz Sowa
d384929e75
allow to use host connection parameter
2022-04-28 06:03:40 +02:00
Tomasz Sowa
ac77abb8fd
allow to use hostaddr, port or conn_string to connect to PostgreSQL
2022-04-20 18:36:06 +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
c25a5d2215
- code from JSONExpression::esc(char val, ...) moved to Pikotools (convert/misc.h)
...
- added ModelContainerWrapper::set_iterator_at_first_model() method
2021-10-12 19:59:19 +02:00
Tomasz Sowa
e682e057ad
added to SpaceWrapper class: void invalidate_iterators(size_t space_index_start)
2021-08-13 21:43:02 +02:00
Tomasz Sowa
f94a9e27db
added flags FT::json and FT::space for pt::Space class - serializing/parsing to/from json/space
2021-08-12 21:56:32 +02:00