0
(a addObject: (self dictionaryForTuple:i))))
0
+ (- (id) dictionaryWithKey:(id) key is
0
+ ((self tupleCount) times:
0
+ (set row (self dictionaryForTuple:i))
0
+ (d setValue:row forKey:(row valueForKey:key))))
0
+ (if (eq (self tupleCount) 1)
0
+ (then (self dictionaryForTuple:0))
0
(- (id) dictionaryForTuple:(int)i is
0
((self fieldTypes) eachWithIndex:
0
(class PGConnection (ivar-accessors)
0
;; Perform a query and return the result as an array of dictionaries.
0
;; Each row of a query result is returned as a dictionary.
0
(- (id) queryAsArray:(id) query is
0
(set result (self query:query))
0
- ((result tupleCount) times:
0
- (a addObject: (result dictionaryForTuple:i))))
0
+ (- (id) queryAsArray:(id) query withArguments:(id) args is
0
+ (set result (self query:query withArguments:args))
0
;; Perform a query and return the result as a dictionary of dictionaries,
0
;; with the top-level dictionary keyed by the specified key.
0
;; Each row of a query result is returned as a dictionary.
0
(- (id) queryAsDictionary:(id) query withKey:(id) key is
0
(set result (self query:query))
0
- ((result tupleCount) times:
0
- (set row (result dictionaryForTuple:i))
0
- (d setValue:row forKey:(row valueForKey:key))))
0
+ (result dictionaryWithKey:key))
0
+ (- (id) queryAsDictionary:(id) query withArguments:(id) args withKey:(id) key is
0
+ (set result (self query:query withArguments:args))
0
+ (result dictionaryWithKey:key))
0
;; Perform a query and return a single result as a dictionary.
0
;; Returns nil if multiple matches exist.
0
(- (id) queryAsValue:(id) query is
0
(set result (self query:query))
0
- (if (eq (result tupleCount) 1)
0
- (then (result dictionaryForTuple:0))
0
+ (- (id) queryAsValue:(id) query withArguments:(id) args is
0
+ (set result (self query:query withArguments:args))
Comments
No one has commented yet.