nandi 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea1c9b758014a99ea83562525b13d80c54ed0dd310ffd64eaebae6009235cebf
|
|
4
|
+
data.tar.gz: 77d9ae338cd152b213acaa18c2e6ba6ecbe56f7f1fe955264694d98d8b526030
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3b1935d279ba467262f79d7153ad5cfe1741da7d6c42ba618dd038f7216cc32435403343ad3adfde4e800953658cf5c8db75ab5b2fc434faef54d6871b4081b
|
|
7
|
+
data.tar.gz: 0c71da4c6691fe6e3b75acaa32c23af55b32c4b94ce3a7e7afc2021e98f2c64ba1aeb19e7da9a182ba0584c716fec3a725d1dff7ce7c789c49bb18f2a8cf170b
|
data/lib/nandi/migration.rb
CHANGED
|
@@ -69,12 +69,18 @@ module Nandi
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
# @param validator [Nandi::Validator]
|
|
72
|
-
|
|
72
|
+
# @param database_name [Symbol, nil] The database this migration is being compiled
|
|
73
|
+
# for. Used to resolve per-database config. Defaults to the default database.
|
|
74
|
+
def initialize(validator, database_name: nil)
|
|
73
75
|
@validator = validator
|
|
76
|
+
@database_name = database_name
|
|
74
77
|
@instructions = Hash.new { |h, k| h[k] = InstructionSet.new([]) }
|
|
75
78
|
validate
|
|
76
79
|
end
|
|
77
80
|
|
|
81
|
+
# @api private
|
|
82
|
+
attr_reader :database_name
|
|
83
|
+
|
|
78
84
|
# @api private
|
|
79
85
|
def up_instructions
|
|
80
86
|
compile_instructions(:up)
|
|
@@ -331,7 +337,7 @@ module Nandi
|
|
|
331
337
|
|
|
332
338
|
def disable_lock_timeout?
|
|
333
339
|
if self.class.lock_timeout.nil?
|
|
334
|
-
strictest_lock == LockWeights::SHARE && Nandi.config.concurrent_lock_timeout.nil?
|
|
340
|
+
strictest_lock == LockWeights::SHARE && Nandi.config.concurrent_lock_timeout(database_name).nil?
|
|
335
341
|
else
|
|
336
342
|
false
|
|
337
343
|
end
|
|
@@ -339,7 +345,7 @@ module Nandi
|
|
|
339
345
|
|
|
340
346
|
def disable_statement_timeout?
|
|
341
347
|
if self.class.statement_timeout.nil?
|
|
342
|
-
strictest_lock == LockWeights::SHARE && Nandi.config.concurrent_statement_timeout.nil?
|
|
348
|
+
strictest_lock == LockWeights::SHARE && Nandi.config.concurrent_statement_timeout(database_name).nil?
|
|
343
349
|
else
|
|
344
350
|
false
|
|
345
351
|
end
|
|
@@ -377,17 +383,18 @@ module Nandi
|
|
|
377
383
|
|
|
378
384
|
def default_statement_timeout
|
|
379
385
|
if strictest_lock == LockWeights::SHARE
|
|
380
|
-
Nandi.config.concurrent_statement_timeout ||
|
|
386
|
+
Nandi.config.concurrent_statement_timeout(database_name) ||
|
|
387
|
+
Nandi.config.access_exclusive_statement_timeout(database_name)
|
|
381
388
|
else
|
|
382
|
-
Nandi.config.access_exclusive_statement_timeout
|
|
389
|
+
Nandi.config.access_exclusive_statement_timeout(database_name)
|
|
383
390
|
end
|
|
384
391
|
end
|
|
385
392
|
|
|
386
393
|
def default_lock_timeout
|
|
387
394
|
if strictest_lock == LockWeights::SHARE
|
|
388
|
-
Nandi.config.concurrent_lock_timeout || Nandi.config.access_exclusive_lock_timeout
|
|
395
|
+
Nandi.config.concurrent_lock_timeout(database_name) || Nandi.config.access_exclusive_lock_timeout(database_name)
|
|
389
396
|
else
|
|
390
|
-
Nandi.config.access_exclusive_lock_timeout
|
|
397
|
+
Nandi.config.access_exclusive_lock_timeout(database_name)
|
|
391
398
|
end
|
|
392
399
|
end
|
|
393
400
|
|
|
@@ -43,11 +43,11 @@ module Nandi
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def statement_timeout_maximum
|
|
46
|
-
Nandi.config.access_exclusive_statement_timeout_max
|
|
46
|
+
Nandi.config.access_exclusive_statement_timeout_max(migration.database_name)
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def lock_timeout_maximum
|
|
50
|
-
Nandi.config.access_exclusive_lock_timeout_max
|
|
50
|
+
Nandi.config.access_exclusive_lock_timeout_max(migration.database_name)
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
end
|
|
@@ -53,11 +53,11 @@ module Nandi
|
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
def minimum_lock_timeout
|
|
56
|
-
Nandi.config.concurrent_lock_timeout_min
|
|
56
|
+
Nandi.config.concurrent_lock_timeout_min(migration.database_name)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def minimum_statement_timeout
|
|
60
|
-
Nandi.config.concurrent_statement_timeout_min
|
|
60
|
+
Nandi.config.concurrent_statement_timeout_min(migration.database_name)
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
end
|
data/lib/nandi/version.rb
CHANGED