pg_easy_replicate 0.2.3 → 0.2.5

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: 86261e2b60e55c5770bbd1537d5a3a501a514d1eaf8e741c5c81890d864b0a0f
4
- data.tar.gz: bf6a710930b4f9533d01c3f66e3b91c02ad5a422df9d17be2bbaf72cdb979a2e
3
+ metadata.gz: 3e6514e70589083375b9f9112d737a2620f48d62d07d4cc5ec213c209289a1ad
4
+ data.tar.gz: fe93ff6a1a741c8f330d878893e511aa0e82e5505acaa031e5b809b482553999
5
5
  SHA512:
6
- metadata.gz: 5d7aab6e89948a45248fcb19fb6d3e9a6982adbc23cba094fe413b2a376cbffb1bbfdb011833f16c4c3aeb3c4d3e1192792699b4c360a20555fc05972e2ae111
7
- data.tar.gz: a4c72947b466664dfc716a2ed21cab159d0f6768b3ae74c9c95db105bafb22da57244236a1f9677e1936af8140989dae9a0c5b1729c2f4bc62dfcbbad0d6a007
6
+ metadata.gz: c14eb4c2256e0adb336a628d24d88a4134849f75f2ca3a656ef3abc9474de3a4d5b06dae994f826674e3343998c34d69604e0a8d417cfee2b7e9675d9b77b0c6
7
+ data.tar.gz: 590c021623ea48f17059cb5b7f640a82433f4f25c99ae1afdc20544d751271f7a57d6ff8243328aa611ca9acb61969660b4eb5b82cd976147727c934ce76f8e3
data/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
- ## [0.2.1] - 2024-01-21
1
+ ## [0.2.4] - 2024-02-13
2
+
3
+ - Introduce PG_EASY_REPLICATE_STATEMENT_TIMEOUT env var
4
+
5
+ ## [0.2.3] - 2024-01-21
6
+
7
+ - Fix tables check in config_check - #93
8
+ - add option to skip vacuum analyzing on switchover - #92
9
+ - Disable statement timeout and reset it before/after vacuum+analyze - #94
10
+ - Add spec for skip_vacuum_analyze - #95
11
+
12
+ Highlights
13
+
14
+ - You can now skip vacuum and analyze by passing `--skip-vacuum-analyze` to `switchover`. Thanks to @honzasterba
15
+ - Vacuum and Analyze won't run into timeouts. Thanks to the report from @TrueCarry
16
+
17
+ ## [0.2.2] - 2024-01-21
2
18
 
3
19
  - Extend config check to assert for REPLICA IDENTITY on tables and drop index bug - #88
4
20
 
data/Gemfile.lock CHANGED
@@ -1,34 +1,34 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_easy_replicate (0.2.3)
4
+ pg_easy_replicate (0.2.5)
5
5
  ougai (~> 2.0.0)
6
6
  pg (~> 1.5.3)
7
- sequel (>= 5.69, < 5.77)
7
+ sequel (>= 5.69, < 5.80)
8
8
  thor (>= 1.2.2, < 1.4.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
13
  ast (2.4.2)
14
- bigdecimal (3.1.5)
14
+ bigdecimal (3.1.7)
15
15
  coderay (1.1.3)
16
- diff-lcs (1.5.0)
16
+ diff-lcs (1.5.1)
17
17
  haml (6.1.1)
18
18
  temple (>= 0.8.2)
19
19
  thor
20
20
  tilt
21
- json (2.7.1)
21
+ json (2.7.2)
22
22
  language_server-protocol (3.17.0.3)
23
23
  method_source (1.0.0)
24
24
  oj (3.14.3)
25
25
  ougai (2.0.0)
26
26
  oj (~> 3.10)
27
27
  parallel (1.24.0)
28
- parser (3.3.0.4)
28
+ parser (3.3.0.5)
29
29
  ast (~> 2.4.1)
30
30
  racc
31
- pg (1.5.4)
31
+ pg (1.5.6)
32
32
  prettier_print (1.2.1)
33
33
  pry (0.14.2)
34
34
  coderay (~> 1.1)
@@ -39,20 +39,20 @@ GEM
39
39
  rbs (3.1.0)
40
40
  regexp_parser (2.9.0)
41
41
  rexml (3.2.6)
42
- rspec (3.12.0)
43
- rspec-core (~> 3.12.0)
44
- rspec-expectations (~> 3.12.0)
45
- rspec-mocks (~> 3.12.0)
46
- rspec-core (3.12.2)
47
- rspec-support (~> 3.12.0)
48
- rspec-expectations (3.12.3)
42
+ rspec (3.13.0)
43
+ rspec-core (~> 3.13.0)
44
+ rspec-expectations (~> 3.13.0)
45
+ rspec-mocks (~> 3.13.0)
46
+ rspec-core (3.13.0)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-expectations (3.13.0)
49
49
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.12.0)
51
- rspec-mocks (3.12.5)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-mocks (3.13.0)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.12.0)
54
- rspec-support (3.12.0)
55
- rubocop (1.60.1)
53
+ rspec-support (~> 3.13.0)
54
+ rspec-support (3.13.0)
55
+ rubocop (1.62.1)
56
56
  json (~> 2.3)
