Skip to content

Commit

Permalink
Document escape_bytea properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed May 1, 2020
1 parent 5f70cda commit 0874176
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/contents/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Version 5.2 (to be released)
----------------------------
- We now require Python version 2.7 or 3.5 and newer
- Changes to the classic PyGreSQL module (pg):
- New module level function `get_pqlib_version()` that gets the version
of the pqlib used by PyGreSQL (needs PostgreSQL >= 9.1 on the client).
- New query method `memsize()` that gets the memory size allocated by
the query (needs PostgreSQL >= 12 on the client).
- New module level function `get_pqlib_version()` that gets the version
of the pqlib used by PyGreSQL (needs PostgreSQL >= 9.1 on the client).
- New query method `memsize()` that gets the memory size allocated by
the query (needs PostgreSQL >= 12 on the client).


Version 5.1.2 (2020-04-19)
Expand Down
6 changes: 3 additions & 3 deletions docs/contents/pg/db_wrapper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -851,9 +851,9 @@ properties (such as character encoding).

Escape binary data for use within SQL as type ``bytea``

:param str datastring: string containing the binary data that is to be escaped
:param bytes/str datastring: the binary data that is to be escaped
:returns: the escaped string
:rtype: str
:rtype: bytes/str

Similar to the module function :func:`pg.escape_bytea` with the same name,
but the behavior of this method is adjusted depending on the connection
Expand All @@ -866,7 +866,7 @@ unescape_bytea -- unescape data retrieved from the database

Unescape ``bytea`` data that has been retrieved as text

:param datastring: the ``bytea`` data string that has been retrieved as text
:param str string: the ``bytea`` string that has been retrieved as text
:returns: byte string containing the binary data
:rtype: bytes

Expand Down
7 changes: 4 additions & 3 deletions docs/contents/pg/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,13 @@ escape_bytea -- escape binary data for use within SQL

escape binary data for use within SQL as type ``bytea``

:param str datastring: string containing the binary data that is to be escaped
:param bytes/str datastring: the binary data that is to be escaped
:returns: the escaped string
:rtype: str
:rtype: bytes/str
:raises TypeError: bad argument type, or too many arguments

Escapes binary data for use within an SQL command with the type ``bytea``.
The return value will have the same type as the given *datastring*.
As with :func:`escape_string`, this is only used when inserting data directly
into an SQL command string.

Expand All @@ -320,7 +321,7 @@ unescape_bytea -- unescape data that has been retrieved as text

Unescape ``bytea`` data that has been retrieved as text

:param str datastring: the ``bytea`` data string that has been retrieved as text
:param str string: the ``bytea`` string that has been retrieved as text
:returns: byte string containing the binary data
:rtype: bytes
:raises TypeError: bad argument type, or too many arguments
Expand Down

0 comments on commit 0874176

Please sign in to comment.