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
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,22 @@ users may find useful:
to you, if you need to pin your usage to a particular, supported
WherobotsDB version. Defaults to `"latest"`.
* `session_type`: `"single"` or `"multi"`; if set to `"single"`, then
each call to `connect()` establishes an exclusive connection to a
distinct and dedicated Wherobots runtime; if set to "multi", then
multiple `connect()` calls with the same arguments and credentials
will connect to the same shared Wherobots runtime; `"multi"` is the
default.

Consider multi-session for potential cost savings, but be mindful of
performance impacts from shared resources. You might need to adjust
cluster size if slowdowns occur, which could affect overall cost.
each call to `connect()` establishes an exclusive connection to a
distinct and dedicated Wherobots runtime; if set to "multi", then
multiple `connect()` calls with the same arguments and credentials
will connect to the same shared Wherobots runtime; `"multi"` is the
default.

Consider multi-session for potential cost savings, but be mindful of
performance impacts from shared resources. You might need to adjust
cluster size if slowdowns occur, which could affect overall cost.
* `shutdown_after_inactive_seconds`: how long the runtime waits and
stays running after all clients have disconnected. This delay gives
an opportunity for clients to reconnect to a previously-established
runtime without having to start a new one.

If you're using a simple "connect-query-disconnect" pattern from
your application, you can set this parameter to a value greater than
your expected time between queries and effectively get a continuously
running SQL session runtime without any complex connection management
in your application.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[project]
name = "wherobots-python-dbapi"
version = "0.19.0"
version = "0.20.0"
description = "Python DB-API driver for Wherobots DB"
authors = [{ name = "Maxime Petazzoni", email = "max@wherobots.com" }]
requires-python = "~=3.8"
requires-python = ">=3.8, <4"
readme = "README.md"
license = "Apache-2.0"
dependencies = [
Expand Down
3 changes: 3 additions & 0 deletions tests/smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
from wherobots.db.constants import DEFAULT_ENDPOINT, DEFAULT_SESSION_TYPE
from wherobots.db.connection import Connection
from wherobots.db.region import Region
from wherobots.db.runtime import Runtime
from wherobots.db.session_type import SessionType

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--api-key-file", help="File containing the API key")
parser.add_argument("--token-file", help="File containing the token")
parser.add_argument("--region", help="Region to connect to (ie. aws-us-west-2)")
parser.add_argument("--runtime", help="Runtime type (ie. tiny)")
parser.add_argument("--version", help="Runtime version (ie. latest)")
parser.add_argument(
"--session-type",
Expand Down Expand Up @@ -83,6 +85,7 @@
api_key=api_key,
shutdown_after_inactive_seconds=args.shutdown_after_inactive_seconds,
wait_timeout=900,
runtime=Runtime(args.runtime) if args.runtime else Runtime.MICRO,
region=Region(args.region) if args.region else Region.AWS_US_WEST_2,
version=args.version,
session_type=SessionType(args.session_type),
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions wherobots/db/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


class Runtime(Enum):
MICRO = "micro"
TINY = "tiny"
SMALL = "small"
MEDIUM = "medium"
Expand Down