kvesteri / sqlalchemy-utils

Various utility functions and datatypes for SQLAlchemy.
Other
1.26k stars 321 forks source link

database_exits() raises Oracle exception #180

Open daveoncode opened 8 years ago

daveoncode commented 8 years ago

database_exists() raises an exception if the database is Oracle: "ORA-00923: FROM keyword not found where expected" The problem is the following query: SELECT 1 (line 476 in functions/database.py) Which should be: SELECT 1 FROM DUAL (for Oracle) I found the fix here: http://stackoverflow.com/a/3670000/267719

I hope to see the fix applied for each type of db :)

kvesteri commented 8 years ago

Thanks for reporting. Good way to solve this would be adding some kind of dummy_query function with different compilers for each database using SQLAlchemy compilers.