Created
May 26, 2015 18:35
-
-
Save Linicks/29267d895efffdbc644c to your computer and use it in GitHub Desktop.
Proper Elixir Control Structure ?
This file contains hidden or 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]) | |
#Create ore Destroy the authors table. | |
if cd == "create" do | |
q = table_create("authors") | |
|> run conn | |
end | |
if cd == "destroy" do | |
q = table_drop("authors") | |
|> run conn | |
end | |
results = inspect(q.data) | |
IO.puts "#{results}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment