Sha256: a5061e151ca70eb69f3e1c278dcf29a57503bfaf90a8d2ed7f3c2ba15160ac95

Contents?: true

Size: 468 Bytes

Versions: 11

Compression:

Stored size: 468 Bytes

Contents

class Baza::Driver::Pg::Indexes
  attr_reader :db

  def initialize(args)
    @db = args.fetch(:db)
  end

  def create_index(index_list, args = {})
    sqls = Baza::Driver::Pg::CreateIndexSqlCreator.new(db: db, indexes: index_list, create_args: args, on_table: args.fetch(:table_name)).sqls

    unless args[:return_sql]
      db.transaction do
        sqls.each do |sql|
          db.query(sql)
        end
      end
    end

    sqls if args[:return_sql]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
baza-0.0.38 lib/baza/driver/pg/indexes.rb
baza-0.0.37 lib/baza/driver/pg/indexes.rb
baza-0.0.36 lib/baza/driver/pg/indexes.rb
baza-0.0.35 lib/baza/driver/pg/indexes.rb
baza-0.0.34 lib/baza/driver/pg/indexes.rb
baza-0.0.33 lib/baza/driver/pg/indexes.rb
baza-0.0.32 lib/baza/driver/pg/indexes.rb
baza-0.0.31 lib/baza/driver/pg/indexes.rb
baza-0.0.30 lib/baza/driver/pg/indexes.rb
baza-0.0.29 lib/baza/driver/pg/indexes.rb
baza-0.0.28 lib/baza/driver/pg/indexes.rb