Skip to content

Commit

Permalink
Added docs for #indexes on adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinez87 committed Apr 22, 2011
1 parent df70b9d commit 900470c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Expand Up @@ -611,6 +611,7 @@ def drop_table(table_name, options = {})
super(table_name, options)
end

# Returns an array of indexes for the given table.
def indexes(table_name, name = nil)#:nodoc:
indexes = []
current_index = nil
Expand Down
Expand Up @@ -690,7 +690,7 @@ def extract_schema_and_table(name)
[schema, table]
end

# Returns the list of all indexes for a table.
# Returns an array of indexes for the given table.
def indexes(table_name, name = nil)
schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',')
result = query(<<-SQL, name)
Expand Down
Expand Up @@ -263,6 +263,7 @@ def columns(table_name, name = nil) #:nodoc:
end
end

# Returns an array of indexes for the given table.
def indexes(table_name, name = nil) #:nodoc:
exec_query("PRAGMA index_list(#{quote_table_name(table_name)})", name).map do |row|
IndexDefinition.new(
Expand Down

0 comments on commit 900470c

Please sign in to comment.