Skip to content

Commit 2378df6

Browse files
committed
Driver/Erlang: Add "CrateDB Cloud" instructions for the ODBC variant
1 parent c561408 commit 2378df6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/connect/erlang.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,25 @@ docker run --rm --publish=5432:5432 crate -Cdiscovery.type=single-node
4848
escript odbc_example.erl
4949
```
5050

51+
:::{rubric} CrateDB Cloud
52+
:::
53+
54+
For connecting to CrateDB Cloud, start the Erlang [SSL application],
55+
add `sslmode=require`, and replace `Server`, `Uid`, and `Pwd` with
56+
values matching your environment.
57+
58+
`odbc_example.erl`
59+
```erlang
60+
-module(odbc_example).
61+
62+
main(_) ->
63+
ssl:start(),
64+
odbc:start(),
65+
{ok, Ref} = odbc:connect("Driver={PostgreSQL};Server=testcluster.cratedb.net;Port=5432;sslmode=require;Uid=admin;Pwd=password", []),
66+
io:fwrite("~p~n", [odbc:sql_query(Ref, "SELECT mountain, height FROM sys.summits ORDER BY height DESC LIMIT 3")]),
67+
init:stop().
68+
```
69+
5170

5271
## epgsql
5372

0 commit comments

Comments
 (0)