Skip to content

Commit

Permalink
Fixed broken upsert example
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Feb 23, 2025
1 parent 75c576c commit 457164b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
8 changes: 5 additions & 3 deletions examples/topics/data_writing/database_upsert/code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

use function Flow\ETL\Adapter\Doctrine\{from_dbal_query, postgresql_insert_options, to_dbal_table_insert};
use function Flow\ETL\Adapter\Doctrine\{from_dbal_query,
sqlite_insert_options,
to_dbal_table_insert};
use function Flow\ETL\DSL\{data_frame, from_array, to_stream};
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\{Column, Table, UniqueConstraint};
Expand Down Expand Up @@ -61,7 +63,7 @@
'driver' => 'pdo_sqlite',
]),
'orders',
postgresql_insert_options(conflict_columns: ['order_id'])
sqlite_insert_options(conflict_columns: ['order_id'])
)
)
// second insert that normally would fail due to Integrity constraint violation
Expand All @@ -72,7 +74,7 @@
'driver' => 'pdo_sqlite',
]),
'orders',
postgresql_insert_options(conflict_columns: ['order_id'])
sqlite_insert_options(conflict_columns: ['order_id'])
)
)
->run();
Expand Down
24 changes: 12 additions & 12 deletions examples/topics/data_writing/database_upsert/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified examples/topics/data_writing/database_upsert/flow_php_example.zip
Binary file not shown.

0 comments on commit 457164b

Please sign in to comment.