active_replicas 0.1.7 → 0.2.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a4e6a65ebf2519207361a930c6188a6de567275
|
4
|
+
data.tar.gz: fc151079d63943b66cddcf399a4534e75436003a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8f74d14ed8b07c1bf71bdb87793fc3c17caa1bb22ada956212756151fb035dfc6bf5797fd45ee39c2c593347a744faf73b21f3d56ce079f603451c573db0b3f
|
7
|
+
data.tar.gz: 625e0e68c893befdbcd2d32aa464d8f9e231aa8eb83d4dfb3600ade9e45c718ecc81b7f9bf0e0a64805b94f1469aac79b733af0244f4ed0154b9f439aa55d974
|
@@ -4,6 +4,10 @@ module ActiveReplicas
|
|
4
4
|
@connection = connection
|
5
5
|
@is_primary = is_primary
|
6
6
|
@proxy = proxy
|
7
|
+
|
8
|
+
# NOTE: This is to support the `database_cleaner gem`:
|
9
|
+
# https://github.com/DatabaseCleaner/database_cleaner/blob/ba3664a/lib/database_cleaner/active_record/deletion.rb#L56
|
10
|
+
@config = @connection.instance_variable_get(:@config)
|
7
11
|
end
|
8
12
|
|
9
13
|
# Forwards a call to its own connection or back up to the proxy pool's
|
@@ -8,12 +8,16 @@ module ActiveReplicas
|
|
8
8
|
# All the methods which are safe to be delegated to a replica.
|
9
9
|
@@replica_delegated_methods = (
|
10
10
|
[
|
11
|
-
:active?, :
|
11
|
+
:active?, :cacheable_query, :case_sensitive_comparison,
|
12
|
+
:case_sensitive_modifier, :case_insensitive_comparison,
|
13
|
+
:clear_query_cache, :column_name_for_operation, :columns,
|
12
14
|
:disable_query_cache!, :disconnect!, :enable_query_cache!,
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
15
|
+
:exec_query, :prepared_statements, :query_cache_enabled, :quote,
|
16
|
+
:quote_column_name, :quote_table_name,
|
17
|
+
:quote_table_name_for_assignment, :raw_connection, :reconnect!,
|
18
|
+
:sanitize_limit, :schema_cache, :select, :select_all, :select_one,
|
19
|
+
:select_rows, :select_value, :select_values, :substitute_at, :to_sql,
|
20
|
+
:type_cast, :valid_type?, :verify!
|
17
21
|
]
|
18
22
|
).uniq
|
19
23
|
|
@@ -21,16 +25,17 @@ module ActiveReplicas
|
|
21
25
|
DDL_METHODS = [
|
22
26
|
:add_column, :add_foreign_key, :add_index, :add_reference,
|
23
27
|
:add_timestamps, :change_column, :change_column_default,
|
24
|
-
:change_column_null, :create_join_table, :create_table,
|
25
|
-
:drop_join_table, :drop_table, :enable_extension,
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
28
|
+
:change_column_null, :column_spec, :create_join_table, :create_table,
|
29
|
+
:delete_table, :drop_join_table, :drop_table, :enable_extension,
|
30
|
+
:execute, :execute_block, :initialize_schema_migrations_table,
|
31
|
+
:migration_keys, :remove_column, :remove_columns, :remove_foreign_key,
|
32
|
+
:remove_index, :remove_reference, :remove_timestamps, :rename_column,
|
33
|
+
:rename_index, :rename_table
|
29
34
|
]
|
30
35
|
|
31
36
|
# Rails methods that deal with create, read, update, delete in SQL
|
32
37
|
CRUD_METHODS = [
|
33
|
-
:delete, :insert, :truncate, :update
|
38
|
+
:delete, :insert, :next_sequence_value, :truncate, :update
|
34
39
|
]
|
35
40
|
|
36
41
|
# Rails methods that query whether or not the adapter or database engine
|
@@ -49,9 +54,12 @@ module ActiveReplicas
|
|
49
54
|
CRUD_METHODS +
|
50
55
|
SUPPORTS_METHODS +
|
51
56
|
[
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
57
|
+
:add_transaction_record, :assume_migrated_upto_version,
|
58
|
+
:begin_db_transaction, :commit_db_transaction,
|
59
|
+
:disable_referential_integrity, :foreign_keys, :indexes,
|
60
|
+
:native_database_types, :prefetch_primary_key?, :primary_key,
|
61
|
+
:rollback_db_transaction, :tables, :table_exists?, :transaction,
|
62
|
+
:transaction_state
|
55
63
|
]
|
56
64
|
).uniq
|
57
65
|
|