Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Expert Delphi

You're reading from   Expert Delphi Robust and fast cross-platform application development

Arrow left icon
Product type Paperback
Published in Feb 2024
Publisher Packt
ISBN-13 9781805121107
Length 424 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Marco Cantù Marco Cantù
Author Profile Icon Marco Cantù
Marco Cantù
Paweł Głowacki Paweł Głowacki
Author Profile Icon Paweł Głowacki
Paweł Głowacki
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Building Blocks FREE CHAPTER
2. Chapter 1: Fasten Your Seat Belts 3. Chapter 2: Mind Your Language 4. Chapter 3: Packing Up Your Toolbox 5. Chapter 4: Using the Parallel Programming Library 6. Part 2: Going Mobile
7. Chapter 5: Playing with FireMonkey 8. Chapter 6: FireMonkey in 3D 9. Chapter 7: Building User Interfaces with Style 10. Chapter 8: Working with Mobile Operating Systems 11. Chapter 9: Desktop Apps and Mobile Bridges 12. Part 3: From Data to Services
13. Chapter 10: Embedding Databases 14. Chapter 11: Integrating with Web Services 15. Chapter 12: Building Mobile Backends 16. Chapter 13: Easy REST API Publishing with RAD Server 17. Chapter 14: App Deployment 18. Chapter 15: The Road Ahead 19. Index
20. Other Books You May Enjoy

Accessing databases with FireDAC

Now that we have a database, we need a way to access it, reading and writing data via SQL commands. The best way to do it in a Delphi application is to use FireDAC, a very powerful data access library, which has been a part of the product for many years and offers access to a dozen different database engines with native and specific drivers.

To keep the demo app simple, we are going to use SQLite as the database engine and our ToDo List app will have just one database table called ToDos. SQLite has a simple type system and effectively a column can store null, integer, real, text, or blob values.

In our design, we are going to use an integer Id value as the primary key. We will also need the Title and Category text fields. The key FireDAC component that we will need is a FireDAC database connection. There will also be query components connected to the database connection.

Let’s see how we can add a data access layer to our sample app...

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 €18.99/month. Cancel anytime