Class: ClickHouse::Client::ToRedactedSqlVisitor

Inherits:
ArelVisitor
  • Object
show all
Defined in:
lib/click_house/client/to_redacted_sql_visitor.rb

Overview

Redacts the SQL query represented by the query builder.

Example:

query_builder = ClickHouse::QueryBuilder.new('users').where(name: 'John Doe')
redacted_query = query_builder.to_redacted_sql
# The redacted_query will contain the SQL query with values replaced by placeholders.
output: "SELECT * FROM \"users\" WHERE \"users\".\"name\" = $1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, bind_manager: ClickHouse::Client::BindIndexManager.new) ⇒ ToRedactedSqlVisitor

Returns a new instance of ToRedactedSqlVisitor.



15
16
17
18
# File 'lib/click_house/client/to_redacted_sql_visitor.rb', line 15

def initialize(*args, bind_manager: ClickHouse::Client::BindIndexManager.new)
  @bind_manager = bind_manager
  super(*args)
end

Instance Attribute Details

#bind_managerObject (readonly)

Returns the value of attribute bind_manager.



13
14
15
# File 'lib/click_house/client/to_redacted_sql_visitor.rb', line 13

def bind_manager
  @bind_manager
end