Index: src/SL3Connection.h ================================================================== --- src/SL3Connection.h +++ src/SL3Connection.h @@ -22,10 +22,13 @@ #import #include +#import "SL3PreparedStatement.h" +#import "SL3PreparedStatement+Private.h" + OF_ASSUME_NONNULL_BEGIN @interface SL3Connection: OFObject { #ifdef SL3_PUBLIC_IVARS @@ -38,8 +41,9 @@ + (instancetype)connectionWithPath: (OFString *)path flags: (int)flags; - (instancetype)initWithPath: (OFString *)path; - (instancetype)initWithPath: (OFString *)path flags: (int)flags OF_DESIGNATED_INITIALIZER; +- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQL; @end OF_ASSUME_NONNULL_END Index: src/SL3Connection.m ================================================================== --- src/SL3Connection.m +++ src/SL3Connection.m @@ -19,10 +19,11 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "SL3Connection.h" +#import "SL3PreparedStatement.h" #import "SL3OpenFailedException.h" @implementation SL3Connection + (instancetype)connectionWithPath: (OFString *)path @@ -67,6 +68,13 @@ { sqlite3_close(_db); [super dealloc]; } + +- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQL +{ + return [[[SL3PreparedStatement alloc] + sl3_initWithConnection: self + SQLStatement: SQL] autorelease]; +} @end