Apache Solr Dialect for SQLAlchemy and Apache Superset
Project description
Apache Solr dialect for SQLAlchemy and Apache Superset
A dialect for Apache Solr that can be used with Apache Superset.
Installation
The package can either be installed through PyPi or from the source code.
Through Python Package Index
pip install sqlalchemy-solr
Latest from Source Code
pip install git+https://github.com/aadel/sqlalchemy-solr
Usage
To connect to Solr with SQLAlchemy, the following URL pattern can be used:
solr://<username>:<password>@<host>:<port>/solr/<collection>[?use_ssl=true|false]
Basic Example
The following example illustrates the basic usage in a Python project:
engine = create_engine('solr://solr:8983/solr/examples_books')
with engine.connect() as connection:
result = connection.execute(text("SELECT sequence_i, genre_s FROM examples_books"))
for row in result:
print("Sequence: {}, Genre: {}".format(row['sequence_i'], row['genre_s']))
Testing
Requirements
- A Solr instance with a Parallel SQL supported up and running
- A Superset instance up and running with this package installed
pytest
>= 6.2.1 installed on the testing machine
Procedure
- Change
conftest.py
as appropriate - Run
pytest
Resources
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
sqlalchemy_solr-0.2.2.1.tar.gz
(17.0 kB
view hashes)
Built Distribution
Close
Hashes for sqlalchemy_solr-0.2.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b88f2b13e2c1a396408f880cb43bd393408cd49cb4856f4138d7db981e23e90 |
|
MD5 | 996dd67bcf8371b4b4ddd7b50ddf83eb |
|
BLAKE2b-256 | 9aa000714836a9244115b95a1da7f9c7a0e0c1208108929572e73f8a8d1c7e7a |