diff --git a/README.rst b/README.rst index 46cc410..279b3c1 100644 --- a/README.rst +++ b/README.rst @@ -128,14 +128,14 @@ Resources DB-API 2.0: http://www.python.org/dev/peps/pep-0249/ -NuoDB Documentation: http://doc.nuodb.com/display/DOC/Getting+Started +NuoDB Documentation: http://doc.nuodb.com/display/DOC/NuoDB+Online+Documentation License ------- PyNuoDB is licensed under a `BSD 3-Clause License `_. -.. _Documentation: http://doc.nuodb.com/display/DOC/Getting+Started +.. _Documentation: http://doc.nuodb.com/display/doc/ .. _NuoDB: http://www.nuodb.com/ .. _CPython: http://www.python.org/ .. _PEP 249: https://www.python.org/dev/peps/pep-0249/ diff --git a/pynuodb/__init__.py b/pynuodb/__init__.py index 41b6510..601c2c9 100644 --- a/pynuodb/__init__.py +++ b/pynuodb/__init__.py @@ -1,4 +1,4 @@ -__version__ = '2.2' +__version__ = '2.3' from .connection import * from .datatype import * diff --git a/pynuodb/datatype.py b/pynuodb/datatype.py index c9b40ae..abddb74 100644 --- a/pynuodb/datatype.py +++ b/pynuodb/datatype.py @@ -121,6 +121,7 @@ def __cmp__(self, other): "double precision":NUMBER, "date":DATETIME, "timestamp":DATETIME, + "datetime":DATETIME, "time":DATETIME, "clob":BINARY, "blob":BINARY, diff --git a/pynuodb/exception.py b/pynuodb/exception.py index 18189c3..e1497d2 100644 --- a/pynuodb/exception.py +++ b/pynuodb/exception.py @@ -89,8 +89,8 @@ def db_error_handler(error_code, error_string): raise DataError(error_code_string + ': ' + error_string) elif error_code in protocol.OPERATIONAL_ERRORS: raise OperationalError(error_code_string + ': ' + error_string) - # elif errorCode in []: - # raise IntegrityError(error_code_string + ': ' + errorString) + elif error_code in protocol.INTEGRITY_ERRORS: + raise IntegrityError(error_code_string + ': ' + error_string) elif error_code in protocol.INTERNAL_ERRORS: raise InternalError(error_code_string + ': ' + error_string) elif error_code in protocol.PROGRAMMING_ERRORS: diff --git a/pynuodb/protocol.py b/pynuodb/protocol.py index 77c01b2..8ebead2 100644 --- a/pynuodb/protocol.py +++ b/pynuodb/protocol.py @@ -252,6 +252,8 @@ DEADLOCK, IS_SHUTDOWN} +INTEGRITY_ERRORS = {UNIQUE_DUPLICATE} + PROGRAMMING_ERRORS = {SYNTAX_ERROR, CONNECTION_ERROR, APPLICATION_ERROR,