Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What your asking for is to be able to structurally define a type as the <em>difference</em> of two other types (the original relation and the projection definition). I honestly can't think of any language which would allow you to do that. Types can be structurally cumulative (<code>A with B</code>) since <code>A with B</code> is a structural sub-type of both <code>A</code> and <code>B</code>. However, if you think about it, a type operation <code>A less B</code> would actually be a <em>supertype</em> of <code>A</code>, rather than a sub-type. You're asking for an arbitrary, contravariant typing relation on naturally covariant types. It hasn't even been proven that sort of thing is sound with nominal existential types, much less structural declaration-point types.</p> <p>I've worked on this sort of modeling before, and the route I took was to constraint projections to one of three domains: <code>P</code> == <code>T</code>, <code>P</code> == <code>{F} where F in T</code>, <code>P</code> == <code>{$_1} where $_1 anonymous</code>. The first is where the projection is equivalent to the input type, meaning it is a no-op (<code>SELECT *</code>). The second is saying that the projection is a single field contained within the input type. The third is the tricky one. It is saying that you are allowing the declaration of some anonymous type <code>$_1</code> which has no <em>static</em> relationship to the input type. Presumably it will consist of fields which delegate to the input type, but we can't enforce that. This is roughly the strategy that LINQ takes.</p> <p>Sorry I couldn't be more helpful. I wish it were possible to do what you're asking, it would open up a lot of very neat possibilities.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload