-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOP-15749] - add ExecuteOptions, FetchOptions
- Loading branch information
1 parent
3cd5dfc
commit 5c67306
Showing
17 changed files
with
276 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Divide general ``JDBCOptions`` into ``FetchOptions`` for fetching data and ``ExecuteOptions`` for executing statements. | ||
|
||
Before: | ||
|
||
.. code-block:: python | ||
from onetl.connection import Postgres | ||
postgres = Postgres(...) | ||
df = postgres.fetch( | ||
"SELECT * FROM some.mytable WHERE key = 'something'", | ||
options=Postgres.JDBCOptions(fetchsize=1000, query_timeout=30), | ||
) | ||
After: | ||
|
||
.. code-block:: python | ||
from onetl.connection import Postgres | ||
# Using FetchOptions for fetching data | ||
postgres = Postgres(...) | ||
df = postgres.fetch( | ||
"SELECT * FROM some.mytable WHERE key = 'something'", | ||
options=Postgres.FetchOptions(fetchsize=1000), | ||
) | ||
# Using ExecuteOptions for executing statements | ||
postgres.execute( | ||
"UPDATE some.mytable SET value = 'new' WHERE key = 'something'", | ||
options=Postgres.ExecuteOptions(query_timeout=30), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.