Sha256: 429d0bef99131620bfd98ef729d76d60d509c011a513eaafe72a70f5a539cb8c

Contents?: true

Size: 978 Bytes

Versions: 8

Compression:

Stored size: 978 Bytes

Contents

module ActiveRecord
  module Tasks # :nodoc:
    #extend ActiveSupport::Autoload
   
    class BigQueryDatabaseTasks 

      include ActiveRecord::Tasks::DatabaseTasks

      delegate :connection, :establish_connection, to: ActiveRecord::Base

      ActiveRecord::Tasks::DatabaseTasks.register_task(/bigquery/, ActiveRecord::Tasks::BigQueryDatabaseTasks)

      def create
        establish_connection configuration
        connection.create_database configuration['database']
        establish_connection configuration
      end

      def drop
        establish_connection configuration
        connection.drop_database configuration['database']
        establish_connection configuration
      end

      def initialize(configuration)
        @configuration = configuration
      end

      private

      def configuration
        @configuration
      end

      def configuration_without_database
        configuration.merge('database' => nil)
      end
    end

  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bigbroda-0.1.0.pre lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.7 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.6 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.5 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.4 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.3 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.2 lib/active_record/tasks/bigquery_database_tasks.rb
bigbroda-0.0.1 lib/active_record/tasks/bigquery_database_tasks.rb