Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning SQLite for iOS

You're reading from  Learning SQLite for iOS

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781785288975
Pages 154 pages
Edition 1st Edition
Languages
Author (1):
Gene Da Rocha Gene Da Rocha
Profile icon Gene Da Rocha
Toc

Table of Contents (15) Chapters close

Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Introduction to SQL and SQLite 2. Database Design Concepts 3. Administering the Database 4. Essentials of SQL 5. Exposing the C API 6. Using Swift with iOS and SQLite 7. iOS Development with PhoneGap and HTML5 8. More Features and Advances in SQLite Index

Viewing database schema data


SQLite offers several commands as part of a command set to get information about the contents of a database. For example, to get a list of tables, use the .table command. To find a specific table name, use a % symbol and text as a pattern to find the result, for example, .tables [pattern], as shown in the following screenshot. By issuing the .tables command and appending a %te% text to it, is a request to SQLite to list all its tables within the database that has the word te (in our case temp) in their name which are displayed correctly:

Index data

Prior to the following example, a temp_idx index has been created, to get a list of indexes for the temp table, at the sqlite3 prompt .indices temp, which is actually the .indices command followed by the table name, as shown here:

By using the preceding command, the temp table's index can be seen.

Schema data

To view the schema of the database, the following command can be issued, .schema, but type the .schema <table...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime}