monolayer-pg / schema / bytea
Function: bytea()
bytea():
PgBytea
Column that stores binary strings.
Returns
Remarks
Kysely database schema type definition
ts
{
readonly __select__: Buffer | null;
readonly __insert__: Buffer | string | null | undefined;
readonly __update__: Buffer | string | null;
};
Nullability and optionality will change according to the column's constraints, generated values, and default data values.
Example
ts
import { schema, table, bytea } from "@monolayer/pg/schema";
const dbSchema = schema({
tables: {
example: table({
columns: {
image: bytea(),
},
}),
},
});
// Kysely database schema type
type DB = typeof dbSchema.infer;
See
PostgreSQL Docs: bytea