Config Schema

The following options will be added to the config schema


The database URI that should be used for the connection.

Default: 'sqlite:///:memory:'


If set to True SQLAlchemy will log all the statements issued to stderr which can be useful for debugging.

Default: True


Can be used to explicitly disable or enable query recording. Query recording automatically happens in debug or testing mode. See get_debug_queries() for more information

Default: None


Can be used to explicitly disable native unicode support. This is required for some database adapters (like PostgreSQL on some Ubuntu versions) when used with improper database defaults that specify encoding-less databases.

Default: None


The size of the database pool. Defaults to the engine’s default (usually 5)

Default: None


Specifies the connection timeout for the pool. Defaults to 10.

Default: None


Number of seconds after which a connection is automatically recycled. This is required for MySQL, which removes connections after 8 hours idle by default. Note that Flask-SQLAlchemy automatically sets this to 2 hours if MySQL is used.

Default: None


Controls the number of connections that can be created after the pool reached its maximum size. When those additional connections are returned to the pool, they are disconnected and discarded.

Default: None


If set to True, Flask-SQLAlchemy will track modifications of objects and emit signals. The default is None, which enables tracking but issues a warning that it will be disabled by default in the future. This requires extra memory and should be disabled if not needed.

Default: False

Alternative Variables

Some hosting providers such as Heroku other names for config values. You can remap them using the key parameter:

        'type': str,
        'key': 'DATABASE_URL',

This will use the environment variable DATABASE_URL for the value to SQLALCHEMY_DATABASE_URI.