[swift-server-dev] Database API/Framework

Haris Amin aminharis7 at gmail.com
Tue Oct 25 14:34:24 CDT 2016


Hey everyone,

So I’m currently working on a pure Swift Postgres driver. It has no
dependency on libpq at all. I’m parsing the Postgres Wire Protocol (V3)
myself and everything seems great. Here are some problems/issues I’m facing
that db driver implementers like myself (don’t shoot me this is my first
shot at a db driver ;) )  would like to see resolved by this swift server
group or we could use some guidance on:

1. A standard socket api, there are a few right now. Currently I’m using
IBM’s BlueSocket but really we just need one socket api that works cross
platform. From the blog post it seems like that falls under this groups
umbrella/objectives

2. A lil more guidance around timestamps + time zones. These are super
important for decent compliant swift db drivers. Can we rely on Foundation
NSDate and timezones to work well cross platform without issues here?

3. A standard lightweight crypto library to handle authentication. This is
something all database driver authors will have to deal with (MD5 hashing
etc). During the summer I had been switching between a few libraries but
would be great to have this unified, cross platform support for this. Again
I think this falls under the umbrella of this organization.

4. Coming from a diverse backend/server background, I’ve seen different
lang+environments handle sql interfaces differently. Most have left it up
to third party frameworks/ecosystems (ruby/node/python) but some like
Golang provide at least a default SQL interface that driver authors can
adapt to. I’m starting to lean towards the latter of the two but I’m by no
means and expert on anything :). This probably needs more community
engagement/proposal.

In short, for me at least, these 4 points would be great to be addressed
(the 4th one perhaps is debatable and not as urgent), for database driver
authors would greatly help a lot. Pretty much every server side swift
framework right now has their own ORM-ish libs/frameworks. That’s awesome!
My hope is we can start writing some of the drivers in pure Swift and help
all those frameworks/libs get better too.

Just my 2 cents. Perhaps this deserves a thread of its own. Perhaps it
doesn’t. I apologize in advance if this is distracting from the current
thread :)

-- 
Haris Amin
Sent with Airmail

On October 25, 2016 at 3:21:07 PM, Paulo Faria via swift-server-dev (
swift-server-dev at swift.org) wrote:

Hello, Helge.

Yes, most of the things we’ll cover are already provided by some
frameworks, but having an official library joining efforts will be great
for the community. We’ll provide full-fledged Swift libraries for the
topics mentioned. How they’re going to be developed it’s still to be
decided.

Cheers,
Paulo

> On Oct 25, 2016, at 4:56 PM, Helge Heß via swift-server-dev <
swift-server-dev at swift.org> wrote:
>
> Hi Chris,
>
> it is a little unclear what the scope of the group is. Presumably you
have some very specific things in mind?
>
> Of course we’ve seen https://swift.org/server-apis/#focus-areas. But what
does it actually mean? :-) Looking at it:
> - base networking: TCP/UDP, DNS. Covered already by libdispatch and the
OS’ses?
> - security: OpenSSL? or some wrapper around both, CC and OpenSSL?
> - provide low level HTTP parsing: http_parser? Is anyone using something
> else?
> All that seems kinda covered/standard already? Unless maybe you include
non-Unix stuff like Windows.
>
> Is this primarily for things like providing a standardised ’swiftier'
OpenSSL wrapper (similar to how Objective-GCD wraps libdispatch)?
> Or would that just be module maps which are shipped by default with Swift
and hence can be relied on by all frameworks?
>
> But maybe I’m just a little too impatient :->
>
> hh
>
>> On 25 Oct 2016, at 20:41, Chris Bailey via swift-server-dev <
swift-server-dev at swift.org> wrote:
>>
>> Hi Ron:
>>
>> As you say, that's outside of the scope of the work group, however I do
think its a valuable area that the various existing web framework groups
might be interested in collaborating on. Having a common, recognized
framework that the database providers or third parties would be interested
in writing database drivers for would be a huge step forward.
>>
>> I know that Vapor has its Fluent ORM framework, and that its an area
that the Kitura team are looking at as well, so your post might kick-start
some wider discussion.
>>
>> Chris
>>
>>
>>
>>
>> From: Ron Olson via swift-server-dev <swift-server-dev at swift.org>
>> To: swift-server-dev at swift.org
>> Date: 25/10/2016 18:54
>> Subject: [swift-server-dev] Database API/Framework
>> Sent by: swift-server-dev-bounces at swift.org
>>
>>
>>
>> Hi all-
>>
>> I've been working with Swift more on Linux than macOS and am very
>> excited to see the formation of this group. Looking at the server api
>> workgroup's focus, I notice it's primarily low-level interaction with
>> the operating system. When might it be a good time to bring up the
>> possibility of creating a database-specific framework for those folks
>> who want to work directly with Postgres, MySQL, even DB2 and Oracle; I'm
>> thinking a JDBC-inspired framework that drivers could be written
>> against.
>>
>> Thanks,
>>
>> Ron
>> _______________________________________________
>> swift-server-dev mailing list
>> swift-server-dev at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-server-dev
>>
>>
>> _______________________________________________
>> swift-server-dev mailing list
>> swift-server-dev at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-server-dev
>
> _______________________________________________
> swift-server-dev mailing list
> swift-server-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-server-dev


_______________________________________________
swift-server-dev mailing list
swift-server-dev at swift.org
https://lists.swift.org/mailman/listinfo/swift-server-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-server-dev/attachments/20161025/12d9cfc6/attachment.html>


More information about the swift-server-dev mailing list