StackLatestSchemaType aliases
InferPlaintext
Infer the plaintext (decrypted) type from a EncryptedTable schema.
Type Alias: InferPlaintext<T>
type InferPlaintext<T> = T extends EncryptedTable<infer C> ? { [K in keyof C as C[K] extends EncryptedColumn | EncryptedField ? K : never]: string } : never;Defined in: .tmp-stack/packages/stack/src/schema/index.ts:464
Infer the plaintext (decrypted) type from a EncryptedTable schema.
Type Parameters
T
T extends EncryptedTable<any>
Example
const users = encryptedTable("users", {
email: encryptedColumn("email").equality(),
name: encryptedColumn("name"),
})
type UserPlaintext = InferPlaintext<typeof users>
// => { email: string; name: string }