How can I access an Oracle DB with Swift?

Hi all, I have a school assignment that requires we make an application that accesses a database, in particular, our school Oracle db instance.

We're allowed to write this assignment in any language, so I reckoned I'd give it a shot in Swift.

I've found many questions like this...(https://stackoverflow.com/questions/32916709/connect-to-an-oracle-database-in-swift) in which people are trying to access a DB from a mobile front end. Naturally, answers are advising against making DB connections from the front end, and instead connecting to a back end application that does the DB access. These questions aren't helpful, because I'm trying to write that back end application... in Swift.
Thanks.

Hello, do you use a framework (classic ones are Vapor, Perfect, Kitura) for your Swift backend?

AFAIK there's no Oracle driver implementation yet. Although I started playing with Oracle DB, you can find the result here https://github.com/segabor/CodpiExperiment.

I don't think there's anything official for any of the listed frameworks yet, but you could give SwiftOracle a try. It's a wrapper around the C driver OCILIB which you could also try using if you were feeling adventurous.

The trunk of SwiftOracle is out of date, but you might try this fork which looks like it might have been updated to Swift 4 at least.

Wow I didn't know that.
I wonder why OCILIB was chosen over Oracle's official C wrapper ODPI.

Terms of Service

Privacy Policy

Cookie Policy