Commit 1f65b08 1 parent 1ede083 commit 1f65b08 Copy full SHA for 1f65b08
File tree 1 file changed +18
-0
lines changed
apple/WCDB/interface/chaincall
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 21
21
#import < WCDB/WCTChainCall+Private.h>
22
22
#import < WCDB/WCTCore+Private.h>
23
23
#import < WCDB/WCTExpr.h>
24
+ #import < WCDB/WCTResult.h>
24
25
#import < WCDB/WCTSelectBase+Private.h>
25
26
#import < WCDB/WCTSelectBase.h>
26
27
#import < WCDB/handle_statement.hpp>
27
28
28
29
@implementation WCTSelectBase
29
30
31
+ - (instancetype )initWithResultList : (const WCTResultList &)resultList fromTable : (NSString *)tableName
32
+ {
33
+ if (self = [super init ]) {
34
+ if (resultList.size () == 0 ) {
35
+ WCDB::Error::ReportInterface (_core->getTag (),
36
+ _core->getPath (),
37
+ WCDB::Error::InterfaceOperation::Select,
38
+ WCDB::Error::InterfaceCode::NilObject,
39
+ [NSString stringWithFormat: @" Selecting nothing from %@ is invalid" , tableName].UTF8String ,
40
+ &_error);
41
+ return self;
42
+ }
43
+ _statement.select (resultList, resultList.isDistinct ()).from (tableName.UTF8String );
44
+ }
45
+ return self;
46
+ }
47
+
30
48
- (instancetype )initWithCore : (const std::shared_ptr<WCDB::CoreBase> &)core
31
49
{
32
50
if (self = [super initWithCore: core]) {
You can’t perform that action at this time.
0 commit comments