Learning SQLite for iOS
eBook - ePub

Learning SQLite for iOS

Gene Da Rocha, MSc, BSc (Hons)

Share book
  1. 154 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning SQLite for iOS

Gene Da Rocha, MSc, BSc (Hons)

Book details
Book preview
Table of contents
Citations

About This Book

Extend SQLite with mobile development skills to build great apps for iOS devices

About This Book

  • Implement Swift code using SQLite statements
  • Learn the background to SQL and SQLite for mobile development, its statements, and command features through practical examples
  • Extend the standard SQLite functionality and increase your software creation portfolio

Who This Book Is For

This book is intended for those who want to learn about SQLite and how to develop apps in Swift or HTML5 using SQLite. Whether you are an expert Objective-C programmer or new to this platform, you'll learn quickly, grasping the code in real-world apps to use Swift.

What You Will Learn

  • Explore Swift's basic language statements
  • Connect to SQLite and execute SQL statements
  • Extend the SQLite language to create your own software extensions
  • Use HTML5 with Phonegap on iOS
  • Set up a Swift project using XCode with SQLite
  • Administer SQLite databases in an easy and effective way

In Detail

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications.

This book starts with the architecture of SQLite database and introduces you to concepts in SQL. You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands.

You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.

Style and approach

This book is a practical and comprehensive guide to developing applications using SQLite and iOS.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Learning SQLite for iOS an online PDF/ePUB?
Yes, you can access Learning SQLite for iOS by Gene Da Rocha, MSc, BSc (Hons) in PDF and/or ePUB format, as well as other popular books in Informatique & Programmation en SQL. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785288975

Learning SQLite for iOS


Table of Contents

Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Introduction to SQL and SQLite
About SQL
Where does SQLite stand in today's industry?
iOS with SQLite
Embedded databases
The architecture of the SQLite database
Features
The advantages of using SQLite
Working with SQLite
The examples of using SQLite with iOS
Summary
2. Database Design Concepts
Database essentials
Reasons for using SQLite
Database connections
Preparing queries
Parameterized SQL
Error handling
Queries within the db.exec statement
SQL injection attacks
Creating user-defined functions
Transactions and locks
Transactions – reading/writing
Designing for SQLite
Summary
3. Administering the Database
Creating a database
Creating a table
Inserting data
Selecting data
Creating an index
Exporting data
Viewing database schema data
Index data
Schema data
Backing up the database
Database tools
Database file information
Summary
4. Essentials of SQL
Transactions
Query plan
SQL basics
Insert with a subselect clause
Update with a subselect clause
Select with a subselect clause
Data integrity
Default values
Constraint checking
Foreign keys
Updating Views
Index use
Triggers
Synchronous writes
Database locking and deadlocks
FMDB SQLite wrapper
Database creation and opening
SQL in iOS
Summary
5. Exposing the C API
SQLite C components' functionality
sqlite3_open()
sqlite3_prepare()
sqlite3_step()
sqlite3_column()
sqlite3_finalize()
sqlite3_close()
Using the C API with the open database statement
Using Swift with the open database statement
load_extension()
sqlite3_exec()
sqlite3_config()
The prepare statement
Summary
6. Using Swift with iOS and SQLite
Basic requirements
Starting an Xcode Project with Swift
Using the SQLite 3 Library
Using FMDB
Summary
7. iOS Development with PhoneGap and HTML5
HTML5 and PhoneGap development
An HTML5 framework
Hybrid applications
An Xcode project with PhoneGap, HTML5, and Swift
Summary
8. More Features and Advances in SQLite
PhoneGap plugins
Extensions to the C API
Write Ahead Logging with SQLite
The B-tree usage with SQLite
Creating a simple Swift
Summary
Index

Learning SQLite for iOS

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2016
Production reference: 1180316
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-897-5
www.packtpub.com

Credits

Author
Gene Da Rocha, MSc, BSc (Hons)
Reviewers
Alvaro Franco
Ting Xiao
Acquisition Editors
Larissa Pinto
Subho Gupta
Content Development Editor
Rashmi Suvarna
Technical Editor
Anushree Arun Tendulkar
Copy Editors
Charlotte Carneiro
Yesha Gangani
Ameesha Green
Project Coordinator
Judie Jose
Proofreader
Safis Editing
Indexer
Tejal Daruwale Soni
Graphics
Abhinash Sahu
Production Coordinator
Aparna Bhagat
Cover Work
Aparna Bhagat

About the Author

Gene Da Rocha, MSc, BSc (Hons) in mobile and computer science is an experienced IT professional with over 25 years in the IT industry. He has worked for a variety of companies nationally and internationally, in different industries including corporate, start-up, pharmaceutical, finance, banking, and the NHS.
Gene is also the owner and founder of a mobile solutions company, Voxstar (www.voxstar.com), based in London and Buckinghamshire. He comes from a programming and development background, and has worked with database technology, iOS, Android, Windows mobile, and a variety of other technologies.
He has been helping and advising, programming, and recently testing software for a number of companies such as DigitasLBI, Oxfam, News UK, QAWorks, Reuters, and the Association for Project Management, among many others.

About the Reviewer

Alvaro Franco is an iOS engineer and web developer. He has contributed to the iOS and OS X open source community. He has also been a part of Aluana, building Mindrop, and companies such as Mozilla, where he contributed to delivering Firefox for iOS. Alvaro is also a motorsport fan and guitarist.
Ting Xiao, is a frontend developer focusing on how to make things good on the webpage; she is also working on the development of a mobile app simultaneously. She is interested in any brain technology. According to Ting, thanks to the technology, we can know this world much better.

www.PacktPub.com

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
eBooks, discount offers, and more
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

  • Fully searchab...

Table of contents