StackLatestPackagesStackSrcSchemaFunctions
encryptedColumn
encryptedColumn is a function in @cipherstash/stack. TypeScript API reference with its signature, parameters, and usage.
Function: encryptedColumn()
function encryptedColumn(columnName): EncryptedColumn;Defined in: packages/stack/src/schema/index.ts:628
Define an encrypted column within a table schema.
Creates a EncryptedColumn builder for the given column name. Chain index
methods (.equality(), .freeTextSearch(), .orderAndRange(),
.searchableJson()) and/or .dataType() to configure searchable encryption
and the plaintext data type.
Parameters
columnName
string
The name of the database column to encrypt.
Returns
A new EncryptedColumn builder.
Example
import { encryptedTable, encryptedColumn } from "@cipherstash/stack/schema"
const users = encryptedTable("users", {
email: encryptedColumn("email").equality().freeTextSearch().orderAndRange(),
})