fluent-plugin-pghstore 0.1.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +14 -0
- data/fluent-plugin-pghstore.gemspec +1 -1
- data/lib/fluent/plugin/out_pghstore.rb +9 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -78,3 +78,17 @@ This source code is mainly borrowed from
|
|
78
78
|
|
79
79
|
Copyright:: Copyright (c) 2012- Shirou WAKAYAMA
|
80
80
|
License:: Apache License
|
81
|
+
|
82
|
+
|
83
|
+
== ChangeLog
|
84
|
+
|
85
|
+
- 0.2.1 / 2012-09-11
|
86
|
+
|
87
|
+
PostgreSQL 9.2 {removes hstore's => operator}{http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#Remove_hstore.27s_.3D.3E_operator}. This
|
88
|
+
plugin checks the server's version and change the operator.
|
89
|
+
|
90
|
+
But not fully tested yet.
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "fluent-plugin-pghstore"
|
6
|
-
s.version = "0.1
|
6
|
+
s.version = "0.2.1"
|
7
7
|
s.authors = ["WAKAYAMA Shirou"]
|
8
8
|
s.email = ["shirou.faw@gmail.com"]
|
9
9
|
s.homepage = "https://github.com/shirou/fluent-plugin-pghstore"
|
@@ -54,7 +54,11 @@ class Fluent::PgHStoreOutput < Fluent::BufferedOutput
|
|
54
54
|
def generate_sql(tag, time, record)
|
55
55
|
kv_list = []
|
56
56
|
record.each {|(key,value)|
|
57
|
-
|
57
|
+
if @after_9_2
|
58
|
+
kv_list.push("\"#{key}\" , \"#{value}\"")
|
59
|
+
else
|
60
|
+
kv_list.push("\"#{key}\" => \"#{value}\"")
|
61
|
+
end
|
58
62
|
}
|
59
63
|
|
60
64
|
tag_list = tag.split(".")
|
@@ -84,6 +88,10 @@ SQL
|
|
84
88
|
$log.error "Error: could not connect database:" + @database
|
85
89
|
return nil
|
86
90
|
end
|
91
|
+
|
92
|
+
@server_version = @conn.server_version
|
93
|
+
@after_9_2 = (@server_version > 90200)
|
94
|
+
|
87
95
|
return @conn
|
88
96
|
|
89
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-pghstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|