protected SDatabase _Add(SDbObject s, string nm, long p) { switch (s.type) { case Types.STable: return(Install((STable)s, nm, p)); case Types.SColumn: return(Install((SColumn)s, nm, p)); // case Types.SAlter: return Install((SAlter)s, nm, p); } return(this); }
public SRecord Get(long pos) { var rc = _Get(pos) as SRecord ?? throw new Exception("Record " + SDbObject._Uid(pos) + " never defined"); var tb = objects[rc.table] as STable ?? throw new Exception("Table " + rc.table + " has been dropped"); if (!tb.rows.Contains(rc.Defpos)) { throw new Exception("Record " + SDbObject._Uid(pos) + " has been dropped"); } var dp = tb.rows[rc.Defpos]; if (dp == pos) { return(rc); } return((SRecord)_Get(dp)); }
protected SDatabase _Add(SDbObject s, long p) { switch (s.type) { case Types.SRecord: return(Install((SRecord)s, p)); case Types.SAlter: return(Install((SAlter)s, p)); case Types.SDrop: return(Install((SDrop)s, p)); case Types.SIndex: return(Install((SIndex)s, p)); case Types.SDropIndex: return(Install((SDropIndex)s, p)); case Types.SUpdate: return(Install((SUpdate)s, p)); case Types.SDelete: return(Install((SDelete)s, p)); } return(this); }
internal static string Uid(long uid) { return(SDbObject._Uid(uid)); }