Skip to content

Conversation

@SimonRethore
Copy link

@SimonRethore SimonRethore commented Jul 26, 2024

Add Update strategy to only update existing lines

@SimonRethore SimonRethore requested a review from thislg July 26, 2024 14:38
@SimonRethore SimonRethore self-assigned this Jul 26, 2024
@le-phare le-phare deleted a comment from aegypius Jul 26, 2024
@SimonRethore SimonRethore marked this pull request as draft July 26, 2024 15:20
@SimonRethore SimonRethore marked this pull request as ready for review July 30, 2024 09:59
Copy link
Member

@thislg thislg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an example? I'm not sure to understand update_load_identifier and update_copy_identifier.

@SimonRethore
Copy link
Author

Yes, this is an example of config :

name: articles
source_dir: "var/exchange/input"

archive:
    enabled: true
    dir: "var/exchange/archives"
    rotation: 14
quarantine:
    dir: "var/exchange/quarantine"
    enabled: false

resources:
    article:
        tablename: import.article
        load:
            pattern: "^articles.csv$"
            format_options:
                validate_headers: true
                with_header: true
                line_delimiter: "\n"
            fields:
                reference: ~
                name: ~
                description: ~
    copy_article:
        tablename: import.article
        copy:
            target: article
            strategy: update
            strategy_options:
                conflict_target: id
                update_load_identifier: reference
                update_copy_identifier: id
            mapping:
                reference: id
                name: name
                description: description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants