ioxiocom / firedantic

Database models for Firestore using Pydantic base models.
BSD 3-Clause "New" or "Revised" License
43 stars 14 forks source link

implment get_or_insert #72

Open steveobd opened 1 month ago

steveobd commented 1 month ago

NDB has this and it is handy.

https://github.com/googleapis/python-ndb/blob/982f8a70dfa4b940c162ce327441099aca982d21/google/cloud/ndb/model.py#L5937

It's a little more difficult with pydantic since non-optional fields have to be populated (I think) even in a constructor, but it should be doable