Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Dart to SQLite?

My old application used web2py with SQLite as the database. Now I want to try porting this app to Dart and again use SQLite as the database.

I can't find any documentation on how to use it. I just found out how to use MySQL with sqljocky.

I've tried to read the web_sql and indexed_db APIs, but I can't find a way to connect to SQLite. How can I use SQLite from Dart?

like image 490
AhmadDani Avatar asked May 20 '13 02:05

AhmadDani


People also ask

How do I connect to a SQLite database?

Select SQLite from the list. Give a Connection name for your own internal reference. For Database , click Choose a File and then select the database file on your local machine to which you want to connect. Hit Connect and you're all set!


1 Answers

As far as I can tell, dart-sqlite is the only public attempt at SQLite bindings for Dart, but it's out of date. My guess is that it would actually be pretty easy to update the code and get it up-and-running.

web_sql and indexed_db are both for use in the browser, which, as far as I can tell from your question, isn't what you're looking for.

Update: I updated dart-sqlite so that all the tests now pass, at least on my machine. You're definitely venturing into uncharted territory if you use it, but it's a start.

like image 53
Darshan Rivka Whittle Avatar answered Oct 03 '22 09:10

Darshan Rivka Whittle