LakeQL
Overview
  • Introduction
  • Datasource Contract
  • API Reference
Writing
  • Write Strategies
  • Load Strategies
  • Partitioning
Storage
  • Storage Operations
Trino
  • Connection
  • Write Config
  • Metadata
  • API Reference
Fabric
  • Connection
  • Metadata
  • API Reference
GitHub
LakeQL
  1. Data Sources
  2. Fabric
  3. API Reference

On this page

  1. API Reference
    1. VfabricAdapterFactory
    2. VfabricAdapterDefinition
    3. VADAPTER_NAME
    4. FvalidateFabricConfig
    5. IFabricConnectionConfig
    6. TFabricAuth
    7. IFabricOAuth2Auth
    8. IFabricBearerAuth
    9. FclassifyFabricError
    10. VfabricDialect
    11. VfabricResponseNormalizer
    12. VfabricTypeMapper

API Reference

Complete reference for the @lakeql/adapter-fabric public API.

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

AdapterFactory

Typed-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 const

Adapter name literal for the Fabric adapter. Used across all modules.

Definition

"fabric" as const

Assertion-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

NameType
configRequiredunknown

The unknown value to validate.

Returns

asserts config is FabricConnectionConfig

Configuration 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

NameType
hostRequiredstring

Fabric SQL endpoint hostname (e.g. "your-endpoint.datawarehouse.fabric.microsoft.com").

portRequirednumber

Port the Fabric SQL endpoint listens on (typically 1433).

catalogRequiredstring

Default catalog (database) for all queries.

authRequiredFabricAuth

Authentication credentials.

source?string

Source identifier for diagnostics.

Authentication credentials for a Fabric connection — either OAuth2 client credentials or a static bearer token.

Definition

FabricOAuth2Auth | FabricBearerAuth
See:FabricOAuth2AuthFabricBearerAuth

OAuth2 client credentials authentication for Azure AD.

Properties

NameType
typeRequired"oauth2"
tenantIdRequiredstring

Azure AD tenant ID.

clientIdRequiredstring

Azure AD application (client) ID.

clientSecretRequiredstring

Azure AD client secret.

scope?string

Optional scope override.

Bearer token authentication (e.g. pre-acquired OAuth2 token).

Properties

NameType
typeRequired"bearer"
tokenRequiredstring

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

NameType
errorRequiredunknown

The caught error value (may be any type).

dataSourceRequiredstring

Runtime name of the data source for error context.

Returns

DataSourceError

A concrete DataSourceError subclass instance.

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

QueryDialect

Fabric response normalizer implementing the neutral ResponseNormalizer contract. Accepts true or 1 as the record sentinel (T-SQL returns 1).

Definition

ResponseNormalizer

Shared TypeMapper for Fabric / T-SQL types.

Definition

createTypeMapper({
  toPrimitive: FABRIC_TO_PRIMITIVE,
  toEngine: PRIMITIVE_TO_FABRIC,
})

Previous page

Metadata