Skip to content

New Feature: Add Binary[] Load function when Primary Key is Binary[] #1421

Open
@xux1217

Description

@xux1217

What version of SQLBoiler are you using (sqlboiler --version)?

4.16.2

What is your database and version (eg. Postgresql 10)

mysql8

If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)

As this issue(#1381), when primary key is binary, the load function would report error.

The core reason is we use map as the record structure instead of array when release V4.16.0 (https://github.com/volatiletech/sqlboiler/releases/tag/v4.16.0).

Further information. What did you do, what did you expect?

We have many projects use sqlboiler, and we use the load function too, we also need high performance load function, but we have many tables has binary primary key.

The new version breaks the compatibility, so in the future, we also can't upgrade it.

Resolve method?

I think we need to optimize this point, it not very hard.

Just need to do binary sorting as map key when detect the key is binary array.

  1. cover it to string.
  2. implement a special struct(like type sortbinary []byte), implement sort function, and do the type conversion.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions