Describe2:
PUBLIC
PROC [conv: Conv ←
NIL, db: OpenDB]
RETURNS [info: SchemaInfo] ~ {
Returns schema information about the database.
oldinfo: LoganBerry.SchemaInfo ← LoganBerry.Describe[conv, db];
info ← NEW[SchemaInfoRec];
info.dbName ← oldinfo.dbName;
WHILE oldinfo.logs#
NIL
DO
log: LogInfo ← NEW[LogInfoRec ← [id: oldinfo.logs.first, file: oldinfo.logNames.first]];
info.logs ← CONS[log, info.logs];
oldinfo.logs ← oldinfo.logs.rest;
oldinfo.logNames ← oldinfo.logNames.rest;
ENDLOOP;
info.logs ← ReverseLogList[info.logs];
WHILE oldinfo.keys#
NIL
DO
index: IndexInfo ← NEW[IndexInfoRec ← [key: oldinfo.keys.first, file: oldinfo.indexNames.first]];
info.indices ← CONS[index, info.indices];
oldinfo.keys ← oldinfo.keys.rest;
oldinfo.indexNames ← oldinfo.indexNames.rest;
ENDLOOP;
info.indices ← ReverseIndexList[info.indices];
};