Kodeco Forums

SQLite With Swift Tutorial: Getting Started

In this SQLite with swift tutorial, learn how to utilise the SQLite database with your Swift projects, including inserting, updating and deleting rows.


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

Hello I am using Xcode 8.2.1 swift 3.0 I am trying to learn to use SQLite by taking this tutorial.
I know SQLIte is on my Mac since I can use it in the terminal window to create tables.
However I want to follow this Tutorial and my Xcode says
Playground execution failed: error: The C API.xcplaygroundpage:24:8: error: no such module ā€˜SQLite3ā€™
import SQLite3

Cant even try to Import SQLite into old Project, didnā€™t let me.

How do I get Xcode to Import SQLite?

is their any way to perform join on tables of different databases in sqlite using swift

Hi @delmarsh,

you need to use Xcode 9 for this tutorial. Also, I believe on older Xcode versions you actually need to import import SQL instead of import SQLite3.

Hello! How can I call insert method in ViewController class?



Hi ! I can't find **SQLite3** and **Darwin.stdlib** in Developer Document, and I don't find those in Google, how Can I find those???????? !!!!!!!!!!!!!!!!!!!!!!

how should i go about creating a cross platform database app. Iā€™m planning to create an inventory app which mostly will be accessed on Mac but sometime via windows too? (iOS not required.)

If not then atleast on Mac again iOS not required.

@shaokahn @delmarsh

Thanks very much for your questions! I believe the problem youā€™re running into is because you have not imported the correct framework into your project in Xcode. If you go into ā€œBuild Phasesā€, and then select ā€œLink Binary with Librariesā€, you will find the options to include the SQLite frameworks into your project as shown in the following screenshot:

Once you have imported the framework into your project, you should be able to import the necessary library in your relevant ViewControllers :slight_smile:

I hope this helps!

All the best!

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!