Commit graph

40 commits

Author SHA1 Message Date
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
eelke
d1114793a1 Fixed missing comman in pg_class query.
Added checks on row and column indexes in Pgsql::Result to detect these kind of problems earlier in the future.
2017-12-17 20:28:02 +01:00
eelke
db75d9ed50 More flexible array retrieval + *vector support. 2017-12-17 11:27:42 +01:00
eelke
d9854d81fa Improved error checking in Value + more to array conversion control. 2017-12-17 09:06:18 +01:00
eelke
1fe7d3c56d . 2017-12-16 21:43:51 +01:00
eelke
2ad4a2601f Value::getAsArray function to parse array convert to correct type and
uses inserter to fill container.

Unit tests included.
2017-12-16 21:41:16 +01:00
eelke
ec930218cd Implemented ArrayParser and unit tests to verify its working. 2017-12-16 10:31:51 +01:00
eelke
e9d72d391d PgAttribute loading + ColummnTableModel
Required enchancement to PgContainer to make multifield key work.
2017-12-12 20:13:53 +01:00
eelke
6466062cc8 pg_classes can be loaded now, used in TablesTableModel for overview of tables in database. 2017-12-10 10:35:46 +01:00
eelke
3a13b7ffb4 Messy commit. Testing suff and some improvements to how data is shown. 2017-12-09 10:45:13 +01:00
eelke
bebb3391c3 Builds on windows again 2017-11-26 13:07:21 +01:00