• Stars
    star
    157
  • Rank 238,399 (Top 5 %)
  • Language
    Objective-C
  • Created over 9 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

One Key Database Operations

image

OC收山之作: CoreModel Series

##CoreFMDB
.Xcode 5.0, iOS 6.0
.OC,Swift
.Under the MIT License



SERIES

    Doesn’t know how to write sql? No worries. Now the second part offers you one key 
    automatically create table, one key CURD, automatically check model and 
    dynamically add field, model cascade CURD. All these things are automatic without          
    one sql code.
    
    
    
    Due to my time constraints and ease of use these frames,
    the release cycle will be long.
    
    
    
    EN:The second part  automatically CURD release date: 21/06/2015, so stay tuned or 
    join our qq group(163865401) to get the latest news, thanks a lot.



EN:I am Charlin Feng, a developer from Chengdu, China. The true spirit of open source is an attitude and sharing even a challenge to the traditional way. There is no flaunt, pretentious or money but all my spirits which need your support.


The core purpose of these series frames is replace to Core Data and implement one key Dynamic Cache. This is the first frame with other three followed. You are gonna ask me why make these frame so separately. Even some of my friends blame me at the “chaos” of my projects’ structure. Actually, it’s due to I got a magnificent frame in all my frameworks with a core purpose which is decoupling. Because I believe that I will try my best to separate it if it’s a function module. I feel I benefit from the core idea of decoupling. I hope you guys could understand. Thank you very much.



DEPENDENCE

.FMDB

USAGE

This frame is based on FMDB and it’s static package, all classes method call, thread-safe at the same time. You don’t need to create datebase object, instance or record. It’s a green, simple and good frame.


1. Introduced header

  #import "CoreFMDB.h"

2. the method of the update statement

    /**
     *  执行一个更新语句
     *
     *  @param sql 更新语句的sql
     *
     *  @return 更新语句的执行结果
     */
    +(BOOL)executeUpdate:(NSString *)sql;

3. the method of search statement

    /**
     *  执行一个查询语句
     *
     *  @param sql              查询语句sql
     *  @param queryResBlock    查询语句的执行结果
     */
    +(void)executeQuery:(NSString *)sql queryResBlock:(void(^)(FMResultSet *set))queryResBlock;

5. Truncate your table

/**
*  清空表(但不清除表结构)
*
*  @param table 表名
*
*  @return 操作结果
*/
+(BOOL)truncateTable:(NSString *)table;

5. get the recored count of table

    /**
     *  表记录数计算
     *
     *  @param table 表
     *
     *  @return 记录数
     */
    +(NSUInteger)countTable:(NSString *)table;

6. get all the rows of the table

    /**
     *  查询出指定表的列
     *
     *  @param table table
     *
     *  @return 查询出指定表的列的执行结果
     */
    +(NSArray *)executeQueryColumnsInTable:(NSString *)table;


EXAMPLE

    BOOL res =  [CoreFMDB executeUpdate:@"create table if not exists user(id integer primary key autoIncrement,name text not null default '',age integer not null default 0);"];
    
    if(res){
        NSLog(@"创表执行成功 create table succeed");
    }else{
        NSLog(@"创表执行失败 create table fails");
    }

    

    BOOL res2= [CoreFMDB executeUpdate:@"insert into user (name,age) values('jack',27);"];

    if(res2){
        NSLog(@"添加数据成功 add data succeed");
    }else{
        NSLog(@"添加数据失败 add data fails");
    }

    

    NSArray *columns = [CoreFMDB executeQueryColumnsInTable:@"user"];
    
    NSLog(@"列信息:%@",columns);


    [CoreFMDB executeQuery:@"select * from user;" queryResBlock:^(FMResultSet *set) {
        
        while ([set next]) {
            NSLog(@"%@-%@",[set stringForColumn:@"name"],[set stringForColumn:@"age"]);
        }
        
    }];
    
    
    
    NSUInteger count = [CoreFMDB countTable:@"user"];
    
    NSLog(@"当前有%@条记录",@(count));




Career

Charlin's Career

WebSite:http://ios-android.cn
Sina WeiBo:http://weibo.com/charlin2015/


CoreModel Series

