示例#1
0
文件: Schema.cs 项目: zyhong/DBTrie
        internal static async ValueTask <Schema> OpenOrInitFromTrie(LTrie trie)
        {
            using var key = await trie.GetValue(LastFileNumberKey);

            ulong number = 10000000UL;

            if (key is LTrieValue)
            {
                number = await key.ReadValueULong();
            }
            else
            {
                await trie.SetValue(LastFileNumberKey, number);

                await trie.Storage.Flush();
            }
            return(new Schema(trie, number));
        }