It turned out to be trickier than I thought. The thing is, we're injecting id 
field into every type definition under db macro. This is necessary so that we 
can safely rely on objects having ids, which is necessary for getOne.

If we're allowing to define types separately from db macro, we can't just 
inject id field somewhere in another module.

The solution I'm leaning towards is:

  * allow to create db schema from types defined elsewhere only if those types 
have id field, which is also int and readonly
  * add db pragma to help people with the previous step: types with db pragma 
will be injected with id
  * disallow mixing the two approaches: you either define the schema as body 
for db macro, or you pass a list of db-annotated types to a different macro 
(e.g. dbFromTypes).


Reply via email to