Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michaelkschmidt
Copy link
Contributor

This adds support for passing additional arguments to Mnesia.create_table().

The previous engine "type" parameters are checked to
maintain backwards compatibility

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
Copy link
Member

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 =
Copy link
Member

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.

opts when is_list(opts) ->
opts
end

Copy link
Member

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 =
Copy link
Member

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


Copy link
Member

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.

@AndrewDryga
Copy link
Member

Ebert has finished reviewing this Pull Request and has found:

  • 6 possible new issues (including those that may have been commented here).

You can see more details about this review at https://ebertapp.io/github/Nebo15/ecto_mnesia/pulls/51.

opts
end
end

Copy link
Member

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

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants