Class: ClickHouse::SQL::BindIndexManager
- Inherits:
-
Object
- Object
- ClickHouse::SQL::BindIndexManager
- Defined in:
- lib/clickhouse/sql/bind_index_manager.rb
Overview
Emits sequential $1-style bind markers when rendering redacted SQL,
so every typed placeholder in a query gets a stable positional marker
suitable for external log aggregation.
Derived from GitLab's MIT-licensed click_house-client gem; see LICENSE.
Instance Method Summary collapse
-
#initialize(start_index = 1) ⇒ BindIndexManager
constructor
A new instance of BindIndexManager.
-
#next_bind_str ⇒ String
Returns the next positional bind marker.
Constructor Details
#initialize(start_index = 1) ⇒ BindIndexManager
Returns a new instance of BindIndexManager.
12 13 14 |
# File 'lib/clickhouse/sql/bind_index_manager.rb', line 12 def initialize(start_index = 1) @current_index = start_index end |
Instance Method Details
#next_bind_str ⇒ String
Returns the next positional bind marker.
19 20 21 22 23 |
# File 'lib/clickhouse/sql/bind_index_manager.rb', line 19 def next_bind_str bind_str = "$#{@current_index}" @current_index += 1 bind_str end |