Commit graph

60 commits

Author SHA1 Message Date
eelke
ee86327869 Fix warnings and dependencies 2025-02-23 16:52:39 +01:00
eelke
80f751aeea Pgsql lib add some convenience routines 2024-04-13 09:09:54 +02:00
eelke
2c899bd799 Generate PARTITIONED BY SQL for partitioned tables.
Expressions not yet supported.
2023-02-06 20:31:00 +01:00
Eelke Klein
2ff9577d41 The table inheritance works mostly 2023-01-24 17:47:52 +00:00
eelke
80272e81c3 Improve error handling 2022-08-17 18:18:10 +02:00
eelke
457b09f15c Improved error reporting 2022-08-14 08:04:21 +02:00
eelke
8b671090a0 Big cleanup 2022-05-26 08:25:31 +02:00
eelke
91ac77a058 operator== and != should be const 2022-04-10 09:26:23 +02:00
eelke
03b4194193 Merge branch 'crudtesting' 2022-04-03 10:05:09 +02:00
eelke
357dc3d114 Cleanup and new formatting 2022-04-03 09:17:18 +02:00
eelke
23e61c6c95 Fix broken unittest.
Was probably broken by a change in Qt. Now using custom parser.
(I also tested a regex based parser but that was more then 80 times slower)
2022-02-06 14:15:16 +01:00
eelke
c346430b25 Abstract IResult interface for Result
This is to allow faking the result for testing the CrudModel.
2022-02-06 12:19:43 +01:00
eelke
06504ecc1f Improvements to the CrudModel
The new data of modified rows is now stored directly within the row_mapping
also changed how new rows are handled so the new empty row for inserting
is not a special case but is part of the list.
2022-01-22 16:22:29 +01:00
eelke
a7f247bdee Cleanup 2022-01-21 18:54:50 +01:00
eelke
11459e1e12 Show sizes
table, index, toast and total size per Table
size of each index
2021-03-10 19:06:40 +01:00
eelke
7fbc828326 misc stuff 2021-03-06 13:15:17 +01:00
eelke
423043d431 Qt6 migration 2021-03-06 13:13:31 +01:00
eelke
7734661d26 missing includes
technically it was wrong all the time but it only showed up with newer visual c++ compiler.
2020-10-15 19:12:11 +02:00
eelke
c5f6da48ce Pgsql::Connection::connect functions now all report connection errors
by throwing exception.
2019-11-03 07:58:48 +01:00
eelke
d7763e83bf More projects fixes. 2019-03-27 18:50:58 +01:00
eelke
4694b09ba1 Merge branch 'master' of ssh://gitlab.com:/eelke/pgLab
# Conflicts:
#	common.pri
2019-03-27 18:24:27 +01:00
eelke
089c793df7 MIsc changes 2019-03-27 18:23:00 +01:00
Eelke Klein
e7bfaeff9a project file cleanup
Moving system dependent parts into local.pri which is not tracked and supply local.pri.sample as a template for developers to adjust for their local system.
2019-03-24 08:53:22 +01:00
eelke
b210c570fc ArrayParser doesn't require the string to be null terminated anymore,
instead the length of the string can be passed in.

This is first step in process to allow Value to work without null terminator.
2018-12-24 08:10:09 +01:00
eelke
efb3e71556 The getAsArray and getAsVector function now use StringToArrayElem template for conversion
to the array element type.

A five line construct had been copy pasted to achieve conversion by using the capabilities of the Value object
however this was not going to work for types that are not known to the database as adding support for these
to Value would be a bad idea. So StringToArrayElem was introduced with a default implementation that relies on
Value.
2018-12-24 07:46:13 +01:00
eelke
471139ba4d Added getResultNoThrow as the AsyncDBCOnnection doesn't like exceptions. 2018-12-23 12:39:53 +01:00
eelke
a88af1ac11 Improved connection error handling.
Just returning a boolean is too limiting. Using expection instead to easily pass on error message.
2018-12-23 08:43:43 +01:00
eelke
62c6ad5bfb Improved support from removing rows in crud tabs.
It can handle now complex selections and reports back errors encountered
when removing the rows fails.
2018-12-15 11:24:58 +01:00
eelke
e32c82ac6f Created Pgsql::Transaction class for handling of transactions. It auto rollsback if no commit has been done.
Also moved some code out of the connection files to their own files.
2018-12-09 20:24:11 +01:00
eelke
d8fc14c823 Added mapping of char to db oids. 2018-11-17 19:37:02 +01:00
eelke
3b8d0e40c4 Commented out code removed 2018-11-17 19:36:32 +01:00
eelke
e23164c98c Pgsql::Col has now stream operator overload for boost::container::small_vector 2018-11-17 19:36:12 +01:00
eelke
f40b9e4c84 Fix: the stream operator for values to optionals crashed 2018-11-17 19:32:55 +01:00
eelke
6313a5a918 Made behaviour of getAsArray versions and getAsVector more consistent.
The version `void getAsArray(I insert_iter, NullHandling nullhandling = NullHandling::Throw) const`
used the nullhandling param to also throw an error when the whole array is NULL however as
empty arrays are often saved as NULL values and the distinction is often not important
I decided that behaviour was more annoying then useful. You can easily use null() if the
distinction is important.

