Better type inference for insert #47
Labels
backend-integration
Interop code between DSL and some db backend, e.g. generate SQL, execute, [de]serialize results
error message
Refers to compilation errors (unclear, misleading, ...)
insert
(as well asinsert_
) has a meaningless type for a user, thus it is hard to start using it.motivation: #40 has more background on this issue.
Say we have the following table definition:
We should be able to apply
insert_
toemployees
and let type inference figure out the rest.But this is not currently the case as
salary
is a default column, thus we can assign two different types toinsert_ employees
Potential Solution
Change (or provide an alternative) insert to allow only one type once a table is provided (type parameter
t
should uniquely determiner
from the type ofinsert_
).Types of optional columns should get wrapped with
Maybe
.Then definition
Should be inferred to
The text was updated successfully, but these errors were encountered: