litestream 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/litestream/commands.rb +12 -11
- data/lib/litestream/upstream.rb +0 -1
- data/lib/litestream/version.rb +1 -1
- data/lib/tasks/litestream_tasks.rake +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d9a72285610321f39ded2e66eca9bc926f1643b03216d83f34f1395b7465a76
|
4
|
+
data.tar.gz: abfde27ae5ee756fa0c508005d09e6d0f3228d681e2c2cdf07caabe45f2492b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf7e5b45727750a18e8bdc2af52be0514a78e4f5c0e2ecce8bc592b07c215e9680d9f05acaee664fecc609b3b95e2e3dfb51ea3c1e902ec9ad030a85a3c2ce8
|
7
|
+
data.tar.gz: 49776dc61cc1001badd86a87e297058befa36295e7fff95e133a45fd27d881172f5ef0ce7c7d8d9069a9905f07190432892e01f2afb501e9f00ef817d6dfb148
|
data/lib/litestream/commands.rb
CHANGED
@@ -82,26 +82,27 @@ module Litestream
|
|
82
82
|
|
83
83
|
def restore(database, async: false, **argv)
|
84
84
|
raise DatabaseRequiredException, "database argument is required for restore command, e.g. litestream:restore -- --database=path/to/database.sqlite" if database.nil?
|
85
|
+
argv.stringify_keys!
|
86
|
+
|
87
|
+
execute("restore", argv, database, async: async, hashify: false)
|
88
|
+
|
89
|
+
argv["-o"] || database
|
90
|
+
end
|
91
|
+
|
92
|
+
def verify(database, async: false, **argv)
|
93
|
+
raise DatabaseRequiredException, "database argument is required for verify command, e.g. litestream:verify -- --database=path/to/database.sqlite" if database.nil? || !File.exist?(database)
|
94
|
+
argv.stringify_keys!
|
85
95
|
|
86
96
|
dir, file = File.split(database)
|
87
97
|
ext = File.extname(file)
|
88
98
|
base = File.basename(file, ext)
|
89
99
|
now = Time.now.utc.strftime("%Y%m%d%H%M%S")
|
90
100
|
backup = File.join(dir, "#{base}-#{now}#{ext}")
|
91
|
-
|
92
101
|
args = {
|
93
102
|
"-o" => backup
|
94
103
|
}.merge(argv)
|
95
104
|
|
96
|
-
|
97
|
-
|
98
|
-
backup
|
99
|
-
end
|
100
|
-
|
101
|
-
def verify(database, async: false, **argv)
|
102
|
-
raise DatabaseRequiredException, "database argument is required for verify command, e.g. litestream:verify -- --database=path/to/database.sqlite" if database.nil? || !File.exist?(database)
|
103
|
-
|
104
|
-
backup = restore(database, async: false, **argv)
|
105
|
+
backup = restore(database, async: false, **args)
|
105
106
|
|
106
107
|
raise BackupFailedException, "Failed to create backup for validation" unless File.exist?(backup)
|
107
108
|
|
@@ -150,7 +151,7 @@ module Litestream
|
|
150
151
|
|
151
152
|
args = {
|
152
153
|
"--config" => Rails.root.join("config", "litestream.yml").to_s
|
153
|
-
}.merge(argv).to_a.flatten.compact
|
154
|
+
}.merge(argv.stringify_keys).to_a.flatten.compact
|
154
155
|
cmd = [executable, command, *args, database].compact
|
155
156
|
puts cmd.inspect if ENV["DEBUG"]
|
156
157
|
|
data/lib/litestream/upstream.rb
CHANGED
data/lib/litestream/version.rb
CHANGED
@@ -97,14 +97,14 @@ namespace :litestream do
|
|
97
97
|
puts <<~TXT if result
|
98
98
|
|
99
99
|
size
|
100
|
-
original #{result[
|
101
|
-
restored #{result[
|
102
|
-
delta #{result[
|
100
|
+
original #{result["size"]["original"]}
|
101
|
+
restored #{result["size"]["restored"]}
|
102
|
+
delta #{result["size"]["original"] - result["size"]["restored"]}
|
103
103
|
|
104
104
|
tables
|
105
|
-
original #{result[
|
106
|
-
restored #{result[
|
107
|
-
delta #{result[
|
105
|
+
original #{result["tables"]["original"]}
|
106
|
+
restored #{result["tables"]["restored"]}
|
107
|
+
delta #{result["tables"]["original"] - result["tables"]["restored"]}
|
108
108
|
TXT
|
109
109
|
end
|
110
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: litestream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|