DIRACGrid / diracx

The neXt DIRAC incarnation
GNU General Public License v3.0
9 stars 20 forks source link

How to handle upserts? #49

Open chrisburr opened 1 year ago

chrisburr commented 1 year ago

In SandboxMetadataDB.insert there is a need for upserting to set the last update time if the entry already exists. I suspect this isn't a unique case so it would be nice to have a standard way to do it.

I think we can on_conflict_do_update but it might need to be a utility function as I'm not sure about the SQL-dialect-specificness of it.

If it does need to be a utility function, perhaps it should be limited to only supporting setting a "last access time" style column.