MssqlAdapter
MssqlAdapter is the Adapter implementation shipped by
@sqb/mssql, connecting to Microsoft SQL Server via
mssql (tedious-based). It self-registers with
AdapterRegistry as a side effect of importing @sqb/mssql — see the
SQL Server adapter guide for setup and configuration.
import '@sqb/mssql';
Constructor
new MssqlAdapter()
Takes no arguments. You normally never construct this directly — importing @sqb/mssql
registers a shared instance with AdapterRegistry for you.
Properties
| Property | Type | Description |
|---|---|---|
driver | 'mssql' | The driver name, matched against ClientConfiguration.driver. |
dialect | 'mssql' | The dialect name, matched against ClientConfiguration.dialect. |
features | Adapter.Features | { cursor: true }. |
Methods
connect()
connect(config: ClientConfiguration): Promise<Adapter.Connection>
Opens a mssql ConnectionPool and connects it. config.host maps to server (defaulting to
'localhost'); .port, .user, .password, and .database are mapped onto the driver's own
config object. config.driverOptions.encrypt/.trustServerCertificate (defaulting to
false/true) and .options seed config.options; the rest of driverOptions is spread onto
the top-level config object. Returns a MssqlConnection wrapping the connected pool.
See also
- SQL Server adapter guide
AdapterinterfaceAdapterRegistry