Commit e0cefc1f authored by Pavel Vainerman's avatar Pavel Vainerman

(SQLite): добавил описание с примером использования

parent 27dc66df
...@@ -33,6 +33,51 @@ ...@@ -33,6 +33,51 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
class SQLiteResult; class SQLiteResult;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/*! \page SQLiteIntarface Интерфейс к SQLite
Пример использования:
\code
try
{
SQLiteInterface db;
if( !db.connect("test.db") )
{
cerr << "db connect error: " << db.error() << endl;
return 1;
}
stringstream q;
q << "SELECT * from main_history";
SQLiteResult r = db.query(q.str());
if( !r )
{
cerr << "db connect error: " << db.error() << endl;
return 1;
}
for( SQLiteResult::iterator it=r.begin(); it!=r.end(); it++ )
{
cout << "ROW: ";
SQLiteResult::COL col(*it);
for( SQLiteResult::COL::iterator cit = it->begin(); cit!=it->end(); cit++ )
cout << as_string(cit) << "(" << as_double(cit) << ") | ";
cout << endl;
}
db.close();
}
catch(Exception& ex)
{
cerr << "(test): " << ex << endl;
}
catch(...)
{
cerr << "(test): catch ..." << endl;
}
\endcode
*/
// ----------------------------------------------------------------------------
// Памятка: // Памятка:
// Включение режима для журнала - "вести в памяти" (чтобы поберечь CompactFlash) // Включение режима для журнала - "вести в памяти" (чтобы поберечь CompactFlash)
// PRAGMA journal_mode = MEMORY // PRAGMA journal_mode = MEMORY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment