BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

SQLite WinRT Wrapper with Lightweight APIs

by Anand Narayanaswamy on Jun 08, 2013 |

SQLite WinRT Wrapper for Windows Phone 8 provides an ability to access the SQLite database functionality using lightweight Windows Runtime (WinRT) APIs. The wrapper provides functions for various database actions as listed below

The above mentioned operations follow the async pattern that means they perform operations on a worker thread, which helps make your database apps fast and fluid. The wrapper also provide support for exception based programming and is mainly designed to provide a very thin wrapper over the SQLite functionality.

SQLite WinRT wrapper also supports collection-based access to the returned result, but it's not enabled by default because it slows down processing and returns all columns as strings. In order to make use of this feature, you should call EnableColumnsProperty() method.\

var statement = await db.PrepareStatementAsync("SELECT rowid, CityName FROM Cities;");
statement.EnableColumnsProperty();


In order to fix the problems associated with read only databases, you can either make use of temp_store pragma to force SQLite to use in-memory temporary tables and indices or copy the database from the install folder to the isolated storage folder on the first run of your app. While the first option is the easy to use, the second option uses more disk space and will take little time to initiate the first boot. However, you will not notice any undue delay if the database file is small. \

"Another feature that needs to be avoided with read-only databases is the journal_mode pragma with a value of WAL (write-ahead logging)," said Peter Torr, Program Manager, Windows Phone Developer Platform.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT