SQLite and iOS: Advanced GRDB

Hi,

I’ve published a new post on elliotekj.com that takes you through some of the more advanced features of GRDB now that we’ve learnt the basics. Here’s a preview; thanks for subscribing!

GRDB leverages SQLite's data change notifications to provide us with an efficient ValueObservation tool that will, in turn, call either the onChange or onError callback it is passed.

For this example, we'll implement an observer into a simple TaskListViewController whose view we want to update as and when the tasks that belong to a certain project update.

📖 Continue reading…

SQLite and iOS: Getting started with GRDB

Hi,

I’ve published a new post on elliotekj.com that guides you through setting up an SQLite database for your iOS app using GRDB. Here’s a preview; thanks for subscribing!

Designed to provide local data storage for individual applications and devices, SQLite is a small, fast, highly reliable SQL database engine that I have a lot of love for.

GRDB is a fantastic SQLite toolkit maintained by Gwendal Roué that does all the hard work for us: it provides, amongst other features, a query interface so we don't have to write raw SQL (though you can still do that if you need to), migrations, database observation, and encryption. It's what I use in my own projects, and it's what we'll be using in this article.

This article will cover setting up a local SQLite database for your iOS app, writing migrations, writing a struct to the database without any manual value mapping, and querying data pre-modelled into a struct. There will be a follow-up article that'll cover some of GRDB's more advanced features.

📖 Continue reading…

Loading more posts…