SingleStore¶
Driver Version v0.1.0-beta.1 Tested With SingleStore 9.0.20
This driver provides access to SingleStore , a distributed database for low-latency SQL. It is developed by SingleStore, Inc. The source code can be found at singlestore-adbc-connector ; the ADBC Driver Foundry distributes precompiled binaries of the upstream sources for Linux, macOS, and Windows.
Installation¶
The SingleStore driver can be installed with dbc :
dbc install --pre singlestore
Note
Only prerelease versions of the driver are currently available, so you must use --pre with dbc 0.2.0 or newer to install the driver.
Connecting¶
To connect, edit the uri option below to match your environment and run the following:
from adbc_driver_manager import dbapi
conn = dbapi.connect(
driver="singlestore",
db_kwargs = {
"uri": "root@tcp(localhost:3306)/demo"
}
)
Note: The example above is for Python using the adbc-driver-manager package but the process will be similar for other driver managers.
Connection String Format¶
Connection strings are passed with the uri option which uses the following format:
mysql://[user[:[password]]@]host[:port][/schema][?attribute1=value1&attribute2=value2...]
Examples:
mysql://localhost/mydbmysql://user:pass@localhost:3306/mydbmysql://user:pass@host/db?charset=utf8mb4&timeout=30smysql://user@(/path/to/socket.sock)/db(Unix domain socket)mysql://user@localhost/mydb(no password)
This follows MySQL’s official URI-like connection string format . Also see MySQL Connection Parameters for the complete specification.
Components:
scheme:mysql://(required)user: Optional (for authentication)password: Optional (for authentication, requires user)host: Required (must be explicitly specified)port: Optional (defaults to 3306)schema: Optional (can be empty, SingleStore database name)Query params: SingleStore connection attributes
Note
Reserved characters in URI elements must be URI-encoded. For example, @ becomes %40. If you include a zone ID in an IPv6 address, the % character used as the separator must be replaced with %25.
When connecting via Unix domain sockets, use the parentheses syntax to wrap the socket path: (/path/to/socket.sock).
The driver also supports the SingleStore DSN format (see Go SingleStore Driver documentation ), but standard URIs are recommended.
Feature & Type Support¶
| Feature | Support | |
|---|---|---|
| Bulk Ingestion | Create | ✅ |
| Append | ✅ | |
| Create/Append | ✅ | |
| Replace | ✅ | |
| Temporary Table | ❌ | |
| Specify target catalog | ✅ | |
| Specify target schema | ❌ | |
| Non-nullable fields are marked NOT NULL | ✅ | |
| Catalog (GetObjects) | depth=catalogs | ✅ |
| depth=db_schemas | ✅ | |
| depth=tables | ✅ | |
| depth=columns (all) | ✅ | |
| Get Parameter Schema | ❌ | |
| Get Table Schema | ✅ | |
| Prepared Statements | ✅ | |
| Transactions | ✅ | |
Driver-Specific Features¶
| Feature | Name | Support | Description |
|---|---|---|---|
| Configuration | Connect with URI | ✅ | Test authentication with credentials embedded in URI. |
Types¶
SingleStore to Arrow¶
SingleStore Type |
Arrow Type |
|---|---|
BIGINT |
int64 |
BIT |
binary |
BOOLEAN |
int64, int8 ⚠️ [1] |
DATE |
date32[day] |
DATETIME |
timestamp[us] |
DOUBLE PRECISION |
double |
FLOAT |
float |
INT |
int32 |
JSON |
extension<arrow.json> |
NUMERIC |
decimal64 |
REAL |
float |
SMALLINT |
int16 |
TIME |
time64[us] |
TIMESTAMP |
timestamp[us], timestamp[us] (with time zone) ⚠️ [1] |
VARBINARY |
binary |
VARCHAR |
string |
Arrow to SingleStore¶
| Arrow Type | SingleStore Type | |
|---|---|---|
| Bind | Ingest | |
|
binary |
VARBINARY |
|
|
binary_view |
VARBINARY |
|
|
bool |
BOOLEAN |
|
|
date32[day] |
DATE |
|
|
decimal128 |
DECIMAL |
|
|
double |
DOUBLE PRECISION |
|
|
fixed_size_binary |
VARBINARY |
|
|
float |
FLOAT |
|
|
int16 |
SMALLINT |
|
|
int32 |
INT |
|
|
int64 |
BIGINT |
|
|
large_binary |
VARBINARY |
|
|
large_string |
VARCHAR |
|
|
string |
VARCHAR |
|
|
string_view |
VARCHAR |
|
|
time32[ms] |
TIME |
|
|
time32[s] |
TIME |
|
|
time64[ns] |
TIME |
|
|
time64[us] |
TIME |
|
|
timestamp[ms] |
DATETIME |
|
|
timestamp[ms] (with time zone) |
TIMESTAMP |
|
|
timestamp[ns] |
DATETIME |
|
|
timestamp[ns] (with time zone) |
TIMESTAMP |
|
|
timestamp[s] |
DATETIME |
|
|
timestamp[s] (with time zone) |
TIMESTAMP |
|
|
timestamp[us] |
DATETIME |
|
|
timestamp[us] (with time zone) |
TIMESTAMP |
|
Compatibility¶
This driver was tested on the following versions of SingleStore:
9.0.20 (SingleStoreDB source distribution (compatible; MySQL Enterprise & MySQL Commercial))