pinot_connect.connection🔗
BaseConnection🔗
__init__🔗
Base class for building connections to Apache Pinot
Arguments:
client
- an instance of subclass of httpx.Clientquery_options
- (optional): global query options for all queries made from the connection
closed🔗
True
if connection's client is closed
Connection🔗
connect🔗
@classmethod
def connect(cls,
host: str,
port: int = 8099,
username: str | None = None,
password: str | None = None,
scheme: t.Literal["http", "https"] = "http",
database: str | None = None,
query_options: QueryOptions | None = None,
client_options: ClientOptions | None = None) -> Self
Constructor for building a client and returning a connection
Arguments:
host
- the hostname of your apache pinot brokerport
- (optional) the port of your apache pinot broker, defaults to8099
username
- (optional): the username to use, if auth is enabledpassword
- (optional): the password to use, if auth is enabledscheme
- (optional): the scheme to use, defaults tohttp
database
- (optional): the database/tenant to usequery_options
- (optional): global query options for all queries made from the connectionclient_options
- (optional): httpx client options for all queries made from the connection
cursor🔗
Builds a new pinot_connect.Cursor object using the connection.
Arguments:
query_options
- (optional): query options to be used by cursor, overrides any options set at connection levelrow_factory
- (optional): RowFactory type to use to build rows fetched from cursor, defaults to returning tuples
close🔗
Close the connection and cleans up resources.
Closes all open cursors and all open TCP connections in the client.
AsyncConnection🔗
connect🔗
@classmethod
def connect(
cls,
host: str,
port: int = 8099,
username: str | None = None,
password: str | None = None,
scheme: t.Literal["http", "https"] = "http",
database: str | None = None,
query_options: QueryOptions | None = None,
client_options: ClientOptions | None = None
) -> CoroContextManager[Self]
Constructor for building a client and returning an async connection wrapped in a CoroContextManager object. This allows this method to both be awaited and be used with async with (without having to do async with await).
Arguments:
host
- the hostname of your apache pinot brokerport
- the port of your apache pinot broker, defaults to8099
username
- (optional): the username to use, if auth is enabledpassword
- (optional): the password to use, if auth is enabledscheme
- (optional): the scheme to use, defaults tohttp
database
- (optional): the database/tenant to usequery_options
- (optional): global query options for all queries made from the connection-
client_options
- (optional): httpx client options for all queries made from the connection -
Returns
- an instance ofpinot_connect.AsyncConnection
wrapped in a CoroContextManager
commit🔗
Not implemented - read only interface
cursor🔗
Builds a new pinot_connect.AsyncCursor object using the connection.
Arguments:
query_options
- (optional): query options to be used by cursor, overrides any options set at connection levelrow_factory
- (optional): RowFactory type to use to build rows fetched from cursor, defaults to returning tuples
close🔗
Close the connection and cleans up resources.
Closes all open cursors and all open TCP connections in the client.