IrenejMarc / dpq

Simple but powerful PostgreSQL library inspired by higher-level languages.
MIT License
21 stars 9 forks source link

IsValidRelation returns false for a relation declared without explicit name #37

Closed Betelgeyser closed 4 years ago

Betelgeyser commented 4 years ago

For example

@relation("s")
struct S
{
    @serial @PK int id;
    mixin RelationMixin;
}

will compile just fine, but

@relation
struct S
{
    @serial @PK int id;
    mixin RelationMixin;
}

won't compile with an error

../dpq/source/dpq/mixins.d(32,17): Error: template instance `dpq.relationproxy.RelationProxy!(S)` does not match template declaration `RelationProxy(T)`
  with `T = S`
  must satisfy the following constraint:
`       IsValidRelation!T`