15 Commits

Author SHA1 Message Date
Dimitri Fontaine
801d8a6e09 Add support for MS SQL time data type.
As for the other datetime types we have to use CONVERT at the SQL level in
order to get a format that PostgreSQL understands. This time the magic
number for it is 114.
2018-11-23 10:43:58 +01:00
Jon Snell
0957bd0efa Fix pgloader bug #844 by adding support for mssql real types (#845) 2018-10-05 12:47:54 +02:00
Dimitri Fontaine
de9b43c332 Add support for the MS-SYBDATE datatype.
Fixes #568, thanks to a test case being provided!
2017-06-14 21:02:00 +02:00
Dimitri Fontaine
b2f9590f58 Add support for MS SQL XML data type.
Given a test case and some reading of the FreeTDS source code, it appears
that the XML data type is sent on the wire as (unicode) text. This patch
makes pgloader aware of that and also revisit the choice of casting XML to
PostgreSQL XML data type (thanks to the test case where we see it just works
without surprise).

Fix #503.
2017-03-25 21:26:16 +01:00
Dimitri Fontaine
6bd17f45da Add support for MS SQL smalldatatime data type.
Availability of a test case for MS SQL allows to make progress on this
limitation and add support to the smalldatetime data type. It is
converted server-side with the same CONVERT expression as the longer
datetime datatype.

Fixes #431.
2017-01-28 18:08:55 +01:00
Dimitri Fontaine
63c3b3b1c7 Fix MS SQL text values processing.
The previous code required non-zero data length for all MS SQL returned
values, where it makes no sense for text like values (an empty string is
ok). Also, the code was trimming spaces from both ends on syb-char data,
and in testing that return type is used for varchar too.

Fix #366. Fix #368.
2016-03-20 20:15:02 +01:00
Dimitri Fontaine
87698cf114 Fix MS SQL int conversion, fix #282.
This is a blind fix that I hope is the one needed, wherein -1 get sent
to unsigned-to-sign which fails to handle it as expected. The protocol
and driver are then sending unsigned ints and that's what we now handle
in the CFFI layer.

This allows to push the attempt to ease testing of it, and allows me
also to cut a release without modified files handling around.
2015-09-06 21:11:14 +02:00
Gavin Wahl
d71d39c59f Fix mssql int conversion
The case statement got messed up in commit db0f21b5a5. Fixes #277.
2015-08-26 10:17:10 +02:00
Dimitri Fontaine
db0f21b5a5 Process MS SQL smallint datatypes as unsigned, fix #262.
The freetds protocol apparently sends unsigned versions of the values on
the wire, so that we have to convert them to signed numbers upon
reception.
2015-07-22 10:32:13 +02:00
Dimitri Fontaine
cd0b7b4240 Remove the FreeTDS dbbuffer setting.
In current testing it's counter-productive and introduces surprising bugs.
2014-12-23 15:38:19 +01:00
Dimitri Fontaine
f048e36838 Attempt to set a proper FreeTDS buffer size.
Let's see what happens in the tests with that before cleaning up the API
a little here, and maybe getting rid of the hardcoded "25000" rows.
2014-12-22 19:25:24 +01:00
Dimitri Fontaine
f323625738 Improve MS SQL error handling when reading from source.
In particular, protect the sysdb-data-to-lisp routine, that calls into
CFFI and character decodings, with a restart-case allowing the calling
code to just ignore errors on a particular column by skipping it and
using nil instead (or something else if needed).
2014-12-22 18:32:11 +01:00
Dimitri Fontaine
87e2e16582 Implement data transfer from SQL Server. 2014-11-10 03:15:22 +01:00
Dimitri Fontaine
03bba5f486 Some more SQL Server support (schema conversion).
Converting the table definitions (with type casting) seems to work. Also
did experiment a little with actuallt fetching some data... and had to
edit the cl-mssql driver, which is temporarily monkey patched.
2014-11-10 01:16:10 +01:00
Dimitri Fontaine
3c334dcdc4 Refactor the main parser to use the bind macro.
The metabang-bind lib offers a nice bind macro that solves the problem
of ignoring bindings in destructuring-bind, and allows a let* approach
to nested destructuring (wven when mixed with let declarations).

Using that lib (that we already indirectly depend on anyway) simplifies
the parser code substantially.
2014-10-02 17:05:35 +02:00