From: Daniele Varrazzo Date: Tue, 1 Dec 2020 03:29:38 +0000 (+0000) Subject: Fixed links in error docs, uniform DB-API spelling X-Git-Tag: 3.0.dev0~292 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49a689d95d078205b8ca63badaf1f0679990df7f;p=thirdparty%2Fpsycopg.git Fixed links in error docs, uniform DB-API spelling --- diff --git a/docs/errors.rst b/docs/errors.rst index 3c6d8821a..80a3caec3 100644 --- a/docs/errors.rst +++ b/docs/errors.rst @@ -52,12 +52,14 @@ This module exposes objects to represent and examine database errors. .. index:: - single: Exceptions; DB API + single: Exceptions; DB-API -DBAPI exceptions ----------------- +.. _dbapi-exceptions: -In compliance with the DB API, all the exceptions raised by ``psycopg3`` +DB-API exceptions +----------------- + +In compliance with the DB-API, all the exceptions raised by ``psycopg3`` derive from the following classes: .. parsed-literal:: @@ -90,12 +92,15 @@ These classes are also exposed by the ``psycopg3`` module. .. index:: single: Exceptions; PostgreSQL +.. _sqlstate-exceptions: + SQLSTATE exceptions ------------------- Errors coming from a database server (as opposite as ones generated client-side, such as connection failed) usually have a 5-letters error code -called SQLSTATE (available in the ``diag.sqlstate`` attribute). +called SQLSTATE (available in the `~Diagnostic.sqlstate` attribute of +`Error.diag`). ``psycopg3`` exposes a different class for each SQLSTATE value, allowing to write idiomatic error handling code according to specific conditions happening @@ -119,7 +124,7 @@ refer to the table below for all the classes defined. .. __: https://www.postgresql.org/docs/current/errcodes-appendix.html#ERRCODES-TABLE Every exception class is a subclass of one of the :ref:`standard DB-API -exception ` and expose the `~Error` interface. +exception ` and expose the `Error` interface. .. autofunction:: lookup diff --git a/docs/index.rst b/docs/index.rst index 9b460abe2..b3eabb42c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,7 +6,7 @@ Psycopg 3 -- PostgreSQL database adapter for Python programming language. `!psycopg3` presents a familiar interface for everyone who has used -`!psycopg2` or any other `DB API 2.0`__ database adapter, but allows to use +`!psycopg2` or any other `DB-API 2.0`__ database adapter, but allows to use more modern PostgreSQL and Python features, such as: - Strict Strong Typing diff --git a/docs/usage.rst b/docs/usage.rst index d69e4d6bc..ede4a39c8 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -4,7 +4,7 @@ Basic module usage ================== The basic Psycopg usage is common to all the database adapters implementing -the `DB API`__ protocol. Other database adapters, such as the builtin +the `DB-API`__ protocol. Other database adapters, such as the builtin `sqlite3` or `psycopg2`, have roughly the same pattern of interaction.