2017-05-22 13:09:19 -07:00

34 lines
859 B
Objective-C
Executable File

//
// NSString+RSDatabase.h
// RSDatabase
//
// Created by Brent Simmons on 3/27/15.
// Copyright (c) 2015 Ranchero Software, LLC. All rights reserved.
//
@import Foundation;
@interface NSString (QSDatabase)
/*Returns @"(?, ?, ?)" -- where number of ? spots is specified by numberOfValues.
numberOfValues should be greater than 0. Triggers an NSParameterAssert if not.*/
+ (NSString *)rs_SQLValueListWithPlaceholders:(NSUInteger)numberOfValues;
/*Returns @"(someColumn, anotherColumm, thirdColumn)" -- using passed-in keys.
It's essential that you trust keys. They must not be user input.
Triggers an NSParameterAssert if keys are empty.*/
+ (NSString *)rs_SQLKeysListWithArray:(NSArray *)keys;
/*Returns @"key1=?, key2=?" using passed-in keys. Keys must be trusted.*/
+ (NSString *)rs_SQLKeyPlaceholderPairsWithKeys:(NSArray *)keys;
@end