instance method lock_options

Ruby on Rails edge

Since edge

Signature

lock_options()

Returns the available lock options for MySQL DDL operations.

MySQL supports the following lock modes:

  • :default - Let MySQL decide the lock level.

  • :none - Allow concurrent reads and writes (online DDL).

  • :shared - Allow concurrent reads but block writes.

  • :exclusive - Block all concurrent reads and writes.

Source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 225
      def lock_options
        {
          default:   "LOCK = DEFAULT",
          none:      "LOCK = NONE",
          shared:    "LOCK = SHARED",
          exclusive: "LOCK = EXCLUSIVE",
        }
      end

Defined in activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb line 225 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close