Commit graph

144 commits

Author SHA1 Message Date
eelke
5f2857f12a Fix crashes from accessing invalid pointers. 2019-11-02 14:28:48 +01:00
eelke
ead3ce8a8a Show view definition 2019-10-26 13:13:58 +02:00
eelke
60d8f36328 poc Add support for reloading the catalog
Reload works and the column page reacts correctly. Others to be checked
and fixed.
2019-10-06 13:52:45 +02:00
eelke
83122e89df fix: comparison that should have been assignment
Didn't cause any bugs because the state was not used after that point
however it would have cause issues when that changed later.
2019-10-06 09:39:11 +02:00
eelke
4ea388cad7 Merge branch 'master' of ssh://git@gitlab.com:/eelke/pgLab.git 2019-10-06 09:34:45 +02:00
eelke
09d5461d01 Seperate event types in the trigger definition with OR 2019-10-05 08:55:02 +02:00
eelke
082293e58a Switched ConnectionConfig to QString from std::string to fit better into Qt framework 2019-09-16 19:24:39 +02:00
eelke
bcfd82c27d Fix crash when starting to add connection.
Caused by uninitialized variable. Commit contains some minor style fixes also.
2019-09-02 16:33:13 +02:00
eelke
d489f11e52 Store encrypted passwords with connections.
Closes #22 as encrypted password is now deleted as part of the connection record.
2019-09-01 14:07:58 +02:00
eelke
b3a98f6dc0 Most of functionality for connections in tree works now. Old list largely removed. 2019-08-27 20:12:00 +02:00
eelke
8840d3bcbb Basic version of ConnectionTreeModel is working. 2019-08-25 15:33:51 +02:00
eelke
b09e8a6d4b ConnectionManager overhaul
- connection settings are now changed by seperate component currently called in a seperate window
- old settings pane on the right of the connections had been removed
- new edit config button added between new connection and remove connection
2019-08-24 20:47:32 +02:00
eelke
b939916b07 Fix incorrect ALTER TABLE statement for columns in the instepctor.
Was caused by incorrect condition for determining the use of IDENTITY.
2019-08-19 19:44:07 +02:00
eelke
48ac8c6bab Improved generation of c/cpp string from query
Extra lines before and after query are removed. Whitespace at end of line
is removed. SQL comments are converted to cpp style comments and are outside
the string literal.

To achieve this the function now uses the SQLLexer to know what is comment.
This also required the additional capability in the lexer to also return whitespace and newline tokens.
Also a few bugs in the lexer were fixed.
2019-08-19 13:52:23 +02:00
eelke
fbd630489e Added paste lang option for pasting programming code.
Expects you to paste only string literals with possible concatenation operators like . or +
2019-08-19 11:38:04 +02:00
eelke
5494e5076b Don't read relhasoids on version 12. Also don't try to select data we are not allowed to read. 2019-08-10 18:12:26 +02:00
eelke
86cdcbe06a Don't read protransform, we are not using it and version 12 doesn't have it. 2019-08-10 18:10:19 +02:00
eelke
2ceea4b577 Don't read consrc we are not using it and version 12 doesn't have it. 2019-08-10 18:09:14 +02:00
eelke
70b842597c Read from pg_roles as only superusers can read pg_authid
Contents is same except password is masked. Password does not seem very important to view as it is encrypted anyway.

