Browse Source

Add `BigInt` storage support into `DBRecord`

pull/8/head
Anton Tarasenko 2 years ago
parent
commit
9f22d6cc31
  1. 8
      sources/Data/Database/Local/DBRecord.uc

8
sources/Data/Database/Local/DBRecord.uc

@ -112,7 +112,10 @@ enum DBDataType
DBAT_String, DBAT_String,
// We actually store the name of another `DBRecord` that represents either // We actually store the name of another `DBRecord` that represents either
// sub-array or sub-object. // sub-array or sub-object.
DBAT_Reference DBAT_Reference,
// Some integer values we might want to store won't fit into `int`, so we
// store them as `BigIntData`
DBAT_BigInt,
}; };
/** /**
@ -130,6 +133,9 @@ struct StorageItem
var float f; var float f;
// For both `DBRecord` references and JSON strings // For both `DBRecord` references and JSON strings
var string s; var string s;
// For storing `BigInt`'s `BigIntData` - last `byte` stores `negative`
// value
var array<byte> b;
}; };
var private config array<StorageItem> storage; var private config array<StorageItem> storage;

Loading…
Cancel
Save