| 1 | //===----------------------------------------------------------------------===// |
| 2 | // DuckDB |
| 3 | // |
| 4 | // duckdb/common/adbc/adbc.hpp |
| 5 | // |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | #include "duckdb/common/adbc/adbc.h" |
| 12 | |
| 13 | #include <string> |
| 14 | |
| 15 | namespace duckdb_adbc { |
| 16 | |
| 17 | AdbcStatusCode DatabaseNew(struct AdbcDatabase *database, struct AdbcError *error); |
| 18 | |
| 19 | AdbcStatusCode DatabaseSetOption(struct AdbcDatabase *database, const char *key, const char *value, |
| 20 | struct AdbcError *error); |
| 21 | |
| 22 | AdbcStatusCode DatabaseInit(struct AdbcDatabase *database, struct AdbcError *error); |
| 23 | |
| 24 | AdbcStatusCode DatabaseRelease(struct AdbcDatabase *database, struct AdbcError *error); |
| 25 | |
| 26 | AdbcStatusCode ConnectionNew(struct AdbcConnection *connection, struct AdbcError *error); |
| 27 | |
| 28 | AdbcStatusCode ConnectionSetOption(struct AdbcConnection *connection, const char *key, const char *value, |
| 29 | struct AdbcError *error); |
| 30 | |
| 31 | AdbcStatusCode ConnectionInit(struct AdbcConnection *connection, struct AdbcDatabase *database, |
| 32 | struct AdbcError *error); |
| 33 | |
| 34 | AdbcStatusCode ConnectionRelease(struct AdbcConnection *connection, struct AdbcError *error); |
| 35 | |
| 36 | AdbcStatusCode ConnectionGetInfo(struct AdbcConnection *connection, uint32_t *info_codes, size_t info_codes_length, |
| 37 | struct ArrowArrayStream *out, struct AdbcError *error); |
| 38 | |
| 39 | AdbcStatusCode ConnectionGetObjects(struct AdbcConnection *connection, int depth, const char *catalog, |
| 40 | const char *db_schema, const char *table_name, const char **table_type, |
| 41 | const char *column_name, struct ArrowArrayStream *out, struct AdbcError *error); |
| 42 | |
| 43 | AdbcStatusCode ConnectionGetTableSchema(struct AdbcConnection *connection, const char *catalog, const char *db_schema, |
| 44 | const char *table_name, struct ArrowSchema *schema, struct AdbcError *error); |
| 45 | |
| 46 | AdbcStatusCode ConnectionGetTableTypes(struct AdbcConnection *connection, struct ArrowArrayStream *out, |
| 47 | struct AdbcError *error); |
| 48 | |
| 49 | AdbcStatusCode ConnectionReadPartition(struct AdbcConnection *connection, const uint8_t *serialized_partition, |
| 50 | size_t serialized_length, struct ArrowArrayStream *out, struct AdbcError *error); |
| 51 | |
| 52 | AdbcStatusCode ConnectionCommit(struct AdbcConnection *connection, struct AdbcError *error); |
| 53 | |
| 54 | AdbcStatusCode ConnectionRollback(struct AdbcConnection *connection, struct AdbcError *error); |
| 55 | |
| 56 | AdbcStatusCode StatementNew(struct AdbcConnection *connection, struct AdbcStatement *statement, |
| 57 | struct AdbcError *error); |
| 58 | |
| 59 | AdbcStatusCode StatementRelease(struct AdbcStatement *statement, struct AdbcError *error); |
| 60 | |
| 61 | AdbcStatusCode StatementExecuteQuery(struct AdbcStatement *statement, struct ArrowArrayStream *out, |
| 62 | int64_t *rows_affected, struct AdbcError *error); |
| 63 | |
| 64 | AdbcStatusCode StatementPrepare(struct AdbcStatement *statement, struct AdbcError *error); |
| 65 | |
| 66 | AdbcStatusCode StatementSetSqlQuery(struct AdbcStatement *statement, const char *query, struct AdbcError *error); |
| 67 | |
| 68 | AdbcStatusCode StatementSetSubstraitPlan(struct AdbcStatement *statement, const uint8_t *plan, size_t length, |
| 69 | struct AdbcError *error); |
| 70 | |
| 71 | AdbcStatusCode StatementBind(struct AdbcStatement *statement, struct ArrowArray *values, struct ArrowSchema *schema, |
| 72 | struct AdbcError *error); |
| 73 | |
| 74 | AdbcStatusCode StatementBindStream(struct AdbcStatement *statement, struct ArrowArrayStream *stream, |
| 75 | struct AdbcError *error); |
| 76 | |
| 77 | AdbcStatusCode StatementGetParameterSchema(struct AdbcStatement *statement, struct ArrowSchema *schema, |
| 78 | struct AdbcError *error); |
| 79 | |
| 80 | AdbcStatusCode StatementSetOption(struct AdbcStatement *statement, const char *key, const char *value, |
| 81 | struct AdbcError *error); |
| 82 | |
| 83 | AdbcStatusCode StatementExecutePartitions(struct AdbcStatement *statement, struct ArrowSchema *schema, |
| 84 | struct AdbcPartitions *partitions, int64_t *rows_affected, |
| 85 | struct AdbcError *error); |
| 86 | |
| 87 | void SetError(struct AdbcError *error, const std::string &message); |
| 88 | |
| 89 | void InitiliazeADBCError(AdbcError *error); |
| 90 | } // namespace duckdb_adbc |
| 91 | |