# Path: norm/interface.py
# class IAsyncCursor(Interface):
# 
# 
#     def execute(query, params=None):
#         """
#         Execute the given sql and params.
# 
#         Return a C{Deferred} which will fire with the DB-API results.
#         """
# 
# 
#     def fetchone():
#         pass
# 
# 
#     def fetchall():
#         pass
# 
# 
#     def lastRowId():
#         """
#         Return a C{Deferred} id of the most recently inserted row.
#         """
# 
# 
#     def close():
#         pass
# 
# Path: norm/postgres.py
# def translateSQL(sql):
#     # this is naive
#     return sql.replace('?', '%s')


from zope.interface import implements
from txpostgres import txpostgres
from norm.interface import IAsyncCursor
from norm.postgres import translateSQL
import psycopg2.extras
# Copyright (c) Matt Haggard.
# See LICENSE for details.





class TxPostgresCursor(txpostgres.Cursor):


    implements(IAsyncCursor)


    def execute(self, sql, params=()):

# Path: norm/interface.py
# class IAsyncCursor(Interface):
# 
# 
#     def execute(query, params=None):
#         """
#         Execute the given sql and params.
# 
#         Return a C{Deferred} which will fire with the DB-API results.
#         """
# 
# 
#     def fetchone():
#         pass
# 
# 
#     def fetchall():
#         pass
# 
# 
#     def lastRowId():
#         """
#         Return a C{Deferred} id of the most recently inserted row.
#         """
# 
# 
#     def close():
#         pass
# 
# Path: norm/postgres.py
# def translateSQL(sql):
#     # this is naive
#     return sql.replace('?', '%s')


# Path: norm/tx_postgres.py
from zope.interface import implements
from txpostgres import txpostgres
from norm.interface import IAsyncCursor
from norm.postgres import translateSQL
import psycopg2.extras

# Copyright (c) Matt Haggard.
# See LICENSE for details.





class TxPostgresCursor(txpostgres.Cursor):


    implements(IAsyncCursor)


    def execute(self, sql, params=()):

        sql = translateSQL(sql)