55
66==Ocsipersist
77
8- <<div class="wip"|Ocsipersist (2 implémentations)
8+ <<div class="wip"|Ocsipersist (3 implémentations)
99Eliom 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
1212configuration file before {{{ Eliom }}}).
1313There 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
1921It 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