Commit Graph

586 Commits

Author SHA1 Message Date
Dimitri Fontaine
252abdeaa7 Find field attributes case-insensitively, fix #80.
That's a follow-up to the case management cleanup for fields and
columns, wherein the "null if" property would stop being applied
properly.
2014-06-17 21:53:53 +02:00
Dimitri Fontaine
88eba90776 Handle "ragged right" fixed width files, fix #82. 2014-06-17 17:24:07 +02:00
Dimitri Fontaine
9ad98c5c2a Handle errors when parsing fixed width files, per #82. 2014-06-17 17:10:04 +02:00
Dimitri Fontaine
899f0a3291 Improve nil handling of transformation functions, fix #81.
Several transformation functions where not handling nil value
specifically, preventing the compiler to do its best and producing
WARNING at pgloader run time.
2014-06-17 16:13:35 +02:00
Dimitri Fontaine
63e6b506be Travis; tweak some tests for PostgreSQL 9.1 compat. 2014-06-17 01:00:33 +02:00
Dimitri Fontaine
9c7f88c0d2 Travis: pre-install extension ip4r as superuser. 2014-06-17 00:47:56 +02:00
Dimitri Fontaine
e8828289cf Travis: try again with no SSL. 2014-06-17 00:33:35 +02:00
Dimitri Fontaine
f123843cdc Travis: apt-get install openssl rather than libssl... 2014-06-17 00:31:24 +02:00
Dimitri Fontaine
1d9c2251c5 Travis: add apt.postgresql.org and ip4r. 2014-06-17 00:28:46 +02:00
Dimitri Fontaine
34da7fac10 Travis: more tweaks. 2014-06-17 00:15:48 +02:00
Dimitri Fontaine
c14d620d83 Travis: let's see some debug information. 2014-06-16 21:15:22 +02:00
Dimitri Fontaine
0e16b221f0 Travis: we need to use GNU awk here! 2014-06-16 20:24:20 +02:00
Dimitri Fontaine
9d15376604 Yet another travis tweak. 2014-06-16 20:19:30 +02:00
Dimitri Fontaine
0882a18b52 Yet another attempt at getting the travis specs right. 2014-06-16 20:12:35 +02:00
Dimitri Fontaine
32b4cf23e8 New test case showing off the 'null if' source field option, see #80. 2014-06-16 19:59:08 +02:00
Dimitri Fontaine
61ff60d285 Another tweak of the travis build setup. 2014-06-16 18:30:19 +02:00
Dimitri Fontaine
4c43e5e3c3 Use http://pgsql.tapoueh.org/sbcl/sbcl_1.2.0-1_amd64.deb in travis builds. 2014-06-16 18:21:23 +02:00
Dimitri Fontaine
477c019fe1 Put the pv silencer on the right command line. 2014-06-16 18:03:36 +02:00
Dimitri Fontaine
59a31bec1b Travis command needs explicit install of the pv tool, now. 2014-06-16 17:44:41 +02:00
Dimitri Fontaine
cbf6f5d865 Another attempt at fixing the travis backport of SBCL. 2014-06-16 17:34:03 +02:00
Dimitri Fontaine
f5c703c206 Handle camelCase column names for CSV, fix #79 again.
The previous patch didn't take into account the need to retain the case
of the PostgreSQL column names when using double-quotes in the load
command, which is now properly forwarded down in the COPY command.
2014-06-16 17:33:14 +02:00
Dimitri Fontaine
0cba5edacd Handle the whole of PostgreSQL errors.
In a recent test case about camelCasing column names, another kind of
error did pop up and there's really no point not to handle it correctly.
2014-06-16 17:31:41 +02:00
Dimitri Fontaine
ecd4f31d12 Accept more syntaxes for fields and columns, fixes #79.
With this patch it's now possible to "quote" column names and to use
_ (underscore) as the leading character in a field or column name. Of
course it is still unnecessary to quote the column names, but handling
the PostgreSQL quoting rules can't be bad here.
2014-06-16 16:27:46 +02:00
Dimitri Fontaine
b1c1b8bd45 Don't hide the verbose output of backporting SBCL.
The backport takes a long time, and with the output redirected away the
Travis build system kills the build with the following message:

  No output has been received in the last 10 minutes, this potentially
  indicates a stalled build or something wrong with the build itself.
  The build has been terminated.
2014-06-16 14:41:39 +02:00
Dimitri Fontaine
242b0b1d93 Fix links in the docs, fix #78. 2014-06-16 14:30:13 +02:00
Dimitri Fontaine
8153cecf19 Allow any clause ordering in all commands, see #56.
Generalize what the previous patch did only for the MySQL case, this
time affecting the internal parser API expectations to "flag" all
clauses return values with a per-clause keyword so that an ordinary
lambda list keyword can then be destructured.
2014-06-16 14:26:12 +02:00
Dimitri Fontaine
807f5cefcd Fix omitted file dependency (reading queries from file). 2014-06-16 14:24:05 +02:00
Dimitri Fontaine
fe4f577300 Add the csv-filename-pattern test to the suite. 2014-06-16 14:17:53 +02:00
Dimitri Fontaine
65aabb8216 Add a dbf test to the regression suite. 2014-06-16 14:17:33 +02:00
Dimitri Fontaine
793095ea9f Remove some extra dependencies from travis setup. 2014-06-15 19:10:48 +02:00
Dimitri Fontaine
32b4fb8f41 Travis CI integration, first try. 2014-06-15 19:07:10 +02:00
Dimitri Fontaine
8770a23695 Typo fix for #56.
Of course I commited and pushed with a stupid typo...
2014-06-15 14:37:40 +02:00
Dimitri Fontaine
7db001a7c3 Allow the MySQL command parser to process clauses in any order, fix #56.
Only the MySQL command is addressed in this patch, because the code
level approach is not safisfying me completely. It might be easier to
just bite the bullet and review all the optional clauses return values
rather than add a layer as this patch does.

The feature still is available for MySQL given this patch, so let's push
it, get feedback, then see about how to make the approach scale and
revise all the other commands.
2014-06-15 14:19:38 +02:00
Dimitri Fontaine
ff8489e656 Fix internal API in sqlite, using report-full-summary. 2014-06-14 23:31:34 +02:00
Dimitri Fontaine
de4ff30acc Implement --summary to copy the output to a file, fix #68.
Given than redirecting a tty such as *terminal-io* isn't easy enough,
let's provide a way to copy the summary output to a file. Another way to
solve it would have been to output the summary to the main logs, but
that could have made the logs parsing more difficult that necessary.

Let's see how users like it...
2014-06-14 23:31:11 +02:00
Dimitri Fontaine
655937a958 Document default values for the connection string, see #74. 2014-06-10 12:02:10 +02:00
Dimitri Fontaine
ef02160a66 Merge pull request #74 from rdunklau/master
Take the default password from PGPASSWORD
2014-06-10 11:51:17 +02:00
Ronan Dunklau
1e208ad29a Take the default password from PGPASSWORD 2014-06-10 11:45:54 +02:00
Dimitri Fontaine
97ba71d1ee Be more explicit about the licencing in the main README. 2014-06-06 12:04:56 +02:00
Dimitri Fontaine
8becf05803 Register "real" datatype to the existing float transformation.
Attempt at fixing #73.
2014-06-05 01:00:33 +02:00
Dimitri Fontaine
1273c42393 Parse SQLite "unsigned" and "short" noise words, fix #72.
In SQLite it's possible to define columns using type names such as
"smallint unsigned" or "short integer", without any changes to the way
those data types are handled, given its "dynamic typing" features.

Improve the pgloader casting machinery for SQLite to handle those cases.
2014-06-04 11:11:50 +02:00
Dimitri Fontaine
f6fae39b2e Explicitely use gawk in the new regression testing facility.
Turns out that debian has mawk by default, which is not behaving the
same in our very simple use case already. In passing, add gawk as a
build dependency of the debian package, because the packaging is meant
to exercize the test cases.
2014-06-03 13:39:21 +02:00
Dimitri Fontaine
3bcd236de6 Add automated regression tests.
Those tests currently only work when a single table is the target of the
load, and when this target is explicit in the INTO target clause. More
work needs to be done to cover interesting cases like MySQL and SQLite
where we want to diff a full database rather than a single table.
2014-06-03 12:19:23 +02:00
Dimitri Fontaine
ae2f7e9ed0 Add an hstore test
This test is currently commented out of the test suite so that we don't
require the hstore being available to run the basic tests.
2014-06-03 10:33:43 +02:00
Dimitri Fontaine
b4dac6b684 Fix archive filename matching, recent regression.
The census test didn't pass anymore because I broke the archive filename
matching in b17383fa90, where the special
variable *csv-path-root* stoped being authoritative in the archive case.

To fix, initialize that variable to nil and give its value priority as
soon as it's non-nil, such as the archive case.
2014-06-03 10:33:43 +02:00
Dimitri Fontaine
352a833400 Merge pull request #69 from seamusabshere/patch-1
it's CL=ccl not CC=ccl
2014-06-02 22:37:58 +02:00
Seamus Abshere
e667aceba7 it's CL=ccl not CC=ccl 2014-06-02 17:19:58 -03:00
Dimitri Fontaine
9fc7589a9c Output all reporting to *terminal-io*, fix #68. 2014-06-02 12:08:27 +02:00
Dimitri Fontaine
df6e6c4673 TODO: add support for other archive formats. 2014-05-29 00:12:03 +02:00
Dimitri Fontaine
ae63c9b85c Improve COPY CONTEXT message parsing, fix #67.
When adding the CONTEXT message parsing I totally forgot that PostgreSQL
provides a nice error message translation capability. The code now copes
better with the situation, using a more advanced regular expression.

We could inline the known translations in the matching, but that would
be tedious to maintain, so we just use loose matching rules here.
2014-05-28 17:23:08 +02:00