Esempio n. 1
0
        public static string Get(this LMDBTransaction tx, LMDBDatabase db, string key)
        {
            var enc = System.Text.Encoding.UTF8;

            byte[] bufferKey = enc.GetBytes(key);
            var    result    = tx.Get(db, bufferKey);
            var    ret       = enc.GetString(result);

            return(ret);
        }
Esempio n. 2
0
        public void GetData(string key, out string value)
        {
            LMDBTransaction tx = _env.BeginTransaction();
            LMDBDatabase    db = tx.OpenDatabase(_dbName, new DatabaseConfiguration {
                Flags = DatabaseOpenFlags.Create
            });

            value = tx.Get(db, key);
            tx.Commit();
            db.Dispose();
        }