4
* Copyright (C) 2009 Tim Marston <edam@waxworlds.org>
6
* This file is part of sqlitepp (hereafter referred to as "this program").
7
* See http://www.waxworlds.org/edam/software/sqlitepp for more information.
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU Lesser General Public License as published
11
* by the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU Lesser General Public License for more details.
19
* You should have received a copy of the GNU Lesser General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
28
#include <boost/utility.hpp>
41
private boost::noncopyable
43
//______________________________________________________________________________
48
* Constructor that specifies the filename of a database to open.
49
* @param filename the filename of the database file to open
50
* @throws database_error on error
53
const std::string &filename );
56
virtual ~database() throw( );
58
//______________________________________________________________________________
64
* @param filename the filename of the database file to open
65
* @param flags flags appropriate for sqlite3_open_v2()
66
* @returns an sqlite error code
67
* @see sqlite3_open_v2()
70
const std::string &filename,
71
int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE );
74
* Close an open database.
75
* @throws database_error on error
76
* @see sqlite3_close()
81
* Execute an SQL statement.
82
* @param sql an SQL statement in UTF-8
83
* @return an sqlite error code
87
const std::string &sql );
90
* Sets a default busy handler which will
91
* wait for the specified number of milliseconds.
92
* @param milliseconds number of milliseconds to wait
93
* @returns an sqlite error code
94
* @see sqlite3_busy_timeout()
99
//______________________________________________________________________________
103
friend class statement;
104
friend class transaction;
106
/** the database handle */
115
#endif /* DATABASE_HPP_ */