SQLAlchemy dialect for SQreamDB
Project description
Prerequisites
SQream => 4.5.6
Python == 3.9
SQLAlchemy == 2.0.27
SQream DB-API Connector == 3.2.5
SQLite
Cython (optional - improves performance)
Installing SQream SQLAlchemy
pip3.9 install pysqream-sqlalchemy -U
Verifying Installation
import sqlalchemy as sa
import pandas as pd
from sqlalchemy import text, orm
conn_str = "sqream://sqream:sqream@localhost:3108/master"
engine = sa.create_engine(conn_str, connect_args={"clustered": True})
session = orm.sessionmaker(bind=engine)()
session.execute(text('create or replace table test (ints int)'))
session.execute(text('insert into test values (5), (6)'))
df = pd.read_sql('select * from test', engine)
print(df)
Connection String
sqream://<user_login_name>:<password>@<host>:<port>/<db_name>
Parameters
Parameter |
Description |
---|---|
username |
Username of a role to use for connection |
password |
Specifies the password of the selected role |
host |
Specifies the hostname |
port |
Specifies the port number |
port_ssl |
An optional parameter |
database |
Specifies the database name |
clustered |
Establishing a multi-clustered connection. Input values: True, False. Default is False |
service |
Specifies service queue to use |
Example
Pulling a Table into Pandas
The following example shows how to pull a table in Pandas. This example uses the URL method to create the connection string:
import sqlalchemy as sa
import pandas as pd
from sqlalchemy.engine.url import URL
engine_url = sa.engine.url.URL(
'sqream',
username='sqream',
password='12345',
host='127.0.0.1',
port=3108,
database='master')
engine = sa.create_engine(engine_url,connect_args={"clustered": True, "service": "admin"})
table_df = pd.read_sql("select * from nba", con=engine)
Limitations
Arrays
SQream SQLAlchemy doesn’t suppport ARRAY type for columns.
Parameterized Queries
SQream SQLAlchemy supports only the BULK INSERT statement.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pysqream_sqlalchemy-1.4.tar.gz
.
File metadata
- Download URL: pysqream_sqlalchemy-1.4.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
c9f8a1a2e552470dbb9ae84335fbe5c8f551ac13945d44cf97ecd32c3c5532a9
|
|
MD5 |
7062c8ead7b9a548f881f69483039985
|
|
BLAKE2b-256 |
868bd4e0c64ab6e25a4d52833dec13105c28906b42d60dce2783faea05ce71c1
|
Provenance
The following attestation bundles were made for pysqream_sqlalchemy-1.4.tar.gz
:
Publisher:
python-publish.yml
on SQream/pysqream_sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pysqream_sqlalchemy-1.4.tar.gz
-
Subject digest:
c9f8a1a2e552470dbb9ae84335fbe5c8f551ac13945d44cf97ecd32c3c5532a9
- Sigstore transparency entry: 190096380
- Sigstore integration time:
-
Permalink:
SQream/pysqream_sqlalchemy@7531d37d1112d33a4d91a261d0a32c70757527c1
-
Branch / Tag:
refs/tags/v1.4
- Owner: https://github.com/SQream
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@7531d37d1112d33a4d91a261d0a32c70757527c1
-
Trigger Event:
release
-
Statement type:
File details
Details for the file pysqream_sqlalchemy-1.4-py3-none-any.whl
.
File metadata
- Download URL: pysqream_sqlalchemy-1.4-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
65654edbb8ccd362b7b5036ccf9d34550da088bd564b6a8def74bd3c23cad3a2
|
|
MD5 |
9d8375b0d6467d2498160088911ab312
|
|
BLAKE2b-256 |
868aa3f850be630ce63ebdd6cc7676b54c8df2893e6c1b73a21af886bf553b5d
|
Provenance
The following attestation bundles were made for pysqream_sqlalchemy-1.4-py3-none-any.whl
:
Publisher:
python-publish.yml
on SQream/pysqream_sqlalchemy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pysqream_sqlalchemy-1.4-py3-none-any.whl
-
Subject digest:
65654edbb8ccd362b7b5036ccf9d34550da088bd564b6a8def74bd3c23cad3a2
- Sigstore transparency entry: 190096381
- Sigstore integration time:
-
Permalink:
SQream/pysqream_sqlalchemy@7531d37d1112d33a4d91a261d0a32c70757527c1
-
Branch / Tag:
refs/tags/v1.4
- Owner: https://github.com/SQream
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
python-publish.yml@7531d37d1112d33a4d91a261d0a32c70757527c1
-
Trigger Event:
release
-
Statement type: