public static void Put(this LMDBTransaction tx, LMDBDatabase db, string key, string value) { var enc = System.Text.Encoding.UTF8; byte[] bufferKey = enc.GetBytes(key); byte[] bufferValue = enc.GetBytes(value); tx.Put(db, bufferKey, bufferValue); }
public void SetData(string key, string value) { LMDBTransaction tx = _env.BeginTransaction(); LMDBDatabase db = tx.OpenDatabase(_dbName, new DatabaseConfiguration { Flags = DatabaseOpenFlags.Create }); tx.Put(db, key, value); tx.Commit(); db.Dispose(); }