def bigquery_connection(config)

      # Require database.
      unless config[:database]
        raise ArgumentError, "No database file specified. Missing argument: database"
      end
      db = BigBroda::Auth.authorized? ? BigBroda::Auth.client : BigBroda::Auth.new.authorize
      #db #quizas deberia ser auth.api o auth.client

      #In case we are using a bigquery adapter as standard config in database.yml
      #All models are BigQuery enabled
      ActiveRecord::Base.send :include, ActiveRecord::BigQueryPersistence
      ActiveRecord::SchemaMigration.send :include, ActiveRecord::BigQuerySchemaMigration
      ActiveRecord::Migrator.send :include, ActiveRecord::BigQueryMigrator
      ActiveRecord::Relation.send :include, ActiveRecord::BigQueryRelation
      ActiveRecord::Base.send :include, ActiveRecord::BigQuerying

      #db.busy_timeout(ConnectionAdapters::SQLite3Adapter.type_cast_config_to_integer(config[:timeout])) if config[:timeout]
      ConnectionAdapters::BigqueryAdapter.new(db, logger, config)
    rescue  => e
      raise e
      #Errno::ENOENT => error
      #if error.message.include?("No such file or directory")
      #  raise ActiveRecord::NoDatabaseError.new(error.message)
      #else
      #  raise error
      #end
    end
def bigquery_connection(config)

      # Require database.
      unless config[:database]
        raise ArgumentError, "No database file specified. Missing argument: database"
      end
      db = BigBroda::Auth.authorized? ? BigBroda::Auth.client : BigBroda::Auth.new.authorize
      #db #quizas deberia ser auth.api o auth.client

      #In case we are using a bigquery adapter as standard config in database.yml
      #All models are BigQuery enabled
      ActiveRecord::Base.send :include, ActiveRecord::BigQueryPersistence
      ActiveRecord::SchemaMigration.send :include, ActiveRecord::BigQuerySchemaMigration
      ActiveRecord::Migrator.send :include, ActiveRecord::BigQueryMigrator
      ActiveRecord::Relation.send :include, ActiveRecord::BigQueryRelation
      ActiveRecord::Base.send :include, ActiveRecord::BigQuerying

      #db.busy_timeout(ConnectionAdapters::SQLite3Adapter.type_cast_config_to_integer(config[:timeout])) if config[:timeout]
      ConnectionAdapters::BigqueryAdapter.new(db, logger, config)
    rescue  => e
      raise e
      #Errno::ENOENT => error
      #if error.message.include?("No such file or directory")
      #  raise ActiveRecord::NoDatabaseError.new(error.message)
      #else
      #  raise error
      #end
    end
:nodoc:
 bigquery adapter reuses BigBroda::Auth.