One:CoreFMDB https://github.com/nsdictionary/CoreFMDB

Two:CoreArchive https://github.com/nsdictionary/CoreArchive

Three:CoreModel https://github.com/nsdictionary/CoreClass

More Repositories

1

CorePhotoBroswerVC

快速集成高性能照片浏览器,支持本地及网络相册
Objective-C
1,575
star
2

CoreLock

高仿支付宝解锁
Objective-C
971
star
3

CoreModel

Replace CoreData
Objective-C
727
star
4

PhotoBrowser

Photo Browser Terminator
Swift
613
star
5

CFCityPickerVC

城市选取控制器
Swift
544
star
6

Reflect

Reflection, Dict2Model, Model2Dict, Archive
Swift
307
star
7

CoreStatus

网络状态监听者:可监听2G/3G/4G
Objective-C
220
star
8

CoreLaunch

一键启动动画
Objective-C
214
star
9

CorePagesView

列表滚动视图,性能王者!
Objective-C
189
star
10

CoreRefresh

核心上拉下拉刷新控件,高性能、与众不同!
Objective-C
188
star
11

CoreNavVC

Most Powerfull NavigationController
Objective-C
187
star
12

CFRuntime

重磅推出:Swift版的MJExtension,运行时、反射与一键字典模型互转
Swift
174
star
13

CoreNewFeatureVC

版本新特性
Objective-C
171
star
14

Show

信息公示牌
153
star
15

CorePhotoPickerVCManager

大统一的多功能照片选取器,集成拍摄,单选,多选。
Objective-C
150
star
16

CoreJPush

三分钟,五句代码,搞定JPush
Objective-C
125
star
17

CoreArchive

One Key Archive
Objective-C
111
star
18

CoreUmeng

友盟分享封装
Objective-C
103
star
19

CoreHttp

抛弃AFN,网络处理工具类,将网络交互玩于股掌间的利器!
Objective-C
93
star
20

CorePullScale

表格顶部图片下拉放大控件,一键式安装,异常简单
Objective-C
86
star
21

CoreEmotionView

表情键盘
Objective-C
79
star
22

CoreTFManagerVC

强大的键盘躲避管理器,完全解耦版本!
Objective-C
77
star
23

TextField-InputView

UITextField+InputView模式:终结注册类、信息采集类
Swift
68
star
24

CFPPTView

Swift版幻灯,scrollView无限滚动,支持网络和本地图片展示!
Objective-C
66
star
25

CorePPTVC

幻灯终结者:超简单、酷且炫、多样式、自定义!
Objective-C
62
star
26

CoreLabel

为图文混排而设计,超轻量级的Label,轻度使用下是TTTLabel的最佳替换选择
Objective-C
61
star
27

SinaPhotoView

朋友圈相册视图
Swift
57
star
28

CoreCategory

核心分类,基本所有需要用的功能聚集于此!
Objective-C
48
star
29

CFPagesVC

Professional Multi controller management Framework based on Swift
Swift
45
star
30

CoreMediaFuncManagerVC

一句话打电话
Objective-C
39
star
31

CoreBtn

核心按钮,让界面更专业!旨在替代一部份HUD的Btn
Objective-C
36
star
32

TextView-KeyBoard

textView的键盘躲避者,一句代码集成,灵活,好用。
Swift
34
star
33

CorePasswordView

仿支付宝密码视图
Objective-C
32
star
34

CoreHamburgerManagerVC

汉堡菜单,高度解耦,您想怎么搞就怎么搞!
Objective-C
31
star
35

CoreAleetViewManagerVC

高度集成AlertView/ActionSheet,真的只需要一句代码!
Objective-C
26
star
36

CoreSVP

核心提示工具
Objective-C
25
star
37

CoreList

内部研发
Objective-C
21
star
38

ThreeDTouch

3D Touch
Swift
18
star
39

CoreViewNetWorkStausManager

网络状态提示图层管理者,提高你的app的逼格与细节。
Objective-C
17
star
40

CoreException

核心异常捕捉及处理框架
Objective-C
15
star
41

CoreEaseMob

EaseMob
Objective-C
15
star
42

SwipeNavigationVC

向右滑动退出栈顶控制器
Objective-C
15
star
43

