This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def authors(cd) do | |
#Connect to the database. | |
conn = RethinkDB.connect([host: "10.0.0.30", port: 28015]) | |
q = case cd do | |
"create" -> table_create("authors") | |
"destroy" -> table_drop("authors") | |
end | |
|> run(conn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp table_action("create"), do: table_create("authors") | |
defp table_action("destroy"), do: table_drop("authors") | |
def authors(cd) do | |
#Connect to the database. | |
conn = RethinkDB.connect([host: "10.0.0.30", port: 28015]) | |
q = table_action(cd) |> run(conn) |