Commit Graph

1568 Commits

Author SHA1 Message Date
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
Dimitri Fontaine
e93ba8b887 Fix handling --client-min-messages and --log-min-messages.
Should help with issue #67 by allowing --client-min-messages to
effectively control entering the debugger in case of unhandled
conditions, etc.

Contrary to the discussion, in this patch --log-min-messages has no
impact on the behavior of the console and interactive behaviors.
2014-05-28 16:37:38 +02:00
Dimitri Fontaine
89d1ab460d Handle both PostgreSQL reserved keywords catcode, fix #63. 2014-05-27 17:36:00 +02:00
Dimitri Fontaine
3454247cc7 Fix MySQL view cleanup.
In case of PostgreSQL schema preparation error, and when some
materialized views where given with their SQL command, they were left
over by pgloader. The next run would then fail because the view already
exists at CREATE VIEW time.

Fix that by cleaning up materialized views we just created in handling
any condition signaled when preparing the PostgreSQL schema.
2014-05-27 17:34:59 +02:00
Dimitri Fontaine
a2370938b6 MATERIALIZE ALL VIEWS.
Complete the MySQL migration feature.
2014-05-26 18:03:50 +02:00
Dimitri Fontaine
e1bf53906d Don't send over useless verbose log messages.
When in :data logging mode we log the whole data set as we read then
write it, which is quite a lot of data. Our current logging system works
by filling up a queue that the cl-log lib is then fed from, and sending
lots of data in that queue is way expensive, stop doing that.

Hopefully we don't need to revisit the logs more than that, the other
messages should be few enough not to count much when doing a full load.
2014-05-26 16:59:12 +02:00
Dimitri Fontaine
2637bb7e81 Avoid double logging the TRUNCATE call, that's scary. 2014-05-26 15:47:20 +02:00
Dimitri Fontaine
e9e9e364b0 Add optional clauses USING FIELDS and TARGET COLUMNS. 2014-05-26 15:04:06 +02:00
Dimitri Fontaine
b17383fa90 Allow IN DIRECTORY sub-clause for the FILENAME MATCHING clause.
With this the user is now able to have a way about where the files are
going to be read and matched against the regular expression. It used not
to be necessary in the archive expansion mode, but is required now that
the feature is exposed in more cases.
2014-05-26 14:45:12 +02:00
Dimitri Fontaine
a0518f2e98 Document FILENAMES MATCHING option. 2014-05-26 11:08:10 +02:00
Dimitri Fontaine
36805afc64 Fix *csv-path-root* at run-time.
When using LOAD CSV it's possible to load from filename matching a
regular expression, but for that to work the *csv-path-root* needs to be
properly setup at run-time.
2014-05-26 11:01:19 +02:00
Dimitri Fontaine
51b9618cf6 Fix a call to truncate-tables which didn't get the memo.
In passing, have a default identifier-case of :downcase.
2014-05-26 10:59:35 +02:00
Dimitri Fontaine
92ebb13042 Keep the order in which we saw files when matching filenames. 2014-05-26 10:58:30 +02:00
Dimitri Fontaine
dbc9699940 Review the TODO list. 2014-05-26 00:04:50 +02:00
Dimitri Fontaine
24c0580e11 Move the TODO into its own file. 2014-05-25 23:57:18 +02:00
Dimitri Fontaine
c21f3f06ff Retain NULL tinyints in tinyint-to-boolean, fix #65. 2014-05-24 00:03:41 +02:00
Dimitri Fontaine
8b2b2af076 Use quicklisp release of qmynd and improve source dependencies.
As seen in #64 it's no longer necessary anymore to use a local clone of
qmynd to be able to compile pgloader: simplify the Makefile accordingly.

In passing, add source level dependencies so that if you edit any source
lisp file the binary will get automatically rebuilt by `make`.
2014-05-23 16:00:51 +02:00
Dimitri Fontaine
b1ba09a21b Handle MySQL FK column names idenfier case, fix #62.
The code forgot completely that MySQL column name references in foreign
key definitions have to follow the identifier case rules, this patch fix
that.

To be able to do that, we need to parse the GROUP_CONCAT() result that
lists the FK columns, as there's apparently no arrays in MySQL. The
problem here is that about any character is allowed in column names when
`quoted`, so using a comma here might reveal to be fragile later.
2014-05-22 12:35:54 +02:00
Dimitri Fontaine
d14f9ce334 Add the ELS Lightning Talk video to pgloader.io. 2014-05-20 22:52:17 +02:00