Skip to content

Removed query id in prepare statement #60

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

Merged
merged 6 commits into from
May 31, 2023
Merged

Removed query id in prepare statement #60

merged 6 commits into from
May 31, 2023

Conversation

ilyakharev
Copy link
Contributor

@ilyakharev ilyakharev commented May 23, 2023

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Close #59

@ilyakharev ilyakharev changed the title Remove query id in prepare statement Removed query id in prepare statement May 23, 2023
@ilyakharev ilyakharev self-assigned this May 23, 2023
src/Session.php Outdated
@@ -359,7 +359,7 @@ public function query($yql, array $parameters = null)
$query = $this->newQuery($yql)
->parameters($parameters)
->txControl($tx_control)
->keepInCache($this->keep_query_in_cache);
->keepInCache($this->keep_query_in_cache || ($parameters&&count($parameters)>0));
Copy link
Member

Choose a reason for hiding this comment

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

Need check about flag keep_query_in_cache exists.
if keep_query_in_cache is null - use autoset of flag (by parameters count)
if keep_query_in_cache is not null - use value of the flag, without check parameters count.

src/Session.php Outdated
@@ -416,20 +416,11 @@ public function prepare($yql)
{
$statement = new Statement($this, $yql);

Copy link
Member

Choose a reason for hiding this comment

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

Remove cache will dramatically decreasy perforemance, because SDK will go to server for prepare every time.

I suggest save cache of metadata if any of them need to execute query of replace prepare to stub if nothing need for execute query.

@ilyakharev ilyakharev merged commit 33eb0e1 into main May 31, 2023
@ilyakharev ilyakharev deleted the fix-prepare branch May 31, 2023 10:07
@rekby rekby mentioned this pull request May 31, 2023
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.

bug: getQueryId() on null
2 participants