Facilitating the spread of knowledge and innovation in professional software development



Choose your language

InfoQ Homepage News SQLite WinRT Wrapper with Lightweight APIs

SQLite WinRT Wrapper with Lightweight APIs


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;");

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.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article


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.

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

Community comments

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

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


Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.