Skip to content

Commit dc9a242

Browse files
author
Jan Rochel
committed
Wiki documentation for ocsipersist-pgsql
1 parent 3235c59 commit dc9a242

File tree

2 files changed

+35
-8
lines changed

2 files changed

+35
-8
lines changed

doc/manual-wiki/config.wiki

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ Here is a simple example:
148148
</ocsigen>
149149
}}}
150150

151-
Here is another example, for use as unprivileged user toto on port 8000:
151+
Here is another example, for use as unprivileged user toto on port 8000.
152+
We use the PostgreSQL (version >= 9.5) backend for ocsipersist. Note that the
153+
ocsipersist-database under the specified name (default: "ocsipersist") needs to
154+
exist. To create it run {{{psql}}} and execute {{{CREATE TABLE ocsipersist;}}}.
152155

153156
{{{
154157
<ocsigen>
@@ -167,8 +170,14 @@ Here is another example, for use as unprivileged user toto on port 8000:
167170

168171
<extension findlib-package="ocsigenserver.ext.staticmod"/>
169172

170-
<extension findlib-package="ocsigenserver.ext.ocsipersist-sqlite"/>
171-
<!-- sqlite3.cma will be loaded automatically using findlib -->
173+
<extension findlib-package="ocsigenserver.ext.ocsipersist-pgsql">
174+
<database <!-- optional, as each of the following attributes are -->
175+
port="3000"
176+
user="toto"
177+
password="toto's secret"
178+
/>
179+
</extension>
180+
<!-- pa_pgsql.cma will be loaded automatically using findlib -->
172181

173182
<extension findlib-package="ocsigenserver.ext.eliom"/>
174183
<!-- Eliom's dependencies will be loaded automatically using findlib -->
@@ -182,7 +191,7 @@ Here is another example, for use as unprivileged user toto on port 8000:
182191
<site path="tuto">
183192
<eliom module="/usr/local/lib/ocsigenserver/tutoeliom.cmo" />
184193
<static dir="/home/toto/var/www/ocsigenserver/tutorial" />
185-
<!-- Module's path coul be relative but static dir must be absolute -->
194+
<!-- Module's path coul be relative but static dir must be absolute -->
186195
</site>
187196

188197
</host>

doc/manual-wiki/libraries.wiki

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55

66
==Ocsipersist
77

8-
<<div class="wip"|Ocsipersist (2 implémentations)
8+
<<div class="wip"|Ocsipersist (3 implémentations)
99
Eliom allows to use more persistent data, using the module
1010
<<a_api project="ocsigenserver" | module Ocsipersist >> is needed in
1111
{{{ eliom.cma }}}, thus you need to dynlink it in the
1212
configuration file before {{{ Eliom }}}).
1313
There are currently two implementations of {{{ Ocsipersist }}}:
14-
{{{ ocsipersist-dbm.cma }}} (uses the DBM database) and
15-
{{{ ocsipersist-sqlite.cma }}} (uses the SQLite database,
16-
and depends on {{{ sqlite3.cma }}}).
14+
{{{ ocsipersist-dbm.cma }}} (uses the DBM database);
15+
{{{ ocsipersist-sqlite.cma }}} (uses the SQLite database
16+
and depends on {{{ sqlite3.cma }}});
17+
{{{ ocsipersist-pgsql.cma }}} (uses the PostgreSQL (version >= 9.5)
18+
database and depends on {{{ pa_pgsql.cma }}});
1719
>>
1820

1921
It is possible to customize the location of the database on the
@@ -31,3 +33,19 @@ name of the {{{ocsidbm}}} process you want to use:
3133
<ocsidbm name="_EXTRALIBDIR_/ocsidbm"/>
3234
</extension>
3335
}}}
36+
PostgreSQL has more options to specify how to connect to the database.
37+
Note that the ocsipersist-database under the specified name (default:
38+
"ocsipersist") needs to exist. To create it run {{{psql}}} and execute
39+
{{{CREATE TABLE ocsipersist;}}}.
40+
{{{
41+
<extension findlib-package="ocsigenserver.ext.ocsipersist-pgsql">
42+
<database <!-- optional, as each of the following attributes are -->
43+
host="localhost"
44+
port="3000"
45+
user="Aerobic Respirator"
46+
password="Guess what I need!"
47+
database="ocsipersist" <!-- this is the default value if not specified -->
48+
unix_domain_socket_dir="./udsd"
49+
/>
50+
</extension>
51+
}}}

0 commit comments

Comments
 (0)