Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fluent/plugin/in_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def read_attribute_for_serialization(n)
if v.respond_to?(:to_msgpack)
v
elsif v.is_a? Time
v.strftime('%Y-%m-%d %H:%M:%S.%6N%z')
v.strftime('%Y-%m-%d %H:%M:%S.%6N')
else
v.to_s
end
Expand Down
3 changes: 3 additions & 0 deletions lib/fluent/plugin/out_sql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TableElement

config_param :table, :string
config_param :column_mapping, :string
config_param :primary_key, :string, :default => :id
config_param :num_retries, :integer, :default => 5

attr_reader :model
Expand Down Expand Up @@ -74,8 +75,10 @@ def configure(conf)
def init(base_model)
# See SQLInput for more details of following code
table_name = @table
primary_key = @primary_key
@model = Class.new(base_model) do
self.table_name = table_name
self.primary_key = primary_key
self.inheritance_column = '_never_use_output_'
end

Expand Down