Skip to content

Commit 0f87a4d

Browse files
committed
Fix documentation
1 parent f3dee42 commit 0f87a4d

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,20 @@ statement.set(0, 42);
4747
*/
4848

4949
// Execute and get results
50-
statement.execute(transaction);
51-
52-
// Process results...
53-
do
50+
if (statement.execute(transaction))
5451
{
55-
const std::optional<std::int32_t> id = statement.getInt32(0);
56-
const std::optional<std::string> name = statement.getString(1);
57-
58-
/* Or
59-
const auto id = statement.get<std::int32_t>(0);
60-
const auto name = statement.get<std::string>(1);
61-
*/
62-
} while (statement.fetchNext());
52+
// Process results...
53+
do
54+
{
55+
const std::optional<std::int32_t> id = statement.getInt32(0);
56+
const std::optional<std::string> name = statement.getString(1);
57+
58+
/* Or
59+
const auto id = statement.get<std::int32_t>(0);
60+
const auto name = statement.get<std::string>(1);
61+
*/
62+
} while (statement.fetchNext());
63+
}
6364

6465
// Commit transaction
6566
transaction.commit();

src/lib/Statement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ namespace fbcpp
340340
///
341341
/// @brief Executes a prepared statement using the supplied transaction.
342342
/// @param transaction Transaction that will own the execution context.
343-
/// @return `true` when execution yields a result set that can be fetched.
343+
/// @return `true` when execution yields a record.
344344
///
345345
bool execute(Transaction& transaction);
346346

0 commit comments

Comments
 (0)