![]() Of course, as I’m planning to talk about a database-related topic I assume that you have a basic SQL language understanding, otherwise maybe you should familiarise yourself with it first before you continue.Īnyway, if you’re a database lover like me, then just follow me we are just about to see some quite interesting things! Demo App Overview For more information I encourage you to see the original Github page. We’ll start by creating a new database programmatically, and we’ll see all the usual operations that can apply to the data: Insert, update, delete and select. We’ll take our walk through the FMDB library by using some simple examples in a small demonstrative app we’ll implement next. It works with both Objective-C and Swift, and as it’s really fast to integrate it into a project, productivity has no cost in that case. It’s the best option for developers who want to use their SQL knowledge and write their own SQL queries, but without having to write their own SQLite manager. ![]() So, both of them are great tools that can become perfect fit for our needs.įocusing on the FMDB library now only, this one is actually a SQLite wrapper, meaning that it provides us with the SQLite features in a higher level so we don’t have to deal with the connection stuff, as well as with the actual writing and reading of data to and from the database. But generally speaking, one can be better than the other on specific cases, and that always depends on each application’s nature and purpose. It still “hides” the connection and communication details to the SQLite database under the hood, but that’s the boring stuff after all what most developers want is to write their custom queries and to perform operations over the data. ![]() SwiftyDB offers a high-level programming API hiding all the SQL details and other advanced operations behind the scenes, while FMDB provides a way better fine-grained data handling by just being a more low-level API. However, they’re not similar at all to the way they are used. Today, I’m coming back aiming to talk about databases again, but this time I’m going to present you another library that you may have known about already: The FMDB.īoth of those libraries serve the same goal to let you handle SQLite databases, and manage your app’s data efficiently. I had covered a topic on how to manage a SQLite database using SwiftyDB some months ago on another post. So instead of hardcoded values you should fetch results from your MySQL db and echo it.Dealing with databases and handling data in general is an important and crucial part of any app. I have done a small service with MAMP, just echoing a JSON to a client "Apple", fruit2=>"Banana", fruit3=>"Pear",fruit4=>"JackFruit",fruit5=>"Guava",fruit6=>"Pomogrenate")) What I would suggest you is that learn basics of PHP, connecting to MySQL via PHP and read all your database contents and echo it as a JSON, your mobile client can use a JSON parser that would parse and give you valid information that was echoed from your PHP script.įor setting up Apache, MySQL, PHP you can go with MAMP for mac or if windows try WAMP server You can start off with connecting a MySQL DB because setting up MySQL is pretty simple.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |