nuvira
Version:
Nuvira Database. New Database format (Readable & Easy to use), (Inbuilt Schema & constraints & rules & relations).
65 lines (59 loc) • 1.43 kB
text/typescript
export type Document = {
'#doc': number;
data: Array<{ key: string; value: any; type: string }>;
};
export interface ParsedResult {
fileRules: { Strict: boolean; };
relations: Record<string, any>;
schema: Record<string, any>;
validations: Record<string, any>;
records: Document[];
errors: { line: number | null; message: string }[];
metadata?: ParsingMetadata;
}
export interface ParsingMetadata {
timeTaken: string;
recordCount: number;
schemaFieldCount: number;
validationRuleCount: number;
fileSize: string;
averageRecordSize: string;
timestamp: string;
memoryUsage: {
heapTotal: string;
heapUsed: string;
external: string;
};
sections: {
schema: { timeMs: number };
relations: { timeMs: number }
validations: { timeMs: number };
records: { timeMs: number };
};
}
export interface ParserConfig {
filePath?: string;
fileContent?: string
section?: 'schema' | 'records';
}
export type SchemaType = 'ROOT' | 'NODE' | 'LEAF' | 'ISOLATED' | 'REFERENCE'
export type AllowedTypes =
| 'Any'
| 'undefined'
| 'Null'
| 'Number'
| 'NumberArray'
| 'String'
| 'StringArray'
| 'ObjectArray'
| 'Any[]'
| 'Object[]'
| 'Number[]'
| 'String[]'
| '[]'
| 'Array'
| 'Object'
| 'Binary'
| 'Uint8Array'
| 'Date'
| 'Boolean';