-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for arbitrary Mnesia arguments #51
base: master
Are you sure you want to change the base?
Conversation
The previous engine "type" parameters are checked to maintain backwards compatibility
@@ -166,9 +166,33 @@ defmodule EctoMnesia.Storage.Migrator do | |||
end | |||
|
|||
# Helpers | |||
defp do_create_table(repo, table, type, attributes) do | |||
defp do_create_table(repo, table, engine, attributes) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function is too complex (CC is 10, max is 9).
@@ -166,9 +166,33 @@ defmodule EctoMnesia.Storage.Migrator do | |||
end | |||
|
|||
# Helpers | |||
defp do_create_table(repo, table, type, attributes) do | |||
defp do_create_table(repo, table, engine, attributes) do | |||
opts = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
lib/ecto_mnesia/storage/migrator.ex
Outdated
opts when is_list(opts) -> | ||
opts | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
config = conf(repo) | ||
tab_def = [{:attributes, attributes}, {config[:storage_type], [config[:host]]}, {:type, get_engine(type)}] | ||
|
||
storage_opts = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
[{config[:storage_type], [config[:host]]}] | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
Ebert has finished reviewing this Pull Request and has found:
You can see more details about this review at https://ebertapp.io/github/Nebo15/ecto_mnesia/pulls/51. |
opts | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
:else -> | ||
[{config[:storage_type], [config[:host]]}] | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no trailing white-space at the end of a line.
This adds support for passing additional arguments to Mnesia.create_table().
The previous engine "type" parameters are checked to
maintain backwards compatibility