Code Monkey home page Code Monkey logo

Comments (5)

coleifer avatar coleifer commented on May 23, 2024

SQLite does not natively support a UUID data-type. SQLite knows about BLOB, TEXT, INTEGER, REAL and NULL...that's it. Is the UUID stored in a BLOB column?

from sqlite-web.

tchoutri avatar tchoutri commented on May 23, 2024

Hmm, since the column type isn't TEXT then I'll assume that yes, it's a BLOB

SQLite version 3.20.1 2017-08-24 16:21:36
Enter ".help" for usage hints.
sqlite> .schema
[…]
CREATE TABLE IF NOT EXISTS "chans" ("id" UUID PRIMARY KEY, "name" TEXT NOT NULL, "inserted_at" NAIVE_DATETIME NOT NULL, "updated_at" NAIVE_DATETIME NOT NULL);

Moreover:
screenshot-2017-11-16 sqlite web dev sqlite3

from sqlite-web.

coleifer avatar coleifer commented on May 23, 2024

With SQLite you can specify arbitrary/bogus types, but internally it has only the type "affinities" I listed earlier. UUID is not recognized, and is thus treated as TEXT (hence why the app is trying to decode it as UTF-8). Might try specifying id BLOB and checking if that fixes it?

from sqlite-web.

tchoutri avatar tchoutri commented on May 23, 2024

I changed the type in my migration file, but it didn't help peewee :/
screenshot-2017-11-17 sqlite web dev sqlite3

  File "/home/tchoutri/.local/lib/python2.7/site-packages/peewee.py", line 3830, in execute_sql
    cursor.execute(sql, params or ())
OperationalError: Could not decode to UTF-8 column 'id' with text '}�˅
�G��3i��@'

Instead of wanting to decode that, wouldn't it be easier to catch the exception and display a placeholder text like "binary data"? It's a rough guess, I never wrote python but I heard that the language uses exception-based programming a lot. :)

from sqlite-web.

coleifer avatar coleifer commented on May 23, 2024

Hmm... I'm sorry to have wasted your time, I thought that would fix it.

from sqlite-web.

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.