CorePickerView

极简选取器,一安一取,简单方便!
Objective-C
13
star
44

ShiDianFontFit

全自动的屏幕字体适配
Objective-C
13
star
45

CoreBlurView

第二牛B的模糊视图(含图片模糊)
Objective-C
12
star
46

CoreReg

正则封装
Objective-C
11
star
47

CorePageControl

高度自定义的pageControl
Objective-C
10
star
48

CFSegmentControl

双版本分段选取控件
Swift
9
star
49

CoreWeb

原生WebView与H5混编,高效,简单!
8
star
50

CoreExtend

Charlin私有框架:核心扩展
Objective-C
7
star
51

CoreSDWebImage

自用图片加载模型,基于SDWebImage封装
Objective-C
6
star
52

CFSnapKit

CFSnapKit
Swift
6
star
53

CoreFormView

表格
Objective-C
6
star
54

AppLaunchADView

AppLaunchADView
Swift
5
star
55

Resource

5
star
56

SwiftExtension

SwiftExtension
Swift
5
star
57

CoreToast

基于CRToast的封装,更好用
Objective-C
5
star
58

CoreCalendar

日历
Objective-C
5
star
59

CoreJazzHandsVC

手势帧动画
Objective-C
5
star
60

KRVideoPlayerVC

KRVideoPlayer 修改版
Objective-C
5
star
61

CoreCapture

仿微信视频拍摄
Objective-C
4
star
62

CoreAddressBookVC

通讯录
Objective-C
4
star
63

CoreTransition

Push切换
Objective-C
4
star
64

CoreGuideView

CoreGuideView
Objective-C
4
star
65

CoreKXMovie

编译KXMovie
C
3
star
66

ShiDianHttp

基于Volley的框架(浓郁的iOS风格)
Java
3
star
67

LocationManager

LocationManager
Swift
3
star
68

AnimTabVC

AnimTabVC
Swift
3
star
69

CoreRAC

集成RAC
Objective-C
3
star
70

CoreMasonry

Masonry
Objective-C
3
star
71

CoreShineLabel

淡入淡出的Label
Objective-C
3
star
72

CountDownLabel

考试系统倒计时
Swift
3
star
73

CoreVideoView

CoreVideoView
Objective-C
3
star
74

Snapkit

Snapkit
Objective-C
2
star
75

ImagePicker

ImagePicker
Objective-C
2
star
76

CoreYYWebImage

CoreYYWebImage
Objective-C
2
star
77

WeChatApp

微信小程序笔记
2
star
78

CorePopView

CorePopView
Objective-C
2
star
79

CorePaperButton

CorePaperButton
Objective-C
2
star
80

CorePopoverController

PopoverController
Objective-C
2
star
81

CoreWebViewController

CoreWebViewController
Objective-C
2
star
82

CoreTipView

CoreTipView
Objective-C
2
star
83

Pop

Pop动画引擎
Objective-C++
2
star
84

ShiDianPay

ShiDianPay
C
2
star
85

CoreKeyChain

KeyChain
Objective-C
2
star
86

YeahComponent

YeahComponent
Objective-C
1
star
87

ShiDianPlayerView

ShiDianPlayerView
Objective-C
1
star
88

CFPhotoBroswer

Powefull PhotoBroswer For Swift
Swift
1
star
89

MapView

MapView
Swift
1
star
90

CoreLBXScan

CoreLBXScan
Objective-C
1
star
91

CoreJHAnim

CoreJHAnim
Objective-C
1
star
92

CoreTextView

CoreTextView
Objective-C
1
star
93

NewcomerGuide

NewcomerGuide
Swift
1
star
94

CoreAsyncDisplayKit

CoreAsyncDisplayKit
Objective-C++
1
star
95

CoreMorphingLabel

仿iOS8的Label
Objective-C
1
star
96

CoreIV

CoreIV
Objective-C
1
star
97

ShiDianUM

ShiDianUM
Objective-C
1
star
98

ShiDianWebViewController

Objective-C
1
star
99

CoreUMengMobClick

CoreUMengMobClick
Objective-C
1
star
100

ShiDianRefresh

ShiDianRefresh
Objective-C
1
star