SQLite With Swift Tutorial: Getting Started | Kodeco, the new raywenderlich.com

In this SQLite with Swift tutorial, you’ll learn to use a SQLite database with Swift projects by creating tables and inserting, updating and deleting rows.


This is a companion discussion topic for the original entry at https://www.kodeco.com/6620276-sqlite-with-swift-tutorial-getting-started

When I get to the “Create a Table” step, instead of printing “Contact table created”, I get “CREATE TABLE statement is not prepared”. I did some checking, and the result of the sqlite3_prepare_v2() function call is 1, which is the sqlite code for a generic error occurred.
I’m not sure what’s gone wrong here.

I found the problem. I was sure I had typed the code properly, but I had a typo earlier in my SQL code (in the let createTableString = “”" bit. Fixed the typo, and then my code worked fine.