Database Dialects

June 18, 2026 ยท View on GitHub

The AWS Advanced Python Wrapper uses two types of dialects: driver dialects and database dialects. This page is on database dialects. To find out more about driver dialects, see Driver Dialects.

What are database dialects?

The AWS Advanced Python Wrapper requires an underlying driver, and it is meant to be compatible with any Python driver. Database dialects help the AWS Advanced Python Wrapper determine what kind of underlying database is being used. To function correctly, the AWS Advanced Python Wrapper requires details unique to specific databases such as the default port number or the method to get the current host from the database. These details can be defined and provided to the AWS Advanced Python Wrapper by using database dialects.

Configuration Parameters

NameRequiredDescriptionExample
wrapper_dialectNo (see notes below)The dialect code of the desired database type.DialectCode.AURORA_MYSQL or aurora-mysql

NOTES:

The wrapper_dialect parameter is not required. When it is not provided by the user, the AWS Advanced Python Wrapper will attempt to determine which of the existing dialects to use based on other connection details. However, if the dialect is known by the user, it is preferable to set the wrapper_dialect parameter because it will take time to resolve the dialect.

List of Available Dialect Codes

Dialect codes specify what kind of database any connections will be made to.

Dialect Code ReferenceValueDatabase
AURORA_MYSQLaurora-mysqlAurora MySQL
GLOBAL_AURORA_MYSQLglobal-aurora-mysqlAurora Global Database MySQL
RDS_MULTI_AZ_MYSQL_CLUSTERrds-multi-az-mysql-clusterAmazon RDS MySQL Multi-AZ DB Cluster Deployments
RDS_MYSQLrds-mysqlAmazon RDS MySQL
MYSQLmysqlMySQL
AURORA_PGaurora-pgAurora PostgreSQL
GLOBAL_AURORA_PGglobal-aurora-pgAurora Global Database PostgreSQL
RDS_MULTI_AZ_PG_CLUSTERrds-multi-az-pg-clusterAmazon RDS PostgreSQL Multi-AZ DB Cluster Deployments
RDS_PGrds-pgAmazon RDS PostgreSQL
PGpgPostgreSQL
MARIADBmariadbMariaDB
CUSTOMcustomSee custom dialects. This code is not required when using custom dialects.
UNKNOWNunknownUnknown. Although this code is available, do not use it as it will result in errors.

Custom Dialects

If you are interested in using the AWS Advanced Python Wrapper but your desired database type is not currently supported, it is possible to create a custom dialect.

To create a custom dialect, implement the DatabaseDialect class. For databases clusters that are aware of their topology, the TopologyAwareDatabaseDialect interface should also be implemented. See the following classes in the Database Dialect file for examples:

  • PgDialect is a generic dialect that should work with any PostgreSQL database.
  • AuroraPgDialect is an extension of PgDialect, but also implements the TopologyAwareDatabaseDialect interface.

Once the custom dialect class has been created, tell the AWS Advanced Python Wrapper to use it by setting the custom_dialect attribute in the DialectManager class. It is not necessary to set the wrapper_dialect parameter. See below for an example:

custom_dialect: Dialect = CustomDialect()
DialectManager.custom_dialect = custom_dialect