Meet SquiDB
Written by Kay Ewbank   
Thursday, 23 April 2015

Yahoo has announced SquiDB, an open source SQLite database layer for Android.  

 

yahoosqidbgithub

 

SquiDB is designed to let you work with SQLite databases while still giving the power and flexibility of raw SQL. It combines features of an ORM with object-oriented SQL statement builders, so avoiding the need to have SQL strings in your Java code. SquiDB also includes built-in tools and hooks that you can use to write database migrations as well as implement ContentProviders.

SquiDB represents rows in your SQLite tables as objects, and according to developers Sam Bosley and Jonathan Koren on the Yahoo Engineering blog uses compile time code generation to let you define your models/table schemas as minimally as possible – the actual code you will work with is generated at compile time. You use a DatabaseDao object to read from and write to these objects from the database. The generated model class also defines constant fields that you can reference for constructing queries.

The blog post says that SquiDB’s query object and associated classes support almost the entire SQL grammar in a way that is cleaner and easier to maintain, particularly for complex queries, as shown in this example:

SQUIeg

(click in code to enlarge)

 

The pattern used by many of SQLite’s methods, including query methods, is that when you write your query, you use placeholders for arguments that will be passed to the statement. The values of these arguments are placed in a separate string. As the blog post points out, this makes the code harder to read and necessitates that extra string array for the arguments. SquiDB inserts those placeholders for you when compiling the Query object and binds the arguments automatically at query time.

The developers say that SquiDB can help you work with SQL views using model objects, write database migrations, and implement flexible ContentProviders backed by your SQLite database.  

 

yahoosq

 

 

More Information

SquiDB, a SQLite database layer for Android

SquiDB on Github

Related Articles

Yahoo Launches Games Network

Yahoo Boosts Search Share

Google Lovefield Relational Query Engine

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Google Intensive AI Course - Free On Kaggle
05/11/2024

Google is offering a 5-Day Gen AI Intensive Course designed to equip data scientists with the knowledge and skills to tackle generative AI projects with confidence. It runs on the Kaggle platform from [ ... ]



Looking Forward To NAO 7
03/11/2024

Introduced to the world in 2004 by its creator Bruno Maisonnier the kid-sized, autonomous humanoid robot NAO, turns 20 this year. At less than 2 ft tall, it is small in stature, but plays a big r [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Thursday, 23 April 2015 )