Re:Show HN: PL/Swift – PostgreSQL Functions in Swift
by helge5 on Sunday January 07, 2018 @04:25PM
(#16092827)
I disagree that it is easier or faster to just write it in C. But C still makes a lot more sense for many other reasons. And yes, this demos only the very basics, nothing fancy.
Anyways, a nice feature of Swift in this context is that Swift can directly access C APIs w/o any "wrapping". So while PL/Swift can add convenience APIs (like the ones it has to convert String's and Int's into Datum's), it can already do almost everything C can do due to that.
There are many cases you should consider, like returning rows (composite types) and implementing trigger functions.