public SDatabase Install(SIndex x, long c) { var tb = (STable)objects[x.table]; for (var b = tb.rows.First(); b != null; b = b.Next()) { x += (Get(b.Value.Item2), b.Value.Item2); } tb = new STable(tb, tb.indexes + (x.uid, true)); return(New(objects + (x.uid, x) + (tb.uid, tb), names, c)); }
public SIndex(STransaction tr, SIndex x, AStream f) : base(x, f) { table = tr.Fix(x.table); long[] c = new long[x.cols.Length]; var i = 0; for (var b = x.cols.First(); b != null; b = b.Next()) { c[i++] = tr.Fix(b.Value); } cols = SList <long> .New(c); rows = x.rows; }
static STransaction Rdc(STransaction tr, SIndex ix, SCList <Variant> _key) { if (_key.Length == 0) { return(tr + ix.table); } var mb = ix.rows.PositionAt(_key); if (mb == null) { return(tr); } if (mb.hasMore(tr, ix.cols.Length ?? 0)) { return(tr + ix.table); } return(tr + mb.Value.Item2); }
public IndexRowSet(STransaction tr, STable t, SIndex ix, SCList <Variant> key, SList <Serialisable> wh) : base(Rdc(tr, ix, key), t, SDict <long, SFunction> .Empty, t.rows.Length) { _ix = ix; _key = key; _wh = wh; _unique = key.Length == _ix.cols.Length; }
internal SIndex(SIndex x, long t, SList <long> c) : base(x) { table = t; cols = c; primary = x.primary; rows = x.rows; }