deserializeRow
deserializeRow<
Desc>(schema,row,columnMap?,columns?):MessageShape<Desc>
Defined in: serialization.ts:121
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: trueare skipped (they get proto3 defaults). - Fields with
serialize: "json"are parsed from JSON strings viafromJsonString. - Fields with
serialize: "binary"are parsed fromUint8ArrayviafromBinary.
Type Parameters
Section titled “Type Parameters”Desc extends DescMessage
Parameters
Section titled “Parameters”schema
Section titled “schema”Desc
The message descriptor.
Record<string, unknown>
The database row as a plain object.
columnMap?
Section titled “columnMap?”Record<string, string>
Map of proto field names (snake_case) to database column names.
columns?
Section titled “columns?”Record<string, ColumnConfig>
Per-field column configuration.
Returns
Section titled “Returns”MessageShape<Desc>