@samveys/mssql

Microsoft SQL Server driver (tedious via mssql)

Version
1.0.2Nov 5, 2026
Install
pnpm add @samveys/mssql
Import
import { mssql, mssqlColumnSql, mssqlDialect, mssqlDriver } from '@samveys/mssql'

Function (2)

mssql Function

A SQL Server connection config: `mssql({ host: '127.0.0.1', user: 'sa', password, database: 'app' })`.

function mssql(options: MssqlOptions): ConnectionConfig<MssqlOptions>;

Exported from packages/mssql/src/index.ts

mssqlColumnSql Function

SQL Server type for a schema-builder column.

function mssqlColumnSql(column: ColumnDefinition): string;

Exported from packages/mssql/src/dialect.ts

Value (2)

mssqlDialect Value

The SQL Server dialect. Identifiers are bracket-quoted (`[users]`), which works whatever `QUOTED_IDENTIFIER` is set to. Pagination is `OFFSET … ROWS FETCH NEXT … ROWS ONLY`, which needs an ORDER BY, so an unordered query gets `order by (select null)`. Inserts use `OUTPUT inserted.*` (ADR 0014).

const mssqlDialect: Dialect;

Exported from packages/mssql/src/dialect.ts

mssqlDriver Value

No documentation comment.

const mssqlDriver: DatabaseDriver<MssqlOptions>;

Exported from packages/mssql/src/index.ts

Interface (1)

MssqlOptions Interface

No documentation comment.

interface MssqlOptions {
    readonly host: string;
    readonly port?: number;
    readonly user: string;
    readonly password: string;
    readonly database: string;
    /** TLS to the server. Default false; `trustServerCertificate` accepts a self-signed certificate. */
    readonly encrypt?: boolean;
    readonly trustServerCertificate?: boolean;
    readonly pool?: {
  …
Show the whole declaration (13 lines)
interface MssqlOptions {
    readonly host: string;
    readonly port?: number;
    readonly user: string;
    readonly password: string;
    readonly database: string;
    /** TLS to the server. Default false; `trustServerCertificate` accepts a self-signed certificate. */
    readonly encrypt?: boolean;
    readonly trustServerCertificate?: boolean;
    readonly pool?: {
        readonly max?: number;
    };
}

Exported from packages/mssql/src/index.ts