On Friday, March 8, 2019 at 12:56:26 PM UTC-5, Walt wrote: > > Thanks, so the limitations the documentation is bringing up are more that > SQLAlchemy doesn't know how to bind the same variety of types as does the > DBAPI? >
Hopefully I will get this write so Mike won't have to correct me... It's not about the "type" but the "context". The library is large and supports many dialects and dbapi drivers. Over time, that has meant many things have had to support 'textual arguments' and supplying literal SQL to certain commands. (see https://docs.sqlalchemy.org/en/latest/orm/tutorial.html#orm-tutorial-literal-sql ) I think there are some odd issues with binding different types, but they're largely for the database specific columns/types and few people will encounter them. For example, in the bugreport i mentioned above... some people discovered one could submit unsafe input to a group_by or order_by clause. That action is an anti-pattern, as it the functions are designed and documented for safe developer input, but some person on the internet generated a CVE report... so it became a vulnerability that had to be addressed. In your example above though, ensuring you have an INT will catch an error before it hits the database. Otherwise, if you submit text, SqlAlchemy will properly escape it , submit it, and you will get a database error that needs to be parsed to figure things out. (if sqlalchemy were talking to the database directly, it would wrap the error into a standardized sqlalchemy error that handles the various dialect-specific errors for that type, but you'd still need to parse it to figure out what happened on the db layer) -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
