Some docs review, fix MySQL command example, remove FK limitation.

This commit is contained in:
Dimitri Fontaine 2013-11-06 14:05:20 +01:00
parent d8a6bf1849
commit 7ae56cbed3
2 changed files with 2 additions and 79 deletions

View File

@ -123,83 +123,10 @@ Some notes about what I intend to be working on next.
- commands: `LOAD` and `INI` formats
- compat with `SQL*Loader` format
Here's a quick spec of the `LOAD` grammar:
LOAD FROM '/path/to/filename.txt'
stdin
http://url.to/some/file.txt
mysql://[user[:pass]@][host[:port]]/dbname
[ COMPRESSED WITH zip | bzip2 | gzip ]
WITH workers = 2,
batch size = 25000,
batch split = 5,
reject file = '/tmp/pgloader/<table-name>.dat'
log file = '/tmp/pgloader/pgloader.log',
log level = debug | info | notice | warning | error | critical,
truncate,
fields [ optionally ] enclosed by '"',
fields escaped by '"',
fields terminated by '\t',
lines terminated by '\r\n',
encoding = 'latin9',
drop table,
create table,
create indexes,
reset sequences
SET guc-1 = 'value', guc-2 = 'value'
PREPARE CLIENT WITH ( <lisp> )
PREPARE SERVER WITH ( <sql> )
INTO postgresql://[user[:pass]@][host[:port]]/dbname?table-name
[ WITH <options> SET <gucs> ]
(
field-name data-type field-desc [ with column options ],
...
)
USING (expression field-name other-field-name) as column-name,
...
INTO table-name [ WITH <options> SET <gucs> ]
(
*
)
WHEN
FINALLY ON CLIENT DO ( <lisp> )
ON SERVER DO ( <lisp> )
< data here if loading from stdin >
The accepted column options are:
terminated by ':'
nullif { blank | zero date }
date format "DD-Month-YYYY"
And we need a database migration command syntax too:
LOAD DATABASE FROM mysql://localhost:3306/dbname
INTO postgresql://localhost/db
WITH drop tables,
create tables,
create indexes,
reset sequences,
<options>
SET guc = 'value', ...
CAST tablename.column to timestamptz drop default,
varchar to text,
int with extra auto_increment to bigserial,
datetime to timestamptz drop default,
date to date drop default;
- see pgloader.1.md for details.
### docs
- write proper documentation
- host a proper website for the tool, with use cases and a tutorial
### error management

View File

@ -535,7 +535,7 @@ Here's an example:
FROM mysql://root@localhost/sakila
INTO postgresql://localhost:54393/sakila
WITH drop tables, create tables, create indexes, reset sequences
WITH include drop, create tables, create indexes, reset sequences
SET maintenance_work_mem to '128MB',
work_mem to '12MB',
@ -758,10 +758,6 @@ the following limitations:
The difficulty of doing so is not yet assessed.
- Foreign Keys are not migrated
It's on the roadmap, it's just not done yet.
- `ON UPDATE CURRENT_TIMESTAMP` is currently not migrated
It's simple enough to implement, just not on the priority list yet.