Close #53
2019-08-10 14:18:01 +02:00
eelke
d7763e83bf More projects fixes. 2019-03-27 18:50:58 +01:00
eelke
f2808de613 Sequence and Function pages are now properly filtered on namespace. 2019-02-09 20:37:34 +01:00
eelke
b08bd1a315 The trigger SQL now also shows the function definition. 2019-02-09 17:36:37 +01:00
eelke
42432b06a9 Restructuring catalog tabs
- Moved detail tabs of table to their own components
- Table list has become seperate component on seperate tab
- Table list does not use designer anymore
- Moved sequences and functions tabs into the catalog inspector
2019-02-09 11:36:22 +01:00
eelke
f130c426a1 Fix error on pg96 because of wrong minimum version 2019-01-01 11:04:48 +01:00
eelke
f0ffcf4abd TablesTableModel now also shows (materialized) views en foreign tables. 2018-12-29 11:19:12 +01:00
eelke
437736a023 Tab with list of sequences and create sql for selected sequence. 2018-12-28 08:51:02 +01:00
eelke
769307c821 Added the trigger definitions to the sql for a table. Also tuned the formatting of the trigger definitions a bit. 2018-12-27 12:15:37 +01:00
eelke
4ec4e02411 The SQL tab for a table now also shares the grant/revoke statements for that table (but not yet any column level grants). 2018-12-27 12:07:19 +01:00
eelke
93687df959 Removed the acl field from several Pg* classes as the acl is now stored in the PgServerObject base class they inherit from. 2018-12-27 12:05:48 +01:00
eelke
aaa05f64ef PgTablespace now inherits from PgServerObject. 2018-12-25 17:38:13 +01:00
eelke
0b6c1a8544 Make PgAuthId inherit PgServerObject and related changes. 2018-12-25 16:41:44 +01:00
eelke
c2c01cf431 Generic GRANT/REVOKE generation from ACL's complete.
Moved the owned concept to PgServerObject as it is needed for the generic
acl functionality that is also in PgServerObject.
2018-12-25 14:25:15 +01:00
eelke
cc0b28e8e0 No need for PgSPtrContainer to store weak pointer to the catalog when its parent already has a reference to the catalog. 2018-12-24 11:33:24 +01:00
eelke
3f337b2cca Added typeName function to PgObject as it might be useful for building generic functions. 2018-12-24 11:31:56 +01:00
eelke
93c8b49f61 PgServerObject now contains a list of acl's for the object so all the different objects
can use this implementation.
2018-12-24 07:51:27 +01:00
eelke
54d4dfface Improved code generation for functions and procedures.
alter statements for configuration settings
alter statement for owner
2018-12-24 07:41:23 +01:00
eelke
fc58acb252 Added convenience functions to PgLanguage for quickly testing for the standard languages. 2018-12-23 19:43:50 +01:00
eelke
471139ba4d Added getResultNoThrow as the AsyncDBCOnnection doesn't like exceptions. 2018-12-23 12:39:53 +01:00
eelke
43f8117bbd pg11: pg_proc, type of function is stored differently from pg11 forward
Followed the more structured approach of pg11 in combining the different types into a kind field
when reading from older versions we migrate the old fields to the new field. Change in 11
is because of PROCEDURE support. However full PROCEDURE support will be its own change and is
registered as issue #37
2018-12-23 08:48:45 +01:00
eelke
6a2c8ec5e0 Do not use flat_set anymore gives compilation issues.
Not worth the time solving the issue without having prove of a clear benefit of
using flat_set over unordered_set.
2018-12-23 08:41:33 +01:00
eelke
1854a4bdaa Improvements in generated SQL for CREATE FUNCTION 2018-12-22 13:52:19 +01:00
eelke
f692569d27 Added the list of installed language to the catalog. The ProcTableModel now returns the owner name and language name instead of the oids. 2018-12-17 21:51:14 +01:00
eelke
e75b0f1a71 Added CollationModel + factory for editing and added to EditTableWidget 2018-12-16 11:35:39 +01:00
eelke
f0c1035378 Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder
Models go into model
2018-12-16 11:31:33 +01:00
eelke
56cbeea183 Fix: SelectionEditorFactory::setEditorData incorrectly used default DisplayRole with index.data() while it should use the EditRole. 2018-12-16 09:39:43 +01:00
eelke
44358d198a PgType now inherits from PgNamespaceObject and PgOwnedObject 2018-12-16 09:24:27 +01:00
eelke
742fd0a4d3 SelectionEditorFactory + ItemModel + ItemModelFactory combination is working
in new EditTableWidget

(EditTableWidget is very much WIP)
2018-12-15 20:27:40 +01:00
eelke
e44f73166f SelectionEditorFactory for creating combobox selections for use in QTableView.
TypeSelectionItemModelFactory to use the TypeSelectionItemModel with above factory.
2018-12-15 15:28:33 +01:00
eelke
f8d61b61f4 Added capability to create editors from an editor factory to PgLabItemDelegate 2018-12-15 12:11:23 +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