Git Product home page Git Product logo

Comments (8)

jamesgpearce avatar jamesgpearce commented on May 24, 2024

If this is as simple as hooking into LibSQL, I think this can be done easily enough. Am I missing an extra step?

from tinybase.

jamesgpearce avatar jamesgpearce commented on May 24, 2024

Main question seems to be whether to integrate with (newer) libsql-js or (older) libsql-client, or both

from tinybase.

glommer avatar glommer commented on May 24, 2024

hello @jamesgpearce - founder of Turso here. Great to see Turso integrated into this project!

the libsql-js driver is a dependency of @libsql/client, and is lower level. If you need to go down to a lower level, you may have to use it, but if possible, integrate with @libsql/client.

from tinybase.

jamesgpearce avatar jamesgpearce commented on May 24, 2024

Thanks for swinging by! And thanks for the clarification. I'll take a look.

from tinybase.

jamesgpearce avatar jamesgpearce commented on May 24, 2024

@glommer I'm wondering if there's a way to subscribe to database changes. My other sqlite-based adapters all provide a way to get to sqlite3_update_hook which I can listen to. I can't see that exposed in either libsql-js or libsql/client. Am I blind? :)

If not, is there another way to subscribe to changes, other than polling?

from tinybase.

jamesgpearce avatar jamesgpearce commented on May 24, 2024

Please give v4.7.0 a whirl! I use polling for now. https://tinybase.org/

from tinybase.

glommer avatar glommer commented on May 24, 2024

hey @jamesgpearce how did you do the integration? If you integrated at the level of our C api, this function should still be there.
If you integrated at the typescript client SDK, indeed I think there's no typescript API that exposes that directly. Can you point us to how you are doing this with any other adaptor? We're happy to expose a similar function.

Tagging my cofounder @penberg in this thread!

from tinybase.

jamesgpearce avatar jamesgpearce commented on May 24, 2024

At the moment I am polling which is not ideal but it works. If you can expose that hook that would be awesome though. Eg Expo SQLite has addDatabaseChangeListener, CR-SQLite has onUpdate, sqlite3 has db.on('change'... etc etc

from tinybase.

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.