RdsMariaDBDialect extendsMariaDBDialect (driver mariadb) and adds verified TLS against the RDS CASUPER refusals and the mysql.rds_* builders.| Property | Value |
|---|---|
| Dialect name | rdsmariadb |
| Extends | MariaDBDialect |
| Driver | mariadb |
| Cloud SDK | none |
| Default port | 3306 |
| Local runtime | none — hosted service only |
$ npm install ts-prorm-orm mariadb$ pnpm add ts-prorm-orm mariadb$ yarn add ts-prorm-orm mariadb$ bun add ts-prorm-orm mariadbmariadb is the same driver the mariadb dialect uses.import { Prorm } from 'ts-prorm-orm';
export const db = new Prorm({
dialect: 'rdsmariadb',
host: 'mydb.abc123.us-east-1.rds.amazonaws.com',
database: 'app',
username: 'app_user',
password: process.env.DB_PASSWORD,
dialectOptions: {
caBundle: '/etc/ssl/rds/global-bundle.pem',
},
});import { Prorm } from 'ts-prorm-orm';
export const db = new Prorm({
dialect: 'rdsmariadb',
url: 'rdsmariadb://app_user:secret@mydb.abc123.us-east-1.rds.amazonaws.com:3306/app',
dialectOptions: {
caBundle: '/etc/ssl/rds/global-bundle.pem',
},
});host, port, database, username and password before the dialect is built; any of those passed alongside it wins.import { DataTypes } from 'ts-prorm-orm';
const User = db.define('User', {
id: { type: DataTypes.INTEGER(), primaryKey: true, autoIncrement: true },
email: { type: DataTypes.STRING(255), allowNull: false, unique: true },
name: { type: DataTypes.STRING(100) },
meta: { type: DataTypes.JSON() },
});
await db.sync(); // CREATE TABLE — see Generated SQL belowimport { Op } from 'ts-prorm-orm';
await User.create({ email: 'ada@example.com', name: 'Ada' });
const page = await User.findAll({
where: { name: { [Op.like]: 'A%' } },
order: [['id', 'ASC']],
limit: 20,
offset: 40,
});[!CAUTION] AWS IAM ( iamAuth,tokenProvider) is refused
RDS for MariaDB: IAM database authentication is not available through this dialect. MariaDBDialect has no resolvePoolConfig hook and the mariadb connector has no per-connection password callback, so an IAM token (valid 15 minutes) would break every pooled connection opened after it expires. Use a password, or RdsMySQLDialect (mysql2), which supports IAM against RDS for MariaDB. The dialect throws at construction.
query(), captured with the driver stubbed out. The model layer inlines the values.db.sync() for the model in the Quick start:CREATE TABLEawait User.create({ email: 'ada@example.com', name: 'Ada' });
await User.update({ name: 'Grace' }, { where: { email: 'ada@example.com' } });
await User.destroy({ where: { id: 1 } });await User.upsert({ id: 1, email: 'ada@example.com', name: 'Ada Lovelace' });upsert() also reads the row by primary key before and after the write, to return the instance.await User.findAll({
where: { name: { [Op.like]: 'A%' } },
order: [['id', 'ASC']],
limit: 20,
offset: 40,
});meta column:import { Op } from 'ts-prorm-orm';
await User.findAll({ where: { meta: { [Op.contains]: { plan: 'pro' } } } });await db.transaction(async (t) => {
await User.create({ email: 'grace@example.com', name: 'Grace' }, { transaction: t });
// A nested transaction is a SAVEPOINT; its failure undoes only its own work.
await db
.transaction(async (sp) => {
await User.destroy({ where: { id: 1 }, transaction: sp });
throw new Error('keep the row');
}, { transaction: t })
.catch(() => {});
});SKIP LOCKED)lock with skipLocked inside a transaction:await db.transaction(async (t) => {
await User.findAll({ where: { name: 'Ada' }, lock: { level: 'UPDATE', skipLocked: true }, transaction: t });
});STRING → VARCHAR(255), auto-increment INTEGER → INT, BOOLEAN → BOOLEAN, DATE → DATETIME, UUID → CHAR(36), JSON → JSON. The type comparison lines the major engines up side by side.caBundle (or PRORM_RDS_CA_BUNDLE) and no explicitssl, the connection verifies the server certificate against the RDS CAssl is kept.MariaDBDialect has no resolvePoolConfig hook: it builds its pool from aconnect() runs. RdsMariaDBDialect.connect()iamAuth and tokenProvider at construction:mariadb connector takes password only as a string fixed when the poolRdsMySQLDialect (mysql2 speaks to MariaDB and supportsbuildCreateIamUserQuery(user) stillIDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS' user for otherRdsMariaDBDialect extends MariaDBDialect (mariadb) andObject.getOwnPropertyNames(RdsMariaDBDialect.prototype),| Area | Overridden |
|---|---|
| Connection and execution | connect |
| DML builders | buildSetBinlogRetentionSql |
| DDL and schema | buildCreateIamUserQuery, buildGrantQuery |
| Other | buildKillQueryIdSql, buildKillQuerySql, buildKillSql, buildShowConfigurationSql, buildSkipReplicationErrorSql, buildStartReplicationSql, buildStopReplicationSql, killConnection, killQuery |
SUPERSUPER, FILE, SHUTDOWN andCREATE TABLESPACE; buildGrantQuery refuses them and ALL on *.*.| Builder | SQL |
|---|---|
buildKillSql(id) / killConnection(id) | CALL mysql.rds_kill(id) |
buildKillQuerySql(id) / killQuery(id) | CALL mysql.rds_kill_query(id) |
buildKillQueryIdSql(queryId) | CALL mysql.rds_kill_query_id(queryId) (MariaDB only; QUERY_ID from information_schema.PROCESSLIST) |
buildSetBinlogRetentionSql(hours | null) | CALL mysql.rds_set_configuration('binlog retention hours', n); no upper bound is applied |
buildShowConfigurationSql() | CALL mysql.rds_show_configuration |
buildStartReplicationSql() / buildStopReplicationSql() / buildSkipReplicationErrorSql() | mysql.rds_start_replication / rds_stop_replication / rds_skip_repl_error |
mysql.rds_start_replication_until is not available on MariaDB.mariadb), lineage rdsmariadb → mariadb.rdsmariadb://, rds-mariadb://.capabilitiesOf() (src/transaction-support.ts),whereSupportOf() (src/query-builders/expression-render.ts),sqlObjectCapabilitiesOf() (src/sql-objects/capabilities.ts) and the| Capability | rdsmariadb |
|---|---|
| Transactions atomic | yes |
| Savepoints | yes |
| Isolation | up to SERIALIZABLE |
| Transaction modes | read-only no; deferrable no; constraint deferral no |
| RETURNING | RETURNING on INSERT |
| Upsert | INSERT … ON DUPLICATE KEY UPDATE |
| JSON column | JSON (JSONB → JSON) |
| Vector column | VECTOR(3) |
| Array column | VARCHAR(255) |
| WHERE builder | 37 operator keys plus the $json: prefix; $and/$or/$not; $exists: yes; $in subquery: yes; expression operands: yes |
| SQL objects | family mariadb: triggers yes; procedures yes; functions multiStatement; materialized views emulated (procedure); sequences yes; enums inline; RLS no |
| Streaming | queryStream() present; LISTEN absent; createExtension() present |
tests/dialects/rdsmariadb.test.ts exercises the dialect with a mocked driver, so nothing touches a server.