source: npl/mailserver/dspam/dspam-3.10.2/doc/sqlite_drv.txt

Last change on this file was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 4.1 KB
Line 
1$Id: sqlite_drv.txt,v 1.3 2011/07/08 23:01:42 pcockings Exp $
2
3COPYRIGHT (C) 2002-2012 DSPAM Project
4http://dspam.sourceforge.net
5
6LICENSE
7
8This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU Affero General Public License as
10published by the Free Software Foundation, either version 3 of the
11License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16GNU Affero General Public License for more details.
17
18You should have received a copy of the GNU Affero General Public License
19along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21ABOUT
22
23- - ----------------------------------------------------------------------- - -
24- - Note: The sqlite_drv for using SQLite2 (>2.7.7) is not widely used and  - -
25- -       is likely to be removed in a future release. Please consider      - -
26- -       moving to SQLite3 and the sqlite3_drv instead.                    - -
27- - ----------------------------------------------------------------------- - -
28
29sqlite_drv and sqlite3_drv are SQLite storage drivers for DSPAM v3.0 and above.
30These drivers enables DSPAM to read and write all token, signature, and
31statistics data from individual SQLite databases created for each user.
32
33WARNING: SQLite is not designed to function over NFS. If your system is large
34         enough to require NFS, it is strongly recommended you use a stateful
35         SQL driver, such as MySQL or PostgreSQL.
36
371. CONFIGURING DSPAM
38
39To configure DSPAM to use a driver, use the following arguments while running
40DSPAM's configure:
41
42--with-storage-driver=sqlite_drv
43Tells DSPAM to use the sqlite_drv driver
44
45--with-storage-driver=sqlite3_drv
46Tells DSPAM to use the sqlite3_drv driver (for SQLite v3.x)
47
48--with-sqlite-libraries=/path/to/libs
49Tells DSPAM where to find the SQLite library (libsqlite.so).
50
51--with-sqlite-includes=/path/to/includes
52Tells DSPAM where to find the SQLite headers.
53
54After configure has successfully finished, build and install DSPAM using the
55instructions from DSPAM's readme.
56
572. OBJECT CREATION
58
59The drivers will automatically create the necessary database objects for each
60user upon first use of DSPAM by that user.
61
623. PURGING
63
64The purge script should be run against all databases periodically. The best
65way to do this is to use a find recipe such as:
66
67find /usr/local/var/dspam/data -name "*.sdb" -exec sqlite {} < /var/dspam/purge-2.sql \;
68
69or use sqlite3 and purge-3.sql if you're running sqlite3_drv.
70
71You may also wish to occasionally compact your databases. This should only
72be run once in a great while, and is not entirely necessary as SQLite will
73automatically reclaim space the next time it is used.  Nevertheless, some
74databases can grow quite large if not purged well enough. Another find
75recipe such as the one below can be used to compact all databases on a
76system.
77
78find /usr/local/var/dspam/data -name "*.sdb" -exec echo 'vacuum;' \| sqlite {} \;
79
80or sqlite3, if you're running sqlite3_drv.
81
824. TUNING
83
84There are some tuning parameters which can be set, discussed here:
85http://sqlite.org/pragma.html#syntax
86
87Whenever sqlite_drv connects to a database, it will read
88$DSPAM_HOME/sqlite.pragma and execute any commands found in the file. For
89example, if you wish to turn off synchronous mode (which speeds up queries by
90as much as 50x, but could potentially risk database corruption on system
91crash), you could add this line to sqlite.pragma:
92
93PRAGMA synchronous = OFF
94
95Note: - Do not put a semicolon at the end of any statements in sqlite.pragma.
96      - Comments are not allowed in sqlite.pragma. Anything you add to the file
97        will be executed without being filtered.
98
99ERRORS
100
101Any SQL errors will be reported to LOGDIR/sql.errors as well as the standard
102syslog facilities (although the query will be truncated).
103
104QUESTIONS
105
106Please contact the dspam-dev mailing list with any questions or constructive
107feedback.
108
109Initial storage driver written by Jonathan A. Zdziarski <jonathan@nuclearelephant.com>
110and later enhanced by Stevan Bajic <stevan@bajic.ch> for DSPAM 3.9.0.
Note: See TracBrowser for help on using the repository browser.