57
57
  language_server-protocol (>= 3.17.0)
58
58
  parallel (~> 1.10)
@@ -60,11 +60,11 @@ GEM
60
60
  rainbow (>= 2.2.2, < 4.0)
61
61
  regexp_parser (>= 1.8, < 3.0)
62
62
  rexml (>= 3.2.5, < 4.0)
63
- rubocop-ast (>= 1.30.0, < 2.0)
63
+ rubocop-ast (>= 1.31.1, < 2.0)
64
64
  ruby-progressbar (~> 1.7)
65
65
  unicode-display_width (>= 2.4.0, < 3.0)
66
- rubocop-ast (1.30.0)
67
- parser (>= 3.2.1.0)
66
+ rubocop-ast (1.31.2)
67
+ parser (>= 3.3.0.4)
68
68
  rubocop-capybara (2.20.0)
69
69
  rubocop (~> 1.41)
70
70
  rubocop-factory_bot (2.25.1)
@@ -76,12 +76,15 @@ GEM
76
76
  rubocop-ast (>= 1.30.0, < 2.0)
77
77
  rubocop-rake (0.6.0)
78
78
  rubocop (~> 1.0)
79
- rubocop-rspec (2.26.1)
79
+ rubocop-rspec (2.29.1)
80
80
  rubocop (~> 1.40)
81
81
  rubocop-capybara (~> 2.17)
82
82
  rubocop-factory_bot (~> 2.22)
83
+ rubocop-rspec_rails (~> 2.28)
84
+ rubocop-rspec_rails (2.28.2)
85
+ rubocop (~> 1.40)
83
86
  ruby-progressbar (1.13.0)
84
- sequel (5.76.0)
87
+ sequel (5.79.0)
85
88
  bigdecimal
86
89
  syntax_tree (6.2.0)
87
90
  prettier_print (>= 1.2.0)
@@ -94,7 +97,7 @@ GEM
94
97
  rbs
95
98
  syntax_tree (>= 2.0.1)
96
99
  temple (0.10.1)
97
- thor (1.3.0)
100
+ thor (1.3.1)
98
101
  tilt (2.1.0)
99
102
  unicode-display_width (2.5.0)
100
103
 
data/README.md CHANGED
@@ -76,6 +76,14 @@ $ export SOURCE_DB_URL="postgres://USERNAME:PASSWORD@localhost:5432/DATABASE_NAM
76
76
  $ export TARGET_DB_URL="postgres://USERNAME:PASSWORD@localhost:5433/DATABASE_NAME"
77
77
  ```
78
78
 
79
+ **Optional**
80
+
81
+ You can extend the default timeout by setting the following environment variable
82
+
83
+ ```bash
84
+ $ export PG_EASY_REPLICATE_STATEMENT_TIMEOUT="10s" # default 5s
85
+ ```
86
+
79
87
  Any `pg_easy_replicate` command can be run the same way with the docker image as well. As long the container is running in an environment where it has access to both the databases. Example
80
88
 
81
89
  ```bash
@@ -88,10 +88,12 @@ module PgEasyReplicate
88
88
  Query
89
89
  .run(
90
90
  query:
91
- "SELECT table_name
92
- FROM information_schema.tables
93
- WHERE table_schema = '#{schema}' AND
94
- table_type = 'BASE TABLE'
91
+ "SELECT c.relname::information_schema.sql_identifier AS table_name
92
+ FROM pg_namespace n
93
+ JOIN pg_class c ON n.oid = c.relnamespace
94
+ WHERE c.relkind = 'r'
95
+ AND c.relpersistence = 'p'
96
+ AND n.nspname::information_schema.sql_identifier = '#{schema}'
95
97
  ORDER BY table_name",
96
98
  connection_url: conn_string,
97
99
  user: db_user(conn_string),
@@ -15,7 +15,7 @@ module PgEasyReplicate
15
15
  )
16
16
  conn =
17
17
  connect(connection_url: connection_url, schema: schema, user: user)
18
- timeout ||= "5s"
18
+ timeout ||= ENV["PG_EASY_REPLICATE_STATEMENT_TIMEOUT"] || "5s"
19
19
  if transaction
20
20
  r =
21
21
  conn.transaction do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgEasyReplicate
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_easy_replicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shayon Mukherjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-28 00:00:00.000000000 Z
11
+ date: 2024-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ougai
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '5.69'
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
- version: '5.77'
50
+ version: '5.80'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: '5.69'
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
- version: '5.77'
60
+ version: '5.80'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: thor
63
63
  requirement: !ruby/object:Gem::Requirement