Example #1
0
        protected void Init(RelNode value)
        {
            var equal  = value.Heading.IsEqual(Heading);
            var compat = equal || value.Heading.IsCompatible(Heading);

            if (!compat)
            {
                throw Error.Fatal($"headings are not compatible: <{value.Heading}> and <{Heading}>");
            }
            var map = Heading.CreateMap(value.Heading);

            Value = Rel.Create(value.Select(t => RelStatic.CreateByMap <T>(t, map)));
        }
Example #2
0
 public RelVarST(RelValueST <T> tuples)
 {
     Value   = Rel.Create(tuples);
     Heading = RelBaseST <T> .Heading;
 }
Example #3
0
 public RelVarST()
 {
     Value   = Rel.Create(new T[0]);
     Heading = RelBaseST <T> .Heading;
 }
Example #4
0
 // remove tuples that satisfy predicate
 public void Delete(Func <T, bool> selfunc)
 {
     Value = Rel.Create(Value.Where(t => !selfunc(t)));
 }
Example #5
0
 // update tuples that satisfy predicate
 public void Update(Func <T, bool> selfunc, Func <T, T> upfunc)
 {
     Value = Rel.Create(Value.Select(t => selfunc(t) ? upfunc(t) : t));
 }
Example #6
0
 // insert tuples, discard duplicates
 public void Insert(RelValueST <T> value)
 {
     Value = Rel.Create(RelOpsST.Union(Value, value));
 }
Example #7
0
 // relational assignment
 public void Assign(RelValueST <T> value)
 {
     Value = Rel.Create(value);
 }