1/// @file
2/// @brief schema and dut classes for DuckDB
3
4#ifndef DUCKDB_HH
5#define DUCKDB_HH
6
7#include "duckdb.hpp"
8
9#include "dut.hh"
10#include "relmodel.hh"
11#include "schema.hh"
12
13struct duckdb_connection {
14 std::unique_ptr<duckdb::DuckDB> database;
15 std::unique_ptr<duckdb::Connection> connection;
16 char *zErrMsg = 0;
17 int rc;
18 void q(const char *query);
19 duckdb_connection(std::string &conninfo);
20};
21
22struct schema_duckdb : schema, duckdb_connection {
23 schema_duckdb(std::string &conninfo, bool no_catalog);
24 virtual std::string quote_name(const std::string &id) {
25 return id;
26 }
27};
28
29struct dut_duckdb : dut_base, duckdb_connection {
30 virtual void test(const std::string &stmt);
31 dut_duckdb(std::string &conninfo);
32};
33#endif
34