sqlite-vec icon indicating copy to clipboard operation
sqlite-vec copied to clipboard

Does this support mobile and flutter?

Open zhubarb opened this issue 1 year ago • 5 comments

The only dart/flutter compatible vector db project I am aware of is this: https://github.com/FastCodeAI/DVDB.

I was wondering whether this would support Android / IoS / Flutter?

Specifically, Flutter has the following package: import 'package:sqflite/sqflite.dart' [1]; and I am curious whether this sqlite-vec would be compatible with this?

zhubarb avatar May 13 '24 11:05 zhubarb

Ideally it should work on mobile devices. It's written in portable C, so theoretically you should be able to compile sqlite-vec to work on any mobile device.

I'm unsure about sqflite, however. Is it possible to load sqlite extensions in sqflite? I can't seem to find any examples of that in their documentation. I guess we could compile on own version of SQLite with sqlite-vec builtin, but I'm unsure how the sqflite ecosystem usually handles these things

To be clear: I 100% want sqlite-vec to work on all devices, including Android/iOS/Flutter/Dart etc. But I haven't personally ever done much mobile development in the past. Would be happy to make it work if someone shows me the ropes!

asg017 avatar May 13 '24 15:05 asg017

Hi Alex, Makes sense, thanks. I think flutter/dart would be good for "two birds-one stone"ing the problem in terms of Android and IoS compatibility.

Regarding the ability to load extensions with sqflite, I found:

  1. https://stackoverflow.com/questions/53351775/loading-json1-extension-with-flutter-sqflite
  2. https://github.com/tekartik/sqflite/issues/105

I will keep digging, and post here if I find a lead.

zhubarb avatar May 13 '24 15:05 zhubarb

Made a flutter example, even got it working on MacOS!

https://github.com/rodydavis/flutter_sqlite_document_search

rodydavis avatar Aug 02 '24 17:08 rodydavis

Currently there are some blockers for web: https://github.com/simolus3/sqlite3.dart/issues/247

rodydavis avatar Aug 09 '24 00:08 rodydavis

PR: https://github.com/asg017/sqlite-vec/pull/119

rodydavis avatar Oct 11 '24 21:10 rodydavis