mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-16 18:56:52 +02:00
namespace Keywords (!!! breaks existing code !!!)
Following keywords were moved from Poco:Data to Poco::Data::Keywords namespace - now - use - bind - into - in - out - io - from - bulk - null - limit - upperLimit - lowerLimit - range
This commit is contained in:
@@ -47,24 +47,25 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
||||
Session* ODBCAccessTest::_pSession = 0;
|
||||
std::string ODBCAccessTest::_dbConnString;
|
||||
ODBC::Utility::DriverMap ODBCAccessTest::_drivers;
|
||||
Session* ODBCAccessTest::_pSession = 0;
|
||||
std::string ODBCAccessTest::_dbConnString;
|
||||
Poco::Data::ODBC::Utility::DriverMap ODBCAccessTest::_drivers;
|
||||
|
||||
|
||||
ODBCAccessTest::ODBCAccessTest(const std::string& name):
|
||||
CppUnit::TestCase(name)
|
||||
{
|
||||
ODBC::Connector::registerConnector();
|
||||
Poco::Data::ODBC::Connector::registerConnector();
|
||||
}
|
||||
|
||||
|
||||
@@ -204,10 +205,10 @@ bool ODBCAccessTest::init(const std::string& driver, const std::string& dsn)
|
||||
Utility::drivers(_drivers);
|
||||
if (!canConnect(driver, dsn)) return false;
|
||||
|
||||
ODBC::Connector::registerConnector();
|
||||
Poco::Data::ODBC::Connector::registerConnector();
|
||||
try
|
||||
{
|
||||
_pSession = new Session(ODBC::Connector::KEY, _dbConnString);
|
||||
_pSession = new Session(Poco::Data::ODBC::Connector::KEY, _dbConnString);
|
||||
}catch (ConnectionException& ex)
|
||||
{
|
||||
std::cout << ex.toString() << std::endl;
|
||||
|
@@ -50,11 +50,12 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
|
@@ -49,11 +49,12 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::NotFoundException;
|
||||
|
@@ -45,11 +45,14 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
|
@@ -43,10 +43,11 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Any;
|
||||
using Poco::AnyCast;
|
||||
|
@@ -46,11 +46,15 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
|
@@ -47,11 +47,11 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::NotFoundException;
|
||||
|
||||
|
@@ -51,12 +51,14 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::ODBCException;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ODBCException;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
@@ -1165,10 +1167,10 @@ ODBCTest::SessionPtr ODBCTest::init(const std::string& driver,
|
||||
Utility::drivers(_drivers);
|
||||
if (!canConnect(driver, dsn, uid, pwd, dbConnString, db)) return 0;
|
||||
|
||||
ODBC::Connector::registerConnector();
|
||||
Poco::Data::ODBC::Connector::registerConnector();
|
||||
try
|
||||
{
|
||||
return new Session(ODBC::Connector::KEY, dbConnString);
|
||||
return new Session(Poco::Data::ODBC::Connector::KEY, dbConnString);
|
||||
}catch (ConnectionException& ex)
|
||||
{
|
||||
std::cout << ex.toString() << std::endl;
|
||||
|
@@ -66,13 +66,24 @@
|
||||
#include <iterator>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using ODBC::Utility;
|
||||
using ODBC::Preparation;
|
||||
using ODBC::ConnectionException;
|
||||
using ODBC::StatementException;
|
||||
using ODBC::DataTruncatedException;
|
||||
using ODBC::StatementDiagnostics;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::Column;
|
||||
using Poco::Data::Row;
|
||||
using Poco::Data::SQLChannel;
|
||||
using Poco::Data::LimitException;
|
||||
using Poco::Data::BindingException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::Date;
|
||||
using Poco::Data::Time;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::Preparation;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::DataTruncatedException;
|
||||
using Poco::Data::ODBC::StatementDiagnostics;
|
||||
using Poco::format;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
@@ -2981,7 +2992,7 @@ void SQLExecutor::sqlChannel(const std::string& connect)
|
||||
{
|
||||
try
|
||||
{
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(ODBC::Connector::KEY, connect, "TestSQLChannel");
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(Poco::Data::ODBC::Connector::KEY, connect, "TestSQLChannel");
|
||||
pChannel->setProperty("keep", "2 seconds");
|
||||
|
||||
Message msgInf("InformationSource", "a Informational async message", Message::PRIO_INFORMATION);
|
||||
@@ -3040,7 +3051,7 @@ void SQLExecutor::sqlLogger(const std::string& connect)
|
||||
try
|
||||
{
|
||||
Logger& root = Logger::root();
|
||||
root.setChannel(new SQLChannel(ODBC::Connector::KEY, connect, "TestSQLChannel"));
|
||||
root.setChannel(new SQLChannel(Poco::Data::ODBC::Connector::KEY, connect, "TestSQLChannel"));
|
||||
root.setLevel(Message::PRIO_INFORMATION);
|
||||
|
||||
root.information("a Informational message");
|
||||
|
@@ -83,11 +83,11 @@
|
||||
assert (SQL_SUCCEEDED(r))
|
||||
|
||||
|
||||
#define poco_data_using_statements using Poco::Data::now; \
|
||||
using Poco::Data::into; \
|
||||
using Poco::Data::use; \
|
||||
using Poco::Data::bulk; \
|
||||
using Poco::Data::limit; \
|
||||
#define poco_data_using_statements using Poco::Data::Keywords::now; \
|
||||
using Poco::Data::Keywords::into; \
|
||||
using Poco::Data::Keywords::use; \
|
||||
using Poco::Data::Keywords::bulk; \
|
||||
using Poco::Data::Keywords::limit; \
|
||||
using Poco::Data::BLOB; \
|
||||
using Poco::Data::ODBC::ConnectionException; \
|
||||
using Poco::Data::ODBC::StatementException
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include "Poco/Data/AbstractExtractor.h"
|
||||
#include "Poco/Data/MetaColumn.h"
|
||||
#include "Poco/Data/DataException.h"
|
||||
#include "Poco/Data/Constants.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include <vector>
|
||||
@@ -135,7 +136,7 @@ public:
|
||||
bool extract(std::size_t pos, Poco::DynamicAny& val);
|
||||
/// Extracts a DynamicAny.
|
||||
|
||||
bool isNull(std::size_t pos, std::size_t row = -1);
|
||||
bool isNull(std::size_t pos, std::size_t row = POCO_DATA_INVALID_ROW);
|
||||
/// Returns true if the current row value at pos column is null.
|
||||
/// Because of the loss of information about null-ness of the
|
||||
/// underlying database values due to the nature of SQLite engine,
|
||||
|
@@ -56,7 +56,20 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::Column;
|
||||
using Poco::Data::Row;
|
||||
using Poco::Data::SQLChannel;
|
||||
using Poco::Data::LimitException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::Date;
|
||||
using Poco::Data::Time;
|
||||
using Poco::Data::AbstractExtractionVec;
|
||||
using Poco::Data::AbstractExtractionVecVec;
|
||||
using Poco::Data::AbstractBindingVec;
|
||||
using Poco::Tuple;
|
||||
using Poco::Any;
|
||||
using Poco::AnyCast;
|
||||
@@ -174,19 +187,19 @@ private:
|
||||
|
||||
SQLiteTest::SQLiteTest(const std::string& name): CppUnit::TestCase(name)
|
||||
{
|
||||
SQLite::Connector::registerConnector();
|
||||
Poco::Data::SQLite::Connector::registerConnector();
|
||||
}
|
||||
|
||||
|
||||
SQLiteTest::~SQLiteTest()
|
||||
{
|
||||
SQLite::Connector::unregisterConnector();
|
||||
Poco::Data::SQLite::Connector::unregisterConnector();
|
||||
}
|
||||
|
||||
|
||||
void SQLiteTest::testSimpleAccess()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
assert (tmp.isConnected());
|
||||
std::string tableName("Person");
|
||||
std::string lastName("lastname");
|
||||
@@ -217,7 +230,7 @@ void SQLiteTest::testSimpleAccess()
|
||||
|
||||
void SQLiteTest::testNullCharPointer()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::string lastName("lastname");
|
||||
int age = 100;
|
||||
int count = 100;
|
||||
@@ -259,7 +272,7 @@ void SQLiteTest::testNullCharPointer()
|
||||
|
||||
void SQLiteTest::testInsertCharPointer()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::string tableName("Person");
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
@@ -300,7 +313,7 @@ void SQLiteTest::testInsertCharPointer()
|
||||
|
||||
void SQLiteTest::testInsertCharPointer2()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::string tableName("Person");
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
@@ -330,7 +343,7 @@ void SQLiteTest::testInsertCharPointer2()
|
||||
|
||||
void SQLiteTest::testComplexType()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
tmp << "DROP TABLE IF EXISTS Person", now;
|
||||
@@ -351,7 +364,7 @@ void SQLiteTest::testComplexType()
|
||||
|
||||
void SQLiteTest::testSimpleAccessVector()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<std::string> lastNames;
|
||||
std::vector<std::string> firstNames;
|
||||
std::vector<std::string> addresses;
|
||||
@@ -388,7 +401,7 @@ void SQLiteTest::testSimpleAccessVector()
|
||||
|
||||
void SQLiteTest::testComplexTypeVector()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<Person> people;
|
||||
people.push_back(Person("LN1", "FN1", "ADDR1", 1));
|
||||
people.push_back(Person("LN2", "FN2", "ADDR2", 2));
|
||||
@@ -407,7 +420,7 @@ void SQLiteTest::testComplexTypeVector()
|
||||
|
||||
void SQLiteTest::testInsertVector()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<std::string> str;
|
||||
str.push_back("s1");
|
||||
str.push_back("s2");
|
||||
@@ -432,7 +445,7 @@ void SQLiteTest::testInsertVector()
|
||||
|
||||
void SQLiteTest::testInsertEmptyVector()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<std::string> str;
|
||||
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
@@ -450,7 +463,7 @@ void SQLiteTest::testInsertEmptyVector()
|
||||
|
||||
void SQLiteTest::testAffectedRows()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<std::string> str;
|
||||
str.push_back("s1");
|
||||
str.push_back("s2");
|
||||
@@ -482,7 +495,7 @@ void SQLiteTest::testAffectedRows()
|
||||
|
||||
void SQLiteTest::testInsertSingleBulk()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
int x = 0;
|
||||
@@ -504,7 +517,7 @@ void SQLiteTest::testInsertSingleBulk()
|
||||
|
||||
void SQLiteTest::testInsertSingleBulkVec()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -529,7 +542,7 @@ void SQLiteTest::testInsertSingleBulkVec()
|
||||
|
||||
void SQLiteTest::testLimit()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -551,7 +564,7 @@ void SQLiteTest::testLimit()
|
||||
|
||||
void SQLiteTest::testLimitZero()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -569,7 +582,7 @@ void SQLiteTest::testLimitZero()
|
||||
|
||||
void SQLiteTest::testLimitOnce()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -599,7 +612,7 @@ void SQLiteTest::testLimitOnce()
|
||||
|
||||
void SQLiteTest::testLimitPrepare()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -637,7 +650,7 @@ void SQLiteTest::testLimitPrepare()
|
||||
|
||||
void SQLiteTest::testPrepare()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
std::vector<int> data;
|
||||
@@ -658,7 +671,7 @@ void SQLiteTest::testPrepare()
|
||||
|
||||
void SQLiteTest::testSetSimple()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::set<std::string> lastNames;
|
||||
std::set<std::string> firstNames;
|
||||
std::set<std::string> addresses;
|
||||
@@ -695,7 +708,7 @@ void SQLiteTest::testSetSimple()
|
||||
|
||||
void SQLiteTest::testSetComplex()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::set<Person> people;
|
||||
people.insert(Person("LN1", "FN1", "ADDR1", 1));
|
||||
people.insert(Person("LN2", "FN2", "ADDR2", 2));
|
||||
@@ -714,7 +727,7 @@ void SQLiteTest::testSetComplex()
|
||||
|
||||
void SQLiteTest::testSetComplexUnique()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::vector<Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
people.push_back(p1);
|
||||
@@ -740,7 +753,7 @@ void SQLiteTest::testSetComplexUnique()
|
||||
|
||||
void SQLiteTest::testMultiSetSimple()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multiset<std::string> lastNames;
|
||||
std::multiset<std::string> firstNames;
|
||||
std::multiset<std::string> addresses;
|
||||
@@ -777,7 +790,7 @@ void SQLiteTest::testMultiSetSimple()
|
||||
|
||||
void SQLiteTest::testMultiSetComplex()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multiset<Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
people.insert(p1);
|
||||
@@ -802,7 +815,7 @@ void SQLiteTest::testMultiSetComplex()
|
||||
|
||||
void SQLiteTest::testMapComplex()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::map<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -823,7 +836,7 @@ void SQLiteTest::testMapComplex()
|
||||
|
||||
void SQLiteTest::testMapComplexUnique()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -847,7 +860,7 @@ void SQLiteTest::testMapComplexUnique()
|
||||
|
||||
void SQLiteTest::testMultiMapComplex()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -871,7 +884,7 @@ void SQLiteTest::testMultiMapComplex()
|
||||
|
||||
void SQLiteTest::testSelectIntoSingle()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -891,7 +904,7 @@ void SQLiteTest::testSelectIntoSingle()
|
||||
|
||||
void SQLiteTest::testSelectIntoSingleStep()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -916,7 +929,7 @@ void SQLiteTest::testSelectIntoSingleStep()
|
||||
|
||||
void SQLiteTest::testSelectIntoSingleFail()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -942,7 +955,7 @@ void SQLiteTest::testSelectIntoSingleFail()
|
||||
|
||||
void SQLiteTest::testLowerLimitOk()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -968,7 +981,7 @@ void SQLiteTest::testLowerLimitOk()
|
||||
|
||||
void SQLiteTest::testSingleSelect()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -993,7 +1006,7 @@ void SQLiteTest::testSingleSelect()
|
||||
|
||||
void SQLiteTest::testLowerLimitFail()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -1019,7 +1032,7 @@ void SQLiteTest::testLowerLimitFail()
|
||||
|
||||
void SQLiteTest::testCombinedLimits()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -1042,7 +1055,7 @@ void SQLiteTest::testCombinedLimits()
|
||||
|
||||
void SQLiteTest::testRange()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -1064,7 +1077,7 @@ void SQLiteTest::testRange()
|
||||
|
||||
void SQLiteTest::testCombinedIllegalLimits()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -1091,7 +1104,7 @@ void SQLiteTest::testCombinedIllegalLimits()
|
||||
|
||||
void SQLiteTest::testIllegalRange()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
std::multimap<std::string, Person> people;
|
||||
Person p1("LN1", "FN1", "ADDR1", 1);
|
||||
Person p2("LN2", "FN2", "ADDR2", 2);
|
||||
@@ -1117,7 +1130,7 @@ void SQLiteTest::testIllegalRange()
|
||||
|
||||
void SQLiteTest::testEmptyDB()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
|
||||
tmp << "DROP TABLE IF EXISTS Person", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))", now;
|
||||
@@ -1137,7 +1150,7 @@ void SQLiteTest::testBLOB()
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
std::string address("Address");
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Person", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Image BLOB)", now;
|
||||
BLOB img("0123456789", 10);
|
||||
@@ -1155,7 +1168,7 @@ void SQLiteTest::testBLOB()
|
||||
|
||||
void SQLiteTest::testTuple10()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1174,7 +1187,7 @@ void SQLiteTest::testTuple10()
|
||||
|
||||
void SQLiteTest::testTupleVector10()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1203,7 +1216,7 @@ void SQLiteTest::testTupleVector10()
|
||||
|
||||
void SQLiteTest::testTuple9()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1222,7 +1235,7 @@ void SQLiteTest::testTuple9()
|
||||
|
||||
void SQLiteTest::testTupleVector9()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1251,7 +1264,7 @@ void SQLiteTest::testTupleVector9()
|
||||
|
||||
void SQLiteTest::testTuple8()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1270,7 +1283,7 @@ void SQLiteTest::testTuple8()
|
||||
|
||||
void SQLiteTest::testTupleVector8()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER, "
|
||||
@@ -1299,7 +1312,7 @@ void SQLiteTest::testTupleVector8()
|
||||
|
||||
void SQLiteTest::testTuple7()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER)", now;
|
||||
@@ -1317,7 +1330,7 @@ void SQLiteTest::testTuple7()
|
||||
|
||||
void SQLiteTest::testTupleVector7()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER, int6 INTEGER)", now;
|
||||
@@ -1345,7 +1358,7 @@ void SQLiteTest::testTupleVector7()
|
||||
|
||||
void SQLiteTest::testTuple6()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER)", now;
|
||||
@@ -1363,7 +1376,7 @@ void SQLiteTest::testTuple6()
|
||||
|
||||
void SQLiteTest::testTupleVector6()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER, int5 INTEGER)", now;
|
||||
@@ -1391,7 +1404,7 @@ void SQLiteTest::testTupleVector6()
|
||||
|
||||
void SQLiteTest::testTuple5()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER)", now;
|
||||
@@ -1409,7 +1422,7 @@ void SQLiteTest::testTuple5()
|
||||
|
||||
void SQLiteTest::testTupleVector5()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER, int4 INTEGER)", now;
|
||||
@@ -1437,7 +1450,7 @@ void SQLiteTest::testTupleVector5()
|
||||
|
||||
void SQLiteTest::testTuple4()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER)", now;
|
||||
@@ -1455,7 +1468,7 @@ void SQLiteTest::testTuple4()
|
||||
|
||||
void SQLiteTest::testTupleVector4()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER, int3 INTEGER)", now;
|
||||
@@ -1483,7 +1496,7 @@ void SQLiteTest::testTupleVector4()
|
||||
|
||||
void SQLiteTest::testTuple3()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER)", now;
|
||||
@@ -1501,7 +1514,7 @@ void SQLiteTest::testTuple3()
|
||||
|
||||
void SQLiteTest::testTupleVector3()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples "
|
||||
"(int0 INTEGER, int1 INTEGER, int2 INTEGER)", now;
|
||||
@@ -1529,7 +1542,7 @@ void SQLiteTest::testTupleVector3()
|
||||
|
||||
void SQLiteTest::testTuple2()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples (int0 INTEGER, int1 INTEGER)", now;
|
||||
|
||||
@@ -1546,7 +1559,7 @@ void SQLiteTest::testTuple2()
|
||||
|
||||
void SQLiteTest::testTupleVector2()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples (int0 INTEGER, int1 INTEGER)", now;
|
||||
|
||||
@@ -1573,7 +1586,7 @@ void SQLiteTest::testTupleVector2()
|
||||
|
||||
void SQLiteTest::testTuple1()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples (int0 INTEGER)", now;
|
||||
|
||||
@@ -1590,7 +1603,7 @@ void SQLiteTest::testTuple1()
|
||||
|
||||
void SQLiteTest::testTupleVector1()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Tuples", now;
|
||||
tmp << "CREATE TABLE Tuples (int0 INTEGER)", now;
|
||||
|
||||
@@ -1617,7 +1630,7 @@ void SQLiteTest::testTupleVector1()
|
||||
|
||||
void SQLiteTest::testDateTime()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS DateTimes", now;
|
||||
tmp << "CREATE TABLE DateTimes (dt0 DATE)", now;
|
||||
|
||||
@@ -1653,7 +1666,7 @@ void SQLiteTest::testDateTime()
|
||||
|
||||
void SQLiteTest::testInternalExtraction()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Vectors", now;
|
||||
tmp << "CREATE TABLE Vectors (int0 INTEGER, flt0 REAL, str0 VARCHAR)", now;
|
||||
|
||||
@@ -1719,7 +1732,7 @@ void SQLiteTest::testInternalExtraction()
|
||||
|
||||
void SQLiteTest::testPrimaryKeyConstraint()
|
||||
{
|
||||
Session ses (SQLite::Connector::KEY, "dummy.db");
|
||||
Session ses (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
ses << "DROP TABLE IF EXISTS LogTest", now;
|
||||
ses << "CREATE TABLE LogTest (Id INTEGER PRIMARY KEY, Time INTEGER, Value INTEGER)", now;
|
||||
const double value = -200000000000.0;
|
||||
@@ -1749,7 +1762,7 @@ void SQLiteTest::testPrimaryKeyConstraint()
|
||||
|
||||
void SQLiteTest::testNull()
|
||||
{
|
||||
Session ses (SQLite::Connector::KEY, "dummy.db");
|
||||
Session ses (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
ses << "DROP TABLE IF EXISTS NullTest", now;
|
||||
|
||||
ses << "CREATE TABLE NullTest (i INTEGER NOT NULL)", now;
|
||||
@@ -1819,7 +1832,7 @@ void SQLiteTest::testNull()
|
||||
|
||||
void SQLiteTest::testRowIterator()
|
||||
{
|
||||
Session ses (SQLite::Connector::KEY, "dummy.db");
|
||||
Session ses (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
ses << "DROP TABLE IF EXISTS Vectors", now;
|
||||
ses << "CREATE TABLE Vectors (int0 INTEGER, flt0 REAL, str0 VARCHAR)", now;
|
||||
|
||||
@@ -1851,7 +1864,7 @@ void SQLiteTest::testRowIterator()
|
||||
|
||||
void SQLiteTest::testAsync()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Strings", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Strings (str INTEGER(10))", now;
|
||||
|
||||
@@ -1935,7 +1948,7 @@ void SQLiteTest::testAsync()
|
||||
|
||||
void SQLiteTest::testAny()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Anys", now;
|
||||
tmp << "CREATE TABLE Anys (int0 INTEGER, flt0 REAL, str0 VARCHAR)", now;
|
||||
|
||||
@@ -1961,7 +1974,7 @@ void SQLiteTest::testAny()
|
||||
|
||||
void SQLiteTest::testDynamicAny()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Anys", now;
|
||||
tmp << "CREATE TABLE Anys (int0 INTEGER, flt0 REAL, str0 VARCHAR)", now;
|
||||
|
||||
@@ -1987,7 +2000,7 @@ void SQLiteTest::testDynamicAny()
|
||||
|
||||
void SQLiteTest::testSQLChannel()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS T_POCO_LOG", now;
|
||||
tmp << "CREATE TABLE T_POCO_LOG (Source VARCHAR,"
|
||||
"Name VARCHAR,"
|
||||
@@ -2008,7 +2021,7 @@ void SQLiteTest::testSQLChannel()
|
||||
"Text VARCHAR,"
|
||||
"DateTime DATE)", now;
|
||||
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(SQLite::Connector::KEY, "dummy.db", "TestSQLChannel");
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(Poco::Data::SQLite::Connector::KEY, "dummy.db", "TestSQLChannel");
|
||||
pChannel->setProperty("keep", "2 seconds");
|
||||
|
||||
Message msgInf("InformationSource", "a Informational async message", Message::PRIO_INFORMATION);
|
||||
@@ -2061,7 +2074,7 @@ void SQLiteTest::testSQLChannel()
|
||||
|
||||
void SQLiteTest::testSQLLogger()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS T_POCO_LOG", now;
|
||||
tmp << "CREATE TABLE T_POCO_LOG (Source VARCHAR,"
|
||||
"Name VARCHAR,"
|
||||
@@ -2073,7 +2086,7 @@ void SQLiteTest::testSQLLogger()
|
||||
"DateTime DATE)", now;
|
||||
|
||||
{
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(SQLite::Connector::KEY, "dummy.db", "TestSQLChannel");
|
||||
AutoPtr<SQLChannel> pChannel = new SQLChannel(Poco::Data::SQLite::Connector::KEY, "dummy.db", "TestSQLChannel");
|
||||
Logger& root = Logger::root();
|
||||
root.setChannel(pChannel.get());
|
||||
root.setLevel(Message::PRIO_INFORMATION);
|
||||
@@ -2100,7 +2113,7 @@ void SQLiteTest::testExternalBindingAndExtraction()
|
||||
AbstractExtractionVec extraction;
|
||||
AbstractBindingVec binding;
|
||||
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
|
||||
tmp << "DROP TABLE IF EXISTS Ints", now;
|
||||
tmp << "CREATE TABLE Ints (int0 INTEGER, int1 INTEGER, int2 INTEGER)", now;
|
||||
@@ -2132,7 +2145,7 @@ void SQLiteTest::testExternalBindingAndExtraction()
|
||||
|
||||
void SQLiteTest::testBindingCount()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
|
||||
tmp << "DROP TABLE IF EXISTS Ints", now;
|
||||
tmp << "CREATE TABLE Ints (int0 INTEGER)", now;
|
||||
@@ -2158,7 +2171,7 @@ void SQLiteTest::testBindingCount()
|
||||
|
||||
void SQLiteTest::testMultipleResults()
|
||||
{
|
||||
Session tmp (SQLite::Connector::KEY, "dummy.db");
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
|
||||
tmp << "DROP TABLE IF EXISTS Person", now;
|
||||
tmp << "CREATE TABLE Person (LastName VARCHAR(30),"
|
||||
|
@@ -63,9 +63,15 @@ enum NullData
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
static const NullData null = NULL_GENERIC;
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
class Data_API AbstractBinder
|
||||
/// Interface for Binding data types to placeholders.
|
||||
{
|
||||
|
@@ -722,6 +722,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline Binding<T>* use(T& t, const std::string& name = "")
|
||||
/// Convenience function for a more compact Binding creation.
|
||||
@@ -814,6 +817,9 @@ inline Binding<T>* bind(T t)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -88,6 +88,9 @@ inline Poco::UInt32 Bulk::size() const
|
||||
}
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline Bulk bulk(const T& limit)
|
||||
/// Convenience function for creation of bulk.
|
||||
@@ -103,6 +106,9 @@ inline void bulk(char)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
typedef void (*BulkFnType)(char);
|
||||
|
||||
|
||||
|
@@ -110,6 +110,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
BulkBinding<std::vector<T> >* use(const std::vector<T>& t, BulkFnType, const std::string& name = "")
|
||||
/// Convenience function for a more compact BulkBinding creation for std::vector.
|
||||
@@ -158,6 +161,9 @@ BulkBinding<std::list<T> >* in(const std::list<T>& t, BulkFnType, const std::str
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -215,6 +215,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
BulkExtraction<std::vector<T> >* into(std::vector<T>& t, const Bulk& bulk, const Position& pos = Position(0))
|
||||
/// Convenience function to allow for a more compact creation of an extraction object
|
||||
@@ -275,6 +278,9 @@ BulkExtraction<std::list<T> >* into(std::list<T>& t, BulkFnType, const Position&
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -763,6 +763,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline Extraction<T>* into(T& t)
|
||||
/// Convenience function to allow for a more compact creation of an extraction object.
|
||||
@@ -802,6 +805,9 @@ inline AbstractExtractionVec& into(AbstractExtractionVec& ev)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -77,6 +77,9 @@ inline Poco::UInt32 Position::value() const
|
||||
}
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline Position from(const T& value)
|
||||
/// Convenience function for creation of position.
|
||||
@@ -85,6 +88,9 @@ inline Position from(const T& value)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -85,6 +85,9 @@ inline const Limit& Range::upper() const
|
||||
}
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
template <typename T>
|
||||
Limit limit(T lim, bool hard = false)
|
||||
/// Creates an upperLimit
|
||||
@@ -114,6 +117,9 @@ Range range(T low, T upp, bool hard = false)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
|
@@ -438,6 +438,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
namespace Keywords {
|
||||
|
||||
|
||||
//
|
||||
// Manipulators
|
||||
//
|
||||
@@ -509,6 +512,9 @@ inline void Data_API reset(Statement& statement)
|
||||
}
|
||||
|
||||
|
||||
} // namespace Keywords
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
|
@@ -22,7 +22,9 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
|
||||
|
||||
struct Person
|
||||
|
@@ -25,7 +25,10 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
|
||||
|
||||
struct Person
|
||||
|
@@ -27,7 +27,11 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::RowFormatter;
|
||||
|
||||
|
||||
class HTMLTableFormatter : public RowFormatter
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
|
||||
|
||||
struct Person
|
||||
|
@@ -41,6 +41,9 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
using namespace Keywords;
|
||||
|
||||
|
||||
//
|
||||
// ArchiveStrategy
|
||||
//
|
||||
|
@@ -42,6 +42,9 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
using namespace Keywords;
|
||||
|
||||
|
||||
Range::Range(Poco::UInt32 lowValue, Poco::UInt32 upValue, bool hardLimit):
|
||||
_lower(lowerLimit(lowValue)),
|
||||
_upper(upperLimit(upValue, hardLimit))
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include "Poco/DateTime.h"
|
||||
|
||||
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::DateTime;
|
||||
|
||||
|
||||
|
@@ -48,6 +48,9 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
using namespace Keywords;
|
||||
|
||||
|
||||
const std::string SQLChannel::PROP_CONNECTOR("connector");
|
||||
const std::string SQLChannel::PROP_CONNECT("connect");
|
||||
const std::string SQLChannel::PROP_NAME("name");
|
||||
|
@@ -54,11 +54,15 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
using namespace Keywords;
|
||||
|
||||
|
||||
const std::string StatementImpl::VECTOR = "vector";
|
||||
const std::string StatementImpl::LIST = "list";
|
||||
const std::string StatementImpl::DEQUE = "deque";
|
||||
const std::string StatementImpl::UNKNOWN = "unknown";
|
||||
|
||||
|
||||
StatementImpl::StatementImpl(SessionImpl& rSession):
|
||||
_state(ST_INITIALIZED),
|
||||
_extrLimit(upperLimit((Poco::UInt32) Limit::LIMIT_UNLIMITED, false)),
|
||||
|
@@ -54,7 +54,7 @@
|
||||
#include <set>
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
|
||||
|
||||
using Poco::BinaryReader;
|
||||
@@ -68,6 +68,24 @@ using Poco::RangeException;
|
||||
using Poco::NotFoundException;
|
||||
using Poco::InvalidArgumentException;
|
||||
using Poco::NotImplementedException;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::SessionFactory;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::NotSupportedException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::BLOBInputStream;
|
||||
using Poco::Data::BLOBOutputStream;
|
||||
using Poco::Data::MetaColumn;
|
||||
using Poco::Data::Column;
|
||||
using Poco::Data::Row;
|
||||
using Poco::Data::SimpleRowFormatter;
|
||||
using Poco::Data::Date;
|
||||
using Poco::Data::Time;
|
||||
using Poco::Data::AbstractExtraction;
|
||||
using Poco::Data::AbstractExtractionVec;
|
||||
using Poco::Data::AbstractExtractionVecVec;
|
||||
using Poco::Data::AbstractBinding;
|
||||
using Poco::Data::AbstractBindingVec;
|
||||
|
||||
|
||||
DataTest::DataTest(const std::string& name): CppUnit::TestCase(name)
|
||||
|
@@ -38,8 +38,12 @@
|
||||
#include "Connector.h"
|
||||
|
||||
|
||||
using namespace Poco::Data;
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Thread;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::SessionPool;
|
||||
using Poco::Data::SessionPoolExhaustedException;
|
||||
using Poco::Data::SessionUnavailableException;
|
||||
|
||||
|
||||
SessionPoolTest::SessionPoolTest(const std::string& name): CppUnit::TestCase(name)
|
||||
|
Reference in New Issue
Block a user