#!/usr/bin/python3
import minidb

db = minidb.Store(debug=True)

class Person(minidb.Model):
    name = str
    email = str
    age = int

db.register(Person)
p = Person(name='Hello World', email='minidb@example.com', age=99)
p.save(db)
p.name = 'Hello Again'
p.save()
if Person.get(db, email='minidb@example.com').age != 99:
    print('Failed to read from db')
    exit(-1)
