singlestoredb.vector_db

singlestoredb.vector_db(host: str | None = None, user: str | None = None, password: str | None = None, port: int | None = None, database: str | None = None, driver: str | None = None, pure_python: bool | None = None, local_infile: bool | None = None, charset: str | None = None, ssl_key: str | None = None, ssl_cert: str | None = None, ssl_ca: str | None = None, ssl_disabled: bool | None = None, ssl_cipher: str | None = None, ssl_verify_cert: bool | None = None, tls_sni_servername: str | None = None, ssl_verify_identity: bool | None = None, conv: Dict[int, Callable[[...], Any]] | None = None, credential_type: str | None = None, autocommit: bool | None = None, results_type: str | None = None, buffered: bool | None = None, results_format: str | None = None, program_name: str | None = None, conn_attrs: Dict[str, str] | None = {}, multi_statements: bool | None = None, client_found_rows: bool | None = None, connect_timeout: int | None = None, nan_as_null: bool | None = None, inf_as_null: bool | None = None, encoding_errors: str | None = None, track_env: bool | None = None, enable_extended_data_types: bool | None = None, vector_data_format: str | None = None, parse_json: bool | None = None, pool_size: int | None = 5, max_overflow: int | None = 10, timeout: float | None = 30) Any

Return a vectorstore API connection. Database should be specified in the URL or as a keyword.

Parameters:
  • host (str, optional) – Hostname, IP address, or URL that describes the connection. The scheme or protocol defines which database connector to use. By default, the mysql scheme is used. To connect to the HTTP API, the scheme can be set to http or https. The username, password, host, and port are specified as in a standard URL. The path indicates the database name. The overall form of the URL is: scheme://user:password@host:port/db_name. The scheme can typically be left off (unless you are using the HTTP API): user:password@host:port/db_name.

  • user (str, optional) – Database user name

  • password (str, optional) – Database user password

  • port (int, optional) – Database port. This defaults to 3306 for non-HTTP connections, 80 for HTTP connections, and 443 for HTTPS connections.

  • database (str, optional) – Database name.

  • pure_python (bool, optional) – Use the connector in pure Python mode

  • local_infile (bool, optional) – Allow local file uploads

  • charset (str, optional) – Character set for string values

  • ssl_key (str, optional) – File containing SSL key

  • ssl_cert (str, optional) – File containing SSL certificate

  • ssl_ca (str, optional) – File containing SSL certificate authority

  • ssl_cipher (str, optional) – Sets the SSL cipher list

  • ssl_disabled (bool, optional) – Disable SSL usage

  • ssl_verify_cert (bool, optional) – Verify the server’s certificate. This is automatically enabled if ssl_ca is also specified.

  • ssl_verify_identity (bool, optional) – Verify the server’s identity

  • conv (dict[int, Callable], optional) – Dictionary of data conversion functions

  • credential_type (str, optional) – Type of authentication to use: auth.PASSWORD, auth.JWT, or auth.BROWSER_SSO

  • autocommit (bool, optional) – Enable autocommits

  • results_type (str, optional) – The form of the query results: tuples, namedtuples, dicts, numpy, polars, pandas, arrow

  • buffered (bool, optional) – Should the entire query result be buffered in memory? This is the default behavior which allows full cursor control of the result, but does consume more memory.

  • results_format (str, optional) – Deprecated. This option has been renamed to results_type.

  • program_name (str, optional) – Name of the program

  • conn_attrs (dict, optional) – Additional connection attributes for telemetry. Example: {‘program_version’: “1.0.2”, “_connector_name”: “dbt connector”}

  • multi_statements (bool, optional) – Should multiple statements be allowed within a single query?

  • connect_timeout (int, optional) – The timeout for connecting to the database in seconds. (default: 10, min: 1, max: 31536000)

  • nan_as_null (bool, optional) – Should NaN values be treated as NULLs when used in parameter substitutions including uploaded data?

  • inf_as_null (bool, optional) – Should Inf values be treated as NULLs when used in parameter substitutions including uploaded data?

  • encoding_errors (str, optional) – The error handler name for value decoding errors

  • track_env (bool, optional) – Should the connection track the SINGLESTOREDB_URL environment variable?

  • enable_extended_data_types (bool, optional) – Should extended data types (BSON, vector) be enabled?

  • vector_data_format (str, optional) – Format for vector types: json or binary

  • pool_size (int, optional) – The number of connections to keep in the connection pool. Default is 5.

  • max_overflow (int, optional) – The maximum number of connections to allow beyond the pool size. Default is 10.

  • timeout (float, optional) – The timeout for acquiring a connection from the pool in seconds. Default is 30 seconds.

See also

Connection

Return type:

VectorDB