The complete public API of @lakeql/adapter-fabric, generated from the package's TypeScript source.
Register the adapter with fabricAdapterDefinition in your config. The rest of the surface is the connection config (FabricConnectionConfig, FabricAuth), the SQL dialect, the response normalizer, and the type mapper that the runtime wires together.
Fabric adapter factory implementing the neutral AdapterFactory contract.
The factory is stateless: it retains no mutable per-data-source state between calls to createDataSource(), createReadStrategy(), and createWriteStrategy(). All construction methods are synchronous and do not perform network requests, metadata discovery, hidden global registration, or environment lookup.
Definition
AdapterFactoryTyped-config registration value compatible with AdapterDefinition<"fabric", FabricConnectionConfig> from @lakeql/config through structural typing.
The adapter package does NOT import or depend on @lakeql/config. This definition is consumed by defineConfig() to provide compile-time connection-shape inference for Fabric data sources.
Intentionally omits registrationOptions and mergeDataSourceConfig because Fabric receives a complete explicit connection payload.
Definition
{
/** Literal adapter name for typed narrowing. */
adapterName: ADAPTER_NAME,
/** The exact adapter factory instance. */
factory: fabricAdapterFactory,
/** The shared assertion-style config validator. */
validateDataSourceConfig: validateFabricConfig,
} as constAdapter name literal for the Fabric adapter. Used across all modules.
Definition
"fabric" as constAssertion-style validator for FabricConnectionConfig.
Validates the shape and constraints of a Fabric connection configuration payload. Throws a plain Error synchronously when the input is invalid. Error messages identify the offending field by name but never include client secrets, bearer tokens, or serialized configuration objects.
The same implementation is used at both the defineConfig() boundary (via fabricAdapterDefinition.validateDataSourceConfig) and the fabricAdapterFactory.createDataSource() boundary, ensuring a single set of validation rules.
Parameters
| Name | Type |
|---|---|
| configRequired | unknown |
The unknown value to validate. | |
Returns
asserts config is FabricConnectionConfigConfiguration for connecting to a Microsoft Fabric SQL endpoint.
Fields mirror FabricClientProps from @lakeql/fabric-client. The outer runtime definition owns adapter selection through its adapter field; this type intentionally does not include an inner adapter discriminator.
Properties
| Name | Type |
|---|---|
| hostRequired | string |
Fabric SQL endpoint hostname (e.g. "your-endpoint.datawarehouse.fabric.microsoft.com"). | |
| portRequired | number |
Port the Fabric SQL endpoint listens on (typically 1433). | |
| catalogRequired | string |
Default catalog (database) for all queries. | |
| authRequired | FabricAuth |
Authentication credentials. | |
| source? | string |
Source identifier for diagnostics. | |
Authentication credentials for a Fabric connection — either OAuth2 client credentials or a static bearer token.
OAuth2 client credentials authentication for Azure AD.
Properties
| Name | Type |
|---|---|
| typeRequired | "oauth2" |
| tenantIdRequired | string |
Azure AD tenant ID. | |
| clientIdRequired | string |
Azure AD application (client) ID. | |
| clientSecretRequired | string |
Azure AD client secret. | |
| scope? | string |
Optional scope override. | |
Bearer token authentication (e.g. pre-acquired OAuth2 token).
Properties
| Name | Type |
|---|---|
| typeRequired | "bearer" |
| tokenRequired | string |
The bearer token value. | |
Classify a Fabric client error into the shared DataSourceError hierarchy.
The classifier always sets adapter to "fabric" and preserves the original error as cause. Error messages are bounded and credential-safe — they never include passwords, tokens, authorization headers, raw SQL, or complete request options.
Already-classified DataSourceError instances are returned unchanged with strict reference identity (no double-wrapping).
Parameters
| Name | Type |
|---|---|
| errorRequired | unknown |
The caught error value (may be any type). | |
| dataSourceRequired | string |
Runtime name of the data source for error context. | |
Fabric query dialect implementing the neutral QueryDialect contract.
Uses Kysely’s MSSQL adapter/compiler since Fabric’s SQL dialect is T-SQL. The dialect provides Fabric-specific SQL fragments for timestamp conversion, pagination, and identifier quoting.
Definition
QueryDialectFabric response normalizer implementing the neutral ResponseNormalizer contract. Accepts true or 1 as the record sentinel (T-SQL returns 1).
Definition
ResponseNormalizerShared TypeMapper for Fabric / T-SQL types.
Definition
createTypeMapper({
toPrimitive: FABRIC_TO_PRIMITIVE,
toEngine: PRIMITIVE_TO_FABRIC,
})