class UnsupportedQueryFeatureError
extends Error
Since 0.2.0

Thrown when an adapter refuses a query feature that is expressible in the portable IDataSource contract but not supported by the active backend.

Carries the feature, the adapter, and a name discriminant so consumers can branch with instanceof rather than matching message text. Every refusal reachable from a Promise-returning method rejects rather than throwing synchronously.

Examples

Example 1

import { UnsupportedQueryFeatureError } from '@setu-ts/database-plugin';
try {
  await repo.findById({ tenantId: 't1', userId: 7 });
} catch (err) {
  if (err instanceof UnsupportedQueryFeatureError) {
    console.error(`Feature '${err.feature}' unsupported on ${err.adapter}`);
  }
}

Constructors

UnsupportedQueryFeatureError(
feature: string,
adapter: string,
message: string,
options?: ErrorOptions
)

Creates the error. The message is the full diagnostic — safe to log, never to serve — and names the feature and the adapter.

Parameters
feature: string

The query feature that is not supported

adapter: string

The adapter name

message: string

The full diagnostic, safe to log

optional
options: ErrorOptions

Native error options, including an underlying cause

Properties

readonly
adapter: string

The adapter name (e.g. 'prisma', 'drizzle', 'memory').

readonly
feature: string

The query feature that could not be honoured (e.g. 'composite-key').

readonly
name: string

Discriminant for consumers that cannot use instanceof across realms.

Usage

import { UnsupportedQueryFeatureError } from "database-plugin/src/index.ts";