You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: table_on_demand.rb
    path of file: ./repos/nobrainer/lib/no_brainer/query_runner
    
    the code of the file until where you have to start completion: class NoBrainer::QueryRunner::TableOnDemand < NoBrainer::QueryRunner::Middleware
  def call(env)
    @runner.call(env)
  # Not matching in RqlRuntimeError because we can get a DocumentNotPersi
    
  def handle_table_on_demand_exception?(env, e)
    /^Table `(.+)\.(.+)` does not exist\.$/.match(e.message).try(:[], 1..2)
  end

  private

  def auto_create_table(env, db_name, table_name)
    model = NoBrainer::Document.all(:types => [:user, :nobrainer])
                               .detect { |m| m.table_name == table_name }
    if model.nil?
      raise "Auto table creation is not working for `#{db_name}.#{table_name}` -- Can't find the corresponding model."
    end

    if env[:last_auto_create_table] == [db_name, table_name]
      raise "Auto table creation is not working for `#{db_name}.#{table_name}`"
    end