Database Access and Swift? (ODBC, native libraries)
Database Access and Swift? (ODBC, native libraries)
- Subject: Database Access and Swift? (ODBC, native libraries)
- From: Andrew Satori <email@hidden>
- Date: Sun, 21 Sep 2014 21:39:44 -0400
Well folks, it's me again. Your slightly off kilter and sometimes obsessed with database stuff developer...
With the upcoming migration to Swift as the language of choice for OS X development, there is a decided lack of tools for getting from Cocoa to the RDBMS' of the world, and unfortunately they aren't moving to REST interfaces as quickly as many of us might wish. So...
What I am here asking is not how, I've already worked that out (and have started making that available). Instead, I am asking for opinions on a priority list. In essence, I am looking for your votes on what you might want, in what order you want it, and if you are really feeling generous, how much you might be willing to pay for it.
Over the last several years, I have built up the ODBCKit to get to any ODBC datasource, but it is an OS X tech, you cannot do ODBC on iOS. Because of that, we also have a very close sibling to provide native PostgreSQL support on either platform. About a year ago, we put together an Objective C Protocol called GenDB that simply let us swap PGSQLKit for ODBCKit in the code. Over the last couple of months, this has been updated to support Swift.
What do we mean? Consider the following:
//
// main.swift
// GenDBSwiftClient
//
// Created by Andy Satori on 8/22/14.
// Copyright (c) 2014 Druware Software Designs. All rights reserved.
//
import Foundation
import ODBCKit
import PGSQLKit
var connection: GenDBConnection;
connection = ODBCConnection();
connection.UserName = "sqluser";
connection.Password = "test";
connection.ConnectionString = "test"; // test can be any ODBC data source,
// in this case it has been vetted against
// all of the ActualTechnologies drivers.
if (!connection.connect())
{
println("Connection Failed");
println(connection.LastError);
connection.close();
} else {
println("Connected");
var rs: GenDBRecordset
rs = connection.open("select * from cases where status = 'A'")
while (!rs.isEOF())
{
println("CaseNumber: " + rs.fieldByName("casenumber").asString())
rs.moveNext()
}
rs.close()
connection.close();
}
var conn: GenDBConnection;
conn = PGSQLConnection();
conn.UserName = "postgres";
conn.Password = "test";
conn.ConnectionString = "host=localhost port=5432 dbname=postgres";
if (!conn.connect())
{
println("Connection Failed");
println(conn.LastError);
conn.close();
} else {
println("Connected");
var rs: GenDBRecordset
rs = conn.open("select * from cases where status = 'A'")
while (!rs.isEOF())
{
println("CaseNumber: " + rs.fieldByName("casenumber").asString())
rs.moveNext()
}
rs.close()
conn.close();
}
exit(0);
With that in mind, what I want to know is this. What RDBMS platforms do you all want native interfaces for the most, in what order, and at what value.
Tentatively, we are are working on the following:
1. TDSSQLKit - MS SQL (including Azure) / Sybase SQL
2. MySQLKit - MySQL
3. OraKit - Oracle
4. Other?
In each case, the code will be made available under the appropriate OSS license. In the instances where the underlying code requires it, the license will be GPL, L/GPL or where possible our preferred BSD. Where possible, this will happen after a predetermined dollar amount in donations is reached ( we are currently tracking at $10k, per library ). ODBCKit and PGSQLKit are already out there, and the newly renovated Swift code is in the SVN repos, though the binaries are not yet published.
Soooo...
this is your chance to tell us what to work on next (assuming you read this far, and or care!)
Andy 'Dru' Satori
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden