spanner-translator 0.3.0 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 455e11c334ebe5c0a3e917dbd84599176e4d16d5c905a0bfbd48e6b36b5975b6
|
4
|
+
data.tar.gz: 246699204b50ed9bf04b4a79639e66dcbd4219ee8fffb013823ddaeda38017e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19c691ff6b6d087bfdc489ff90ee655dbfc6fce1a44a5640b7681d11750dbef24f03a207a37554f2ad38c62050adffea47c153eec5c41b88d3c34f545247ca8b
|
7
|
+
data.tar.gz: eedfb4aa235247374887463df3c116152278de8e3855d9f7d8fed870342b1a320c570b61a902bb8e367b2db7befcf0174aed7fdf08b80fa5a15cbc4cfdde0d3e
|
data/Gemfile.lock
CHANGED
@@ -10,17 +10,17 @@ module Spanner
|
|
10
10
|
class << self
|
11
11
|
# process code translation, raising errors if a CheckRule fails.
|
12
12
|
def process_code!(code,
|
13
|
-
check_classes
|
14
|
-
rule_classes
|
13
|
+
check_classes: Rules::Check.constants,
|
14
|
+
rule_classes: Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
|
15
15
|
check_classes.each do |rule_class|
|
16
16
|
process_check_rule(Spanner::Translator::Rules::Check.const_get(rule_class), code)
|
17
17
|
end
|
18
18
|
|
19
|
-
process_code(code, rule_classes
|
19
|
+
process_code(code, rule_classes:, options:)
|
20
20
|
end
|
21
21
|
|
22
22
|
# process code translation for only the schema related rules
|
23
|
-
def process_code(code, rule_classes
|
23
|
+
def process_code(code, rule_classes: Rules::Translation::ORDERED_SCHEMA_RULES, options: {})
|
24
24
|
rule_classes.each do |rule_class|
|
25
25
|
code = process_rule(Spanner::Translator::Rules::Translation.const_get(rule_class), code, options:)
|
26
26
|
end
|
@@ -10,7 +10,9 @@ module Spanner
|
|
10
10
|
return unless node.create_table?
|
11
11
|
|
12
12
|
# keep table name argument, replace the rest with sensible spanner options
|
13
|
-
primary_keys =
|
13
|
+
primary_keys = translation_options
|
14
|
+
.fetch(:primary_keys, Spanner::Translator.configuration.default_primary_keys)
|
15
|
+
.inspect
|
14
16
|
@rewriter.replace(node.arguments[1].source_range, "primary_key: #{primary_keys}, force: :cascade")
|
15
17
|
end
|
16
18
|
end
|