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

Different tables in columns #744

Closed
wants to merge 1 commit into from

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Aug 17, 2023

What is the correct behavior?

  1. Filter columns from other tables
  2. Let them be in the query

The test example is about the code:

$table = '{{%type}}';
$columns = ['{{%type}}.[[bool_col]]', '{{%another_table}}.[[bool_col2]]'];
$values = [[true, false]];

$command->batchInsert($table, $columns, $values);

// INSERT INTO {{%type}} ([[bool_col]], [[bool_col2]]) VALUES (:qp0, :qp1)

The same for methods batchInsert(), insert(), update(), upsert()

@what-the-diff
Copy link

what-the-diff bot commented Aug 17, 2023

PR Summary

  • New Test Case Added
    A new test case "different tables in columns" has been added to the tests/Provider/QueryBuilderProvider.php file. This helps verify and ensure that data gets correctly inserted into different columns of the same table. This addition contributes to the overall reliability and robustness of our software.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: +10.11% 🎉

Comparison is base (c5aa0b1) 89.59% compared to head (661a5bf) 99.70%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@              Coverage Diff              @@
##             master     #744       +/-   ##
=============================================
+ Coverage     89.59%   99.70%   +10.11%     
+ Complexity     1375     1269      -106     
=============================================
  Files            67       63        -4     
  Lines          3382     3038      -344     
=============================================
- Hits           3030     3029        -1     
+ Misses          352        9      -343     

see 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@terabytesoftw
Copy link
Member

terabytesoftw commented Aug 17, 2023

If you are looking at the test now, of course it is a bug.

@Tigrov
Copy link
Member Author

Tigrov commented Aug 17, 2023

@terabytesoftw

If you are looking at the test now, of course it is a bug.

Or we can mention about this in the doc for these methods:
@param string[] $columns The column names of the table.

Currently it is
@param string[] $columns The column names.

@terabytesoftw
Copy link
Member

terabytesoftw commented Aug 17, 2023

@terabytesoftw

If you are looking at the test now, of course it is a bug.

Or we can mention about this in the doc for these methods: @param string[] $columns The column names of the table.

Now it is @param string[] $columns The column names.

If that’s all right, let's do it.

@Tigrov
Copy link
Member Author

Tigrov commented Nov 1, 2023

Solved by #746

@Tigrov Tigrov closed this Nov 1, 2023
@Tigrov Tigrov deleted the different_tables_in_columns branch November 1, 2023 06:24
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