go/adbc/pkg/snowflake/utils.c (157 lines of code) (raw):

// Code generated by _tmpl/utils.c.tmpl. DO NOT EDIT. // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // clang-format off //go:build driverlib // clang-format on #include "utils.h" #include <string.h> #ifdef __cplusplus extern "C" { #endif void Snowflake_release_error(struct AdbcError* error) { free(error->message); error->message = NULL; error->release = NULL; } AdbcStatusCode AdbcDatabaseNew(struct AdbcDatabase* database, struct AdbcError* error) { return SnowflakeDatabaseNew(database, error); } AdbcStatusCode AdbcDatabaseSetOption(struct AdbcDatabase* database, const char* key, const char* value, struct AdbcError* error) { return SnowflakeDatabaseSetOption(database, key, value, error); } AdbcStatusCode AdbcDatabaseInit(struct AdbcDatabase* database, struct AdbcError* error) { return SnowflakeDatabaseInit(database, error); } AdbcStatusCode AdbcDatabaseRelease(struct AdbcDatabase* database, struct AdbcError* error) { return SnowflakeDatabaseRelease(database, error); } AdbcStatusCode AdbcConnectionNew(struct AdbcConnection* connection, struct AdbcError* error) { return SnowflakeConnectionNew(connection, error); } AdbcStatusCode AdbcConnectionSetOption(struct AdbcConnection* connection, const char* key, const char* value, struct AdbcError* error) { return SnowflakeConnectionSetOption(connection, key, value, error); } AdbcStatusCode AdbcConnectionInit(struct AdbcConnection* connection, struct AdbcDatabase* database, struct AdbcError* error) { return SnowflakeConnectionInit(connection, database, error); } AdbcStatusCode AdbcConnectionRelease(struct AdbcConnection* connection, struct AdbcError* error) { return SnowflakeConnectionRelease(connection, error); } AdbcStatusCode AdbcConnectionGetInfo(struct AdbcConnection* connection, uint32_t* info_codes, size_t info_codes_length, struct ArrowArrayStream* out, struct AdbcError* error) { if (out) memset(out, 0, sizeof(*out)); return SnowflakeConnectionGetInfo(connection, info_codes, info_codes_length, out, error); } AdbcStatusCode AdbcConnectionGetObjects(struct AdbcConnection* connection, int depth, const char* catalog, const char* db_schema, const char* table_name, const char** table_type, const char* column_name, struct ArrowArrayStream* out, struct AdbcError* error) { if (out) memset(out, 0, sizeof(*out)); return SnowflakeConnectionGetObjects(connection, depth, catalog, db_schema, table_name, table_type, column_name, out, error); } AdbcStatusCode AdbcConnectionGetTableSchema(struct AdbcConnection* connection, const char* catalog, const char* db_schema, const char* table_name, struct ArrowSchema* schema, struct AdbcError* error) { if (schema) memset(schema, 0, sizeof(*schema)); return SnowflakeConnectionGetTableSchema(connection, catalog, db_schema, table_name, schema, error); } AdbcStatusCode AdbcConnectionGetTableTypes(struct AdbcConnection* connection, struct ArrowArrayStream* out, struct AdbcError* error) { if (out) memset(out, 0, sizeof(*out)); return SnowflakeConnectionGetTableTypes(connection, out, error); } AdbcStatusCode AdbcConnectionReadPartition(struct AdbcConnection* connection, const uint8_t* serialized_partition, size_t serialized_length, struct ArrowArrayStream* out, struct AdbcError* error) { if (out) memset(out, 0, sizeof(*out)); return SnowflakeConnectionReadPartition(connection, serialized_partition, serialized_length, out, error); } AdbcStatusCode AdbcConnectionCommit(struct AdbcConnection* connection, struct AdbcError* error) { return SnowflakeConnectionCommit(connection, error); } AdbcStatusCode AdbcConnectionRollback(struct AdbcConnection* connection, struct AdbcError* error) { return SnowflakeConnectionRollback(connection, error); } AdbcStatusCode AdbcStatementNew(struct AdbcConnection* connection, struct AdbcStatement* statement, struct AdbcError* error) { return SnowflakeStatementNew(connection, statement, error); } AdbcStatusCode AdbcStatementRelease(struct AdbcStatement* statement, struct AdbcError* error) { return SnowflakeStatementRelease(statement, error); } AdbcStatusCode AdbcStatementExecuteQuery(struct AdbcStatement* statement, struct ArrowArrayStream* out, int64_t* rows_affected, struct AdbcError* error) { if (out) memset(out, 0, sizeof(*out)); return SnowflakeStatementExecuteQuery(statement, out, rows_affected, error); } AdbcStatusCode AdbcStatementPrepare(struct AdbcStatement* statement, struct AdbcError* error) { return SnowflakeStatementPrepare(statement, error); } AdbcStatusCode AdbcStatementSetSqlQuery(struct AdbcStatement* statement, const char* query, struct AdbcError* error) { return SnowflakeStatementSetSqlQuery(statement, query, error); } AdbcStatusCode AdbcStatementSetSubstraitPlan(struct AdbcStatement* statement, const uint8_t* plan, size_t length, struct AdbcError* error) { return SnowflakeStatementSetSubstraitPlan(statement, plan, length, error); } AdbcStatusCode AdbcStatementBind(struct AdbcStatement* statement, struct ArrowArray* values, struct ArrowSchema* schema, struct AdbcError* error) { return SnowflakeStatementBind(statement, values, schema, error); } AdbcStatusCode AdbcStatementBindStream(struct AdbcStatement* statement, struct ArrowArrayStream* stream, struct AdbcError* error) { return SnowflakeStatementBindStream(statement, stream, error); } AdbcStatusCode AdbcStatementGetParameterSchema(struct AdbcStatement* statement, struct ArrowSchema* schema, struct AdbcError* error) { if (schema) memset(schema, 0, sizeof(*schema)); return SnowflakeStatementGetParameterSchema(statement, schema, error); } AdbcStatusCode AdbcStatementSetOption(struct AdbcStatement* statement, const char* key, const char* value, struct AdbcError* error) { return SnowflakeStatementSetOption(statement, key, value, error); } AdbcStatusCode AdbcStatementExecutePartitions(struct AdbcStatement* statement, struct ArrowSchema* schema, struct AdbcPartitions* partitions, int64_t* rows_affected, struct AdbcError* error) { if (schema) memset(schema, 0, sizeof(*schema)); if (partitions) memset(partitions, 0, sizeof(*partitions)); return SnowflakeStatementExecutePartitions(statement, schema, partitions, rows_affected, error); } ADBC_EXPORT AdbcStatusCode AdbcDriverInit(int version, void* driver, struct AdbcError* error) { return SnowflakeDriverInit(version, driver, error); } #ifdef __cplusplus } #endif