ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
database.h
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#pragma once
19
20#include <string_view>
21#include <utility>
22
23#include <arrow-adbc/adbc.h>
24
25#include "driver/framework/base_driver.h"
27
28namespace adbc::driver {
36template <typename Derived>
37class Database : public BaseDatabase<Derived> {
38 public:
39 using Base = Database<Derived>;
40
42 ~Database() = default;
43
46
49
51 virtual Status SetOptionImpl(std::string_view key, Option value) {
52 return BaseDatabase<Derived>::SetOptionImpl(key, value);
53 }
54
55 private:
56 Derived& impl() { return static_cast<Derived&>(*this); }
57};
58} // namespace adbc::driver
Definition base_driver.h:782
virtual Status InitImpl()
Initialize the database.
Definition base_driver.h:809
virtual Status SetOptionImpl(std::string_view key, Option value)
Set an option. May be called prior to InitImpl.
Definition base_driver.h:815
virtual Status ReleaseImpl()
Release the database.
Definition base_driver.h:812
The CRTP base implementation of an AdbcDatabase.
Definition database.h:37
virtual Status ReleaseImpl()
Release the database.
Definition database.h:48
virtual Status SetOptionImpl(std::string_view key, Option value)
Set an option. May be called prior to InitImpl.
Definition database.h:51
virtual Status InitImpl()
Initialize the database.
Definition database.h:45
A typed option value wrapper. It currently does not attempt conversion (i.e., getting a double option...
Definition base_driver.h:59
A wrapper around AdbcStatusCode + AdbcError.
Definition status.h:43