s7clarke10 / tap-sybase

A Singer Tap for Sybase Databases, it should be compatible with Pipelinewise and Meltano
GNU Affero General Public License v3.0
1 stars 4 forks source link

Feature/support date and time #5

Closed s7clarke10 closed 2 years ago

s7clarke10 commented 2 years ago

This PR changes the way dates, times, and timestamps/datetimes are discovered in Sybase ASA, and Sybase ASE.

The underlying Sybase Driver via pymssql and freetds only supports the legacy datetime datatype only. More modern versions using timestamp, date, and time come through as binary code.

The change is for Sybase to detect the datatype and then convert the data in the database via a SQL convert statement to a string to be emitted by singer.

The traditional SQL formats are limited on older versions of Sybase so a rather esoteric SQL statement has been used to get the best precision available allowing the tap to run on Sybase ASA and ASE with much older versions.