Commit graph

502 commits

Author SHA1 Message Date
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
950fea873c Fix QtCreater error
(msvc accepts it but it is an error according to gcc and clang)
2018-12-15 11:19:32 +01:00
eelke
9e645db1a8 Fixed some small details the analyzer was complaining about. 2018-12-09 21:10:35 +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
255b2ec970 CrudModel::removeRows now works for count > 1
This allows for efficient removal of blocks of rows. If you would remove
row by row the repeated beginRemoveRows and endRemoveRows calls will generate
additional overhead.
2018-12-08 13:55:43 +01:00
eelke
266e479344 fkey field is not set for primary keys.
Caused no problems because it just didn't reserve space. So the only side effect
was slightly reduced performance.
2018-12-08 08:47:02 +01:00
eelke
6c76c70a97 The create table statement now lists the inherited tables and inherited columns are commented out. 2018-12-03 21:03:49 +01:00
eelke
498233d58c WIP: SQL for creating table and related objects 2018-11-30 18:41:38 +01:00
eelke
57217974f4 New column page
Shows SQL for columns ALTER TABLE ... [ADD|DROP] COLUMN combines a selection
of multiple columns into a single alter table.
Show collation in list of columns.

(order of columns isn't what is should be but that should maybe be fixed
by a generic column selection and ordering mechanism that knows what the
default sort should be)
2018-11-29 20:21:36 +01:00
eelke
73c4cf4790 Rework of catalog objects. Several of them are now inheriting from common
base classes that implement common functionality.
2018-11-25 19:45:06 +01:00
eelke
840af1e0a9 WIP: Added page showing list of functions.
Only list is shown, still working on details.
2018-11-25 09:06:01 +01:00
eelke
7db859737a Use catalog instead of catalogue consistently 2018-11-25 09:05:01 +01:00
eelke
52011a9842 Updating of detail tabs besides list of tables works correctly again.
Had stopped working because the catalog now behaves a little different,
returning nullptr instead of an invalid element.
2018-11-18 20:24:27 +01:00
eelke
fcb191f2cc Overview of triggers extended with function name and arguments.
Did a lot of refactoring on the catalog to keep things clean.
2018-11-18 19:30:45 +01:00
eelke
35813ae926 Added pg_proc table to the catalog. Contains the definition of functions.
Also improved the loading code for some catalog tables.
2018-11-17 19:38:07 +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
f2639b9ea5 Link with new builds of botan
We now have seperate debug and release builds.
2018-11-17 19:33:47 +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
791db7dd80 Change default type for generating pgLab code to QString 2018-11-17 10:16:48 +01:00
eelke
104ab5de1e Codegen now supports the database column type in the field template.
This allows for inserting it as a comment which is very useful while
tweaking your typemappings as you can see what the input was.
2018-11-17 10:14:31 +01:00
eelke
be0064f730 The codegen now can properly lookup array types.
Array type lookup failed previously because the typemapping class was
not yet receiving the list of types from the database. Fix was to pass
this data
2018-11-17 09:47:50 +01:00
eelke
287073afdc Added remember option to password dialog.
Made to remember password of password manager for given time but not completely sure
how to implement that yet.
2018-11-15 19:24:29 +01:00
eelke
f432c2aa68 bugfix: editing of table contents didn't work correctly after reloading the data
Was caused by then pending and modified rows list not being reset so they were out
of sync with the data.
2018-11-14 19:17:29 +01:00
eelke
24751f81dd Improved PasswordPromptDialog
- can now also set caption
- can set initial state of save option
- improved size and spacing
2018-11-11 12:30:53 +01:00
eelke
634345b38f In the column list show foreign key constraint 2018-11-10 13:36:36 +01:00
eelke
8836611b62 Replace dubious auto conversion with explicit conversion. 2018-11-10 11:37:17 +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
f629e48a85 Position of error marks is adjusted for selection.
Close: #20
2018-11-10 10:59:52 +01:00
Eelke Klein
b0718258c9 Merge branch 'safely-store-passwords' into 'master'
Safely store passwords

See merge request eelke/pgLab!4
2018-11-10 06:50:10 +00: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
2230a4bd61 Lot of password related changes all over the place.
Password is no longer saved with the connection list.
Password is not entered along with other connection credentials.
Password is now asked for when required.
Still working on saving the password and auto retrieving it from the password manager.
2018-11-04 11:44:40 +01:00
eelke
6b9b602c64 Replaced old PasswordManager code with code using Botan's new PSK_Database
This greatly reduces the amount of encryption related code required. Thought
we still have todo our own key strenthening but this also is easier with Botan::PasswordHash.
2018-11-04 11:24:13 +01:00
eelke
1ae9a1151a All the detail tabs on the TablePage now update when the sort order
of the table list changes.
2018-10-21 13:47:38 +02:00
eelke
d4d8316917 Collection of minor code improvements.
Program should still behave exactly the same.
2018-10-21 13:46:58 +02:00
eelke
38ae5f50e4 Moved code from TablesPage into seperate PropetiesPage component
Clears up the TablePage and makes rhe propertypage reusable.
2018-10-20 10:58:42 +02:00
eelke
b8cfb223be Switch of wordwrap in CodeEditor and SqlCodePreview 2018-10-08 18:43:56 +02:00
eelke
eefcb8fd51 Add (inherited) to tablespace name when table is using the default tablespace set for the database. 2018-10-07 20:57:52 +02: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
446923ebaf Merge branch 'gen-code-for-query'
# Conflicts:
#	pglablib/pglablib.pro
2018-09-23 10:44:28 +02:00
eelke
7c7e72ae14 pg_trigger 2018-09-23 10:43:32 +02:00
Eelke Klein
ae86fef2b4 Merge branch 'gen-code-for-query' into 'master'
Gen code for query

See merge request eelke/pgLab!3
2018-09-23 08:38:07 +00:00
Eelke Klein
bab75d1671 Merge branch 'cherry-pick-da45929b' into 'master'
Fix SqlLexer test

See merge request eelke/pgLab!2
2018-09-21 09:43:46 +00:00
eelke
5a2e28b6d9 Fix SqlLexer test
(cherry picked from commit da45929b12)
2018-09-21 09:43:23 +00:00
eelke
092ed67d5e Working on generating string literals for inclusion in generated code. 2018-09-21 11:41:20 +02:00
eelke
0c3bb27e58 Further improvements to codegeneration the defaultcpp config is now called the PgLab
config as it is very specific to the PgLab codebase.

More hard programmed templates moved out of codebuilder to the language config.
2018-09-19 09:55:43 +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
8d3bddfa1e Moved implementations from header to cpp. 2018-09-19 08:25:58 +02:00