lib/duckdb/appender.rb in duckdb-0.8.1 vs lib/duckdb/appender.rb in duckdb-0.8.1.1
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
require 'date'
require 'time'
-require_relative './converter'
+require_relative 'converter'
module DuckDB
# The DuckDB::Appender encapsulates DuckDB Appender.
#
# require 'duckdb'
@@ -192,20 +192,12 @@
when String
blob?(value) ? append_blob(value) : append_varchar(value)
when TrueClass, FalseClass
append_bool(value)
when Time
- if respond_to?(:append_timestamp)
- append_timestamp(value)
- else
- append_varchar(value.strftime('%Y-%m-%d %H:%M:%S.%N'))
- end
+ append_timestamp(value)
when Date
- if respond_to?(:append_date)
- append_date(value)
- else
- append_varchar(value.strftime('%Y-%m-%d'))
- end
+ append_date(value)
else
raise(DuckDB::Error, "not supported type #{value} (#{value.class})")
end
end