Will be interesting to see your results on the GC and timing between MongoDB and SQL Alchemy
@talkpython3 жыл бұрын
Hey Paul. I put together a project to test this. If you query 20k records in SQLAlchemy, it will result in, wait for it, 1,890 GCs!!!! Just while it's returning the results. MongoDB is slightly better at 500. Still insane. Here's the report and app: github.com/mikeckennedy/pythons-gc-and-orms
@lukasjuhrich5032 жыл бұрын
Regarding the discussion at ~14:20: I added such annotations as well for a while, but the shortcoming of that is that the typing becomes i correct when using e.g. User.name as a class variable when writing nontrivial queries. E.g. User.name.desc() as a sort qualifier would be marked as a warning, and this becomes annoying after a while. I think this is solved on a mypy level nowadays with the sqlalchemy typing layer, but unfortunately PyCharm has its own implementation of the whole typing business which is not able to handle the distinction yet. EDIT: ah, yes, they're talking about that a few seconds later. Consider my remarks redundant :)
@mikeckennedy2 жыл бұрын
It's not perfect. I do find I use the attributes in code rather than queries more so I lean on the type definitions in that regard. You're right that .desc() and friends fails but that is not a super common use-case for me. Python has typing like int|float. I might explore using int|sa.Column for an integer column. That would work for both I *think* :)
@iamworstgamer Жыл бұрын
well, it has good performance, may be one of the best, but it sucks, its so complex for simple things,
@gnatinator2 жыл бұрын
16:20 oh god...we're ruining python
@Superdooperhero3 жыл бұрын
Sadly still no us to me. All SQL results should be as of a date and time as per real life.