Last active
August 29, 2015 14:16
-
-
Save jamesbee/2be415394aff81dc8103 to your computer and use it in GitHub Desktop.
Revisions
-
jamesbee revised this gist
Mar 31, 2015 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,6 @@ defmodule SomeProject.Mixfile do use Mix.Project ## # bla, bla, bla ## -
jamesbee created this gist
Mar 12, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ defmodule Conn do def test do stat = "select * from users limit 10;" :emysql.add_pool :demo_pool, [ size: 1, user: 'root', password: 'root', database: 'demo', encoding: :utf8 # you will need this ] res = :emysql.execute :demo_pool, stat rows = :emysql.as_proplist res # from keyword list to elixir map Enum.map rows, &Enum.into(&1, %{}) end end 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ defmodule Sh.Mixfile do use Mix.Project @version String.strip(File.read!("VERSION")) ## # bla, bla, bla ## # Add crypto, emysql to application start link. def application do [applications: [:crypto, :emysql]] end # Add emysql dependencies defp deps do [{:emysql, github: "Eonblast/Emysql", ref: "HEAD"}] end end