Skip to content

Commit fa9a0c9

Browse files
committed
Driver: Fix / improve "SSL connection" section on "Erlang/ODBC" page
1 parent ce8a9b1 commit fa9a0c9

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

docs/connect/erlang/odbc.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,19 @@ main(_) ->
3636
init:stop().
3737
```
3838

39-
:::{rubric} CrateDB Cloud
39+
:::{rubric} SSL connection
4040
:::
4141

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

46-
`odbc_example.erl`
47-
```erlang
48-
-module(odbc_example).
46+
Also use this variant to connect to CrateDB Cloud.
4947

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

5854
:::{rubric} Example

0 commit comments

Comments
 (0)