class UnsupportedRawQueryError
extends Error
Since 0.1.0

Thrown by MongoAdapter.rawQuery — MongoDB has no SQL, so a raw query is refused by name rather than emulated (the silent-divergence defect M70j closed). The error names the adapter and points at the injected client for native commands.

It rejects, never throws synchronously — a synchronous throw from a Promise-typed method is the M52b/M52c/M70j defect class.

Examples

Example 1

import { UnsupportedRawQueryError } from '@setu-ts/database-plugin';
try {
  await adapter.rawQuery('SELECT 1');
} catch (err) {
  if (err instanceof UnsupportedRawQueryError) {
    console.error(err.message);
  }
}

Constructors

UnsupportedRawQueryError(
adapter: string,
message: string
)

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

Parameters
adapter: string

The adapter name that refused the query

message: string

The full diagnostic, safe to log

Properties

readonly
adapter: string

The adapter name that refused the raw query (e.g. 'mongodb').

readonly
name: string

Discriminant for consumers that cannot use instanceof across realms.

Usage

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