logstash-output-charrington 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbbae45d9c763ffa27448320f7150f9827732ef5b20823c078664d6deb8ab652
4
- data.tar.gz: c18245e0ac6cbb11e30a824fdaf2a39dcf466e4631f307a9b1bd6aa9484bb5e1
3
+ metadata.gz: 95cf47c25df7b4666cfc94d7ca2c4b964164a0d76b57ce62993f8cd5c4d53bcd
4
+ data.tar.gz: 5a5eb5c0323f16d0b9143d6953dcf24fdf9f430e56a751412142f2f7c01dea93
5
5
  SHA512:
6
- metadata.gz: d139e03b049aae067a3e5827c520eaa855e33fb889e33f51cec8cf308bb0923f04cca2b01b1b561c2578ccbe1c2ec731e6cf59918cbb101df055058403ef99c7
7
- data.tar.gz: 898bb2a57d84e835a3b2e4933ebb387d1f0e030f6dc06f5c98c284aea4c51b5b6401401d85fb6bb842988d7c15497331d960735a7e57e5d9dd43c79d3f30a284
6
+ metadata.gz: f88562ff8b73f92e22750359178f301c5fef58bd1e2361c9d1d88e8b2c08bba7b69d001be8c5a87fbd2b741ff6bff70138d954a7f094c7794d2155c9103bea23
7
+ data.tar.gz: dcdd5585b34e0335693a42a04f4b0897632c7f441ad4cac419975fcca863ea6c3b8eb58154ea8f111557d2d2743c4b4b1d8659c6a5129408134961fed8bf4699
data/README.md CHANGED
@@ -52,4 +52,5 @@ output {
52
52
  ```bash
53
53
  gem build logstash-output-charrington.gemspec # build
54
54
  gem push logstash-output-charrington-x.x.x.gem # publish
55
+ gem owner --add <email> logstash-output-charrington # add another authorized publisher
55
56
  ```
@@ -66,11 +66,13 @@ module Charrington
66
66
 
67
67
  def current_table_columns
68
68
  sql = "SELECT * FROM #{table_name} LIMIT 1;"
69
- rs = executeQuery(sql)
69
+ stmt, rs = executeQuery(prep_sql(sql))
70
70
  meta_data = rs.getMetaData()
71
+ stmt.close unless stmt.nil?
71
72
  column_count = meta_data.getColumnCount()
72
-
73
73
  (1..column_count).map {|i| meta_data.getColumnName(i) }
74
+ ensure
75
+ stmt.close unless stmt.nil?
74
76
  end
75
77
 
76
78
  def execute(sql)
@@ -84,10 +86,16 @@ module Charrington
84
86
 
85
87
  def executeQuery(sql)
86
88
  stmt = connection.createStatement()
87
- stmt.executeQuery(prep_sql(sql))
89
+ # only close the statement if something goes wrong
90
+ # otherwise, the caller is responsible for closing the
91
+ # statement when they are doen with the result set
92
+ return stmt, stmt.executeQuery(prep_sql(sql))
88
93
  rescue Java::OrgPostgresqlUtil::PSQLException => e
94
+ puts "PSQLException: #{e.message}"
95
+ stmt.close unless stmt.nil?
89
96
  # @logger.error("#{e.message}")
90
- ensure
97
+ rescue => e
98
+ puts "Unknown exception: #{e.message}"
91
99
  stmt.close unless stmt.nil?
92
100
  end
93
101
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-charrington'
3
- s.version = '0.2.1'
3
+ s.version = '0.2.2'
4
4
 
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = 'This plugin allows you to output to SQL, via JDBC'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-charrington
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dconger