pgsync 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pgsync might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e5c1193dba0f46b4b362242ec5d582a014672f9
4
- data.tar.gz: ad199ac38b08d5f28644e5193497fa4deda2a1f2
3
+ metadata.gz: d815251b4114bab3d2f124185c3f4d0a6d7ea01b
4
+ data.tar.gz: 46838871758b47ed72b72de2544e8dca5c4d0448
5
5
  SHA512:
6
- metadata.gz: 279113a7d79714a718af40382dd18a4f985d6c47e6f2aeca97282e4c436206d36a420c3f568f636e78b0cfe7dcd61b0d7f18f04f49e8655b6facb1f4da6965c8
7
- data.tar.gz: 102fbfeac459a32714d3965808f3e09de3edc059a11dc8534886ef08e8cf32111eec4b5ab7c67384dfc5fa997758902cfb059d8339e30dc1dcf44f0b63988c8f
6
+ metadata.gz: 19599ac80d68278b56ebe96d6ed1b6d5065df06d3384bb900d4876974d250048c8ca1bf9e0ba13fb3a7af4a6981c4f7a132d7d47c52636dab0180ec55995b7ca
7
+ data.tar.gz: 19e780c6b2006d3c9b96149bfa73b27e7b366f46b160cb0a6ad9f309530f75b36ffa484c956c7de1c3658623c376ef0e2589d4be42807160a618603ebeb6e196
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.2.3
2
+
3
+ - Fixed `no PostgreSQL user name specified in startup packet`
4
+
1
5
  # 0.2.2
2
6
 
3
7
  - Added `--debug` option
data/README.md CHANGED
@@ -145,6 +145,21 @@ To keep you from accidentally overwriting production, the destination is limited
145
145
 
146
146
  To use another host, add `to_safe: true` to your `.pgsync.yml`.
147
147
 
148
+ ## Upgrading
149
+
150
+ Run:
151
+
152
+ ```sh
153
+ gem install pgsync
154
+ ```
155
+
156
+ To use master, run:
157
+
158
+ ```sh
159
+ gem install specific_install
160
+ gem specific_install ankane/pgsync
161
+ ```
162
+
148
163
  ## Thanks
149
164
 
150
165
  Inspired by [heroku-pg-transfer](https://github.com/ddollar/heroku-pg-transfer).
@@ -1,3 +1,3 @@
1
1
  module PgSync
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/lib/pgsync.rb CHANGED
@@ -176,7 +176,16 @@ module PgSync
176
176
 
177
177
  def parse_args(args)
178
178
  opts = Slop.parse(args) do |o|
179
- o.banner = "usage: pgsync [options]"
179
+ o.banner = %{Usage:
180
+ pgsync [command] [options]
181
+
182
+ Commands:
183
+ tables
184
+ groups
185
+ schema
186
+ setup
187
+
188
+ Options:}
180
189
  o.string "--from", "source"
181
190
  o.string "--to", "destination"
182
191
  o.string "--where", "where"
@@ -240,16 +249,20 @@ module PgSync
240
249
  ".pgsync-#{db}.yml"
241
250
  end
242
251
 
252
+ # borrowed from
253
+ # ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver
243
254
  def with_connection(uri, timeout: 0)
244
- conn =
245
- PG::Connection.new(
255
+ uri_parser = URI::Parser.new
256
+ config = {
246
257
  host: uri.host,
247
258
  port: uri.port,
248
259
  dbname: uri.path.sub(/\A\//, ""),
249
260
  user: uri.user,
250
261
  password: uri.password,
251
262
  connect_timeout: timeout
252
- )
263
+ }.reject { |_, value| value.to_s.empty? }
264
+ config.map { |key, value| config[key] = uri_parser.unescape(value) if value.is_a?(String) }
265
+ conn = PG::Connection.new(config)
253
266
  begin
254
267
  yield conn
255
268
  ensure
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop