marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
745 stars 110 forks source link

UUID decode to string incorrectly. #322

Open james-lawrence opened 15 hours ago

james-lawrence commented 15 hours ago

when passing a sql.NullString to the driver for a uuid field we get a string of the literal uuid bytes instead of the uuid string format.

got:  �dW�Dw��4���
expected: 01936457-ab44-7710-bc9d-1f3414ac9deb

strictly speaking I tried to use the driver provided uuid type however the tooling I'm using can't compile use the datatype due to cgo usage. it'd be nice if the datatypes were in their own pure go package and operated on raw binary.

pgtype by jackc is a wonderful example of a phenomenal database.Value library.