public MemoryDatabase(string name, ISerializer <T> modelSerializer, int blockSize)
            : base(name, modelSerializer)
        {
            dbStream   = new MemoryStream();
            RecStorage = new RecordStorage(new BlockStorage(
                                               dbStream, blockSize
                                               ));
            labels = new List <string>();

            IndexUtils.CreateUniqueIndex();
        }
        public DiskDatabase(string name, ISerializer <T> modelSerializer, string directory, int blockSize)
            : base(name, modelSerializer)
        {
            this.dbDirectory = directory;

            // Create directory
            if (!Directory.Exists(directory))
            {
                Directory.CreateDirectory(directory);
            }

            dbStream = new FileStream(
                GetMainDbPath(),
                FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None,
                blockSize
                );
            RecStorage = new RecordStorage(new BlockStorage(
                                               dbStream, blockSize
                                               ));

            IndexUtils.CreateUniqueIndex();
        }