BUG: Make io.sql.execute raise TypeError on Engine or URI string.
- [X] xref #50185
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.
This bug does not exist in any release of pandas. It only exists in the main branch due to a PR that I created. So this version restriction would only show up in pandas 2.0. I'm not able to open a bug report issue, because the template requires me to check that this bug exists on the latest version of pandas. I discovered the bug while I was trying to complete #48576. The `pandas.io.sql.execute` method is not well-documented. The only mentioned I found is above this line: https://pandas.pydata.org/docs/user_guide/io.html?highlight=sql%20execute#engine-connection-examples. If it's ok to change the method so that it doesn't allow either an `Engine` or a `str` to be passed as the connectable, then the bug could be fixed that way instead of by using the `Result.freeze` method of sqlalchemy, which had a bug in it until version 1.4.45. You can open an issue without using the template at the bottom of that page.

2.0 will come out early next year, the limit is still to strict for us. We updated the minimum versions a couple of months ago. 

Can we revert your initial pr if this can not get fixed otherwise? If you need to revert PR #49531, then you will also need to revert PR #49757. I think this issue needs to be resolved in order for pandas to support sqlalchemy 2.0. I will open a general issue. Yep please open an issue with a reproducible example. Also please link the pr that caused this there, makes investigating easier. I have opened an issue: #50185 @phofl thanks for approving.  Is it ok to merge?  I don't have write access. @mroeschke could you have a quick look? Thanks @cdcadman 