Git Product home page Git Product logo

Comments (5)

PeterSurda avatar PeterSurda commented on August 20, 2024

This is true, but there are potential problems with upgrades. That's why the sql thread should be refactored first and added tests. These are the PRs that tried that but they are too big and need cleaning up: #1794 #1999 #2150

from pybitmessage.

kashikoibumi avatar kashikoibumi commented on August 20, 2024

The type of values whose declared type is blob:

  • inbox.msgid : text
  • inbox.sighash : text
  • inventory.hash : blob
  • inventory.payload : blob
  • inventory.tag : blob
  • objectprocessorqueue.data : (empty)
  • pubkeys.transmitdata : text
  • sent.msgid : text
  • sent.toripe : text
  • sent.ackdata : text
  • settings.key : text
  • settings.value : text, integer

from pybitmessage.

PeterSurda avatar PeterSurda commented on August 20, 2024

It actually isn't consistent across versions, there may be older databases which are different. That's why we need tests for this, even more for the data type change.

from pybitmessage.

kashikoibumi avatar kashikoibumi commented on August 20, 2024

How about this:

  • Change all code at once to store all blob data as blob by using sqlite3.Binary(). Then,
  • Search any blob data:
    • First, try SELECT by blob keys using sqlite3.Binary(key).
    • When there is no match found, as a fallback, try SELECT by text key using CAST(? AS TEXT) in SQLite sintax.

I think this should be compatible to any past versions and future updates, including migrations to Python3.

from pybitmessage.

kashikoibumi avatar kashikoibumi commented on August 20, 2024

I have implemented a quick workaround: #2248

from pybitmessage.

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.