apache / arrow-adbc

Database connectivity API standard and libraries for Apache Arrow
https://arrow.apache.org/adbc/
Apache License 2.0
360 stars 89 forks source link

Make SQLite ADBC C99 compatabile #1944

Closed WillAyd closed 3 months ago

WillAyd commented 3 months ago

What feature or improvement would you like to see?

Right now the sqlite driver makes use of the gmtime_r function, which is not part of the C standard until C23, though it exists as a POSIX extension for C99

I'm assuming we want to work with the C99 standard (or maybe even something new, but not quite as new as C23) so need to replace that function usage

WillAyd commented 3 months ago

Looks like utils also makes use of strdup, which has the same limitations

lidavidm commented 3 months ago

I guess we should port this stuff to C++ instead, and possibly vendor something like https://github.com/HowardHinnant/date ?

WillAyd commented 3 months ago

Certainly a long term option, though in the meantime I think could just remove the gmtime_r usage. ~It looks like it is macro'd in when available, with the non-POSIX branch using a mutex around gmtime; the latter could suffice if we wanted strict C99 (or later) compliance~

Edit: the vendored sqlite source has a good way of handling