Latest 0.1.0
Homepage https://github.com/LinDing/DLFMDB
License MIT
Platforms ios 8.0, requires ARC
Authors

DLFMDB是对FMDB的封装,可以使用直接实体类对象来做增、删、改、查。

CI Status
Version
License
Platform

Feature

1.自动创建数据库、自动创建数据库表。
2.自动检测字段添加新字段。
3.一行代码实现数据库的CURD操作。
4.源码及其简单,易于理解和掌握。
5.支持多线程。
6.支持切换数据库目录。
7.支持外键。

Example

DLRSSGroup.h

#import <DLDBModel.h>

@interface DLRSSGroup : DLDBModel
@property (nonatomic, assign) int pk_id;
@property (nonatomic, copy) NSString *rg_id;
//分组的名称
@property (nonatomic, copy) NSString *name;
//外键,分组的作者id
@property (nonatomic, copy) NSString *u_id_fk;

@end

DLRSSGroup.m

#import "DLRSSGroup.h"
#import <DLDBTool.h>

@implementation DLRSSGroup

//必须重写此方法
+ (NSDictionary *)describeColumnDict{

DLDBColumnDes *pk_id = [[DLDBColumnDes alloc] initWithAuto:YES isNotNull:NO check:nil defaultVa:nil];
pk_id.primaryKey = YES;
pk_id.columnName = @"pk_id";

DLDBColumnDes *rg_id = [[DLDBColumnDes alloc] initWithgeneralFieldWithAuto:NO unique:YES isNotNull:NO check:nil defaultVa:nil];
rg_id.columnName = @"rg_id";

DLDBColumnDes *name = [[DLDBColumnDes alloc] initWithgeneralFieldWithAuto:NO unique:NO isNotNull:NO check:nil defaultVa:nil];
name.columnName = @"name";

DLDBColumnDes *u_id_fk = [[DLDBColumnDes alloc] initWithgeneralFieldWithAuto:NO unique:NO isNotNull:NO check:nil defaultVa:nil];
u_id_fk.columnName = @"u_id_fk";

return @{@"pk_id":pk_id,@"rg_id":rg_id,@"name":name,@"u_id_fk":u_id_fk};
}

@end

DLAddRSSGroupViewController.m

DLRSSGroup *RSSGroup = [[DLRSSGroup alloc] init];
RSSGroup.rg_id = @"12345";
RSSGroup.name = @"technology";
RSSGroup.u_id_fk = @"12345";
[RSSGroup saveOrUpdateByColumnName:@"rg_id" AndColumnValue:RSSGroup.rg_id];

Requirements

Installation

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

pod "DLFMDB"

Author

LinDing, [email protected]

License

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

Latest podspec

{
    "name": "DLFMDB",
    "version": "0.1.0",
    "summary": "A Cocoa / Objective-C wrapper around FMDB.",
    "homepage": "https://github.com/LinDing/DLFMDB",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "LinDing": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LinDing/DLFMDB.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "default_subspecs": "standard",
    "subspecs": [
        {
            "name": "standard",
            "libraries": "sqlite3",
            "source_files": "DLFMDB/Classes/**/*",
            "dependencies": {
                "FMDB": []
            }
        }
    ]
}

Pin It on Pinterest

Share This