本文整理汇总了C++中DatabasePtr::attachTable方法的典型用法代码示例。如果您正苦于以下问题:C++ DatabasePtr::attachTable方法的具体用法?C++ DatabasePtr::attachTable怎么用?C++ DatabasePtr::attachTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabasePtr
的用法示例。
在下文中一共展示了DatabasePtr::attachTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv)
try
{
Poco::AutoPtr<Poco::ConsoleChannel> channel = new Poco::ConsoleChannel(std::cerr);
Logger::root().setChannel(channel);
Logger::root().setLevel("trace");
/// Pre-initialize the `DateLUT` so that the first initialization does not affect the measured execution speed.
DateLUT::instance();
Context context;
context.setPath("./");
loadMetadata(context);
DatabasePtr system = std::make_shared<DatabaseOrdinary>("system", "./metadata/system/");
context.addDatabase("system", system);
system->loadTables(context, nullptr, false);
system->attachTable("one", StorageSystemOne::create("one"));
system->attachTable("numbers", StorageSystemNumbers::create("numbers"));
context.setCurrentDatabase("default");
ReadBufferFromIStream in(std::cin);
WriteBufferFromOStream out(std::cout);
executeQuery(in, out, /* allow_into_outfile = */ false, context, {});
return 0;
}
catch (const Exception & e)
{
std::cerr << e.what() << ", " << e.displayText() << std::endl
<< std::endl
<< "Stack trace:" << std::endl
<< e.getStackTrace().toString();
return 1;
}