mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-05 02:06:02 -04:00
Simplifing the code sample for GitHub formating
This commit is contained in:
parent
83846c890b
commit
bad420cffa
@ -34,11 +34,11 @@ int main (void)
|
|||||||
{
|
{
|
||||||
// Open a database file
|
// Open a database file
|
||||||
SQLite::Database db("example.db3");
|
SQLite::Database db("example.db3");
|
||||||
std::cout << "SQLite database file " << db.getFilename().c_str() << " opened successfully\n";
|
std::cout << "database file: " << db.getFilename().c_str() << " opened successfully\n";
|
||||||
|
|
||||||
// Compile a SQL query, containing one parameter (index 1)
|
// Compile a SQL query, containing one parameter (index 1)
|
||||||
SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?");
|
SQLite::Statement query(db, "SELECT * FROM test WHERE size > ?");
|
||||||
std::cout << "SQLite statement " << query.getQuery().c_str() << " compiled (" << query.getColumnCount () << " columns in the result)\n";
|
std::cout << "statement: " << query.getQuery().c_str() << " compiled (" << query.getColumnCount () << " columns)\n";
|
||||||
|
|
||||||
// Bind the integer value 6 to the first parameter of the SQL query
|
// Bind the integer value 6 to the first parameter of the SQL query
|
||||||
query.bind(1, 6);
|
query.bind(1, 6);
|
||||||
@ -59,7 +59,7 @@ int main (void)
|
|||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::cout << "SQLite exception: " << e.what() << std::endl;
|
std::cout << "exception: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</pre></code>
|
</pre></code>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user