Пример #1
0
        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));
        }