36 Commits

Author SHA1 Message Date
Alessandro Pasotti
f7d1971d01 PG views: be tolerant for unsupported field type ...
... if it's in URI key

Fixes #31799
2019-09-17 14:30:33 +02:00
Sandro Santilli
ffad801fad Add test for custom bbox in postgresql provider
See #18107
2019-08-29 17:47:25 +02:00
Alessandro Pasotti
a3c4eb9947
Providers connections interface API
This is the implementation of the new DB connections API (grant proposal 2019).
Summary

The new API makes it available to QGIS core a new interface for provider connections and will allow to:

    replace the provider specific QgsSettings management in QGIS4 (save/load connections from the settings) NOT IN SCOPE FOR NOW.
    provide a unified API for common operations on DB connections:
        executeSql and get the results
        list tables names and properties and schemas
        create a new vector table (no rasters for now)
        create/rename/drop schemas and tables
        vacuum
       ....
2019-08-16 20:44:05 +02:00
Nyall Dawson
1164d204ee [postgres] Unit tests for citext field type 2019-07-02 06:17:37 +10:00
Nyall Dawson
aa1bc5d1f9 [needs-docs][postgres] Correctly handle binary (bytea) fields
Previously these would be silently dropped from the layers, but
we now have comprehensive support for binary fields and should
expose them.

Fix sponsored by WhereGroup
2019-07-02 06:17:37 +10:00
Alessandro Pasotti
a4187a7a6e Tests for case sensistive pg schema 2019-05-22 18:16:43 +02:00
Alessandro Pasotti
da49f79045 Suggestions from JEF 2019-04-26 12:32:42 +02:00
Alessandro Pasotti
a3368d416c Layout and SQL 2019-04-26 10:26:04 +02:00
Alessandro Pasotti
163082a061 More tests for checkPrimaryKeyUnicity 2019-04-26 09:19:51 +02:00
Alessandro Pasotti
38c91e4e97 [postgres] Fix checkPrimaryKeyUnicity option
This provider option was linked to the project level option
"Trust layer metadata..." which was implemented
to speed up loading of large dataset by trusting extent
read from metadata to avoid costly operations to determine
the layer extent.

Check PK unicity on the other hand has only effect on views
and query layers and it is useful as an independent
option to prevent loading of layers that have no PK (or the
wrong one).

But the operation of determine unicity of a values in a column
can also be costly, so better to get control back to the user.

Legacy default is preserved (the project-level "Trust..." option).

Fixes #21839

Funded by RAAB.nl
2019-04-24 17:14:42 +02:00
Juergen E. Fischer
f8e32f7b9e unit test for 2826ba34f 2019-04-07 15:35:43 +02:00
Tudor Bărăscu
27b417004b Add GetFeature test with array layer
Also added the missing response xmls (forgot to add them
in previous commits)
2018-04-11 15:31:14 +03:00
Nyall Dawson
feb20a7a27 Add unit test for postgres layer metadata 2018-03-15 10:43:04 +11:00
Blottiere Paul
aed6608095 Add test 2018-01-29 07:17:33 +00:00
Martin Dobias
ccd98f5d6c Added test 2018-01-17 15:38:27 +01:00
Denis Rouzaud
531dadf682
fix psql 2017-09-28 13:18:26 +02:00
Blottiere Paul
4a084bf961 Add tests 2017-09-06 14:46:37 +01:00
Matthias Kuhn
e7e73bafcf Add test for postgres boolean 2017-04-10 22:47:41 +02:00
Matthias Kuhn
dbbf062e5d Fix bindings and tests 2016-12-20 01:20:08 +01:00
Matthias Kuhn
930ce545a8 Fix failing tests 2016-12-20 01:20:08 +01:00
Nyall Dawson
d1fd588499 Add method to fetch constraints from a vector data provider
Implemented for unique and not null constraints for postgres
provider
2016-11-02 11:07:07 +10:00
Patrick Valsecchi
7169079f91 Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle
a widget.

Additionaly, plugins can be added to choose a widget factory in function
of an external information. One of them uses a table in PostgresQL to
allow specification of the widget type and configuration.

I took the opportunity to remove a few deprecated method in relation to
this.
2016-09-05 14:22:17 +02:00
Matthias Kuhn
a529b448e7 Revert "Merge pull request #3338 from pvalsecc/editor_widgets_selection"
This reverts commit bbafbf48872eda48a2be8876cc89a0770552c6ad, reversing
changes made to 13ac0434e10fc7edd1eca665ea7c8b6cb5fd212d.
2016-08-29 19:22:04 +02:00
Patrick Valsecchi
24bde35ce6 Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle
a widget.

Additionaly, plugins can be added to choose a widget factory in function
of an external information. One of them uses a table in PostgresQL to
allow specification of the widget type and configuration.

I took the opportunity to remove a few deprecated method in relation to
this.
2016-08-29 07:42:50 +02:00
Denis Rouzaud
ea4e5cb7c0 additional fields should be placed at the end 2016-08-15 10:48:39 +02:00
Nyall Dawson
c2a232848c Add provider test for postgres with compound key 2016-08-15 10:48:33 +02:00
Nyall Dawson
ccc67ef7a5 Rename attributes support for postgres provider 2016-06-02 17:09:45 +10:00
Nyall Dawson
fdd68963c7 [postgres] Improved handling of DOMAIN type fields
- show correct domain type as field type name
- correctly determine length and precision of domain types
- expose bpchar field type as 'character' to users, as postgres only
uses 'bpchar' internally and refers to bpchar as character in the
front end
2016-04-22 17:37:51 +10:00
Matthias Kuhn
a6a77ee46b Remove remainders of buggy pg test 2016-04-07 22:51:43 +02:00
Matthias Kuhn
5cd2319c3f Also retrieve generated values for pktInt 2016-04-07 21:26:43 +02:00
Matthias Kuhn
eecd77a324 Fix postgres unit test 2016-04-07 21:24:01 +02:00
Matthias Kuhn
e98e16f1b2 Unit test for 4ec97c33 2016-04-07 15:59:22 +02:00
Sandro Santilli
034b5c0be5 Make PG initialization scripts work with PostgreSQL 9.1
- Remove lock_timeout setting
   See https://travis-ci.org/qgis/QGIS/jobs/109844438#L942

 - Remove CREATE SCHEMA IF NOT EXISTS
   See https://travis-ci.org/qgis/QGIS/jobs/109891682#L1016
2016-02-17 18:13:45 +01:00
Nyall Dawson
96d8986b9f Add polygon layers to provider tests, so we can test ExactIntersect
feature requests
2016-01-31 20:42:11 +11:00
Nyall Dawson
7dc5eac8bd Improve handling of time values in attributes
- make QgsVectorFileWriter respect QTime field values and only
convert to string if required by output format
- list time types as native types for memory, postgres and OGR
providers (OGR support depends on file format)
2016-01-28 22:14:25 +11:00
Denis Rouzaud
13ccf70e1a test vector join: add PostgreSQL provider 2016-01-20 12:00:46 +01:00