Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Real-Time Full-Text Site Search with SQLite FTS5 extension (sqlitecloud.io)
54 points by marcobambini on May 17, 2023 | hide | past | favorite | 6 comments


I'm a big fan of FTS5 as a cheap/easy way of adding full text search to datasets.

Recently I've been storing these datasets in S3 and been querying them directly via a VFS[0]. Its a simple way to have FTS available to lambda functions without the cost of using an online database.

[0]: https://github.com/psanford/sqlite3vfshttp


I use it for my blog's search function:

https://github.com/fazalmajid/fts5index

Their default syntax is not great, so I wrote a converter from Google syntax to theirs.


> sqlite cloud

lmao


I get it, but seriously trying to wrap my head around it. But their example code took me a minute.

And their demo code looks like:

    #include "sqlite3.h"
             
    #ifdef USE_LOCAL_DATABASE
    #define DATABASE "/var/databases/invoice.sqlite"
    #else
    #define DATABASE "sqlitecloud://username@password:localhost/invoice.sqlite"
    #endif
            
    int main (int argc, char **argv) {
      sqlite3 *db;
      rc = sqlite3_open(DATABASE, &db);
    }

It took me a while to figure out they they are trying to replace the sqlite3.h file with a patched version that includes handling their own remote protocol.

They (in theory) provide:

> SQLite Cloud provides an open-source C library that is 100% source code compatible(1) with SQLite (based on our official SQLiteCloud C SDK).

Why not ship a sqlite3_cloud.h file? You're already using a conditional macro anyway. I assume you could also swap this version in when compiling something like Python, but the friction for a company to use this is really high. Especially when SQLite is designed for a protocol-less, local, experience. I think the fly.io method of moving an application+sqlite3 database both to the same cloud node is probably the better choice.

Or, it might be possible to do something with SQLite's virtual FS module to keep it all vanilla SQLite and still store the full database remotely.


I'm not sure how they're implementing this. If they're replacing something low-level there's advantages to sharing the higher level SQLite code. No subtle incompatibilities depending on how you run it, less code duplication. Plus this makes it easy for a user to pick which way the data is stored in a config file or something.


so, why use SQLite in cloud? Why not Postgres or MySQL?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: