-
Notifications
You must be signed in to change notification settings - Fork 2
Drivers Maria
GitHub Actions edited this page Sep 18, 2026
·
1 revision
MariaDB / MySQL driver wrapping npm:mariadb. The driver uses
per-connection mode (createConnection) and lets BaseEngine's pool
own the lifecycle — no double-pooling.
- Connects to MariaDB and MySQL (8.0+ via
mariadbpackage) - Native named parameters (
:name:rewritten to:name) -
BIGINTreturned asbigint(supportBigInt: true) -
DECIMALreturned asnumber(decimalAsNumber: true) - TLS / SSL support (passes through
sslconfig) - Transactions (commit / rollback / auto-rollback / timeout)
import { MariaEngine } from '@tundralibs/drivers/maria';
const engine = new MariaEngine('app', {
host: 'localhost',
port: 3306,
database: 'app',
username: 'root',
password: '...',
});
const r = await engine.execute({
sql: 'SELECT id, name FROM users WHERE id = :id:',
params: { id: 1 },
});
await engine.disconnect();Extends SQLEngineOptions.
| Option | Type | Default | Notes |
|---|---|---|---|
host |
string |
— | Required. |
port |
number |
3306 |
|
database |
string |
— | Required. |
username |
string |
— | Required. |
password |
string |
— | Optional. |
ssl |
various | — | See SSL/TLS. |
| MariaDB type | JS |
|---|---|
INT / SMALLINT / TINYINT
|
number |
BIGINT |
bigint |
DECIMAL / NUMERIC
|
number |
FLOAT / DOUBLE
|
number |
BIT(1) |
boolean |
VARCHAR / TEXT
|
string |
BLOB / BINARY
|
Buffer (Node-style) |
JSON |
parsed object |
DATETIME / TIMESTAMP
|
Date |
MariaDB error codes (ER_*) are mapped to standard EngineError.code
values. Both the driver-native code (e.g. ER_DUP_ENTRY) and the
MariaDB errno and sqlState are preserved in the error meta for
debugging.
deno run --allow-all packages/drivers/engines/maria/soak.ts