Browse Source

Merge branch 'master' of github.com:synrc/kvs

5HT 5 years ago
parent
commit
aaf76c0382
4 changed files with 4 additions and 5 deletions
  1. 1 0
      .github/workflows/elixir.yml
  2. 1 1
      mix.exs
  3. 1 1
      src/kvs.app.src
  4. 1 3
      src/stores/kvs_mnesia.erl

+ 1 - 0
.github/workflows/elixir.yml

@@ -17,3 +17,4 @@ jobs:
     - name: Compilation
       run: mix compile
     - name: Tests
+      run: mix test test/test_helper.exs

+ 1 - 1
mix.exs

@@ -4,7 +4,7 @@ defmodule KVS.Mixfile do
   def project do
     [
       app: :kvs,
-      version: "7.1.2",
+      version: "7.1.3",
       description: "KVS Abstract Chain Database",
       package: package(),
       deps: deps()

+ 1 - 1
src/kvs.app.src

@@ -1,6 +1,6 @@
 {application, kvs,
    [{description, "KVS Abstract Chain Database"},
-    {vsn, "7.1.2"},
+    {vsn, "7.1.3"},
     {registered, []},
     {applications, [kernel,stdlib]},
     {mod, { kvs, []}},

+ 1 - 3
src/stores/kvs_mnesia.erl

@@ -27,9 +27,7 @@ initialize() ->
     Res.
 
 index(Tab,Key,Value) ->
-    Table = kvs:table(Tab),
-    Index = string:str(Table#table.fields,[Key]),
-    lists:flatten(many(fun() -> mnesia:index_read(Tab,Value,Index+1) end)).
+    lists:flatten(many(fun() -> mnesia:index_read(Tab,Value,Key) end)).
 
 get(RecordName, Key) -> just_one(fun() -> mnesia:read(RecordName, Key) end).
 put(Records) when is_list(Records) -> void(fun() -> lists:foreach(fun mnesia:write/1, Records) end);