Database type selection
Set the database type in the[db] section:
Database type to useOptions:
mysqlpostgresqlsqlite
Print rendered SQL statements to console for debugging
MySQL configuration
Configure MySQL connection settings in the[db.mysql] section. These follow pymysql/aiomysql connection keys.
MySQL parameters
MySQL server hostname or IP address
MySQL server port
Path to MySQL Unix socket. Use this instead of host/port for local connections.Example:
/var/run/mysqld/mysqld.sockDatabase name
Database username
Database password
Minimum number of connections in the connection pool
Maximum number of connections in the connection pool
A connection pool is created per database per process for optimal performance.
PostgreSQL configuration
Configure PostgreSQL connection settings in the[db.postgresql] section. These follow aiosqlite connection keys.
PostgreSQL parameters
PostgreSQL server hostname or IP address. Also used for Unix domain socket connections.
PostgreSQL server port
Database username
Database password
Database name
Minimum number of connections in the connection pool
Maximum number of connections in the connection pool
SQLite configuration
Configure SQLite database file path in the[db.sqlite] section. These follow aiosqlite connection keys.
SQLite parameters
Path to the SQLite database file. Can be relative or absolute.
SQLite is suitable for smaller archives or development environments. For production deployments with multiple boards and high traffic, MySQL or PostgreSQL is recommended.
Database schema
Ayase Quart expects database tables to follow the Asagi schema format. Each board has its own table with the board’s shortname.Validating board tables
Validating board tables
The Set to
validate_boards_db option in the [app] section controls whether Ayase Quart validates that all boards defined in boards.toml have corresponding database tables at startup.false to skip validation if you’re adding board configurations before their data is available.Connection pooling
Ayase Quart creates a connection pool per database per process. The pool size is controlled by:- MySQL:
minsizeandmaxsize - PostgreSQL:
min_sizeandmax_size - SQLite: No pooling configuration needed
Recommended pool sizes
Development
Development
minsize/min_size: 1maxsize/max_size: 10
Production (small/medium)
Production (small/medium)
minsize/min_size: 5maxsize/max_size: 50
Production (large/high traffic)
Production (large/high traffic)
minsize/min_size: 10maxsize/max_size: 100
Troubleshooting
Connection refused errors
Connection refused errors
- Verify the database server is running
- Check host and port are correct
- Ensure firewall rules allow connections
- For MySQL, try using
unix_socketfor local connections
Authentication failures
Authentication failures
- Verify username and password are correct
- Check database user has appropriate permissions
- Ensure user can connect from the application’s host
Too many connections
Too many connections
- Reduce
maxsize/max_sizein connection pool settings - Increase database server’s
max_connections - Check for connection leaks in application logs
Board table not found
Board table not found
- Verify board tables exist in the database
- Check table names match board shortnames exactly
- Ensure
validate_boards_dbis set appropriately