mathesar icon indicating copy to clipboard operation
mathesar copied to clipboard

Add support for column mappings for importing records from one table to another.

Open Anish9901 opened this issue 2 years ago • 0 comments

Description

To import records from one table to another having different column names, types, etc, we need the ability to specify which column of the temp/import table should map to which specific columns of the target table in which the records are to be imported.

Expected behavior

To achieve the above we need support for column mappings. Which will be set by the users and sent to the backend with a request to the /existing_import like this:

{
    "import_target": <target_table_id>,
    "data_files": [<data_file_id>],
    "mappings": [
                    [<temp_table_col1_id>,<target_table_col1_id>],
                    [<temp_table_col2_id>,<target_table_col2_id>]
                ]
}

Anish9901 avatar Aug 09 '22 13:08 Anish9901