You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Sqlacodegen version
3.0.0b2
SQLAlchemy version
2.0.30
RDBMS vendor
MySQL (or compatible)
What happened?
Im trying to generate the model or a mysql database using sqlacodegen mysql://username:password@127.0.0.1:3307/mydb > models.py and getting an error
Traceback (most recent call last):
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\Scripts\sqlacodegen.exe\__main__.py", line 7, in <module>
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\cli.py", line 58, in main
outfile.write(generator.generate())
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 115, in generate
models: List[Model] = self.generate_models()
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 622, in generate_models
self.collect_imports(models_by_table_name.values())
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 138, in collect_imports
self.collect_imports_for_model(model)
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 569, in collect_imports_for_model
super().collect_imports_for_model(model)
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 148, in collect_imports_for_model
self.collect_imports_for_column(column)
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 157, in collect_imports_for_column
self.add_import(Column)
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlacodegen\generators.py", line 208, in add_import
elif type_.__name__ in sqlalchemy.__all__: # type: ignore[attr-defined]
File "C:\Users\UserX\AppData\Local\Programs\Python\Python310\lib\site-packages\sqlalchemy\__init__.py", line 294, in __getattr__
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
AttributeError: module 'sqlalchemy' has no attribute '__all__'. Did you mean: '__file__'?
How can I fix this? I've been trying different sqlalchemy versions with no luck
Database schema for reproducing the bug
No response
The text was updated successfully, but these errors were encountered:
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
Sqlacodegen version
3.0.0b2
SQLAlchemy version
2.0.30
RDBMS vendor
MySQL (or compatible)
What happened?
Im trying to generate the model or a mysql database using
sqlacodegen mysql://username:password@127.0.0.1:3307/mydb > models.py
and getting an errorHow can I fix this? I've been trying different sqlalchemy versions with no luck
Database schema for reproducing the bug
No response
The text was updated successfully, but these errors were encountered: