Commit Graph

189 Commits

Author SHA1 Message Date
e2cfedda6c WIP: add a Val struct as an input/output when calling a function 2025-01-12 16:58:15 +01:00
0ceb2d9c75 WIP: add a Val struct as an input/output when calling a function 2024-12-13 15:48:43 +01:00
04144e81be WIP: add a Val struct as an input/output when calling a function 2024-12-11 17:30:13 +01:00
4f8ef38002 use Ezc::Env instead of Ezc::FunInfo
Ezc::FunInfo has been renamed to Ezc::Env in the pikotools library.
2024-12-06 17:07:58 +01:00
af242dfba6 WIP: use pt::Stream instead of a template argument 2024-12-05 17:48:50 +01:00
698256e2eb print qt environment ids only when .qtcreator directory was created 2024-09-25 09:50:03 +02:00
4f2bc70a00 fix: set a correct global working dir when generating a .clangd file 2024-09-24 23:41:00 +02:00
179e63f3ec use a QTCreator environmentid and a profileid from a local installation
When creating QTCreator project files use local EnvironmentId
and default profile id. By default the environment id is stored
in ~/.config/QtProject/QtCreator.ini and the profile id in
~/.config/QtProject/qtcreator/profiles.xml.
2024-09-24 16:44:41 +02:00
c5a53e8e47 sort a makedepend output
Makefile.dep is sorted now - it's better when making a diff to a previous version.
2024-09-22 15:25:04 +02:00
456e24dd30 add a clangd and qtcreator make targets
Add a clangd make target:
$ make clangd
This installs a .clangd file with configuration (includes/macros/compiler flags)
for the clandg language server.

Add a qtcreator make target:
$ make qtcreator
This installs a .qtcreator directory with QTCreator IDE project files.
In the QTCreator you can open a project by selecting the .qtcreator/morm.creator
file.

You can use 'make qtcreator' again to refresh .qtcreator/morm.files,
the rest of the project files will not be modified.
2024-09-22 11:35:26 +02:00
0e6df30a42 add a Finder::order_by(...) method 2024-07-02 21:52:04 +02:00
8e757aff71 improve escaping characters from multibyte strings
Read the whole character from a multibyte string and then escape it.

while here:
- add more virtual methods for escaping strings to BaseExpression
2024-06-19 23:02:37 +02:00
e46c090b41 fix: correctly serialize a Space class to the json format in the JSONExpression 2024-06-04 16:54:05 +02:00
cd067ae5c3 add Model::field(...) methods with a pt::Stream argument 2024-06-04 10:24:05 +02:00
90b4d9af0b use a char32_t character as a main character when converting strings
Use a char32_t instead of a wchar_t type. This is needed on systems
where sizeof(wchar_t) is equal to 2.
2024-06-01 00:17:01 +02:00
6fb7e29867 fix: correctly escape a pt::Stream in Finder from like() and similar methods
while here:
- in Finder: use pt::Stream and pt::TextStreamBase<> instead of pt::TextStream and pt::WTextStream
- add Finder::raw(...) methods with short int, int, long long and integer unsigned types
2024-05-31 00:31:30 +02:00
9a3f6a6e36 use pt::Stream instead of pt::TextStream as the output stream 2024-05-30 00:01:59 +02:00
e026af9994 add QT Creator files to .gitignore 2023-10-22 23:37:44 +02:00
92d9d2c01b add Finder::esc_like(...) methods 2023-10-10 19:43:02 +02:00
8200092524 add Finder::raw(pt::Date&,...) and esc(pt::Date &,...) methods 2023-07-17 03:42:14 +02:00
21f12a8a98 add support for declared cursors
Declare a cursor with the Finder::declare_cursor() method and next get the cursor with get_cursor():
morm::Cursor<MyObject> cursor = finder.
  declare_cursor("mycursorname").
  select().
  raw("ORDER BY column_name ASC").
  get_cursor();

The cursor now can be used with fetch.*() methods and then get() or get_list():
MyObject myobject = cursor.fetch_next().get();
std::list<MyObject> myobjects = cursor.fetch_forward_count(10).get_list();
2023-07-16 04:03:03 +02:00
6619f3ecb5 fix: correctly use a table name when using Finder::use_table_prefix(true)
We cannot use aliases in the form of "tablename"."fieldname" - now it was
changed to "tablename.fieldname".

Sample how to get the id field, assuming the table name is 'mymodel'.
mymodel = finder2.
          select(morm::Select::no_auto_generated_columns).
          use_table_prefix(true).
          raw("SELECT id AS \"mymodel.id\"").
          raw("FROM mymodel").
          raw("WHERE id = 25").
          get();

In addition, there was an error that the table name was not correctly set
for the first object in the hierarchy - it was empty, e.g. ""."field_name"
2023-07-15 03:08:02 +02:00
e7c62e35dc add Finder::is_null() and is_not_null() methods 2023-07-08 23:26:54 +02:00
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
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
d61fc31b5c allow to set a custom name for the auto generated rows counter column 2023-02-28 09:51:05 +01:00
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
1821c562f7 add a Select::distinct flag 2023-02-28 03:37:20 +01:00
dee48ea2b5 use an <item> field when serializing a table to xml 2023-02-27 00:29:51 +01:00
cf377204a9 improve the xml serializer
while here:
- do some refactoring in BaseExpression
2023-02-26 22:19:46 +01:00
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
d1c86c84cf fix: allow to use a minus sign in strings with FT::numeric flag 2023-01-11 23:06:27 +01:00
794051fa15 add basic support for serializing objects to xml 2022-12-16 02:48:07 +01:00
a3c337355d fix: correctly read a date from a database if a date_only flag is set 2022-12-15 17:33:46 +01:00
a4a1acebeb add Finder::like(...) and ilike(...) methods 2022-12-05 06:36:13 +01:00
dfc631dd06 add more Finder::esc(...) and raw(...) methods 2022-12-02 13:26:30 +01:00
2ac8769d3a add Finder::esc(...) methods 2022-12-02 11:45:19 +01:00
7f4deaf847 update to the new pikotools api: change converting functions to the snake case 2022-11-14 03:38:27 +01:00
0ce05850b3 add FT::date_only, FT::time_only and FT::no_time_zone flags 2022-10-22 16:29:40 +02:00
38e790c2ac fix: correctly delete child objects - use the original value from save_mode 2022-08-17 07:43:58 +02:00
bc92654be9 let Finder::page() takes a page number and not an offset 2022-08-04 14:54:04 +02:00
c54a5bed05 add Model::get_logger() 2022-08-01 03:58:07 +02:00
8373f9e9d8 make depend 2022-07-30 03:32:33 +02:00
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
4e8f3af8fc (finder): take pt::TextStream by const ref in raw(...) method 2022-07-08 22:02:02 +02:00
128f43482a make depend 2022-07-05 19:48:17 +02:00
3ddeb78c97 add LICENSE file 2022-07-03 11:01:14 +02:00
ea6f9fd13e remove empty src/outstream.h file 2022-06-30 13:30:06 +02:00
1ad3d89d52 change headerfile_morm_* macros to headerfile_morm_src_* 2022-06-30 13:28:38 +02:00
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