Commit Graph

43 Commits

Author SHA1 Message Date
Dimitri Fontaine
302a7d402b Refactor connection handling, and clean-up many things.
That's the big refactoring patch I've been sitting on for too long.

First, refactor connection handling to use a uniformed "connection"
concept (class and generic functions API) everywhere, so that the COPY
derived objects just use that in their :source-db and :target-db slots.

Given that, we don't need no messing around with *pgconn* and *myconn-*
and other special variables at all anywhere in the tree.

Second, clean up some oddities accumulated over time, where some parts
of the code didn't get the memo when new API got into place.

Third, fix any other oddity or missing part found while doing those
first two activities, it was long overdue anyway...
2014-12-26 21:50:29 +01:00
Dimitri Fontaine
65c2043694 Improve pgloader usage from the command line.
Make it so that the following command line usages are accepted when
using pgloader without a command file:

 ./build/bin/pgloader ./test/sqlite/sqlite.db postgresql:///pgloader

 ./build/bin/pgloader --set "search_path='sakila'"  \
                      mysql://root@localhost/sakila \
                 postgresql:///sakila

 ./build/bin/pgloader --type csv                             \
                      --field id --field field               \
                      --with truncate                        \
                      --with "fields terminated by ','"      \
                      ./test/data/matching-1.csv             \
                      postgres:///pgloader?matching

It's now possible in most cases to just use command-line options, which
should make the entry bar to pgloader much lower.
2014-12-23 02:40:13 +01:00
Dimitri Fontaine
47c22776f2 Cleanup and fix yesterday's refactoring of pgconn parameters. 2014-12-17 11:35:10 +01:00
Dimitri Fontaine
073f012d1a Add support for SSL modes in the PG connection string, fix #137.
In passing, refactor the *pgconn- dynamic bindings in favor of directly
using the connection property list straight from the connection string
parser, processing it when necessary. That allows to make it simple to
add an internal :use-ssl property.
2014-12-16 18:45:43 +01:00
Dimitri Fontaine
5ab0831d4e Allow building pgloader even when the git command fails, fix #125. 2014-11-22 00:32:29 +01:00
Dimitri Fontaine
5b87b1a85e Refactor *identifier-case* option into a dynamic binding.
That makes it much easier to use from about anywhere in the code, which
is what is needed. In passing, fix #129.
2014-11-21 23:32:02 +01:00
Dimitri Fontaine
5bc5a52582 Some more initial steps towards MS SQL support. 2014-11-09 22:30:02 +01:00
Dimitri Fontaine
ed853a7bea Allow pgloader to work on windows. 2014-11-06 22:12:20 +01:00
Dimitri Fontaine
a5e9cb172c Follow-up to the merge, we're not a release branch. 2014-11-05 16:41:19 +01:00
Dimitri Fontaine
8f1fc2a7a6 Release version 3.1.1. 2014-11-05 16:20:14 +01:00
Dimitri Fontaine
c4141c464d Now that 3.1.0 is released, we're preparing 3.1.1 here. 2014-09-10 23:03:42 +02:00
Dimitri Fontaine
0a3b4af290 Release pgloader 3.1.0! 2014-09-10 23:02:27 +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
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
f34017d023 Improve version strings.
Have the abbreviated git hash appear in the version string when not
using a released version of pgloader.
2014-05-03 15:21:32 +02:00
Dimitri Fontaine
a5a29407f0 Release pgloader version 3.0.99. 2014-04-29 13:59:33 +02:00
Dimitri Fontaine
3a9bc9db0f Switch the default memory watch to on. 2014-04-22 17:13:36 +02:00
Dimitri Fontaine
a8b0f91f37 Allow optional control of batch memory footprint, see #16 and #22.
With the new internal setting *copy-batch-size* it's now possible to
instruct pgloader to close batches early (before *copy-batch-rows* limit)
when crossing the byte count threshold.

When set to 20 MB it allows the new test case (exhausted) to pass under SBCL
and CCL, and there's no measurable cost when *copy-batch-size* is set to
nil (its default value) in the testing done.

This patch is published without any way to tune the values from the command
language yet, that's the next step once its been proven effective.
2014-01-26 23:22:18 +01:00
Dimitri Fontaine
db947e1467 Rework reader and writer data exchange.
With this patch, the whole data massaging and final formating into the
PostgreSQL COPY TEXT format is done by the reader thread, which publishes a
batch at a time in the communication channel: a lparallel.queue object.

