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

Update default parameterisation behaviour in doc #287

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/databricks/sql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,18 +709,18 @@ def execute(
Execute a query and wait for execution to complete.

The parameterisation behaviour of this method depends on which parameter approach is used:
- With INLINE mode (default), parameters are rendered inline with the query text
- With NATIVE mode, parameters are sent to the server separately for binding
- With INLINE mode, parameters are rendered inline with the query text
- With NATIVE mode (default), parameters are sent to the server separately for binding

This behaviour is controlled by the `use_inline_params` argument passed when building a connection.

The paramstyle for these approaches is different:

If the connection was instantiated with use_inline_params=False, then parameters
If the connection was instantiated with use_inline_params=False (default), then parameters
should be given in PEP-249 `named` paramstyle like :param_name. Parameters passed by positionally
are indicated using a `?` in the query text.

If the connection was instantiated with use_inline_params=True (default), then parameters
If the connection was instantiated with use_inline_params=True, then parameters
should be given in PEP-249 `pyformat` paramstyle like %(param_name)s. Parameters passed by positionally
are indicated using a `%s` marker in the query. Note: this approach is not recommended as it can break
your SQL query syntax and will be removed in a future release.
Expand Down
Loading