Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

Interface.insert and Interface.update should just take query #102

Closed Jaymon closed 8 months ago

Jaymon commented 4 years ago

Right now Interface.insert() takes a fields dict and Interface.update() takes a fields dict and a Query instance, they should just take a Query instance and pull the fields from there.

This might be because the fields get ran through the Orm's depopulate methods, which might be a valid reason to keep it the way it is, but it would be worth a look to see if this could be standardized

Jaymon commented 4 years ago

The Orm could pull out the fields, run the needed methods and reset them into the Query instance before passing it to the Interface

Jaymon commented 8 months ago

I think it makes sense the way it is if you are ever using the interface raw. It would be kind of confusing if you were using the interface outside of the Query/Orm to have to create a Query and load the fields onto it in order to insert/update them.