JuliaDatabases / ODBC.jl

An ODBC interface for the Julia programming language
https://odbc.juliadatabases.org/stable
Other
106 stars 62 forks source link

Use GUID instead of UUID #378

Open ahjulstad opened 11 months ago

ahjulstad commented 11 months ago

This solves https://github.com/JuliaDatabases/ODBC.jl/issues/366 for me, but more testing (and unittests) is necessary.

As far as I can understand, the SQL GUID type, isn't really a UInt128, but rather a composite struct. (link

struct GUID
{
    uint32_t Data1;
    uint16_t Data2;
    uint16_t Data3;
    uint8_t  Data4[8];
}

This PR adds a new GUID struct in the ODBC package, and uses that instead of Base.UUID.

As a lot of application code might expect to receive Base.UUID from results, some more thought should probably go into this.

Things to consider

Also, I have only tested this against a MSSQL database (my test rig in dev container here: https://github.com/ahjulstad/debug-julia-odbc ), so I have no idea if this breaks other databases.

ahjulstad commented 11 months ago

This task has grown larger than what I was originally expecting, and help is needed on some items:

What I have now is a devcontainer setup with MariaDB and MSSQL, I have implemented a new API.GUID type, added conversions to and from Base.UUID. Many things work well, but not everything. I have to leave it like this for now, and hope to pick it up again later (unless someone else does it before me)