Packages
Spawn Statestores Native is a storage lib for the Spawn Actors System using Mnesia
Current section
25 Versions
Jump to
Current section
25 Versions
Compare versions
3
files changed
+14
additions
-134
deletions
| @@ -2,20 +2,20 @@ | |
| 2 2 | [{<<"GitHub">>, |
| 3 3 | <<"https://github.com/eigr/spawn/blob/main/spawn_statestores/statestores_native">>}]}. |
| 4 4 | {<<"name">>,<<"spawn_statestores_native">>}. |
| 5 | - {<<"version">>,<<"2.0.0-RC1">>}. |
| 5 | + {<<"version">>,<<"2.0.0-RC10">>}. |
| 6 6 | {<<"description">>, |
| 7 7 | <<"Spawn Statestores Native is a storage lib for the Spawn Actors System using Mnesia">>}. |
| 8 8 | {<<"elixir">>,<<"~> 1.15">>}. |
| 9 9 | {<<"app">>,<<"spawn_statestores_native">>}. |
| 10 10 | {<<"files">>, |
| 11 11 | [<<"lib">>,<<"lib/statestores">>,<<"lib/statestores/adapters">>, |
| 12 | - <<"lib/statestores/adapters/native_snapshot_adapter.ex">>, |
| 13 12 | <<"lib/statestores/adapters/native_projection_adapter.ex">>, |
| 14 | - <<"lib/statestores/adapters/native_lookup_adapter.ex">>, |
| 15 13 | <<"lib/statestores/adapters/native">>, |
| 16 | - <<"lib/statestores/adapters/native/children.ex">>, |
| 17 14 | <<"lib/statestores/adapters/native/custom_mnesiac_supervisor.ex">>, |
| 18 | - <<"lib/statestores/adapters/native/snapshot_store.ex">>,<<"mix.exs">>, |
| 15 | + <<"lib/statestores/adapters/native/snapshot_store.ex">>, |
| 16 | + <<"lib/statestores/adapters/native/children.ex">>, |
| 17 | + <<"lib/statestores/adapters/native_lookup_adapter.ex">>, |
| 18 | + <<"lib/statestores/adapters/native_snapshot_adapter.ex">>,<<"mix.exs">>, |
| 19 19 | <<"README.md">>,<<"LICENSE">>]}. |
| 20 20 | {<<"licenses">>,[<<"Apache-2.0">>]}. |
| 21 21 | {<<"requirements">>, |
| @@ -27,6 +27,6 @@ | |
| 27 27 | [{<<"name">>,<<"spawn_statestores">>}, |
| 28 28 | {<<"app">>,<<"spawn_statestores">>}, |
| 29 29 | {<<"optional">>,false}, |
| 30 | - {<<"requirement">>,<<"2.0.0-RC1">>}, |
| 30 | + {<<"requirement">>,<<"2.0.0-RC10">>}, |
| 31 31 | {<<"repository">>,<<"hexpm">>}]]}. |
| 32 32 | {<<"build_tools">>,[<<"mix">>]}. |
| @@ -10,138 +10,18 @@ defmodule Statestores.Adapters.NativeProjectionAdapter do | |
| 10 10 | import Statestores.Util, only: [normalize_table_name: 1] |
| 11 11 | |
| 12 12 | @impl true |
| 13 | - def create_table(nil), do: {:error, "Projection name cannot be nil."} |
| 14 | - |
| 15 | - def create_table(projection_name) do |
| 16 | - table_name = normalize_table_name(projection_name) |
| 17 | - {:ok, "Table #{table_name} created or already exists."} |
| 13 | + def create_or_update_table(_projection_type, _table_name) do |
| 14 | + raise "Projections are not supported using native adapter" |
| 18 15 | end |
| 19 16 | |
| 20 17 | @impl true |
| 21 | - def get_last(nil), do: {:error, "No record found"} |
| 22 | - |
| 23 | - def get_last(projection_name) do |
| 24 | - nil |
| 18 | + def upsert(_projection_type, _table_name, _data) do |
| 19 | + raise "Projections are not supported using native adapter" |
| 25 20 | end |
| 26 21 | |
| 27 22 | @impl true |
| 28 | - def get_last_by_projection_id(nil, _projection_id), do: {:error, "No record found"} |
| 29 | - def get_last_by_projection_id(_projection_name, nil), do: {:error, "No record found"} |
| 30 | - |
| 31 | - def get_last_by_projection_id(projection_name, projection_id) do |
| 32 | - nil |
| 33 | - end |
| 34 | - |
| 35 | - @impl true |
| 36 | - def get_all(nil, _page, _page_size), do: {:error, "No records found"} |
| 37 | - |
| 38 | - def get_all(projection_name, page \\ 1, page_size \\ 50) do |
| 39 | - nil |
| 40 | - end |
| 41 | - |
| 42 | - @impl true |
| 43 | - def get_all_by_projection_id(nil, _projection_id, _page, _page_size), |
| 44 | - do: {:error, "No records found"} |
| 45 | - |
| 46 | - def get_all_by_projection_id(_projection_name, nil, _page, _page_size), |
| 47 | - do: {:error, "No records found"} |
| 48 | - |
| 49 | - def get_all_by_projection_id(projection_name, projection_id, page \\ 1, page_size \\ 50) do |
| 50 | - nil |
| 51 | - end |
| 52 | - |
| 53 | - @impl true |
| 54 | - def get_by_interval(nil, _time_start, _time_end, _page, _page_size), |
| 55 | - do: {:error, "No records found"} |
| 56 | - |
| 57 | - def get_by_interval(_projection_name, nil, _time_end, _page, _page_size), |
| 58 | - do: {:error, "No records found"} |
| 59 | - |
| 60 | - def get_by_interval(_projection_name, _time_start, nil, _page, _page_size), |
| 61 | - do: {:error, "No records found"} |
| 62 | - |
| 63 | - def get_by_interval(projection_name, time_start, time_end, page \\ 1, page_size \\ 50) do |
| 64 | - nil |
| 65 | - end |
| 66 | - |
| 67 | - @impl true |
| 68 | - def get_by_projection_id_and_interval( |
| 69 | - nil, |
| 70 | - _projection_id, |
| 71 | - _time_start, |
| 72 | - _time_end, |
| 73 | - _page, |
| 74 | - _page_size |
| 75 | - ), |
| 76 | - do: {:error, "No records found"} |
| 77 | - |
| 78 | - def get_by_projection_id_and_interval( |
| 79 | - _projection_name, |
| 80 | - nil, |
| 81 | - _time_start, |
| 82 | - _time_end, |
| 83 | - _page, |
| 84 | - _page_size |
| 85 | - ), |
| 86 | - do: {:error, "No records found"} |
| 87 | - |
| 88 | - def get_by_projection_id_and_interval( |
| 89 | - _projection_name, |
| 90 | - _projection_id, |
| 91 | - nil, |
| 92 | - _time_end, |
| 93 | - _page, |
| 94 | - _page_size |
| 95 | - ), |
| 96 | - do: {:error, "No records found"} |
| 97 | - |
| 98 | - def get_by_projection_id_and_interval( |
| 99 | - _projection_name, |
| 100 | - _projection_id, |
| 101 | - _time_start, |
| 102 | - nil, |
| 103 | - _page, |
| 104 | - _page_size |
| 105 | - ), |
| 106 | - do: {:error, "No records found"} |
| 107 | - |
| 108 | - def get_by_projection_id_and_interval( |
| 109 | - projection_name, |
| 110 | - projection_id, |
| 111 | - time_start, |
| 112 | - time_end, |
| 113 | - page \\ 1, |
| 114 | - page_size \\ 50 |
| 115 | - ) do |
| 116 | - nil |
| 117 | - end |
| 118 | - |
| 119 | - @impl true |
| 120 | - def search_by_metadata( |
| 121 | - projection_name, |
| 122 | - metadata_key, |
| 123 | - metadata_value, |
| 124 | - page \\ 1, |
| 125 | - page_size \\ 50 |
| 126 | - ) do |
| 127 | - nil |
| 128 | - end |
| 129 | - |
| 130 | - @impl true |
| 131 | - def search_by_projection_id_and_metadata( |
| 132 | - projection_name, |
| 133 | - projection_id, |
| 134 | - metadata_key, |
| 135 | - metadata_value, |
| 136 | - page \\ 1, |
| 137 | - page_size \\ 50 |
| 138 | - ) do |
| 139 | - nil |
| 140 | - end |
| 141 | - |
| 142 | - @impl true |
| 143 | - def save(%Projection{} = projection) do |
| 144 | - {:ok, projection} |
| 23 | + def query(_projection_type, _query, _params, _opts) do |
| 24 | + raise "Projections are not supported using native adapter" |
| 145 25 | end |
| 146 26 | |
| 147 27 | @impl true |
| @@ -2,7 +2,7 @@ defmodule StatestoresNative.MixProject do | |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 4 | @app :spawn_statestores_native |
| 5 | - @version "2.0.0-RC1" |
| 5 | + @version "2.0.0-RC10" |
| 6 6 | @source_url "https://github.com/eigr/spawn/blob/main/spawn_statestores/statestores_native" |
| 7 7 | |
| 8 8 | def project do |
| @@ -58,7 +58,7 @@ defmodule StatestoresNative.MixProject do | |
| 58 58 | [ |
| 59 59 | {:ex_doc, ">= 0.0.0", only: :dev, runtime: false}, |
| 60 60 | {:mnesiac, "~> 0.3"}, |
| 61 | - {:spawn_statestores, "2.0.0-RC1"} |
| 61 | + {:spawn_statestores, "2.0.0-RC10"} |
| 62 62 | ] |
| 63 63 | end |