Skip to content

Techi-Freki/datahound_postgresql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datahound PostgreSQL

A PostgreSQL connector for datahound.

Usage

Extending provider base

from datahound import DataProviderBase, ConnectionString


# add your connection string data to the ConnectionString object
postgres_connection = ConnectionString('datahound_postgresql',
                                      user='test_user',
                                      password='test_pass',
                                      host='localhost',
                                      port=5432
                                      database_name='test_db'
                                      )

sqlite_connection = ConnectionString(database_path='/path/to/db.sqlite') # datahound defaults to sqlite3 when a connector_name is not passed

# extend the DataProviderBase class
class PostgreSqlProvider(DataProviderBase):
    def __init__(self):
        super().__init__(postgres_connection)


class SqLiteProvider(DataProviderClass):
    def __init__(self):
        super().__init__(sqlite_connection)


class DataProvider(object):
    postgres = PostgreSqlProvider()
    sqlite = SqLiteProvider()


# you are now ready to use the DataProvider class to access your databases
# see the datahound README for additional information on running queries, etc

Changelog

1.0.0

  • Initial Release.

About

A PostgreSQL connector for datahound.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages