Skip to content

Commit

Permalink
Update __init__ for Commented line paulc#4
Browse files Browse the repository at this point in the history
Removing commented line
  • Loading branch information
jmrenouard committed Oct 15, 2019
1 parent fada1b1 commit 2ef150a
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions pgwrap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

#from .db import connection
from .db import connection

version = "0.8.1"
__doc__ = """
Expand All @@ -13,17 +12,17 @@
This is not intended to provide ORM-like functionality, just to make it
easier to interact with PostgreSQL from python code for simple use-cases
and allow direct SQL access for more complex operations.
The module wraps the excellent 'psycopg2' library and most of the
The module wraps the excellent 'psycopg2' library and most of the
functionality is provided by this behind the scenes.
The module provides:
* Simplified handling of connections/cursor
* Connection pool (provided by psycopg2.pool)
* Cursor context handler
* Python API to wrap basic SQL functionality
* Simple select,update,delete,join methods extending the cursor
* Cursor context handler
* Python API to wrap basic SQL functionality
* Simple select,update,delete,join methods extending the cursor
context handler (also available as stand-alone methods which
create an implicit cursor for simple queries)
* Query results as dict (using psycopg2.extras.DictCursor)
Expand Down Expand Up @@ -77,7 +76,7 @@
[['PostgreSQL...']]
The cursor context provides the following basic methods:
execute - execute SQL query and return rowcount
query - execute SQL query and fetch results
query_one - execute SQL query and fetch first result
Expand Down Expand Up @@ -107,15 +106,15 @@
update - SQL update
delete - SQL delete
The methods can be parameterised to customise the associated query
(see db module for detail):
The methods can be parameterised to customise the associated query
(see db module for detail):
where - 'where' clause as dict (column operators can be
specified using the colunm__operator format)
where - 'where' clause as dict (column operators can be
specified using the colunm__operator format)
where = {'name':'abc','status__in':(1,2,3)}
columns - list of columns to be returned - these can
columns - list of columns to be returned - these can
be real columns or expressions. If spefified
as a tuple the column is explicitly named
using the AS operator
Expand All @@ -137,7 +136,7 @@
returning - columns to return (string)
The methods are also available as standalone functions which create an
The methods are also available as standalone functions which create an
implicit cursor object.
Basic usage:
Expand Down Expand Up @@ -175,11 +174,11 @@
Prepared statements can be created using the
connection.prepare(stmt,params,name,call_type)
connection.prepare(stmt,params,name,call_type)
stmt : prepared statement (with parameters identified
stmt : prepared statement (with parameters identified
in the statement using the psql $1,$2... notation)
params : list of optional parameter types (usually not
params : list of optional parameter types (usually not
needed - infered by psql)
name : name for the prepared statement (usually
autogenerated)
Expand Down Expand Up @@ -214,7 +213,7 @@
instance of logging.Logger or a file-like object (supporting the write
method).
The log message is generated using the self.logf function (called with
The log message is generated using the self.logf function (called with
the cursor object as a parameter). By default this just returns the
query string however can be customised as needed. A cursor.timestamp
attribute is available to allow execution time to be tracked.
Expand All @@ -230,7 +229,7 @@
* 0.1 19-10-2012 Initial import
* 0.2 20-10-2012 Remove psycopg2 dep in setup.py
* 0.3 20-10-2012 Remove hstore default for cursor
* 0.4 21-10-2012 Add logging support
* 0.4 21-10-2012 Add logging support
* 0.5 22-12-2012 Refactor connection class / remove globals
* 0.6 23-12-2012 Add support for prepared statements
* 0.7 26-12-2012 Add callable prepared statements & named cursor
Expand Down

0 comments on commit 2ef150a

Please sign in to comment.