Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed Apr 14, 2022
1 parent f88c5ba commit 90768b0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/pqxx/internal/ignore-deprecated-post.hxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// End a code block started by "ignore-deprecated-pre.hxx".

#if !defined(PQXX_IGNORING_DEPRECATED)
#error "Ended an 'ignore-deprecated' block while none was active."
# error "Ended an 'ignore-deprecated' block while none was active."
#endif

#if defined(__GNUC__)
Expand Down
2 changes: 1 addition & 1 deletion include/pqxx/internal/ignore-deprecated-pre.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* small as possible.
*/
#if defined(PQXX_IGNORING_DEPRECATED)
#error "Started an 'ignore-deprecated' block inside another."
# error "Started an 'ignore-deprecated' block inside another."
#endif

#define PQXX_IGNORING_DEPRECATED
Expand Down
37 changes: 15 additions & 22 deletions include/pqxx/transaction_base.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ public:
* @param query Query or command to execute.
* @return A result set describing the query's or command's result.
*/
result
exec(std::string_view query)
result exec(std::string_view query)
{
#include "pqxx/internal/ignore-deprecated-pre.hxx"
return exec(query, std::string_view{});
Expand All @@ -284,8 +283,9 @@ public:
* @param desc Optional identifier for query, to help pinpoint SQL errors.
* @return A result set describing the query's or command's result.
*/
[[deprecated("Pass your query as a std::string_view, not stringstream.")]]
result exec(std::stringstream const &query, std::string_view desc)
[[deprecated(
"Pass your query as a std::string_view, not stringstream.")]] result
exec(std::stringstream const &query, std::string_view desc)
{
#include "pqxx/internal/ignore-deprecated-pre.hxx"
return exec(query.str(), desc);
Expand All @@ -298,8 +298,8 @@ public:
*
* @throw unexpected_rows If the query returned the wrong number of rows.
*/
[[deprecated("The desc parameter is going away.")]]
result exec0(zview query, std::string_view desc)
[[deprecated("The desc parameter is going away.")]] result
exec0(zview query, std::string_view desc)
{
#include "pqxx/internal/ignore-deprecated-pre.hxx"
return exec_n(0, query, desc);
Expand All @@ -312,10 +312,7 @@ public:
*
* @throw unexpected_rows If the query returned the wrong number of rows.
*/
result exec0(zview query)
{
return exec_n(0, query);
}
result exec0(zview query) { return exec_n(0, query); }

/// Execute command returning a single row of data.
/** Works like @ref exec, but requires the result to contain exactly one row.
Expand All @@ -324,8 +321,8 @@ public:
*
* @throw unexpected_rows If the query returned the wrong number of rows.
*/
[[deprecated("The desc parameter is going away.")]]
row exec1(zview query, std::string_view desc)
[[deprecated("The desc parameter is going away.")]] row
exec1(zview query, std::string_view desc)
{
#include "pqxx/internal/ignore-deprecated-pre.hxx"
return exec_n(1, query, desc).front();
Expand All @@ -339,19 +336,16 @@ public:
*
* @throw unexpected_rows If the query returned the wrong number of rows.
*/
row exec1(zview query)
{
return exec_n(1, query).front();
}
row exec1(zview query) { return exec_n(1, query).front(); }

/// Execute command, expect given number of rows.
/** Works like @ref exec, but checks that the result has exactly the expected
* number of rows.
*
* @throw unexpected_rows If the query returned the wrong number of rows.
*/
[[deprecated("The desc parameter is going away.")]]
result exec_n(result::size_type rows, zview query, std::string_view desc);
[[deprecated("The desc parameter is going away.")]] result
exec_n(result::size_type rows, zview query, std::string_view desc);

/// Execute command, expect given number of rows.
/** Works like @ref exec, but checks that the result has exactly the expected
Expand All @@ -371,8 +365,8 @@ public:
* database. It returns that value, converted to the type you specify.
*/
template<typename TYPE>
[[deprecated("The desc parameter is going away.")]]
TYPE query_value(zview query, std::string_view desc)
[[deprecated("The desc parameter is going away.")]] TYPE
query_value(zview query, std::string_view desc)
{
#include "pqxx/internal/ignore-deprecated-pre.hxx"
row const r{exec1(query, desc)};
Expand All @@ -387,8 +381,7 @@ public:
/** This is convenience shorthand for querying exactly one value from the
* database. It returns that value, converted to the type you specify.
*/
template<typename TYPE>
TYPE query_value(zview query)
template<typename TYPE> TYPE query_value(zview query)
{
row const r{exec1(query)};
if (std::size(r) != 1)
Expand Down
3 changes: 1 addition & 2 deletions src/connection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,7 @@ std::string pqxx::connection::connection_string() const
#if defined(_WIN32) || __has_include(<fcntl.h>)
pqxx::connecting::connecting(zview connection_string) :
m_conn{connection::connect_nonblocking, connection_string}
{
}
{}
#endif // defined(_WIN32) || __has_include(<fcntl.h>


Expand Down

0 comments on commit 90768b0

Please sign in to comment.