Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use SQLite extensions with fastlite? #27

Open
FrLars21 opened this issue Sep 24, 2024 · 3 comments
Open

How can I use SQLite extensions with fastlite? #27

FrLars21 opened this issue Sep 24, 2024 · 3 comments

Comments

@FrLars21
Copy link

Hi there,

I am using fastlite for my FastHTML app. I am using the sqlite-vec extension installed via its sqlite-utils plugin. When I access the database via sqlite-utils' Database object, I can access the sqlite-vec functionality without any issues. If I access the same database via fastlite's Database object, I get the following error:

sqlite no such module: vec0

Given that fastlite is described as a "thin wrapper around sqlite-utils", I expected the sqlite-vec extension to work seamlessly here as well. Is there a known configuration step I might be missing, or does fastlite handle extensions differently?

I'd appreciate any guidance or suggestions on how to resolve this.

Thanks in advance for your help!

Best regards,
Frederik

@asg017
Copy link

asg017 commented Sep 28, 2024

@FrLars21 it's undocumented, but try passing in execute_plugins to the sqlite-utils Database class. Plugins (like sqlite-utils-sqlite-vec) don't automatically enable in the Python API unless execute_plugins=True in the constructor.

@alonsosilvaallende
Copy link

alonsosilvaallende commented Oct 15, 2024

@FrLars21 it's undocumented, but try passing in execute_plugins to the sqlite-utils Database class. Plugins (like sqlite-utils-sqlite-vec) don't automatically enable in the Python API unless execute_plugins=True in the constructor.

I think the possibility to use plugins was lost after fastlite version 0.0.5.
See previously: https://gist.github.com/alonsosilvaallende/9a304bf9514446c5a92b11445f084961
After fastlite version 0.0.5: https://gist.github.com/alonsosilvaallende/7cc32f777e8f20cacb5b537b8eaa13d4

By reading the release it was when fastlite passed from sqlite-utils to sqlite-minutils. I wonder if it's possible to just add the possibility to add plugins such as sqlite-vec (of which I'm a big fan) and not add all the other cli options (redundant for a Python library).

@alonsosilvaallende
Copy link

For information, I opened an issue related to this to sqlite-minutils: AnswerDotAI/sqlite-minutils#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants