# Path: eloquent/connectors/connector.py
# class Connector(object):
# 
#     RESERVED_KEYWORDS = [
#         'log_queries', 'driver', 'prefix'
#     ]
# 
#     def get_api(self):
#         raise NotImplementedError()
# 
#     def get_config(self, config):
#         return {x: config[x] for x in config if x not in self.RESERVED_KEYWORDS}
# 
#     def connect(self, config):
#         return self.get_api().connect(**self.get_config(config))


    import psycopg2
    import psycopg2.extras
from .connector import Connector
# -*- coding: utf-8 -*-

try:
except ImportError:
    pass



class PostgresConnector(Connector):

    def connect(self, config):
        connection = self.get_api().connect(
            connection_factory=psycopg2.extras.DictConnection,
            **self.get_config(config)
        )
        connection.autocommit = True


# Path: eloquent/connectors/connector.py
# class Connector(object):
# 
#     RESERVED_KEYWORDS = [
#         'log_queries', 'driver', 'prefix'
#     ]
# 
#     def get_api(self):
#         raise NotImplementedError()
# 
#     def get_config(self, config):
#         return {x: config[x] for x in config if x not in self.RESERVED_KEYWORDS}
# 
#     def connect(self, config):
#         return self.get_api().connect(**self.get_config(config))


# Path: eloquent/connectors/postgres_connector.py
    import psycopg2
    import psycopg2.extras
from .connector import Connector

# -*- coding: utf-8 -*-

try:
except ImportError:
    pass



class PostgresConnector(Connector):

    def connect(self, config):
        connection = self.get_api().connect(
            connection_factory=psycopg2.extras.DictConnection,
            **self.get_config(config)
        )
        connection.autocommit = True


        return connection