Commit Graph

1568 Commits

Author SHA1 Message Date
Dimitri Fontaine
285c1fcbba Apply review comments. 2020-04-03 23:17:42 +02:00
Dimitri Fontaine
2ab5da3159 Implement tables row count ordering for MySQL.
This should help optimize the duration of migrating databases with very big
tables and lots of smaller ones. It might be a little too naive as far as
the optimisation goes, while still being an improvement on the default
alphabetical one.

Fixes #1099.
2020-03-28 16:47:03 +01:00
Michał "phoe" Herda
bab6aaf890
Simplify and fix errors/warnings/notes on Travis configuration (#1112)
Fixes #1111.

We remove unnecessary .travis.sh code for removing old Postgres versions.
2020-03-28 13:42:18 +01:00
Michał "phoe" Herda
5e7de5d68d
Change Travis build matrix (#1110)
We remove the Travis jobs without the PGLOADER environment variable set to fix #1109 and add Postgres versions 10, 11, and 12 to build and test pgloader against them.
2020-03-28 12:22:02 +01:00
Dimitri Fontaine
64643bff83 Fix MS SQL bigint casting to numeric.
Fixes #937.
2020-03-28 00:00:21 +01:00
Rudi Bruchez
c2b9f79413
handling mssql datetimeoffset (#1113) 2020-03-27 23:50:35 +01:00
Dimitri Fontaine
b3cd5f28d6 Set the MS SQL port in the environment.
As our API to connect to MS SQL does not provide a facility to set the
target port number, place it in the TDSPORT environment variable, which is
reported to have the expected impact.

Should fix #1094.
2020-03-27 23:24:16 +01:00
Svante von Erichsen
8c59f8c9f9
fix typo that chooses wrong option rule (#1107) 2020-03-27 23:14:58 +01:00
Michał "phoe" Herda
6b111ba483
Begin v3.6.3 development 2020-03-22 22:38:46 +01:00
Michał "phoe" Herda
484d3e1dd4
Release v3.6.2 2020-03-22 22:26:18 +01:00
Michał "phoe" Herda
e235c6049d
Update Quicklisp dist to 2020-02-18 (#1106)
#1092 requires us to switch to a new Quicklisp distribution in order to bump CFFI to version 0.21.0. This commit switches to the newest available QL dist (2020-02-18) to achieve this.
2020-03-22 16:59:19 +01:00
Jeff Fendley
be43a49646
Fix unfortunate typo in Redshift doc (#1075) 2020-03-22 16:42:48 +01:00
Dimitri Fontaine
c899d3b5c4 Fix zero-dates-to-null.
Fixes #1098.
2020-03-22 15:56:57 +01:00
Nicolas Delperdange
cc2dc8d671
fix(mysql): use new st_astext function (#1100) 2020-03-22 15:47:57 +01:00
Dimitri Fontaine
ebc72c454e Add a MySQL use case.
See #1102.
2020-03-22 15:20:19 +01:00
Dimitri Fontaine
0daace9d70 Allow source type names to be doube-quoted in CAST rules.
Fixes #1015.
2020-03-21 17:37:54 +01:00
Michał "phoe" Herda
94d0612c12
Do not reload pgloader in Makefile (#1091) 2020-03-21 12:36:31 +01:00
Dimitri Fontaine
30376b2cfe Add support for "datetime2" data type in MS SQL.
That's a blind fix, or almost blind: we're given some information but I'm
not in a position to test the fix myself. Hope it works.

Fixes #1036.
Fixes #1018.
2020-02-29 22:23:58 +01:00
Dimitri Fontaine
df94340396 Avoid parser look-ahead when not necessary.
Fixes #1082 where letters from the URI are doubled because of the
look-ahead in the previous parser's implementation.

Thanks @svantevonerichsen6906 for the fix!
2020-02-29 22:04:06 +01:00
Dimitri Fontaine
3b5c29b030 Attempt to fix foreign-key creation to tables that have been filtered out.
See #1016 where we try to build the DDL for a foreign key that references
tables that are not found in our catalogs. We should probably just ignore
those foreign keys, as we might have a partial load to implement.
2020-02-12 21:50:18 +01:00
Phil
2e8ce7a83c
Update rpm spec file (#1039)
* Update pgloader.spec
- Update from 3.3.2 to 3.6.1
- Use Requires and BuildRequires
- Variablise Source0
- Fix Prep and Files to match source tarball
- Update spec file Changelog

* link to install documentation for RedHat/CentOS. fix tab indentation of debian code block

* Update install instructions for RHEL/CentOS
2020-02-12 21:02:49 +01:00
Dimitri Fontaine
bbcce92418 Allow underscores in SQLite type names.
Fixes #1049.
2020-02-12 00:07:58 +01:00
Dimitri Fontaine
d4da90648e Implement proper hostname parsing, following labels specifications.
Bug report #1053 was the occasion to wander in the specification for DNS
hostnames and their label components, and the syntactic rules for those. It
turns out that my implementation was nothing like the specs:

  https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax

Fixes #1053.
2020-02-12 00:01:07 +01:00
Dimitri Fontaine
e551099463 Attempt at fixing a MS SQL bug.
That's another blind fix, but it looks like this should be doing it.
Hopefully. Chances to break pgloader even more are quite slim, so let's try
it in the master branch.

Fixes #1069.
2020-02-11 22:43:02 +01:00
Dimitri Fontaine
2fef253d28 Implement AFTER CREATE SCHEMA DO for more sources.
It was only implemented for Postgres sources even though the implementation
is generic enough to be shared. It's only a matter of instructing our parser
about the new facility, which this patch does.

Fixes #1062.
2020-02-11 22:20:08 +01:00
Dimitri Fontaine
8a13c02561 Review our Postgres catalog usage for default values.
The pg_catalog.pg_attribute column adsrc is populated only once, and then
not maintained by the server. The function pg_get_expr(adbin, adrelid) is
what to use and has been here since release 8.0, so that's what pgloader
should be using.

Fixed #1934.
2020-02-11 21:46:10 +01:00
Dimitri Fontaine
26cc9ca79f Implement support for DBF deleted records.
Skip over deleted records rather than blindly importing them. Requires an
update of the underlying DBF library.

Fixes #985.
2019-06-10 22:58:12 +02:00
Dimitri Fontaine
d8b0bd5145 Allow casting rules to guard on signed data types.
It used to be that our casting rules mechanism would allow for matching
unsigned data types only, and we sometimes have a need to do special
behavior on signed data types.

In particular, a signed bigint(20) in MySQL has the same values range as a
PostgreSQL bigint, so we don't need to target a numeric in that case. It's
only when the bigint is unsigned that we need to target a numeric.

In passing update some of the default casting rules documentation to match
the code.

Fix #982.
2019-06-04 15:22:25 +02:00
Dimitri Fontaine
b8da7dd2e9
Generic Function API for Materialized Views support. (#970)
Implement a generic-function API to discover the source database schema and
populate pgloader internal version of the catalogs. Cut down three copies of about
the same code-path down to a single shared one, thanks to applying some amount
of OOP to the code.
2019-05-20 19:28:38 +02:00
Elias Carter
ee75bc4765 Fix ccl docker images not having libssl (#968)
pgloader:ccl.latest throws an error: Shared library not open: "libssl.so.1.1". This commit adds libssl1.1 to the docker image which fixes the issue.
2019-05-17 09:47:18 +02:00
Dimitri Fontaine
12e788094b Improve sexp parser and standard symbols support.
Also add split-sequence to the list of special cases that we can use and is
not found in the pgloader.transforms package.

Fixes #965.
2019-05-14 15:49:24 +02:00
Dimitri Fontaine
501cbed745 Quote database name in ALTER DATABASE "..." SET search_path TO
Fixes #933.
2019-05-12 00:50:59 +02:00
Dimitri Fontaine
06216eea99 Refrain from using fancy schema names in the regression tests.
Then being compatible with PostgreSQL 9.6 is too much trouble.
2019-05-12 00:10:28 +02:00
Dimitri Fontaine
e5f78d978e Remove added DBF tests from the Travis target.
Clozure doesn't have the CP866 encoding that the DBF files are using, and
then PostgreSQL 9.6 doesn't have "create schema if not exists", which makes
the tests fail on Travis.
2019-05-11 23:52:47 +02:00
Dimitri Fontaine
98b465fbef Add the new DBF tests in the test suite.
All with expected results so that we can track regressions there.
2019-05-11 22:13:18 +02:00
Dimitri Fontaine
350cffffad Improve DBF support.
The cl-db3 lib just got improvements for new dbase file types and field
types, reflect those in pgloader.

Also, cl-db3 now can read the encoding of the file (language driver)
directly in the header, meaning we can rely on that metadata by default, and
only override it when the users tells us to.

See #961.
2019-05-11 20:50:52 +02:00
Dimitri Fontaine
a51819f874 Have db3-numeric-to-pgsql-integer accept integer values.
The cl-db3 driver is now parsing type I fields and emit them as native
integers. We need to deal with that.

See #929.
2019-05-10 22:09:52 +02:00
Dimitri Fontaine
954eca02d0 Optimize Travis-CI workload.
Before this patch Travis would build the pgloader image twice, one when
doing the `make clones save` command and another time when doing the main
command `make check`, that depends on Make targets that `make save` does not
build, such as buildapp.

Also, fix `make check-saved` to stop requiring that we save pgloader again.

Finally, use uiop:featurep to clean-up the code in the src/save.lisp file.
2019-05-09 10:52:09 +02:00
Dimitri Fontaine
351ce3faaf Rename pgloader's own DB3 field structure.
That's to avoid a name conflict with the cl-db3 package. In SBCL 1.5.2 in
Travis this conflict is an hard error and provoque failure to build the
pgloader binary.
2019-05-09 10:41:40 +02:00
Dimitri Fontaine
ca92cdbf20 Introduce core-compression discovery in make save to fix Travis builds. 2019-05-09 10:27:20 +02:00
Dimitri Fontaine
781e586816 Fix the SBCL 1.5.2 checksum.
Now that we know that the checksum facility actually works and fails when
given the wrong checksum, install the right checksum. Ahem.
2019-05-09 00:46:11 +02:00
Dimitri Fontaine
ede385bce7 Upgrade travis testing to SBCL 1.5.2.
That's needed for current ironclad.
2019-05-09 00:36:58 +02:00
Dimitri Fontaine
0643cf0869 Remove the old mention about building the docs in the README.
It's been a while we switched to the Read The Docs format, the ruby-ronn
manpage is a thing of the past now.
2019-05-09 00:28:01 +02:00
Dimitri Fontaine
3118602702 Attempt to add a Read The Docs badge on the GitHub README for pgloader. 2019-05-09 00:26:05 +02:00
Dimitri Fontaine
1be0f02057 Attempt to get Travis back on its feet again.
The current problem with Travis build is that it's using the Quicklisp
version of the cl-db3 librairy rather than the current master's branch
version, which current sources of pgloader depend on.

In the Dockerfiles we use the alternate build method for preparing the lisp
image, and invoke the `make clones` target explicitely in order to make sure
that we have the right set of dependencies at build time.

In this patch we apply the same approach to Travis, hoping to solve the
current build issues there.
2019-05-09 00:18:11 +02:00
Dimitri Fontaine
291af994ba Let's see how those badges look when on the same line. 2019-05-09 00:14:43 +02:00
Dimitri Fontaine
f17562f62c Attempt to add DockerHub Build Status to the README at GitHub. 2019-05-09 00:13:30 +02:00
Dimitri Fontaine
2b6fb3e6c2 Add a casting rule for the I data type in DBF files.
The I data type is mapped to a PostgreSQL integer.

See #929.
2019-05-08 23:36:17 +02:00
Dimitri Fontaine
7d2e5ae941 Allow lambda expression as cast rules using functions.
Before that it was necessary to install a function in the lisp environment
either in the source itself in src/utils/transforms.lisp, or in a lisp file
loaded with --load-lisp-file (or -l for shorts).

While this could be good enough, sometimes a very simple combination of
existing features is required to transform a function and so doing some
level of lisp coding directly in the load command is a nice to have.

Fixes #961.
2019-05-08 19:02:18 +02:00
Mathieu Santostefano
6aa42ec68f Remove invalid WITH default option (#960)
It seems like `create schema` option for WITH statement is invalid.
2019-05-07 23:06:02 +02:00