Before that, the raw vectors where pushed directly in the queue, offering
more flexibility to adjust to the reader and writer IO rates and
capabilities, but impeding the ability of the Garbage Collector: data still
in the queue was not collected even if not needed anymore.

The new model also uses less memory, and allows a better control over what
amount of data stays in memory. The new *concurrent-batches* parameter
should be key to being able to process huge rows.

The intent is to offering a way for the users to tune *concurrent-batches*
down to 1 for sources with massive per-row memory footprint. Even better
would be to find a way to automatically adjust the setting without spending
too much time counting the bytes we're batching.

Preliminary tests show no sensible impact on performances from this patch,
even some improvements in cases.
2014-01-25 23:54:49 +01:00
Dimitri Fontaine
e8fcb15c27 Fix another hasty commit erroneously containing a for-tests change. 2014-01-23 23:29:27 +01:00
Dimitri Fontaine
b374d4bc8b The current retry method has no need for *copy-batch-split*. 2014-01-23 23:28:25 +01:00
Dimitri Fontaine
59e87b84a0 Release Candidate 8. 2014-01-23 00:26:08 +01:00
Dimitri Fontaine
80b6c46aae Version 3.0.97. 2014-01-15 22:53:43 +01:00
Dimitri Fontaine
d5890f7779 Release 3.0.96, debian packaging included. 2013-12-27 12:22:03 +01:00
Dimitri Fontaine
e31c5cbe83 Set the default batch size (in rows) back to 25000. 2013-12-23 13:17:04 +01:00
Dimitri Fontaine
fe302af221 Refactor the dbname API to feed from the connection string directly. 2013-12-20 17:24:02 +01:00
Dimitri Fontaine
0a6608061c Due to the bug fixed and the new batch implementation, version is now 3.0.95. 2013-12-18 18:56:12 +01:00
Dimitri Fontaine
82c4bc9e9e Switch the pgsql batch implementation to using arrays to reduce consing. 2013-12-18 18:31:06 +01:00
Dimitri Fontaine
f58b5960cd Prepare a debian package, and make it pgloader 3.0.94. 2013-12-09 13:04:29 +01:00
Dimitri Fontaine
157587476b Call it version 3.0.93 now that we did fix many bugs. 2013-11-26 16:59:44 +01:00
Dimitri Fontaine
516bb28ec0 Fix using TMPDIR from the environment when running from the binary image. 2013-11-21 13:06:16 +01:00
Dimitri Fontaine
d52240a95e Review the --root-dir patches for better default management.
Also ensure the directory we're given actually exists on disk, creating it
if necessary, and bail out early in case for whatever reason it's not
possible to create the directory.
2013-11-21 11:27:54 +01:00
Cédric Villemain
17ef2f1933 A word was missing in comment 2013-11-21 11:00:02 +01:00
Cédric Villemain
081f6be0b4 Add new command line parameter for root-dir
This variable replaces reject-root-path and is used to set the root working
directory.

It defaults to /tmp/pgloader/ like previously.

Also set the logfile according to the root-dir.

TODO: tmpdir is not handled in comand-line. Is it really wanted to have more
command line parameters ?
2013-11-21 11:00:02 +01:00
Cédric Villemain
8984a0a810 Rename reject-root-path to root-dir
Prepare the variable to be a parameter
2013-11-21 11:00:01 +01:00
Dimitri Fontaine
c809d93b05 New feature, bump the version number. 2013-11-16 21:41:42 +01:00
Dimitri Fontaine
bccd691ecc Make it release candidate 1. 2013-11-14 00:01:45 +01:00
Dimitri Fontaine
9d5dad7e3e Implement support for FIXED COLS input files, reaching release candidate status. 2013-11-07 15:39:28 +01:00
Dimitri Fontaine
ff9d0fd6f5 Fix function exporting bug, and index counts that caused infinite waiting. 2013-11-04 23:13:46 +01:00
Dimitri Fontaine
70a9a46537 Fix a bug in params.lisp init when PGPORT isn't set. 2013-11-04 22:53:00 +01:00
Dimitri Fontaine
beba2bc5b0 Call it 3.0.50.2 now that we fixed the API and added SQLite command. 2013-11-04 22:14:36 +01:00
Dimitri Fontaine
6e29957c1c Fix the default value for *pgconn-port* when it comes from the environement. 2013-10-24 00:20:33 +02:00
Dimitri Fontaine
fb818ee0e3 Move sources into their own subdirectory, assorted cleaning. 2013-10-20 19:09:09 +02:00