206 results found for "{query"
execute
(ActiveRecord::ConnectionAdapters::PostgreSQL::DatabaseStatements, >= v4.2.1 <= v7.1.3.4)causes the db to reconnect and retry executing the SQL statement in case of a connection-related exception. This option should only be enabled for known idempotent queries. Note: the PG::Result object is manually memory managed; if you don’t need it specifically, you may want consider the exec_query wrapper.
columns_for_distinct
(ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter, >= v4.2.7 <= v7.1.3.4)In MySQL 5.7.5 and up, ONLY_FULL_GROUP_BY affects handling of queries that use DISTINCT and ORDER BY. It requires the ORDER BY columns in the select list for distinct queries, and requires that the ORDER BY include the distinct column. See dev.mysql.com/doc/refman/en/group-by-handling.html
include?
(ActiveRecord::FinderMethods, >= v6.1.3.1 <= v7.1.3.4)Returns true if the relation contains the given record or false otherwise. No query is performed if the relation is loaded; the given record is compared to the records in memory. If the relation is unloaded, an efficient existence query is performed, as in #exists? .
text_field_tag
(ActionView::Helpers::FormTagHelper, >= v1.0.0 <= v7.1.3.4)query. Options :disabled - If set to true, the user will not be able to use this input. :size - The number of visible characters that will fit in the input. :maxlength - The maximum number of characters that the browser will allow the user to enter. :placeholder - The text contained in the field
ActiveRecord::AttributeMethods::Query
Active Record Attribute Methods Query
assert_routing
(ActionDispatch::Assertions::RoutingAssertions, >= v3.0.0 <= v7.1.3.4)that options generates path . This essentially combines assert_recognizes and assert_generates into one step. The extras hash allows you to specify options that would normally be provided as a query string to the action. The message parameter allows you to specify a custom error message to display upon failure.
eager_load
(ActiveRecord::QueryMethods, >= v3.0.0 <= v7.1.3.4)Specify associations args to be eager loaded using a LEFT OUTER JOIN . Performs a single query joining all specified associations. For example: NOTE: Loading the associations in a join can result in many rows that contain redundant data and it performs poorly at scale.
column_definitions
(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter, >= v1.0.0 <= v7.1.3.4)Returns the list of a table’s column names, data types, and default values. The underlying query is roughly:
comment
(ActiveRecord::QueryLogs, >= v7.0.0 <= v7.1.3.4)Returns an SQL comment String containing the query log tags. Sets and returns a cached comment if cache_query_log_tags is true .
ignored_columns=
(ActiveRecord::ModelSchema::ClassMethods, >= v5.1.7 <= v7.1.3.4)queries. A common usage pattern for this method is to ensure all references to an attribute have been removed and deployed, before a migration to drop the column from the database has been deployed and run. Using this two step approach to dropping columns ensures there is no code that
ActiveSupport::Subscriber
Active Support Subscriber + ActiveSupport::Subscriber+ is an object set to consume ActiveSupport::Notifications . The subscriber dispatches notifications to a registered object based on its given namespace. An example would be an Active Record subscriber responsible for collecting statistics about queries:
assert_generates
(ActionDispatch::Assertions::RoutingAssertions, >= v3.0.0 <= v7.1.3.4)This is the inverse of assert_recognizes . The extras parameter is used to tell the request the names and values of additional request parameters that would be in a query string. The message parameter allows you to specify a custom error message for assertion failures. The defaults parameter is unused.
increment_counter
(ActiveRecord::CounterCache::ClassMethods, >= v4.0.2 <= v7.1.3.4)query to calculate the number of posts and comments there are, each time it is displayed. Parameters counter_name - The name of the field that should be incremented. id - The id of the object that should be incremented or an array of ids. :by - The amount by which to increment
length
(ActiveRecord::Associations::CollectionProxy, >= v4.0.2 <= v7.1.3.4)Returns the size of the collection calling size on the target . If the collection has been already loaded, length and size are equivalent. If not and you are going to need the records anyway this method will take one less query. Otherwise size is more efficient.
attribute?
(ActiveRecord::AttributeMethods::Query, >= v3.0.0 <= v7.1.3.4)Alias for ActiveRecord::AttributeMethods::Query#query_attribute
except
(ActiveRecord::SpawnMethods, >= v3.0.0 <= v7.1.3.4)Removes from the query the condition(s) specified in skips .
reset_counters
(ActiveRecord::CounterCache::ClassMethods, >= v4.0.2 <= v7.1.3.4)query. This is useful when adding new counter caches, or if the counter has been corrupted or modified directly by SQL. Parameters id - The id of the object you wish to reset a counter on. counters - One or more association counters to reset. Association name or counter name can be given
query_parameters
(ActionDispatch::Request, >= v3.0.0 <= v7.1.3.4)Alias for ActionDispatch::Request#GET
only
(ActiveRecord::SpawnMethods, >= v3.0.0 <= v7.1.3.4)Removes any condition from the query other than the one(s) specified in onlies .
check_if_method_has_arguments!
(ActiveRecord::QueryMethods, >= v4.0.2 <= v7.1.3.4)Checks to make sure that the arguments are not blank. Note that if some blank-like object were initially passed into the query method, then this method will not raise an error. Example: end
reorder
(ActiveRecord::QueryMethods, >= v3.0.0 <= v7.1.3.4)Replaces any existing order defined on the relation with the specified order . generates a query with ORDER BY id ASC, name ASC .
annotate
(ActiveRecord::QueryMethods, >= v6.0.0 <= v7.1.3.4)Adds an SQL comment to queries generated from this relation. For example: The SQL block comment delimiters, “/*” and “*/”, will be added automatically. Some escaping is performed, however untrusted user input should not be used.
record_key_for_dom_id
(ActionView::RecordIdentifier, >= v4.0.2 <= v7.1.3.4)query for the underlying database record, you should write a helper like ‘person_record_from_dom_id’ that will extract the key either based on the default implementation (which just joins all key attributes with ‘_’) or on your own overwritten version of the method. By default, this implementation passes the key string
destroy_all
(ActiveRecord::Relation, >= v3.0.0 <= v7.1.3.4)record can be time consuming when you’re removing many records at once. It generates at least one SQL DELETE query per record (or possibly more, to enforce your callbacks). If you want to delete many rows quickly, without concern for their associations or callbacks, use #delete_all instead. Examples
references
(ActiveRecord::QueryMethods, >= v4.0.2 <= v7.1.3.4)Use to indicate that the given table_names are referenced by an SQL string, and should therefore be +JOIN+ed in any query rather than loaded separately. This method only works in conjunction with #includes . See #includes for more details.
insert
(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v1.0.0 <= v7.1.3.4)query and returns the new record’s ID id_value will be returned unless the value is nil, in which case the database will attempt to calculate the last inserted id and return that value. If the next id was calculated in advance (as in Oracle), it should be passed
ActiveRecord::Encryption::ExtendedDeterministicQueries::EncryptedQuery
activerecord/test/cases/encryption/performance/extended_deterministic_queries_performance_test.rb to make sure performance overhead is acceptable. @TODO We will extend this to support previous “encryption context” versions in future iterations @TODO Experimental. Support for every kind of query is pending @TODO It should not patch anything if not needed (no previous schemes or no support for previous encryption schemes)
ActionDispatch::Http::FilterParameters
Action Dispatch HTTP Filter Parameters Allows you to specify sensitive query string and POST parameters to filter from the request log. For more information about filter behavior, see ActiveSupport::ParameterFilter .
exec_insert
(ActiveRecord::ConnectionAdapters::DatabaseStatements, >= v3.1.0 <= v7.1.3.4)with the executed sql statement. Some adapters support the `returning` keyword argument which allows to control the result of the query: `nil` is the default value and maintains default behavior. If an array of column names is passed - the result will contain values of the specified columns from the inserted row.
pp
(ActiveRecord::ConnectionAdapters::SQLite3::ExplainPrettyPrinter, >= v5.0.0.1 <= v7.1.3.4)Pretty prints the result of an EXPLAIN QUERY PLAN in a way that resembles the output of the SQLite shell: