sqlalchemy and marshmallow in rest api
I have a simple web application which is using python 2.7 BaseHTTPServer (built-in in python itself) and then I created a rest api based on Tal Liron work (https://gist.github.com/tliron/8e9757180506f25e46d9).
Defined many-to-many with Association table in SQLAlchemy
I’ve seen many solutions, but I still can’t get this to work. I have
Using SQLAlchemy metadata to get info about actual database vs the definition
I want to use the Metadata object to get information about my definitions (i.e., my Model objects) as well as going out to the actual database. But no matter what I try, it always uses the defined information and not what’s in the database.
How to get individual fields from SQLAlchemy Result
I’m trying to use the new SQLAlchemy session.execute
call, instead of session.query
. But I can’t figure out how to get the individual fields
How to use separate model files with SQLAlchemy
There are many questions about this and I tried various combinations, but can’t get this to work. I want to be able to separate my model files into separate files.
Catch UniqueViolationError in sqlalchemy
I have a FastAPI app and in some of the code I have the following code
sqlalchemy cannot access column in results in all() query
Using sqlalchemy with automap from a .SQL file, and up until now, everything has been great. Yesterday, I added a boolean column to a table in the .SQL file, but when attempting to access the new field, I get:
I’ve found a lot of use in orm frameworks for passing references like (*, a, b), which is why, in everyday development, should we do this
https://github.com/sqlalchemy/sqlalchemy/blob/52b03301b3ca6cb285b5290de4dfe6806f4836f1/lib/sqlalchemy/util/cython.py#L56
such as these codes:
SQLAlchemy result SELECT statement wrong: caching?
Here’s the code using sqlite in memory for test purposes.
In verbose mode, you can see it cached the right answer (highlighted) but it displays it wrong nonetheless using print().
What is wrong with my approach:
Use ‘order by’ as parameter in custom SQLAlchemy query fails
I have been running this custom query which works against Postgres db and Python: