StackLatestPackagesStackSrcSchemaFunctions
encryptedField
encryptedField is a function in @cipherstash/stack. TypeScript API reference with its signature, parameters, and usage.
Function: encryptedField()
function encryptedField(valueName): EncryptedField;Defined in: packages/stack/src/schema/index.ts:654
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
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"),
},
})