API Reference¶
Connections¶
The connect()
function is the primary entry point for the SingleStore
package. It connects to a SingleStore database using either
DB-API compliant parameters,
or a connection string in the form of a URL.
|
Return a SingleStoreDB connection. |
Connection¶
Connection objects are created by the singlestoredb.connect()
function. They are
used to create Cursor
objects for querying the database.
|
SingleStoreDB connection. |
|
Set autocommit mode. |
Close the database connection. |
|
Commit the pending transaction. |
|
Rollback the pending transaction. |
|
Create a new cursor object. |
|
Determine if the database is still connected. |
|
|
Enable the data API in the server. |
Disable the data API. |
The Connection.show
attribute of the connection objects allow you to access various
information about the server. The available operations are shown below.
Show all aggregate functions in the current database. |
|
|
Show the column information for the given table. |
Show the function creation code for the given aggregate function. |
|
Show the function creation code for the given function. |
|
|
Show the pipeline creation code for the given pipeline. |
Show the table creation code for the given table. |
|
Show the view creation code for the given view. |
|
|
Show all databases in the server. |
Show status of the current database. |
|
Show errors. |
|
Show all functions in the current database. |
|
Show global status of the current server. |
|
|
Show all indexes in the given table. |
|
Show partitions in the current database. |
Show all pipelines in the current database. |
|
|
Show the plan for the given plan ID. |
Show all query statements compiled and executed. |
|
Show all procedures in the current database. |
|
Show details about currently running threads. |
|
|
Show troubleshooting data for query optimizer and code generation. |
Show schemas in the server. |
|
Show server status information for a session. |
|
|
Show server status information. |
Show table status information for the current database. |
|
|
Show tables in the current database. |
Show warnings. |
ShowResult¶
The results of the above methods and attributes are in the form of a
ShowResult
object. This object is primarily used to display
information to the screen or web browser, but columns from the output
can also be accessed using dictionary-like key access syntax or
attributes.
|
Simple result object. |
Cursor¶
Cursors are used to query the database and download results. They are
created using the Connection.cursor()
method.
|
Database cursor for submitting commands and queries. |
|
Call a stored procedure. |
Close the cursor. |
|
|
Execute a SQL statement. |
|
Execute SQL code against multiple sets of parameters. |
Fetch a single row from the result set. |
|
|
Fetch size rows from the result. |
Fetch all rows in the result set. |
|
Skip to the next available result set. |
|
|
Predefine memory areas for parameters. |
|
Set a column buffer size for fetches of large columns. |
|
Scroll the cursor to the position in the result set. |
Return the next row from the result set for use in iterators. |
|
Is the cursor still connected? |
Utiliites¶
|
Retrieve a JWT token from the SingleStoreDB single-sign-on URL. |
Management API¶
The management objects allow you to create, destroy, and interact with workspaces in the SingleStoreDB Cloud.
|
Retrieve a SingleStoreDB workspace manager. |
WorkspaceManager¶
WorkspaceManager objects are returned by the manage_workspaces()
function.
They allow you to retrieve information about workspaces in your account, or
create new ones.
|
SingleStoreDB workspace manager. |
Return a list of available workspace groups. |
|
Return a list of available regions. |
|
Create a new workspace group. |
|
|
Create a new workspace. |
Retrieve a workspace group definition. |
|
Retrieve a workspace definition. |
WorkspaceGroup¶
WorkspaceGroup objects are retrieved from WorkspaceManager.get_workspace_group()
or by retrieving an element from WorkspaceManager.workspace_groups
.
|
SingleStoreDB workspace group definition. |
Return a list of available workspaces. |
|
|
Create a new workspace. |
Update teh object to the current state. |
|
|
Update the cluster definition. |
|
Terminate the workspace group. |
Workspace¶
Workspaces are created within WorkspaceGroups. They can be created using either
WorkspaceGroup.create_workspace()
or retrieved from
WorkspaceManager.workspaces
.
|
SingleStoreDB workspace definition. |
|
Create a connection to the database server for this workspace. |
Update the object to the current state. |
|
|
Terminate the workspace. |
Region¶
Region objects are accessed from the WorkspaceManager.regions
attribute.
|
Cluster region information. |
Configuration¶
The following functions are used to get and set package configuration settings.
Execute the describe_option()
function with no parameters to
see the documentation for all options.
|
Get the value of an option. |
|
Set the value of an option. |
|
Print the description of one or more options. |
In addition to the function above, you can access options through the
singlestoredb.options
object. This gives you attribute-like access to the option
values.
In [1]: import singlestoredb as s2
In [2]: s2.describe_option('local_infile')
local_infile : bool
Should it be possible to load local files?
[default: False] [currently: False]
In [3]: s2.options.local_infile
Out[3]: False
In [4]: s2.options.local_infile = True
In [5]: s2.describe_option('local_infile')
local_infile : bool
Should it be possible to load local files?
[default: False] [currently: True]