CipherStash Docs
StackLatestSchemaFunctions

encryptedField

API reference for encryptedField

@cipherstash/stack


Function: encryptedField()

function encryptedField(valueName): EncryptedField;

Defined in: .tmp-stack/packages/stack/src/schema/index.ts:595

Define an encrypted field for use in nested or structured schemas.

encryptedField is similar to encryptedColumn but creates an EncryptedField for nested fields that are encrypted but not searchable (no indexes). Use .dataType() to specify the plaintext type.

Parameters

valueName

string

The name of the value field.

Returns

EncryptedField

A new EncryptedField builder.

Example

import { encryptedTable, encryptedField } from "@cipherstash/stack/schema"

const orders = encryptedTable("orders", {
  details: {
    amount: encryptedField("amount").dataType("number"),
    currency: encryptedField("currency"),
  },
})

On this page