ConstLIST data type - DuckDB native variable-length list (elementType[])
STRUCT data type - DuckDB native nested record (STRUCT(field TYPE, ...))
MAP data type - DuckDB native key/value map (MAP(keyType, valueType))
UNION data type - DuckDB native tagged union (UNION(tag TYPE, ...))
ALGORITHM data type for hash algorithms Used for storing hashed values (passwords, checksums, etc.) Supports BCRYPT, MD5, SHA1, SHA256, SHA384, SHA512, ARGON2, PBKDF2, SCRYPT, etc.
// Store password hash using BCRYPT (recommended for passwords)
password: DataTypes.ALGORITHM({ algorithm: 'BCRYPT', cost: 12 })
// Store checksum using SHA256
fileChecksum: DataTypes.ALGORITHM({ algorithm: 'SHA256' })
// Use with VIRTUAL for computed hash fields
passwordHash: DataTypes.VIRTUAL({
returnType: DataTypes.ALGORITHM({ algorithm: 'BCRYPT' }),
set(value: string) {
this.password = hashPassword(value);
}
})
ENUM data type