Coder Social home page Coder Social logo

How to add FTS5? about direct-sqlite HOT 5 CLOSED

ireneknapp avatar ireneknapp commented on July 17, 2024
How to add FTS5?

from direct-sqlite.

Comments (5)

dunnl avatar dunnl commented on July 17, 2024

I would like to add: When I changed the preceding execute_ <blah>s to query_ <blah> :: IO [Only String] (in case sqlite-simple was returning an informational message), I simply got [] back. Also, my own sqlite3 executable DOES see the virtual tables created using direct-sqlite when built with -DSQLITE_ENABLE_FTS5. It seems that only the match part isn't working.

from direct-sqlite.

nurpax avatar nurpax commented on July 17, 2024

Yep, sqlite-simple shouldn't matter here.

My guess would be that the -D feature enable somehow doesn't go through or that the sqlite-simple build (or your app build) somehow picks up an unmodified direct-sqlite build. Are you using stack? If you are, are you starting ghci with stack ghci?

Do you see any disadvantages to enabling FTS5 always? I could make a release that unconditionally turns it on in the release cabal file.

from direct-sqlite.

dunnl avatar dunnl commented on July 17, 2024

I've built a little repo for testing this here to play around with different stack.yaml options so you can see my configuration. With that repo I've reproduced this problem on OS X and Linux.

When I get the time I'm going to keep looking into this, maybe without sqlite-simple or even the C API against the raw sqlite.c file.

from direct-sqlite.

dunnl avatar dunnl commented on July 17, 2024

I followed the instructions here to build a little C program that runs individual queries. I've confirmed that the behavior is the same, (everything seems to work but MATCH), so I believe this is a problem with the direct-sqlite amalgamation. Still doing some tests to see if it's just a matter of updating the file.

Update: I ran my test against this fork that has an updated (3.20) amalgamation and -DSQLITE_ENABLE_FTS5 in the cabal file. The test works (I can insert and retrieve data from FTS5 virtual tables with MATCH). Any thoughts on putting together a new release with 3.20 and FTS5 enabled by default? (The cabal test passes). Is the stat64 patch still necessary?

from direct-sqlite.

moll avatar moll commented on July 17, 2024

I believe the latest version of Direct SQLite in Hackage already comes with FTS5 enabled. Worked when I tried it.

from direct-sqlite.

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.