SQLClient 1.0.0

SQLClient 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2017

Maintained by Martin Rybak.



SQLClient 1.0.0

  • By
  • Martin Rybak

Native Microsoft SQL Server client for iOS. An Objective-C wrapper around the open-source FreeTDS library.

Sample Usage

#import "SQLClient.h"

SQLClient* client = [SQLClient sharedInstance];
client.delegate = self;
[client connect:@"server:port" username:@"user" password:@"pass" database:@"db" completion:^(BOOL success) {
    if (success)
    {
      [client execute:@"SELECT * FROM Users" completion:^(NSArray* results) {
        for (NSArray* table in results)
          for (NSDictionary* row in table)
            for (NSString* column in row)
              NSLog(@"%@=%@", column, row[column]);
        [client disconnect];
      }];
    }
}];

//Required
- (void)error:(NSString*)error code:(int)code severity:(int)severity
{
  NSLog(@"Error #%d: %@ (Severity %d)", code, error, severity);
}

Demo Project

Open the Xcode project inside the SQLClient folder.

Installation

Manual

  1. Drag and drop the contents of the SQLClient/SQLClient/SQLClient folder into your Xcode project.
  2. Select Copy items into destination group's folder (if needed).
  3. Go to Project > Build Phases > Link Binary With Libraries.
  4. Click + and add libiconv.dylib.

Documentation

SQLClient Class Reference

SQLClient: A Native Microsoft SQL Server Library for iOS

Credits

FreeTDS: http://www.freetds.org

FreeTDS-iOS: https://github.com/patchhf/FreeTDS-iOS

FreeTDS example code in C: http://freetds.schemamania.org/userguide/samplecode.htm