Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Optional parameters
## Examples
See [PEP-249](https://www.python.org/dev/peps/pep-0249) for the DB API reference and specifications. An example [jupyter notebook](https://github.com/firebolt-db/firebolt-sdk/tree/main/examples/dbapi.ipynb) is included to illustrate the use of the Firebolt API.

## Special considerations
### Cursor objects should not be shared between threads
Cursor is not thread-safe and should not be shared across threads. In a multi-threaded environment you can share a Connection, but each thread would need to keep its own Cursor. This corresponds to a thread safety 2 in the [DBApi specification](https://peps.python.org/pep-0249/#threadsafety).

## Optional features
### Faster datetime with ciso8601
By default, firebolt-sdk uses `datetime` module to parse date and datetime values, which might be slow for a large amount of operations. In order to speed up datetime operations, it's possible to use [ciso8601](https://pypi.org/project/ciso8601/) package. In order to install firebolt-sdk with `ciso8601` support, run `pip install "firebolt-sdk[ciso8601]"`
Expand Down
2 changes: 1 addition & 1 deletion src/firebolt/async_db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@

apilevel = "2.0"
# threads may only share the module and connections, cursors should not be shared
threadsafety = 1
threadsafety = 2
paramstyle = "qmark"
3 changes: 2 additions & 1 deletion src/firebolt/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
)

apilevel = "2.0"
threadsafety = 3 # threads may share the module, connections and cursors
# threads may only share the module and connections, cursors should not be shared
threadsafety = 2
paramstyle = "qmark"