Skip to content

deserializeRow

deserializeRow<Desc>(schema, row, columnMap?, columns?, operation?, contextValues?): MessageShape<Desc>

Defined in: packages/repo/src/serialization.ts:168

Convert a plain database row object into a protobuf message. Database column names are mapped back to proto JSON field names, then @bufbuild/protobuf’s fromJson handles type conversion (strings back to bigints, RFC 3339 to Timestamps, etc.).

Boolean fields are coerced from integers (0/1) to booleans, since databases like SQLite lack a native boolean type.

When a columns config is provided:

  • Fields with ignore: true are skipped (they get proto3 defaults).
  • Fields with deserialize are transformed before being assigned.

Desc extends DescMessage

Desc

The message descriptor.

Record<string, unknown>

The database row as a plain object.

Record<string, string>

Map of proto field names (snake_case) to database column names.

Partial<{ [K in string]: ColumnConfig<Desc, K, unknown> }>

Per-field column configuration.

ColumnDeserializeOperation = "get"

ContextValues = ...

MessageShape<Desc>