Consistency between `Dataset.insert` / `Dataset.update` and `Model.insert` / `Model.update`
@patarapolw -- I think you may misunderstand the point of `dataset`. The `dataset` library is strictly a convenience API -- although it exposes a lot of functionality, it is not intended to implement all the features you might expect to find using standard Peewee APIs.

Also, your upsert implementation is wide open to race conditions. Peewee has sophisticated support for upsert with SQLite 3.24.0 and newer. For older versions, you probably should use an exclusive lock:

```python
with db.atomic('exclusive'):
    ...
``` How should I upsert, then?

I have just googled and found these two 
- https://github.com/coleifer/peewee/issues/1307
- https://stackoverflow.com/questions/33485312/insert-or-update-a-peewee-record-in-python

Maybe,

    @classmethod
    def upsert(cls, columns, **kwargs):
        try:
            cls.insert(**kwargs).execute()
        except pv.IntegrityError:
            query = (getattr(cls, columns[0]) == kwargs.get(columns[0]))
            for col in columns[1:]:
                query = query & (getattr(cls, col) == kwargs.get(col))

            cls.update(kwargs).where(query).execute()

This one works, but race condition? I don't know. The docs are a good place to look:

http://docs.peewee-orm.com/en/latest/peewee/querying.html#upsert 	rowid = (User
	         .insert(username='huey', last_login=now, login_count=1)
	         .on_conflict(
	             conflict_target=[User.username],  # Which constraint?
	             preserve=[User.last_login],  # Use the value we would have inserted.
	             update={User.login_count: User.login_count + 1})
	         .execute())

I can't use preserve or update clause in SQLite 3.22. Replace everything without preserve (`User.replace()`) raises:

     peewee.IntegrityError: NOT NULL constraint failed: patient.full_name

And I can't figure out a way to update Python3-SQLite on Mac. (I successfully updated the system one, though.) > Peewee has sophisticated support for upsert with SQLite 3.24.0 and newer. For older versions, you probably should use an exclusive lock...
It's not consistent in that making transferring from Dataset to SqliteExtDatabase harder.

Furthermore, there is no upsert function. I have to create my own.

    class BaseModel(pv.Model):
        @classmethod
        def upsert(cls, columns, **kwargs):
            query = (getattr(cls, columns[0]) == kwargs.get(columns[0]))
            for col in columns[1:]:
                query = query & (getattr(cls, col) == kwargs.get(col))
    
            records = set()
            for record in cls.select().where(query):
                for k, v in kwargs.items():
                    setattr(record, k, v)
                record.save()
                records.add(record)
    
            if len(records) == 0:
                cls.create(**kwargs)
