zio / zio-quill

Compile-time Language Integrated Queries for Scala

Home Page:https://zio.dev/zio-quill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Encoder/Decoder for Byte in OrientDB Contexts

daniel-shuy opened this issue · comments

Version: 2.3.2
Module: quill-orientdb
Database: OrientDB

Expected behavior

Built-in Encoder/Decoder for Byte (according to https://orientdb.com/docs/last/Types.html, Bytes are supported).

Actual behavior

Missing Encoder/Decoder for Byte.

Workaround

import io.getquill._

lazy val ctx = new OrientDBSyncContext(SnakeCase, "ctx")

implicit val byteEncoder: Encoder[Byte] = ctx.encoder((index, value, row) => {
  row.insert(index, value)
  row
})

implicit val byteDecoder: Decoder[Byte] = ctx.decoder((index, row) => {
  row.field[Byte](row.fieldNames()(index))
})

@getquill/maintainers