Inserting/upserting

Inserting and upsert-style updating are combined into one insert method.

Insert as follows:

db.insert(
    'exampletable',
    dict(name='Alice', age=33)
)

Upserts look the same except with an upsert_on

db.insert(
    'exampletable',
    dict(name='Alice', age=33),
    upsert_on='name'
)

This example would update any rows with the name Alice, by setting the age value to 33.

Upsert on multiple columns using a list:

db.upsert(
    'exampletable',
    dict(id=1, name='Alice', age=33),
    upsert_on=['id','name']
)