Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update strategy #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update strategy #11

wants to merge 4 commits into from

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.

ImportConfiguration.php Outdated Show resolved Hide resolved
ImportResource.php Outdated Show resolved Hide resolved
ImportResource.php Outdated Show resolved Hide resolved
Strategy/UpdateStrategy.php Outdated Show resolved Hide resolved
Strategy/UpdateStrategy.php Outdated Show resolved Hide resolved
@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