Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions docs/connect/erlang/odbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,19 @@ main(_) ->
init:stop().
```

:::{rubric} CrateDB Cloud
:::{rubric} SSL connection
:::

For connecting to CrateDB Cloud, start the Erlang [SSL application],
add `sslmode=require`, and replace `Server`, `Uid`, and `Pwd` with
Start the Erlang [SSL application],
add `Sslmode=require`, and replace `Server`, `Uid`, and `Pwd` with
values matching your environment.

`odbc_example.erl`
```erlang
-module(odbc_example).
Also use this variant to connect to CrateDB Cloud.

main(_) ->
ssl:start(),
odbc:start(),
{ok, Ref} = odbc:connect("Driver={PostgreSQL Unicode};Server=testcluster.cratedb.net;Port=5432;sslmode=require;Uid=admin;Pwd=password", []),
io:fwrite("~p~n", [odbc:sql_query(Ref, "SELECT mountain, height FROM sys.summits ORDER BY height DESC LIMIT 3")]),
init:stop().
```erlang
ssl:start(),
odbc:start(),
{ok, Ref} = odbc:connect("Driver={PostgreSQL Unicode};Server=testcluster.cratedb.net;Port=5432;Sslmode=require;Uid=admin;Pwd=password", []),
```

:::{rubric} Example
Expand Down