clickhouse-activerecord 0.6.1 → 0.6.1.1

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: 74728f97bde396aae27436dd6b7ec8d57ec172e818122f9094d994583c92781f
4
- data.tar.gz: 64e08f74a95d755338b489b32f2aade49685b6b604a3d02d2f232ca9f24b7b23
3
+ metadata.gz: f67a26e07ac1e077b8966dfb82626a2a4778d8060d07cedc4a93b2681a7dcfb3
4
+ data.tar.gz: 2ef8add7034b493f2353a45af727646beac80a02989a8a198f2283e130cfa5be
5
5
  SHA512:
6
- metadata.gz: 959c753aaf61bcef02dd336953d1bd88bc0d2d3762bc5f96e3816699685c809da2f4ad7646201570892a12fad32760a80d69ff6292b172fb6e9c518c13dc622d
7
- data.tar.gz: e7ee279cf5dc1b8168448f8c657550e2cb418121da1ef58c1d53989f8a7cc678527fcb7678cc0ba903d9e5d9e108450c9da28d03ba0e6d9364738d1c2f60e414
6
+ metadata.gz: 9b5553336901a311c54f5ff449ada535060437dda68800acd5ee1781f6a46debde48294957dff568114657985a0475e7dc1c12bb54c6dba92f211416348d0ac4
7
+ data.tar.gz: b1eb6866cd5882c545fe9bec44cc8d587edb051ec1dd259822a7a5c2ff45c21cffbfae7cc59a22bfb262544c718a69821702f663972ef4987cfd1b92cbb0a22b
@@ -60,7 +60,9 @@ module ActiveRecord
60
60
 
61
61
  def do_system_execute(sql, name = nil)
62
62
  log_with_debug(sql, "#{adapter_name} #{name}") do
63
- res = @connection.post("/?#{@config.to_param}", "#{sql} FORMAT JSONCompact", 'User-Agent' => "Clickhouse ActiveRecord #{ClickhouseActiverecord::VERSION}")
63
+ res = @lock.synchronize do
64
+ @connection.post("/?#{@config.to_param}", "#{sql} FORMAT JSONCompact", 'User-Agent' => "Clickhouse ActiveRecord #{ClickhouseActiverecord::VERSION}")
65
+ end
64
66
 
65
67
  process_response(res)
66
68
  end
@@ -70,7 +72,9 @@ module ActiveRecord
70
72
  log(sql, "#{adapter_name} #{name}") do
71
73
  formatted_sql = apply_format(sql, format)
72
74
  request_params = @config || {}
73
- res = @connection.post("/?#{request_params.merge(settings).to_param}", formatted_sql, 'User-Agent' => "Clickhouse ActiveRecord #{ClickhouseActiverecord::VERSION}")
75
+ res = @lock.synchronize do
76
+ @connection.post("/?#{request_params.merge(settings).to_param}", formatted_sql, 'User-Agent' => "Clickhouse ActiveRecord #{ClickhouseActiverecord::VERSION}")
77
+ end
74
78
 
75
79
  process_response(res)
76
80
  end
@@ -334,7 +334,13 @@ module ActiveRecord
334
334
  end
335
335
 
336
336
  def drop_table(table_name, options = {}) # :nodoc:
337
- do_execute apply_cluster "DROP TABLE#{' IF EXISTS' if options[:if_exists]} #{quote_table_name(table_name)}"
337
+ query = "DROP TABLE"
338
+ query = "#{query} IF EXISTS " if options[:if_exists]
339
+ query = "#{query} #{quote_table_name(table_name)}"
340
+ query = apply_cluster(query)
341
+ query = "#{query} SYNC" if options[:sync]
342
+
343
+ do_execute(query)
338
344
 
339
345
  if options[:with_distributed]
340
346
  distributed_table_name = options.delete(:with_distributed)
@@ -1,3 +1,3 @@
1
1
  module ClickhouseActiverecord
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clickhouse-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Odintsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-29 00:00:00.000000000 Z
11
+ date: 2025-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
150
  requirements: []
151
- rubygems_version: 3.1.6
151
+ rubygems_version: 3.3.7
152
152
  signing_key:
153
153
  specification_version: 4
154
154
  summary: ClickHouse ActiveRecord