mirror of
https://github.com/gnustep/libs-sqlclient.git
synced 2025-02-21 02:41:07 +00:00
Add -isNull
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@39698 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e0e7b74a1f
commit
9449f33fe7
3 changed files with 34 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2016-04-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* SQLClient.h:
|
||||||
|
* SQLClient.m:
|
||||||
|
Add -isNull helper method for testing for null fields in records
|
||||||
|
returned from the database.
|
||||||
|
|
||||||
2016-02-18 Richard Frith-Macdonald <rfm@gnu.org>
|
2016-02-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* configure.ac: get host and cpu with more recent gnustep-make
|
* configure.ac: get host and cpu with more recent gnustep-make
|
||||||
|
|
11
SQLClient.h
11
SQLClient.h
|
@ -208,6 +208,17 @@ extern NSString * const SQLClientDidDisconnectNotification;
|
||||||
#define SQLCLIENT_PRIVATE @private
|
#define SQLCLIENT_PRIVATE @private
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** This category is to extend NSObject with SQL oriented helper methods.
|
||||||
|
*/
|
||||||
|
@interface NSObject(SQLClient)
|
||||||
|
|
||||||
|
/** Trivial method to test a field in a record returned from the database
|
||||||
|
* to see if it is a NULL. This is equivalent to<br />
|
||||||
|
* (receiver == [NSNull null] ? YES : NO)<br />
|
||||||
|
*/
|
||||||
|
- (BOOL) isNull;
|
||||||
|
@end
|
||||||
|
|
||||||
/** This class is used to hold key information for a set of SQLRecord
|
/** This class is used to hold key information for a set of SQLRecord
|
||||||
* objects produced by a single query.
|
* objects produced by a single query.
|
||||||
*/
|
*/
|
||||||
|
|
17
SQLClient.m
17
SQLClient.m
|
@ -217,7 +217,7 @@ static Class rClass = 0;
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
GSTickerTimeNow();
|
GSTickerTimeNow();
|
||||||
if (null == nil)
|
if (nil == null)
|
||||||
{
|
{
|
||||||
null = [NSNull new];
|
null = [NSNull new];
|
||||||
aClass = [NSMutableArray class];
|
aClass = [NSMutableArray class];
|
||||||
|
@ -917,6 +917,10 @@ static int poolConnections = 0;
|
||||||
{
|
{
|
||||||
static id modes[1];
|
static id modes[1];
|
||||||
|
|
||||||
|
if (nil == null)
|
||||||
|
{
|
||||||
|
null = [NSNull new];
|
||||||
|
}
|
||||||
SQLClientClass = self;
|
SQLClientClass = self;
|
||||||
modes[0] = NSDefaultRunLoopMode;
|
modes[0] = NSDefaultRunLoopMode;
|
||||||
queryModes = [[NSArray alloc] initWithObjects: modes count: 1];
|
queryModes = [[NSArray alloc] initWithObjects: modes count: 1];
|
||||||
|
@ -4125,3 +4129,14 @@ validName(NSString *name)
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation NSObject (SQLClient)
|
||||||
|
- (BOOL) isNull
|
||||||
|
{
|
||||||
|
if (nil == null)
|
||||||
|
{
|
||||||
|
null = [NSNull new];
|
||||||
|
}
|
||||||
|
return (self == null ? YES : NO);
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue