aadel / sqlalchemy-solr

Apache Solr dialect for SQLAlchemy
MIT License
9 stars 7 forks source link

Remove semicolon from query #31

Closed f-gerle closed 2 months ago

f-gerle commented 5 months ago

Solr does not accept SQL Queries terminated by a semicolon (;). To ensure compatibility with other packages that generate terminated SQL queries, a trailing semicolon should be removed before sending the query to the solr.

As a quick fix, I added the line query = query.replace(';', '') to substitute_in_query in the Cursor class.

aadel commented 3 months ago

@f-gerle this should be handled by the driver in release 0.2.4.3. It seems that the semi-colon needs to be removed in text queries mode only and the ORM does not generate it.

Thanks for reporting!