Giter Club home page Giter Club logo

Comments (4)

irar2 avatar irar2 commented on May 28, 2024

I checked the databases we support, and it looks like only Postgres fully supports UUIDs. MySQL and and DB2 seem to be able to generate UUID, but don't have a type for it. And SQLite has no support at all.

It is easy to use UUID as input, because we just pass parameters as Any, but getting the result object as UUID will work only for Postgres.

Since we are trying to keep Swift-Kuery as db-independant as possible, adding UUID support seems to break the abstraction too much.

from swift-kuery.

magnusahlberg avatar magnusahlberg commented on May 28, 2024

I see your point. Perhaps a way to go about it then, on the Query-side, would be to allow a method to enter Raw data into a query with named/numbered parameters. So that one could add '58fba7e2-5528-4121-80ff-aee405706c45'::uuid as a named/numbered parameter. If this is already possible, I apologize – I could not figure it out.

On the result-side however, all changes I am suggesting would be done in the Kuery-Postgres implementation. It would help a great deal as currently, the only way to use UUID:s today in a useable way is to run .map() on the resultset.asRows, copying the entire result set and replacing the columns that are of the Data-type with corresponding NSUUID objects.

I'm hoping this would be a manageable way forward.

from swift-kuery.

irar2 avatar irar2 commented on May 28, 2024

Please check the above commit. It handles UUID in the result fetcher and returns its String value. I also added a test that inserts UUID.uuidString.

from swift-kuery.

magnusahlberg avatar magnusahlberg commented on May 28, 2024

From my testing this works exactly as expected. Fantastic!

Thanks!

from swift-kuery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.