getAsArrayOfOptional and getAsVector completely forgot to check for NULL value
getAsVector also didn't test for empty strings which appears to be possible
2018-11-17 19:25:57 +01:00
eelke
cfc218c43b Added to functions to Pgsql::Result to help in doing smart things based on a result.
- ftable, return from which table the column in the result originates
- ftableCol, returns the column number within that table (attnum)
Ofcourse columns can also be expressions in which case these functions return InvalidOid and 0.
2018-11-10 11:36:35 +01:00
eelke
e36924c087 Passwords are now saved in a password manager.
The password manager uses strong encryption using a key derived from the passphrase using
scrypt key strengthening algorithm. This ensures encryption is performed using a strong key
and that brute forcing the passphrase is time consuming.

If the user loses his passphrase no recovery is possible.
2018-11-08 21:50:49 +01:00
eelke
2a75e86102 Added listing of triggers for selected table (not completely finished).
Used slightly different approach. This tab is fully build in source code
using subclasses to adjust behaviour of widgets for reuse in the other tabs.
Uses custom proxy model for filtering triggers for correct table and supporting
out of the box sorting by QTableView.

SqlCodePreview: QPlainTextEditor which sql highlighter and in readonly mode but allows copy.
2018-10-07 19:40:06 +02:00
eelke
0ba632afd1 The getAsArray variation that uses a default value for NULL elements crashed when the
array value itself was NULL.

Choosen to return without error adding zero elements to the list. If you really need strict NULL handling do this
using the other functions possibly checking for null before hand to choose other code path.
2018-09-19 08:45:01 +02:00
eelke
e4ccd93b09 Better support for boost::optional in database layer. 2018-09-19 08:25:23 +02:00
eelke
780d912cd1 Adjusted project files for new boost version.
This should be handled differently the location of boost should not be baked into the project files.
2018-09-18 20:24:54 +02:00
eelke
8f4845d4d2 Lot of code for generating code. Working on unit tests. 2018-09-09 21:04:23 +02:00
Eelke Klein
8b7bbec807 Flexible models 2018-09-02 10:30:30 +00:00
eelke
47ee1857cd Added a gutter and currentline highlighting to the SQL editor.
Currently gutter only shows linenumbers. Code is mostly from http://doc.qt.io/qt-5/qtwidgets-widgets-codeeditor-example.html

There is a little bit included in this commit from a first try to make toobars adept to the current tab.

Code #2
2018-04-08 09:19:32 +02:00
eelke
8c20bd6a02 Added delete support to the CRUD system. 2018-04-08 09:03:03 +02:00
eelke
628c16e2f4 Updating rows kinda works.
Blocking calls are still used.
2018-02-18 07:15:43 +01:00
eelke
d626c19e14 Basic support for update in Crud implementation, error reporting and transfering data to modified set is still missing. 2018-02-05 21:42:54 +01:00
eelke
97d4e2a1a4 Created IndexModel for displaying the indexes on a table. Constraints can now show the SQL to drop and create them.
The keyword list is now directly based of the official keyword list from postgresql.
2018-01-06 21:22:22 +01:00
eelke
a06c752029 Misc minor changes. 2017-12-28 09:20:42 +01:00
eelke
36e5526f5f Some stuff I had on another machine and which might provide useful. 2017-12-28 07:29:07 +01:00
eelke
a76686acfd Changed operator << for Value to explicitly call the conversion operators.
The static_cast route caused it to compile streaming into a vector but actually
generated code that would fail at runtime. This new version won't compile when the left hand
is a vector.
2017-12-20 22:07:20 +01:00