Here are the examples of the python api flask_sqlalchemy.SQLAlchemy.apply_driver_hacks taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Source : __init__.py
with Apache License 2.0
from IntegralDefense
with Apache License 2.0
from IntegralDefense
def apply_driver_hacks(self, app, info, options):
# are we using SSL for MySQL connections? (you should be)
if 'ssl_ca' in saq.CONFIG['database_ace'] \
or 'ssl_cert' in saq.CONFIG['database_ace'] \
or 'ssl_key' in saq.CONFIG['database_ace']:
ssl_options = { 'ca': saq.CONFIG['database_ace']['ssl_ca'] }
if 'ssl_cert' in saq.CONFIG['database_ace']:
ssl_options['cert'] = saq.CONFIG['database_ace']['ssl_cert']
if 'ssl_key' in saq.CONFIG['database_ace']:
ssl_options['key'] = saq.CONFIG['database_ace']['ssl_key']
options.update({'connect_args': {'ssl': ssl_options}})
SQLAlchemy.apply_driver_hacks(self, app, info, options)
db = CustomSQLAlchemy()
3
Source : __init__.py
with Apache License 2.0
from IntegralDefense
with Apache License 2.0
from IntegralDefense
def apply_driver_hacks(self, app, info, options):
# add SSL (if configured)
options.update(config[saq.CONFIG['global']['instance_type']].SQLALCHEMY_DATABASE_OPTIONS)
SQLAlchemy.apply_driver_hacks(self, app, info, options)
db = CustomSQLAlchemy()