How to create sqlite database programmatically?

How to create sqlite database programmatically?

SQLite isn’t the only way to persist data on iOS. Besides Core Data, there are lots of other alternatives for data persistence, including Realm, Couchbase Lite, Firebase, and NSCoding.

SQLite does have some advantages:

  • Shipped with iOS so it adds no overhead to your app’s bundle
  • Tried and tested; version 1.0 was released in August 2000
  • Open source
  • Familiar query language for database developers and admins
  • Cross-platform

Creating a Table
Now that you have a connection to a database file, you can create a table. You’ll work with a very simple table to store contacts.

// SWIFT 

 

// OBJECTIVE-C