Skip to main content

Apache Solr Dialect for SQLAlchemy

Project description

Apache Solr dialect for SQLAlchemy and Apache Superset

A dialect for Apache Solr that can be used with Apache Superset.


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+


To connect to Solr with SQLAlchemy, the following URL pattern can be used:



Basic Authentication

Basic authentication credentials can be supplied in connection URL as shown in the URL pattern above

JWT Authentication

JWT authentication token can be supplied as a token URL parameter, for example:


Additional Parameters:

If HTTPS is enable, the following parameters can be supplied:

  1. use_ssl: a boolean parameter when set to true an HTTPS connection is used. Default value is false.
  2. verify_ssl: a boolean parameter that controls whether to verify SSL certificate. Default value is true.

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']))



  • 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


  1. Change as appropriate
  2. Run pytest


  1. SQLAlchemy documentation
  2. SQLAlchemy dialects

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sqlalchemy_solr- (17.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page