方法
實體公開方法
build_explain_clause(options = []) 連結
原始碼: 顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 96 def build_explain_clause(options = []) return "EXPLAIN" if options.empty? "EXPLAIN (#{options.join(", ").upcase})" end
explain(arel, binds = [], options = []) 連結
原始碼: 顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 7 def explain(arel, binds = [], options = []) sql = build_explain_clause(options) + " " + to_sql(arel, binds) result = internal_exec_query(sql, "EXPLAIN", binds) PostgreSQL::ExplainPrettyPrinter.new.pp(result) end
high_precision_current_timestamp() 連結
原始碼: 顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 92 def high_precision_current_timestamp HIGH_PRECISION_CURRENT_TIMESTAMP end
set_constraints(deferred, *constraints) 連結
設定何時會檢查目前交易約束。
如果不傳遞任何特定約束名稱,則會設定所有可延遲約束的值。
deferred
-
有效值是
:deferred
或:immediate
。
請參閱 www.postgresql.org/docs/current/sql-set-constraints.html
原始碼: 顯示 | 在 GitHub 上
# File activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb, line 110 def set_constraints(deferred, *constraints) unless %i[deferred immediate].include?(deferred) raise ArgumentError, "deferred must be :deferred or :immediate" end constraints = if constraints.empty? "ALL" else constraints.map { |c| quote_table_name(c) }.join(", ") end execute("SET CONSTRAINTS #{constraints} #{deferred.to_s.upcase}") end