Skip to content

Conversation

mdumandag
Copy link
Contributor

We were providing two APIs two execute SQL queries.

  • execute with a string query and parameters
  • execute_statement with SqlStatement parameter two have more
    control over the query execution.

We decided to get rid of the execute_statement and SqlStatement
and provide ability to pass keyword arguments to execute to customize
the behavior of the queries. With that change, the properties of
SqlStatement is now keyword arguments.

Also, upgraded the server version to 5.0 as 5.0 is released.

@mdumandag mdumandag added this to the 5.0 milestone Sep 23, 2021
@mdumandag mdumandag self-assigned this Sep 23, 2021
@mdumandag mdumandag changed the title Get rid of the execute_statement API for SQL [API-901] Get rid of the execute_statement API for SQL Sep 23, 2021
We were providing two APIs two execute SQL queries.

- `execute` with a string query and parameters
- `execute_statement` with `SqlStatement` parameter two have more
control over the query execution.

We decided to get rid of the `execute_statement` and `SqlStatement`
and provide ability to pass keyword arguments to `execute` to customize
the behavior of the queries. With that change, the properties of
`SqlStatement` is now keyword arguments.

Also, upgraded the server version to 5.0 as 5.0 is released.
Returns:
hazelcast.future.Future[SqlResult]: The execution result.
"""
statement = _SqlStatement(sql, params, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the reviewers, I construct the statement outside of the try-except block below so that, for validation errors, we immediately throw the exception not ImmediateFutureException

Copy link
Contributor

@yuce yuce left a comment

Choose a reason for hiding this comment

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

Thanks, the PR looks great. Just One typo.

@mdumandag mdumandag merged commit dc4a53a into hazelcast:master Sep 24, 2021
@mdumandag mdumandag deleted the execute-kwargs branch September 24, 2021 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants