Advertisement
Guest User

Untitled

a guest
Mar 5th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. defmodule Coba do
  2. def connect_db do
  3. opts = [backoff_type: :stop, hostname: "localhost", username: "budi", password: "123456", database: "dbname123", ssl: false]
  4. {:ok, pid} = Postgrex.start_link(opts)
  5. {:ok, res} = Postgrex.query(pid, "SELECT kolom1 FROM tablecoba", [])
  6. end
  7. end
  8.  
  9. Coba.connect_db()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement