wiki:db.backend_name

db.backend_name

Contains the name of the current backend (if available) - one of "mysql", "postgres", "sqlite3", or "pyodbc".

Use with if statements to do DBMS-specific code.

Example

if db.backend_name == 'sqlite':
    # manual table fiddling
else:
    db.alter_column(...)