Giter Club home page Giter Club logo

dlfmdb's Introduction

DLFMDB

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.

dlfmdb's People

Contributors

jessieplus avatar

Stargazers

MohsinAli avatar

Watchers

James Cloos avatar MohsinAli avatar

Forkers

mohsinalimat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.