Firebird and Swift compatibility?

622 views Asked by At

I am extremely new to databases and accessing online data. I have a website using Firebird database that I want to pull data to my app. However, I am not seeing any support for Swift. Is Firebird going to be compatible with a swift-based app? If so, what exactly do I need to do in order to get started?

1

There are 1 answers

2
Brent Rowland On

Swift will need to come to Firebird, not vice versa. The easiest, although by no means easy, solution is to create a Swift wrapper library tying in to the C library API and map data types. Studying one of the existing libraries for Ruby, Python, PHP or Go may prove useful. Familiarity with C would be essential.

Alternatively, if you're looking for an unpaid second job, you could create a new library that speaks the native wire protocol. Mature examples include the Java JDBC driver and the .NET provider. Less mature, but simpler to understand is a recent Go library. Familiarity with or ability to learn wire protocols would be essential.

Both the C library and the wire protocol are extremely low-level, so a major investment would be required before getting to first base.

You don't really want to expose a Firebird database to the open internet, so if you're creating a mobile app, the quickest and safest solution is to create a web service in front of your database in a language that already supports Firebird and have your app talk to the web service for data. This is more secure, gives you flexibility to update your database schema and typically will be much faster, because the Firebird wire protocol is very chatty, making operations on high-latency connections excruciatingly slow. Your web service can pool connections and even cache frequently-accessed data for wins all around.

By creating a web service, you'll have your app shipped before you could have retrieved a single record by writing your own driver.