Latest 0.2.3
Homepage https://github.com/manimaul/madsqlite-ios-objc
License BSD
Platforms ios 8.0, requires ARC
Authors

MadSqlite iOS Objective-C Framework

Build Status

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

pod 'MadSqlite', '~> 0.2.3'

or bleeding edge:

pod 'MadSqlite', :git => 'https://github.com/manimaul/madsqlite-ios-objc.git', :submodules => true

Example

// Open / create database
id <MADDatabase> md = [MADSqliteFactory databaseNamed:@"mydb"];
[md exec:@"CREATE TABLE location_table(name TEXT, latitude REAL, longitude REAL, image BLOB);"];

// Insert into database
id <MADContentValues> cv = [MADSqliteFactory contentValues];
[cv putString:@"name" withValue:@"Cheshire Cat"];
[cv putReal:@"latitude" withValue:@(51.2414945)];
[cv putReal:@"longitude" withValue:@(-0.6354629)];
NSData *data = UIImagePNGRepresentation([UIImage imageNamed:@"Cheshire Cat"]);
[cv putBlob:@"image" withValue:data];
[md insert:@"location_table" withValues:cv];

// Query database
id <MADQuery> query = [md query:@"SELECT name, latitude, longitude FROM location_table WHERE name=?"
                       withArgs:@[@"Cheshire Cat"]];
if ([query moveToFirst]) {
    while (![query isAfterLast]) {
        NSString *name = [query getString:0];
        NSNumber *latitude = [query getReal:1];
        NSNumber *longitude = [query getReal:2];
        NSLog(@"name:%@ latitude:%@ longitude:%@", name, latitude, longitude);
        [query moveToNext];
    }
}

Latest podspec

{
    "name": "MadSqlite",
    "version": "0.2.3",
    "summary": "A simple Sqlite Abstraction",
    "description": "A simple Sqlite Abstraction with FTS5 and R*Tree enabled",
    "homepage": "https://github.com/manimaul/madsqlite-ios-objc",
    "license": {
        "type": "BSD",
        "file": "LICENSE.md"
    },
    "authors": {
        "William Kamp": "[email protected]"
    },
    "source": {
        "git": "https://github.com/manimaul/madsqlite-ios-objc.git",
        "tag": "0.2.3",
        "submodules": true
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": [
        "MadSqlite/Classes/**/*.{h,m,hh,mm}",
        "madsqlite-core/src/main/cpp/*.{hpp}",
        "madsqlite-core/src/main/cpp/api/*.{hpp}",
        "madsqlite-core/src/main/cpp/MadContentValuesImpl.cpp",
        "madsqlite-core/src/main/cpp/MadQueryImpl.cpp",
        "madsqlite-core/src/main/cpp/MadDatabaseImpl.cpp",
        "madsqlite-core/src/main/cpp/sqlite-amalgamation/sqlite3.c",
        "madsqlite-core/src/main/cpp/sqlite-amalgamation/sqlite3.h"
    ],
    "private_header_files": [
        "madsqlite-core/src/main/cpp/*.{hpp}",
        "madsqlite-core/src/main/cpp/api/*.{hpp}",
        "MadSqlite/Classes/**/*Impl.{hh}",
        "madsqlite-core/src/main/cpp/sqlite-amalgamation-3140200/sqlite3.h"
    ],
    "requires_arc": true,
    "libraries": "c++",
    "xcconfig": {
        "CLANG_CXX_LANGUAGE_STANDARD": "c++14",
        "CLANG_CXX_LIBRARY": "libc++",
        "OTHER_CFLAGS": "-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_RTREE"
    }
}

Pin It on Pinterest

Share This