SQLAlchemy support for Splice Machine RDBMS
Splice Machine SQLAlchemy Adapter
- This python package allows users to integrate new and existing SQLAlchemy applications with Splice Machine
- SQLAlchemy exposes a uniform API for database-backed applications, which can be easily used with Splice Machine via this adaptor
- Supported on Splice Machine Versions >= 184.108.40.2060
First, download the appropriate Splice Machine ODBC driver for your system.
Mac OSX 64 bit Driver: Download
Linux 32 bit Driver: Download
Linux 64 bit Driver: Download
Note: Windows is not currently supported for Splice Machine SQLAlchemy ODBC
Then, follow the instructions here to finish the installation, but use the download links above to retrieve the Driver tarball
Once the Driver is installed, you can pip install splicemachinesa
sudo pip install splicemachinesa
There are three URL formats that can be used to access SpliceMachine via ODBC through SQLAlchemy. The first will suffice in most cases.
1: Standard URL format
The Driver Name defaults to
SpliceODBCDriver, which is the default name
when the driver is installed (specified in
odbc.ini). However, this name can be overridden through the
SPLICE_ODBC_DRIVER_NAME environment variable.
from sqlalchemy import create_engine url = 'splicemachinesa://splice:email@example.com:1527/splicedb' engine = create_engine(url)
2. Custom Configuration Without Driver
You can use this SQLAlchemy driver without an ODBC configuration (meaning running the installation from Splice Machine docs) by manually specifying the driver path. On OSX (given installation with
sudo ), this is found in
sudo this located at the same path, but in the home directory e.g.
On Linux (given ODBC Driver installation with
sudo), this is found in
it is found in
$HOME/splice. We provide a utility function for simplifying the URL building process.
This method is easier for an automated driver configuration (e.g. inside Docker) because you only need to copy to Driver binary.
Note: Error messages will not be rendered properly with this approach.
from sqlalchemy import create_engine from splicemachinesa.utilities import url_builder url = url_builder('/usr/local/splice/lib/libsplice_odbc.so', host=[0.0.0.0], port= user=['splice'], password=['admin']) engine = create_engine(url)
3. DSN Configuration
Splice Machine SQLAlchemy also supports ODBC DSNs for
Driver configuration. This means that rather than explicitly specifying
configuration options in the URL string, they are rendered from the odbc.ini file. This is also the only method that
supports Kerberos Authentication for Splice Clusters. You can see how to use Kerberos
odbc.ini file is located
at these locations depending on whether or not the installer was run as root.
sudo installation- Mac OSX:
$HOME/.odbc.ini. In this file, if you have a key named
rename this to
The default DSN is
from sqlalchemy import create_engine url = 'splicemachinesa://SpliceODBC64' engine = create_engine(url)
- First make sure you have a fresh installation of Splice Machine running (either Standalone or Cloud/Bespoke/On-Prem) with an appropriate SQLAlchemy Splice Machine connection string for accessing it
# register any changes for testing cd /path/to/splice_sqlalchemy sudo pip install . sudo pip install pytest py.test -vv --db-url 'splicemachinesa://[...]'
Features not yet supported
- Common Table Expressions
- Indices Reflection
- Check + Unicode Reflection
- Nullable Reflection
- ORDER BY COLLATE
- Empty Set Insertion
- Unicode String Support
- Reflector for Order by Foreign Key
Release history Release notifications
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size splicemachinesa-0.1.1.dev0.tar.gz (26.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for splicemachinesa-0.1.1.dev0.tar.gz