MariadbAdapter
MariadbAdapter is the Adapter implementation shipped by
@sqb/mariadb, connecting to MariaDB via
mariadb, the official
MariaDB connector. It self-registers with AdapterRegistry as a side effect of importing
@sqb/mariadb — see the MariaDB adapter guide for
setup and configuration.
import '@sqb/mariadb';
Constructor
new MariadbAdapter()
Takes no arguments. You normally never construct this directly — importing @sqb/mariadb
registers a shared instance with AdapterRegistry for you.
Properties
| Property | Type | Description |
|---|---|---|
driver | 'mariadb' | The driver name, matched against ClientConfiguration.driver. |
dialect | 'mariadb' | The dialect name, matched against ClientConfiguration.dialect. |
features | Adapter.Features | { cursor: true, positionalParams: true }. |
Methods
connect()
connect(config: ClientConfiguration): Promise<Adapter.Connection>
Opens one physical mariadb connection. config.host, .port, .user, .password, and
.database are mapped onto the driver's own ConnectionConfig; anything set in
config.driverOptions is spread onto that same object first, before namedPlaceholders,
decimalAsNumber, bigIntAsNumber, and insertIdAsNumber are forced to true. Returns a
MariadbConnection wrapping the opened connection.
See also
- MariaDB adapter guide
AdapterinterfaceAdapterRegistry