Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlalchemy library import errors #630

Closed
buckettt opened this issue Jun 18, 2019 · 4 comments
Closed

sqlalchemy library import errors #630

buckettt opened this issue Jun 18, 2019 · 4 comments
Labels
Misc Compatibility Compatibility issue with other third-party addons [class->Updated #{number}: {title}]

Comments

@buckettt
Copy link

buckettt commented Jun 18, 2019

Describe the bug
importing sqlalchemy found in site-packages and creating and engine (using sqlalchemy.create_engine) throws an import error meaning sql connections cannot be made.

To Reproduce
Example script:

from sqlalchemy import create_engine
my_connection = create_engine('mysql+mysqlconnector://XXX:YYY@ZZZ:####/QQQQ')

Expected behavior
Expect a sql connection to occue

Screenshots
image

Additional Information
Running the same script on my anaconda 3.6 environment works fine with sqlalchemy installed in the relevant place.

@buckettt
Copy link
Author

Ironpython is not listed as a support platform.

https://docs.sqlalchemy.org/en/13/intro.html#supported-platforms

@eirannejad
Copy link
Collaborator

Ya I get a series of other errors.

  • Test sqlalchemy compatibility

@eirannejad eirannejad added the Misc Compatibility Compatibility issue with other third-party addons [class->Updated #{number}: {title}] label Jun 25, 2019
@buckettt
Copy link
Author

I was able to get it working using pymysql (additional library requires installation.)

from sqlalchemy import create_engine
my_connection = create_engine('mysql+pymysql://XXX:YYY@ZZZ:####/QQQQ')

However, queries could only be called using the raw MYSQL queries.
e.g.:

cnx = my_connection.raw_connection()
cursor = cnx.cursor()
query = "SELECT * FROM my_table"
cursor.execute(query)

The ORM and mysql expression language don't work. so this will fail:

with my_connection.connect() as con:
    meta = MetaData(my_connection)
    rows = Table('my_table', meta, autoload=True)  
    stm = select([rows])
    rs = con.execute(stm) 

@eirannejad
Copy link
Collaborator

pyRevit 4.8-beta has Ironpython 2.7.10 engine. Would you mind testing this with the newer ironpython?

@eirannejad eirannejad added the Investigating Waiting for information from contributor or other party label Aug 15, 2020
@eirannejad eirannejad removed the Investigating Waiting for information from contributor or other party label Jan 15, 2021
@eirannejad eirannejad reopened this Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Misc Compatibility Compatibility issue with other third-party addons [class->Updated #{number}: {title}]
Projects
None yet
Development

No branches or pull requests

2 participants