# Path: web/py3helpers.py



import datetime
import os
import re
import time
    import urlparse
    import ast
    import sys
            import DBUtils  # noqa, flake8 F401
            import psycopg2.extensions
            import kinterbasdb as db
        import pymssql as db
        import cx_Oracle as db
    import doctest
from .py3helpers import iteritems
from .utils import iters, safestr, safeunicode, storage, threadeddict
    from urllib import parse as urlparse
    from urllib.parse import unquote
    from urllib import unquote
    from .webapi import debug, config
            from DBUtils import PooledDB
            def do_commit(self):
                ctx.commit()

            def do_rollback(self):
                ctx.rollback()

        class subtransaction_engine:
            """Transaction Engine used in sub transactions."""

            def query(self, q):
                db_cursor = ctx.db.cursor()
                ctx.db_execute(db_cursor, SQLQuery(q % transaction_count))

            def do_transact(self):
                self.query("SAVEPOINT webpy_sp_%s")

            def do_commit(self):
                self.query("RELEASE SAVEPOINT webpy_sp_%s")

            def do_rollback(self):
                self.query("ROLLBACK TO SAVEPOINT webpy_sp_%s")

        class dummy_engine:
            """Transaction Engine used instead of subtransaction_engine
            when sub transactions are not supported."""

            do_transact = do_commit = do_rollback = lambda self: None

        if self.transaction_count:
            # nested transactions are not supported in some databases

# Path: web/py3helpers.py



# Path: web/db.py
import datetime
import os
import re
import time
    import urlparse
    import ast
    import sys
            import DBUtils  # noqa, flake8 F401
            import psycopg2.extensions
            import kinterbasdb as db
        import pymssql as db
        import cx_Oracle as db
    import doctest
from .py3helpers import iteritems
from .utils import iters, safestr, safeunicode, storage, threadeddict
    from urllib import parse as urlparse
    from urllib.parse import unquote
    from urllib import unquote
    from .webapi import debug, config
            from DBUtils import PooledDB

            def do_commit(self):
                ctx.commit()

            def do_rollback(self):
                ctx.rollback()

        class subtransaction_engine:
            """Transaction Engine used in sub transactions."""

            def query(self, q):
                db_cursor = ctx.db.cursor()
                ctx.db_execute(db_cursor, SQLQuery(q % transaction_count))

            def do_transact(self):
                self.query("SAVEPOINT webpy_sp_%s")

            def do_commit(self):
                self.query("RELEASE SAVEPOINT webpy_sp_%s")

            def do_rollback(self):
                self.query("ROLLBACK TO SAVEPOINT webpy_sp_%s")

        class dummy_engine:
            """Transaction Engine used instead of subtransaction_engine
            when sub transactions are not supported."""

            do_transact = do_commit = do_rollback = lambda self: None

        if self.transaction_count:
            # nested transactions are not supported in some databases

            if self.ctx.get("ignore_nested_transactions"):