提交 149a1e16 编写于 作者: A Aaron Patterson

cache quoted column names in SQLite3

we do this in other adapters, and it's a nice speed improvement
上级 4cd0da5c
......@@ -121,6 +121,7 @@ def initialize(connection, logger, connection_options, config)
@config = config
@visitor = Arel::Visitors::SQLite.new self
@quoted_column_names = {}
if self.class.type_cast_config_to_boolean(config.fetch(:prepared_statements) { true })
@prepared_statements = true
......@@ -240,7 +241,7 @@ def quote_table_name_for_assignment(table, attr)
end
def quote_column_name(name) #:nodoc:
%Q("#{name.to_s.gsub('"', '""')}")
@quoted_column_names[name] ||= %Q("#{name.to_s.gsub('"', '""')}")
end
#--
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册