3. Custom Databases

Warning

While all data saved in these databases is encrypted where necessary, please make sure that user accounts, user privileges, backup, etc. are properly configured in the database. Just because the data is encrypted, an unauthorized user can still delete it.

Note

Any database configuration changes will result in Krptn assuming that all data has been migrated to the new database and is ready to use.

Internally, these strings are passed to SQLAlchemy to create an engine. To add extra connection parameters, please refer to SQLAlchemy’s and/or your chosen database’s SQL Driver documentation.

Please set these strings at:

1krypton.configs.SQLDefaultCryptoDBpath = # for DB used by Crypto Class
2krypton.configs.SQLDefaultKeyDBpath =  # for DB used by Key Management System (you most likely don't need this)
3krypton.configs.SQLDefaultUserDBpath = # for DB used by User Authentication System

3.1. Microsoft SQL Server

You need to install pyodbc and Microsoft ODBC Driver for SQL Server

The string that you need to pass to this extension should look like this:

1"mssql+pyodbc://user:password@host:port/dbname?driver=odbc driver e.g:ODBC+Driver+18+for+SQL+Server"

If you are only doing development, you may add the following to prevent installing an SSL certificate:

1&Encrypt=no

To use windows authentication, please remove user:password from the string.

3.2. MySQL

Please install mysqlclient.

1"mysql+mysqldb://user:password@host:port/database"

3.3. SQLite

1"sqlite+pysqlite:///Path/example.db"

3.4. PostgreSQL

Please install psycopg2.

1"postgresql+psycopg2://user:password@host:port/databse"