-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'error-msg-bulk-insert'
Show vector parameters values in error messages. See #1200.
- Loading branch information
Showing
18 changed files
with
441 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// | ||
// Copyright (C) 2025 Vadim Zeitlin | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
|
||
#ifndef SOCI_ORACLE_HANDLE_H_INCLUDED | ||
#define SOCI_ORACLE_HANDLE_H_INCLUDED | ||
|
||
#include "soci/oracle/soci-oracle.h" | ||
|
||
namespace soci | ||
{ | ||
|
||
namespace details | ||
{ | ||
|
||
namespace oracle | ||
{ | ||
|
||
template <typename Handle> | ||
struct oci_traits; | ||
|
||
template <> | ||
struct oci_traits<OCIStmt> | ||
{ | ||
static constexpr ub4 type = OCI_HTYPE_STMT; | ||
}; | ||
|
||
template <> | ||
struct oci_traits<OCIError> | ||
{ | ||
static constexpr ub4 type = OCI_HTYPE_ERROR; | ||
}; | ||
|
||
template <typename OCIHandle> | ||
class handle | ||
{ | ||
public: | ||
static constexpr ub4 HandleType = oci_traits<OCIHandle>::type; | ||
|
||
explicit handle(OCIEnv *envhp) | ||
: handle_(NULL) | ||
{ | ||
sword res = OCIHandleAlloc(envhp, | ||
reinterpret_cast<dvoid**>(&handle_), | ||
HandleType, 0, 0); | ||
if (res != OCI_SUCCESS) | ||
{ | ||
throw oracle_soci_error("Failed to allocate handler", 0); | ||
} | ||
} | ||
|
||
~handle() | ||
{ | ||
OCIHandleFree(handle_, HandleType); | ||
} | ||
|
||
handle(handle const &) = delete; | ||
handle& operator=(handle const &) = delete; | ||
|
||
OCIHandle* get() { return handle_; } | ||
operator OCIHandle*() { return handle_; } | ||
|
||
// This is needed to allow passing handle to OCI functions. | ||
void** ptr() { return reinterpret_cast<void**>(&handle_); } | ||
|
||
private: | ||
OCIHandle* handle_; | ||
}; | ||
|
||
} // namespace oracle | ||
|
||
} // namespace details | ||
|
||
} // namespace soci | ||
|
||
#endif // SOCI_ORACLE_HANDLE_H_INCLUDED |
Oops, something went wrong.