Remote / foldkit-remote-drizzle

DrizzleOperators

namespace · packages/remote-drizzle/src/operators.ts:111

const DrizzleOperators = {
  implement,
  make,
  merge,
  override,
  withEvidence,
  kernel,
}

Its type

interface DrizzleOperators extends OperatorTable {
  readonly _tag: 'DrizzleOperators'
  readonly get: (
    operator: OperatorDescriptor,
  ) => Option.Option<SqlImplementation['build']>
  readonly named: (name: string) => Option.Option<OperatorDescriptor>
  readonly implementations: ReadonlyArray<SqlImplementation>
  readonly evidence: ReadonlyArray<Evidence>
}

The SQL compiler's implementations, by operator.

In the guides

Members

DrizzleOperators.implement

function · packages/remote-drizzle/src/operators.ts:122

implement(
  operator: {
    readonly descriptor: OperatorDescriptor
  },
  build: (context: SqlContext) => SQL,
): SqlImplementation

An SQL implementation: built from the call's arguments, compiled, and its collation. It must agree with the operator's in-memory implementation, nulls included (SQL's own operators give null for one, as a strict operator does); the conformance suite is what holds the two together.

ts
DrizzleOperators.implement(joined, ({ args: [left, right] }) => sql`${left} || ${right}`)

DrizzleOperators.make

function · packages/remote-drizzle/src/operators.ts:136

make(...implementations: ReadonlyArray<SqlImplementation>): DrizzleOperators

A table of implementations. One operator implemented twice, or two under one name, is refused.

DrizzleOperators.merge

function · packages/remote-drizzle/src/operators.ts:140

merge(left: DrizzleOperators, right: DrizzleOperators): DrizzleOperators

Both tables' implementations. An operator both implement is refused: say which wins with override.

DrizzleOperators.override

function · packages/remote-drizzle/src/operators.ts:157

override(
  base: DrizzleOperators,
  ...implementations: ReadonlyArray<SqlImplementation>
): DrizzleOperators

The table with these implementations in place of its own for the same operators, a replaced implementation's evidence going with it.

DrizzleOperators.withEvidence

function · packages/remote-drizzle/src/operators.ts:183

withEvidence(
  base: DrizzleOperators,
  evidence: ReadonlyArray<Evidence>,
): DrizzleOperators

The table with what is known of its implementations' laws: records from Conformance.lawsBy run against the database, each of an operator it implements and a law that operator declares. A computed assignment without expect lands under a ledger only by an operator whose commutativity and associativity both tables record as tested.

DrizzleOperators.kernel

const · packages/remote-drizzle/src/operators.ts:205

kernel: DrizzleOperators

The kernel's own operators (Text.startsWith): every binding's default.