Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 882 Bytes

README.md

File metadata and controls

43 lines (29 loc) · 882 Bytes

Firebirdex

Elixir database driver for Firebird https://firebirdsql.org/

Requirements

Firebird 2.5 or higher

Preparation

Add :firebirdex to your dependencies:

def deps() do
  [
    {:firebirdex, "~> 0.3.11"}
  ]
end

Example

If the password is set in the FIREBIRD_PASSWORD environment variable, you can omit the password in the opts variable below.

opts = [
  hostname: "servername",
  username: "sysdba",
  password: "password",
  database: "/some/where/sample.fdb",
]

{:ok, pid} = Firebirdex.start_link(opts)

{:ok, %Firebirdex.Result{} = result} = Firebirdex.query(pid, "SELECT * FROM rdb$relations where rdb$system_flag = ?", [1])

IO.inspect result.columns
IO.inspect Enum.at result.rows, 0

# Same as above (may raise an exception)
result = Firebirdex.query!(pid, "SELECT * FROM rdb$relations where rdb$system_flag = ?", [1])