ext/duckdb/appender.c in duckdb-0.3.2.0 vs ext/duckdb/appender.c in duckdb-0.3.3.0
- old
+ new
@@ -1,9 +1,7 @@
#include "ruby-duckdb.h"
-#ifdef HAVE_DUCKDB_APPENDER_CREATE
-
static VALUE cDuckDBAppender;
static void deallocate(void *);
static VALUE allocate(VALUE klass);
static VALUE appender_initialize(VALUE klass, VALUE con, VALUE schema, VALUE table);
@@ -27,25 +25,15 @@
#ifdef HAVE_DUCKDB_APPEND_DATE
static VALUE appender__append_date(VALUE self, VALUE yearval, VALUE monthval, VALUE dayval);
#endif
-#ifdef HAVE_DUCKDB_APPEND_INTERVAL
static VALUE appender__append_interval(VALUE self, VALUE months, VALUE days, VALUE micros);
-#endif
-#ifdef HAVE_DUCKDB_APPEND_TIME
static VALUE appender__append_time(VALUE self, VALUE hour, VALUE min, VALUE sec, VALUE micros);
-#endif
-
-#ifdef HAVE_DUCKDB_APPEND_TIMESTAMP
static VALUE appender__append_timestamp(VALUE self, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros);
-#endif
-
-#ifdef HAVE_DUCKDB_APPEND_HUGEINT
static VALUE appender__append_hugeint(VALUE self, VALUE lower, VALUE upper);
-#endif
static VALUE appender_flush(VALUE self);
static VALUE appender_close(VALUE self);
static void deallocate(void * ctx) {
@@ -300,11 +288,10 @@
}
return self;
}
#endif
-#ifdef HAVE_DUCKDB_APPEND_INTERVAL
static VALUE appender__append_interval(VALUE self, VALUE months, VALUE days, VALUE micros) {
duckdb_interval interval;
rubyDuckDBAppender *ctx;
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
@@ -313,13 +300,11 @@
if (duckdb_append_interval(ctx->appender, interval) == DuckDBError) {
rb_raise(eDuckDBError, "failed to append interval");
}
return self;
}
-#endif
-#ifdef HAVE_DUCKDB_APPEND_TIME
static VALUE appender__append_time(VALUE self, VALUE hour, VALUE min, VALUE sec, VALUE micros) {
duckdb_time time;
rubyDuckDBAppender *ctx;
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
@@ -328,13 +313,11 @@
if (duckdb_append_time(ctx->appender, time) == DuckDBError) {
rb_raise(eDuckDBError, "failed to append time");
}
return self;
}
-#endif
-#ifdef HAVE_DUCKDB_APPEND_TIMESTAMP
static VALUE appender__append_timestamp(VALUE self, VALUE year, VALUE month, VALUE day, VALUE hour, VALUE min, VALUE sec, VALUE micros) {
duckdb_timestamp timestamp;
rubyDuckDBAppender *ctx;
@@ -345,13 +328,11 @@
if (duckdb_append_timestamp(ctx->appender, timestamp) == DuckDBError) {
rb_raise(eDuckDBError, "failed to append timestamp");
}
return self;
}
-#endif
-#ifdef HAVE_DUCKDB_APPEND_HUGEINT
static VALUE appender__append_hugeint(VALUE self, VALUE lower, VALUE upper) {
duckdb_hugeint hugeint;
hugeint.lower = NUM2ULL(lower);
hugeint.upper = NUM2LL(upper);
@@ -362,11 +343,10 @@
if (duckdb_append_hugeint(ctx->appender, hugeint) == DuckDBError) {
rb_raise(eDuckDBError, "failed to append hugeint");
}
return self;
}
-#endif
static VALUE appender_flush(VALUE self) {
rubyDuckDBAppender *ctx;
Data_Get_Struct(self, rubyDuckDBAppender, ctx);
@@ -408,21 +388,12 @@
rb_define_method(cDuckDBAppender, "append_blob", appender_append_blob, 1);
rb_define_method(cDuckDBAppender, "append_null", appender_append_null, 0);
#ifdef HAVE_DUCKDB_APPEND_DATE
rb_define_private_method(cDuckDBAppender, "_append_date", appender__append_date, 3);
#endif
-#ifdef HAVE_DUCKDB_APPEND_INTERVAL
rb_define_private_method(cDuckDBAppender, "_append_interval", appender__append_interval, 3);
-#endif
-#ifdef HAVE_DUCKDB_APPEND_TIME
rb_define_private_method(cDuckDBAppender, "_append_time", appender__append_time, 4);
-#endif
-#ifdef HAVE_DUCKDB_APPEND_TIMESTAMP
rb_define_private_method(cDuckDBAppender, "_append_timestamp", appender__append_timestamp, 7);
-#endif
-#ifdef HAVE_DUCKDB_APPEND_HUGEINT
rb_define_private_method(cDuckDBAppender, "_append_hugeint", appender__append_hugeint, 2);
-#endif
rb_define_method(cDuckDBAppender, "flush", appender_flush, 0);
rb_define_method(cDuckDBAppender, "close", appender_close, 0);
}
-#endif /* HAVE_DUCKDB_APPENDER_CREATE */