FWDatabaseModel

@protocol FWDatabaseModel <NSObject>

数据库模型协议信息

  • 自定义数据存储路径

    Declaration

    Objective-C

    + (nullable NSString *)databasePath;

    Return Value

    自定义数据库路径(目录即可)

  • 注意: 该返回值在改变数据模型属性类型/增加/删除属性时需要更改否则无法自动更新原来模型数据表字段以及类型

    Declaration

    Objective-C

    + (nullable NSString *)databaseVersion;
  • 注意: 该加密功能需要引用SQLCipher三方库才支持 /// 引入方式有: *** 手动引入 *** *** pod ‘Component/SQLCipher’ ***

    Declaration

    Objective-C

    + (nullable NSString *)databasePasswordKey;
  • 引入第三方创建的数据库存储路径比如:FMDB 来使用FWDatabase进行操作其他方式创建的数据库

    Declaration

    Objective-C

    + (nullable NSString *)databaseVendorPath;

    Return Value

    存储路径

  • 指定自定义表名,默认类名

    在指定引入其他方式创建的数据库时,这个时候如果表名不是模型类名需要实现该方法指定表名称

    Declaration

    Objective-C

    + (nullable NSString *)tableName;

    Return Value

    表名

  • 返回自定义主键名称

    Declaration

    Objective-C

    + (nullable NSString *)tablePrimaryKey;
  • 指定数据库表属性黑名单集合

    Declaration

    Objective-C

    + (nullable NSArray<NSString *> *)tablePropertyBlacklist;

    Return Value

    返回数据库表属性黑名单集合

  • 指定数据库表属性白名单集合

    Declaration

    Objective-C

    + (nullable NSArray<NSString *> *)tablePropertyWhitelist;

    Return Value

    返回数据库表属性白名单集合