dolthub / doltpy

A Python API for Dolt
Apache License 2.0
55 stars 13 forks source link

core: fix CLI flags mapped in table_import #113

Closed lucab closed 3 years ago

lucab commented 3 years ago

This updates all CLI flags used by Dolt.table_import() in order to fix it and match those expected by dolt table import.

lucab commented 3 years ago

For reference:

$ dolt version
dolt version 0.22.7

$ dolt table import --help
[...]
OPTIONS
        <table>
          The new or existing table being imported to.

        <file>
          The file being imported. Supported file types are csv, psv, and nbf.

        -c, --create-table
          Create a new table, or overwrite an existing table (with the -f flag) from the imported data.

        -u, --update-table
          Update an existing table with the imported data.

        -f, --force
          If a create operation is being executed, data already exists in the destination, the force flag will allow the target to be overwritten.

        -r, --replace-table
          Replace existing table with imported data while preserving the original schema.

        --continue
          Continue importing when row import errors are encountered.

        -s <schema_file>, --schema=<schema_file>
          The schema for the output data.

        -m <mapping_file>, --map=<mapping_file>
          A file that lays out how fields should be mapped from input data to output data.

        -pk <primary_key>, --pk=<primary_key>
          Explicitly define the name of the field in the schema which should be used as the primary key.

        --file-type=<file_type>
          Explicitly define the type of the file if it can't be inferred from the file extension.

        --delim=<delimiter>
          Specify a delimeter for a csv style file with a non-comma delimiter.
lucab commented 3 years ago

/cc @oscarbatori

oscarbatori commented 3 years ago

@lucab apologies fo the delayed response, thanks for this. I've merged and will release presently.

lucab commented 3 years ago

@oscarbatori no worries, and thanks for getting back to it!