CipherStashDocs
StackLatestPackagesStackSrcSchemaFunctions

toEqlCastAs

toEqlCastAs is a function in @cipherstash/stack. TypeScript API reference with its signature, parameters, and usage.

@cipherstash/stack


Function: toEqlCastAs()

function toEqlCastAs(value): 
  | "boolean"
  | "text"
  | "int"
  | "small_int"
  | "big_int"
  | "real"
  | "double"
  | "date"
  | "jsonb";

Defined in: packages/stack/src/schema/index.ts:57

Map SDK-facing data types to EQL cast_as values.

The SDK accepts developer-friendly types like 'string' and 'number', but EQL expects PostgreSQL-aligned types like 'text' and 'double'.

Parameters

value

"string" | "number" | "bigint" | "boolean" | "text" | "date" | "json"

Returns

| "boolean" | "text" | "int" | "small_int" | "big_int" | "real" | "double" | "date" | "jsonb"

On this page