Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
Inserts new entry or updates existing entry.
Assumptions:
    - the table has a primary key named 'id'
    - the table has a single unique constraint on its natural key
Insert details:
    - attempt insert
    - if it works, return new id otherwise continue onto update
Update details
    - if id provided, update based on id
    - if id not provided, update based on unique constraint(more...)

src/d/a/datagristle-0.56/gristle/metadata.py   datagristle(Download)
            if not field_desc:
               field_desc = 'field%s' % field_order
            return self.setter(collection_id=collection_id,
                               field_order=field_order,
                               field_name=field_name,
            return rows[0].instance_id
        except IndexError:  # No rows found
            return self.setter(schema_id=schema_id,
                                         instance_name=instance_name)
 
            return rows[0].analysis_profile_id
        except IndexError:  # No rows found
            return self.setter(instance_id=instance_id,
                               collection_id=collection_id,
                               analysis_profile_name=analysis_profile_name)

src/d/a/DataGristle-HEAD/gristle/metadata.py   DataGristle(Download)
            if not field_desc:
               field_desc = 'field%s' % field_order
            return self.setter(collection_id=collection_id,
                               field_order=field_order,
                               field_name=field_name,
            return rows[0].instance_id
        except IndexError:  # No rows found
            return self.setter(schema_id=schema_id,
                                         instance_name=instance_name)
 
            return rows[0].analysis_profile_id
        except IndexError:  # No rows found
            return self.setter(instance_id=instance_id,
                               collection_id=collection_id,
                               analysis_profile_name=analysis_profile_name)