-
Notifications
You must be signed in to change notification settings - Fork 1
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
7) Fix getTables request #75
Conversation
a7cd16f
to
8bd3033
Compare
8bd3033
to
b624fa3
Compare
I've rebased it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this. It was really hard to figure out if this fixes the issue. There are some suggestions below. The testing of fixed behavoir should be here.
$tableDefs = []; | ||
foreach ($arr as $table) { | ||
if ($this->shouldTableBeSkipped($table)) { | ||
continue; | ||
} | ||
if (is_null($tables) || !(array_search($table['name'], array_column($tables, 'tableName')) === false)) { | ||
$tableNameArray[] = $table['name']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still a little bit lost in a logic of this function. I think it would be more clear to:
-
- fetch array of all tables with it schema associated which should be fetched. It is
$tableDefs
array now.
- fetch array of all tables with it schema associated which should be fetched. It is
-
- fetch columns for all tables from
$tableDefs
. So the SQL would look like:
- fetch columns for all tables from
SELECT * FROM information_schema.columns WHERE
(table_schema = 'snowflake_extractor' AND table_name = 'LARGE')
OR
(table_schema = 'snowflake_extractor' AND table_name = 'LARGE_100M')
;
So than you can be sure that really only columns for requested tables are fetched and there is less conditions.
@Halama , sorry I let this slip, I've updated it and think it's now more clear. |
@Halama az budes mit kvilicku muzes na tohle dat oko? rad bych ho releasnout. |
@pivnicek I am not sure when I'll get to this:( Maybe try someone other for review? |
@Halama sure, no worries |
@@ -17,7 +17,7 @@ | |||
"keboola/php-csv-db-import": "~2.3.0" | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "4.6.*", | |||
"phpunit/phpunit": "^7.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the upgrade? And why not upgrade anything else (cs, phpstan)? I have to say I much prefer to create separate PR for any non-related changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There must have been a reason, I think to match with the common-lib version, but you're right, should have been better done somewhere else. Shall I move it, or can we keep it just this once ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tomasfejfar ! I've updated it. |
ok, I'm going to merge this then 🎉 |
Fixes #72
Rebased onto #71