@@ -15,20 +15,13 @@ Erlang includes an [ODBC application] out of the box that provides an
1515interface to communicate with relational SQL-databases, see also
1616[ Erlang ODBC examples] .
1717
18- :::{rubric} Prerequisites
19- :::
20-
21- Install ODBC driver.
22-
23- ` odbcinst.ini `
24- ``` ini
25- [PostgreSQL]
26- Description = PostgreSQL ODBC driver
27- Driver = /usr/local/lib/psqlodbcw.so
18+ ::::{todo}
19+ Enable this include with the [ ODBC patch] ( https://github.com/crate/cratedb-guide/pull/411 ) .
2820```
29- ``` shell
30- odbcinst -i -d -f odbcinst.ini
21+ :::{include} _odbc-setup-widget.md
22+ :::
3123```
24+ ::::
3225
3326:::{rubric} Synopsis
3427:::
@@ -39,12 +32,12 @@ odbcinst -i -d -f odbcinst.ini
3932
4033main (_ ) ->
4134 odbc :start (),
42- {ok , Ref } = odbc :connect (" Driver={PostgreSQL};Servername =localhost;Portnumber =5432;Uid=crate;Pwd=crate" , []),
35+ {ok , Ref } = odbc :connect (" Driver={PostgreSQL ODBC Driver(UNICODE)};Server =localhost;Port =5432;Uid=crate;Pwd=crate" , []),
4336 io :fwrite (" ~p~n " , [odbc :sql_query (Ref , " SELECT mountain, height FROM sys.summits ORDER BY height DESC LIMIT 3" )]),
4437 init :stop ().
4538```
4639
47- Start CrateDB using Docker or Podman, then compile and invoke example program.
40+ Start CrateDB using Docker or Podman, then compile and invoke the example program.
4841``` shell
4942docker run --rm --publish=5432:5432 crate -Cdiscovery.type=single-node
5043```
@@ -84,7 +77,7 @@ start() ->
8477 init :stop ().
8578```
8679
87- Start CrateDB using Docker or Podman, then compile and invoke example program.
80+ Start CrateDB using Docker or Podman, then compile and invoke the example program.
8881``` shell
8982docker run --rm --publish=5432:5432 crate -Cdiscovery.type=single-node
9083```
@@ -93,7 +86,6 @@ rebar3 compile
9386erlc epgsql_example.erl
9487erl -pa ebin ./_build/default/lib/epgsql/ebin ./_build/default/lib/epgsql/include -noshell -run epgsql_example
9588```
96- Stop the REPL using ` CTRL+G ` , ` q ` , ` ENTER ` .
9789
9890:::{rubric} CrateDB Cloud
9991:::
0 commit comments