<commit_before>//
//  MTLFMDBAdapter.h
//  Mantle
//
//  Created by <NAME> on 16/07/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MTLModel;
@class FMResultSet;

/**
 *  A MTLModel object that supports being parsed from and serialized to FMDB.
 */
@protocol MTLFMDBSerializing

@required

/**
 Specify how to map property keys to different columns in FMDB.
 
 Subclasses overriding this method should combine their values with those of
 `super`.
 
 Any property keys not present in the dictionary are assumed to match the column
 name that should be used. Any keys associated with NSNull will not participate
 in serialization.

 @return a dictionary mapping property keys to FMDB columns (as strings) or 
 NSNull values.
 */
+ (NSDictionary *)FMDBColumnsByPropertyKey;

/**
 Specify the primary keys used to identify this object in SQL queries
 
 @return an NSArray of strings. Each string represents the name of a column to
 use as primary key.
 */
+ (NSArray *)FMDBPrimaryKeys;

/**
 Specify the table name for this object.
 
 @return an NSString with the name of the table.
 */
+ (NSString *)FMDBTableName;

@optional

@end

/**
 The domain for errors originating from MTLFMDBAdapter.
 */
extern NSString * const MTLFMDBAdapterErrorDomain;

/**
 The provided FMDBDictionary is not valid.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSet;

/**
 The model's implementation of +FMDBColumnsByPropertyKey included a key which
 does not actually exist in +propertyKeys.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSetMapping;

/**
 Converts a MTLModel object from and FMResultSet and to a SQL query that can
 be fed to FMDB
 */
@interface MTLFMDBAdapter : NSObject

/**
 The model object that the receiver was initialized with, or that the receiver
 parsed from an FMResultSet.
 */
@property (nonatomic, strong, readonly) MTLModel<MTLFMDBSerializing> *model;<commit_msg>Fixes #7 - exposing FMDBTransformerForKey in MTLFMDBSerializing<commit_after>//
//  MTLFMDBAdapter.h
//  Mantle
//
//  Created by <NAME> on 16/07/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <Foundation/Foundation.h>

@class MTLModel;
@class FMResultSet;

/**
 *  A MTLModel object that supports being parsed from and serialized to FMDB.
 */
@protocol MTLFMDBSerializing

@required

/**
 Specify how to map property keys to different columns in FMDB.
 
 Subclasses overriding this method should combine their values with those of
 `super`.
 
 Any property keys not present in the dictionary are assumed to match the column
 name that should be used. Any keys associated with NSNull will not participate
 in serialization.

 @return a dictionary mapping property keys to FMDB columns (as strings) or 
 NSNull values.
 */
+ (NSDictionary *)FMDBColumnsByPropertyKey;

/**
 Specify the primary keys used to identify this object in SQL queries
 
 @return an NSArray of strings. Each string represents the name of a column to
 use as primary key.
 */
+ (NSArray *)FMDBPrimaryKeys;

/**
 Specify the table name for this object.
 
 @return an NSString with the name of the table.
 */
+ (NSString *)FMDBTableName;

@optional

/**
 Specify the `NSValueTransformer` that should be used to transform values
 fetched from FMDB.
 
 @param key The key corresponding to the column in FMDB
 
 @return the `NSValueTransformer` that should be used
 */
- (NSValueTransformer *)FMDBTransformerForKey:(NSString *)key;

@end

/**
 The domain for errors originating from MTLFMDBAdapter.
 */
extern NSString * const MTLFMDBAdapterErrorDomain;

/**
 The provided FMDBDictionary is not valid.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSet;

/**
 The model's implementation of +FMDBColumnsByPropertyKey included a key which
 does not actually exist in +propertyKeys.
 */
extern const NSInteger MTLFMDBAdapterErrorInvalidFMResultSetMapping;

/**
 Converts a MTLModel object from and FMResultSet and to a SQL query that can
 be fed to FMDB
 */
@interface MTLFMDBAdapter : NSObject

/**
 The model object that the receiver was initialized with, or that the receiver
 parsed from an FMResultSet.
 */
@property (nonatomic, strong, readonly) MTLModel<MTLFMDBSerializing> *model;
{'fraction_non_alphanumeric': 0.07284299858557285, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 4.149271844660194, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5496968', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1199, 'n_words': 517}