Skip to content

hgmnz/peegee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peegee

Peegee aims to bring better support for PostgreSQL to ActiveRecord. Peegee is under active development.

###Indexes

Peegee adds support for some indexing extensions allowed by Postgres. You can run these in your migrations.

Partial indexes

add_index :users, :column, :where => 'active = true'

Expression indexes

add_index :users, :name => 'users_created_at_date' do |i|
  i.expression 'DATE(created_at)'
end

Sorted indexes

add_index :users, :name => 'users_created_at_date' do |i|
  i.column :name, :asc
  i.column :active, :desc
end
add_index :users, :name, :name => 'users_name', :concurrently => true

Note that this cannot run inside of a transaction. This will commit your running transaction, add the index concurrently, and start a new transaction. Use with caution.

License

Peegee is distributed under the MIT license.

Copyright 2011 - Harold Giménez and Mike Burns

About

ActiveRecord extensions for PostgreSQL

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages