Latest 0.1.0
Homepage https://github.com/yashthaker7/TYDB
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Setup Instructions

TYDB is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TYDB', :git => 'https://github.com/yashthaker7/TYDB.git'

Import DBManager.h to AppDelegate and call below method in didFinishLaunchingWithOptions.

[DBManager copyDatabaseIfNeeded];

Manually:

  1. Add Database folder to your project.
  2. Add libsqlite3.tbd or libsqlite3.0.tbd to Project -> General -> Linked Frameworks and Libraries.
  3. Import DBManager.h to AppDelegate and call below method in didFinishLaunchingWithOptions.
    [DBManager copyDatabaseIfNeeded];

How to use


Creat table

NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
[data setObject:@"Yash" forKey:@"Name"];
[data setObject:@"[email protected]" forKey:@"Email"];

[DBManager createTable:@"Users" withDictionary:data]; // pass dictionary and table name.

Insert data

NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
[data setObject:@"Yash" forKey:@"Name"];
[data setObject:@"[email protected]" forKey:@"Email"];

[DBManager insertData:data tableName:@"Users"]; // pass dictionary and table name.

Get single data

NSArray *user = [[NSArray alloc] initWithArray:[DBManager findDataWithId:2 tableName:@"Users"]]; // pass id and table name.

Get all data

NSArray *users = [[NSArray alloc] initWithArray:[DBManager getAllData:@"Users"]]; // pass table name.

Delete data

BOOL delete = [DBManager deleteDataWithId:1 tableName:@"Users"]; // pass id and table name.

Update data

NSMutableDictionary *updateData = [[NSMutableDictionary alloc] init];
[updateData setObject:@"update" forKey:@"Name"];
[updateData setObject:@"[email protected]" forKey:@"Email"];

[DBManager updateData:updateData id:1 tableName:@"Users"]; // pass dictionary, id and table name.

Get database path

NSString *getPath = [DBManager getDBPath];

Author

yashthaker7, [email protected]

License

TYDB is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "TYDB",
    "version": "0.1.0",
    "summary": "TYDB is awesome framework that allows you to create, insert, update and delete data.",
    "description": "It is intended to be simple, lightweight, and easy to use. It can be triggered with a single line of code.",
    "homepage": "https://github.com/yashthaker7/TYDB",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yashthaker7": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yashthaker7/TYDB.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "TYDB/Classes/**/*",
    "resource_bundles": {
        "TYDB": [
            "TYDB/Classes/**/*.sqlite"
        ]
    },
    "libraries": "sqlite3"
}

Pin It on Pinterest

Share This