Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added DB2 backend
- Loading branch information
Denis Chapligin
committed
Feb 20, 2013
1 parent
c5135ee
commit 48650b3
Showing
13 changed files
with
1,836 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton | ||
// Copyright (C) 2011 Denis Chapligin | ||
// 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) | ||
// | ||
|
||
#define SOCI_DB2_SOURCE | ||
#include "soci-db2.h" | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(disable:4355) | ||
#endif | ||
|
||
using namespace soci; | ||
using namespace soci::details; | ||
|
||
|
||
db2_blob_backend::db2_blob_backend(db2_session_backend &session) | ||
: session_(session) | ||
{ | ||
// ... | ||
} | ||
|
||
db2_blob_backend::~db2_blob_backend() | ||
{ | ||
// ... | ||
} | ||
|
||
std::size_t db2_blob_backend::get_len() | ||
{ | ||
// ... | ||
return 0; | ||
} | ||
|
||
std::size_t db2_blob_backend::read( | ||
std::size_t /* offset */, char * /* buf */, std::size_t /* toRead */) | ||
{ | ||
// ... | ||
return 0; | ||
} | ||
|
||
std::size_t db2_blob_backend::write( | ||
std::size_t /* offset */, char const * /* buf */, | ||
std::size_t /* toWrite */) | ||
{ | ||
// ... | ||
return 0; | ||
} | ||
|
||
std::size_t db2_blob_backend::append( | ||
char const * /* buf */, std::size_t /* toWrite */) | ||
{ | ||
// ... | ||
return 0; | ||
} | ||
|
||
void db2_blob_backend::trim(std::size_t /* newLen */) | ||
{ | ||
// ... | ||
} |
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,40 @@ | ||
// | ||
// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton, David Courtney | ||
// Copyright (C) 2011 Denis Chapligin | ||
// 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) | ||
// | ||
|
||
#define SOCI_DB2_SOURCE | ||
#include "soci-db2.h" | ||
#include <backend-loader.h> | ||
|
||
using namespace soci; | ||
using namespace soci::details; | ||
|
||
|
||
// concrete factory for ODBC concrete strategies | ||
db2_session_backend * db2_backend_factory::make_session( | ||
std::string const &connectString) const | ||
{ | ||
return new db2_session_backend(connectString); | ||
} | ||
|
||
db2_backend_factory const soci::db2; | ||
|
||
extern "C" | ||
{ | ||
|
||
// for dynamic backend loading | ||
SOCI_DB2_DECL backend_factory const * factory_db2() | ||
{ | ||
return &soci::db2; | ||
} | ||
|
||
SOCI_DB2_DECL void register_factory_db2() | ||
{ | ||
soci::dynamic_backends::register_backend("db2", soci::db2); | ||
} | ||
|
||
} // extern "C" |
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,28 @@ | ||
// | ||
// Copyright (C) 2004-2006 Maciej Sobczak, Stephen Hutton | ||
// Copyright (C) 2011 Denis Chapligin | ||
// 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) | ||
// | ||
|
||
#define SOCI_DB2_SOURCE | ||
#include "soci-db2.h" | ||
|
||
#ifdef _MSC_VER | ||
#pragma warning(disable:4355) | ||
#endif | ||
|
||
using namespace soci; | ||
using namespace soci::details; | ||
|
||
|
||
db2_rowid_backend::db2_rowid_backend(db2_session_backend & /* session */) | ||
{ | ||
// ... | ||
} | ||
|
||
db2_rowid_backend::~db2_rowid_backend() | ||
{ | ||
// ... | ||
} |
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
Oops, something went wrong.