Compare commits

...
Author SHA1 Message Date
Rafa de la Torre 439f604a04 Merge pull request #334 from CartoDB/fix-cannot-find-geometry
Add cartodb to the search path
2016-12-29 12:43:34 +01:00
Rafa de la Torre 9791a5bada Add cartodb to the search path
See
https://github.com/CartoDB/dataservices-api/issues/324#issuecomment-269614566
2016-12-29 12:11:00 +01:00
Javier Goizueta 629555e193 Generate release 0.14.1
This release cantains no actual code changes, only the
use of search_path at the top of the install/migrate scripts
2016-12-21 11:40:55 +01:00
Javier Goizueta af993fde55 Merge branch 'development'
Bring in the setting of the search_path in the client SQL scripts
2016-12-21 11:16:29 +01:00
Javier Goizueta 4be6c9f31d Merge pull request #330 from CartoDB/324-search-path
Set search path before installing/update the extension
2016-12-21 10:47:08 +01:00
Javier Goizueta ed1386d571 Merge branch 'development' 2016-12-20 16:43:42 +01:00
Javier Goizueta 18df3368ef Set search path before installing/update the extension
See #324
2016-12-20 12:57:40 +01:00
Rafa de la Torre 6e134d1ea6 Update exception_safe.md 2016-12-15 19:10:18 +01:00
Rafa de la Torre 59ae4a5492 Merge pull request #325 from CartoDB/exception-safe-doc
Add Exception-safe documentaion
2016-12-15 19:06:37 +01:00
Javier Goizueta b3e67afd92 Add internal documentaion about exception-safe functions 2016-12-15 19:03:12 +01:00
Rafa de la Torre 5b8fd70bdd Merge remote-tracking branch 'origin/development' 2016-12-14 17:23:09 +01:00
Javier Goizueta 55a467f2df Merge branch 'development'
merge python 0.12.3 release
2016-12-13 18:13:14 +01:00
Rafa de la Torre 0adb5164d7 Update README.md
Add a bit about versioning stuff
2016-12-12 17:54:02 +01:00
Rafa de la Torre 147e0ab567 Update README.md
Remove misleading paragraph about `requirements.txt` and `setup.py` dependencies. Refer to https://packaging.python.org/requirements/ for an authoritative discussion.
2016-12-12 17:42:46 +01:00
11 changed files with 3830 additions and 3 deletions
@@ -0,0 +1,9 @@
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.14.1'" to load this file. \quit
-- Make sure we have a sane search path to create/update the extension
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
-- This release introduces no changes other than the use of
-- search path in the install and migration scripts
@@ -0,0 +1,9 @@
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.14.0'" to load this file. \quit
-- Make sure we have a sane search path to create/update the extension
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
-- This release introduces no changes other than the use of
-- search path in the install and migration scripts
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
comment = 'CartoDB dataservices client API extension' comment = 'CartoDB dataservices client API extension'
default_version = '0.14.0' default_version = '0.14.1'
requires = 'plproxy, cartodb' requires = 'plproxy, cartodb'
superuser = true superuser = true
schema = cdb_dataservices_client schema = cdb_dataservices_client
+3
View File
@@ -1,3 +1,6 @@
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES --DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION -- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION cdb_dataservices_client" to load this file. \quit \echo Use "CREATE EXTENSION cdb_dataservices_client" to load this file. \quit
-- Make sure we have a sane search path to create/update the extension
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
+3
View File
@@ -2,4 +2,7 @@
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION -- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '<%= version %>'" to load this file. \quit \echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '<%= version %>'" to load this file. \quit
-- Make sure we have a sane search path to create/update the extension
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
-- HERE goes your code to upgrade/downgrade -- HERE goes your code to upgrade/downgrade
+36
View File
@@ -0,0 +1,36 @@
# Exception-Safe functions
The public API dataservices functions emit exceptions in general when an error occurs
or a limiting condition is met (e.g. quotas are exceeded).
For each public function `func` we have a internal function named `_func_exception_safe` which
acts as a wrapper to the public function, with the same signature, but captures
exceptions generated during its execution (except those due to incomplete configuration or
authentication issues) and returns NULL or empty set values in those cases.
Please note these functions are considered **not public** and therefore their API (including which exceptions are wrapped and which ones are not) may change.
Instead of raising an exception they raise warnings, hopefully containing the same information of the original exception.
## Intended Use
These functions are useful in cases when it is undesirable to rollback a transaction.
Fo example if a table is geocoded with:
```sql
UPDATE table SET the_geom=cdb_geocode_street_point(user,NULL,address,city,NULL,country);
```
In case of the user geocoding quota being exhausted mid-process, the user could
incur in external service expenses but any geocoded data would be lost due to the
transaction rollback.
We can avoid the problem using the corresponding exception-safe function:
```sql
UPDATE table SET the_geom=_cdb_geocode_street_point_exception_safe(user,NULL,address,city,NULL,country);
```
# Addition Information
See https://github.com/CartoDB/dataservices-api/issues/314 for more information.
+4 -2
View File
@@ -46,5 +46,7 @@ cd $(git rev-parse --show-toplevel)/test
python run_tests.py --host=$YOUR_HOST $YOUR_USERNAME $YOUR_API_KEY python run_tests.py --host=$YOUR_HOST $YOUR_USERNAME $YOUR_API_KEY
``` ```
## TODO ## Versioning
- Move dependencies expressed in `requirements.txt` to `setup.py` Once you're satisfied with your changes, it is time to bump the version number in the `setup.py`. A couple of rules:
- **Backwards compatibility**: in general all changes shall be backwards compatible. Do not remove any code used from the server public `pl/python` functions or you'll run into problems when deploying.
- **Semantic versioning**: we try to stick to [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html)