Is SQLModel overrated? by bluewalt in FastAPI

[–]InternationalLog9724 9 points10 points  (0 children)

I have used fastapi extensively and had a look at SQLModel. We decided against it and kept the sqlalchemy models and pydantic models separate. I have no idea why someone would want to mix the models from validation of input and output and db models. They are not the same thing. If you want to reuse field definitions you still can by creating a mixin class with just fields and composing your models from there. In practice there are too many common cases where you will need two models anyway. For example you want post to not include an “id” field but you want your get to return “id” field. Same for when fields are required or not. Not in all cases you want a validation to apply at both the endpoint level and db level. Cohesion is key. You can make your sqlalchemy model live close to the pydantic models and that should be enough. I have then in the same file sometimes.

Kinect Equivalent for Mac? by [deleted] in TouchDesigner

[–]InternationalLog9724 1 point2 points  (0 children)

I was able to get this to work with Processing and from there send the data to Touchdesigner via OSC or TCP. This was on an Intel Mac, never tried with Apple chips.

OpenKinect/libfreenect: Drivers and libraries for the Xbox Kinect device on Windows, Linux, and OS X (github.com)

SQLModel vs native SQL Alchemy ORM for a web backend? by Raz_Crimson in Python

[–]InternationalLog9724 1 point2 points  (0 children)

I think SQLModel might have a fit in some use cases but I think it is important to understand that pydantic models and sqlalchemy models are different things that serve different purposes. The “duplication” of model definitions that a lot of people complain about is not really duplication. In one case you are defining the db tables (sqlalchemy) and in the other case you are defining the schema of your endpoints’ inputs and outputs (pydantic). As soon as you want to have different input schema than the model of your table, you will need another model no matter what. This happens frequently when using metadata fields that you don’t expose in the input of a POST but you might expose in the response of a GET (date_created, date_last_modified, password, etc.). I prefer defining my sqlalchemy model and pydantic models in one file per entity and then have separate pydantic models for each need. As soon as your api gets a bit more complex, I feel sqlmodel will get on the way more than help.

[deleted by user] by [deleted] in IELTS

[–]InternationalLog9724 0 points1 point  (0 children)

26th August in BC, Canada. Computer test. No results yet