52 Commits

Author SHA1 Message Date
Matthias Kuhn
83f9e81e95 [travis] Less noise for DB initialisation 2017-10-07 14:21:13 +02:00
Matthias Kuhn
ae9f263e96
Create test postgres database with UTF-8 2017-09-28 13:22:37 +02:00
Denis Rouzaud
4600ce5891
some fixes 2017-09-28 13:18:27 +02: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
Sandro Santilli
7af47c2afa Add a raster table to the test postgis setup, use it from dbmanager test 2017-06-06 09:51:30 +02:00
Matthias Kuhn
e7e73bafcf Add test for postgres boolean 2017-04-10 22:47:41 +02:00
Matthias Kuhn
56b4976225 Make test database setup more quiet 2017-03-04 16:02:57 +01: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
abc55f4c42 Add support for arrays in PostgresQL
Fix parsing of PostgresQL hstore. Had problems when the key or values were
containing comas.
2016-09-12 10:33:00 +02:00
Patrick Valsecchi
3d6e7c8bdb Add hstore support to the postgres provider 2016-09-08 09:51:46 +02: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
f9d839fac5 [oracle] Fix handling of date/time types
Also add test for Oracle default values

On behalf of Faunalia, sponsored by ENEL
2016-07-07 22:17:45 +10:00
Nyall Dawson
38e65c3f75 [oracle] Implement provider test suite
On behalf of Faunalia, sponsored by ENEL
2016-07-06 16:35:58 +10:00
Nyall Dawson
ccc67ef7a5 Rename attributes support for postgres provider 2016-06-02 17:09:45 +10:00
Patrick Valsecchi
e79a327ab7 WMS GetCapabilities: override parent's style if they have the same name
When there is a layer group with several sub-layers, the group has a
"default" style and the sub-layers each have a "default" layer. QGIS
was showing two "default" styles for the sub-layers, which would be
confusing to the user and could pick the wrong legend for the
sub-layer if the user picked the wrong entry (the first one).

Had to create a static lib for wmsprovider in order to unittest it.
2016-05-29 12:47:57 +02: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
David Adler
5fe19c5f15 merged DB2 updates
[FEATURE] New vector data provider for DB2 sources
2016-04-04 07:55:50 +10:00
Nyall Dawson
527fe9d234 Fix mssql provider test data 2016-03-03 10:31:59 +11: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
Sandro Santilli
cdf05acac8 Add script to create and initialize postgis test database 2016-02-17 11:08:18 +01:00
Nyall Dawson
0a64c16e98 Add polygon test for mssql provider 2016-02-03 08:38:00 +11: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
49e45675ee Correct handling of date and time values in mssql provider 2016-01-30 08:33:09 +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
Matthias Kuhn
b855b0f7b3 Fix csv test dataset 2015-12-18 18:38:19 +01:00
Nyall Dawson
8602a91a1d Add provider test for mssql 2015-12-11 07:14:03 +11:00
Nyall Dawson
89b9b67974 Handle type conversion failures for compiled expressions 2015-12-10 20:49:17 +11:00
Nyall Dawson
038646170f Fix spatialite provider test data (was missing primary key) 2015-12-10 16:18:30 +11:00
Alessandro Pasotti
0287daf8ab Merge pull request #2555 from elpaso/bugfix-pg-inherits
Additional tests for tables with inherits
2015-12-09 12:03:59 +01:00
Matthias Kuhn
be01b7eec5 [FEATURE] Add N:M relation editing possibilities
This adds the possibility to manage data on a normalized relational
database in N:M relations. On the relation editor in a form, the tools
to add, delete, link and unlink work (also) on the linking table if a
relation is visualized as N:M relation.

Configuration is done through the fields tab where on the relation a
second relation can be chosen (if there is a suitable relation in terms
of a second relation on the linking table).

Limitations
===========

QGIS is not a database management system.

It is based on assumptions about the underlying database system. In
particular it expects

 * A `ON DELETE CASCADE` or similar measure on the second relation
 * Does not take care of setting the primary key when adding features.
   Either users need to be instructed to set them manually or - if it's a
   database derived value - the layers need to be in transaction mode
   (currently only activatable through the API)
2015-12-08 15:49:01 +01:00
elpaso
96789f378e Added tests with use estimated metadata 2015-12-08 11:30:32 +01:00
elpaso
614db66129 Added failing test for tables with INHERITS 2015-12-04 17:54:54 +01:00
Nyall Dawson
26f7683cf5 OGR expression compiler fixes
- Allow simple operators as supported by OGR (+, -, * )
- Only return a partial compilation success if expression contains
"column"="column2". Since OGR SQL performs case insensitive
comparisons, we need to double check the result using QGIS'
expressions to ensure that case matches. Add unit tests for this
to provider tests.
2015-11-18 06:30:42 +11:00
Sebastian Dietrich
6ee90c32ec replaced COPY with INSERT INTO 2015-11-15 21:51:33 +01:00
Hugo Mercier
c7aeb774ce PostGIS: Allow to load TIN, PS and Triangle layers
The postgres provider is modified so that layers with
TIN, PolyhedralSurface and Triangle geometries can be loaded.
Geometries are converted to MultiPolygons (and Polygons for Triangles).

The postgres test is completed to cover the loading of different types
of layers
2015-10-21 09:41:49 +02:00
Nyall Dawson
f9917b55c3 Remove expected failure from shapefile provider unique values test
Failure was caused by GDAL bug #6020, which has now been fixed
in GDAL. It turns out the values are only incorrect if the first
feature in the file has a null value, so I've rearranged the
features in the reference shapefile to avoid this.
2015-07-12 19:55:54 +10:00
Nyall Dawson
99150dd39e Add delimited provider to common provider tests, fix records missing
from delimited layers when geometry was null.
2015-06-23 16:35:42 +10:00
Matthias Kuhn
32463d0c15 Postgres provider: test default values are correctly returned 2015-05-23 18:28:30 +02:00