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: spanner_postgresql_order_nulls.rb
    path of file: ./repos/ruby-docs-samples/spanner
    
    the code of the file until where you have to start completion: # Copyright 2022 Google, Inc
#
# Licensed under the Apache License, Version
    
def spanner_postgresql_order_nulls project_id:, instance_id:, database_id:
  # project_id  = "Your Google Cloud project ID"
  # instance_id = "Your Spanner instance ID"
  # database_id = "Your Spanner database ID"

  spanner = Google::Cloud::Spanner.new project: project_id
  client  = spanner.client instance_id, database_id

  row_counts = nil
  client.transaction do |transaction|
    row_counts = transaction.batch_update do |b|
      b.batch_update "INSERT INTO Singers (SingerId, FirstName) VALUES (51, 'Alice')"
      b.batch_update "INSERT INTO Singers (SingerId, FirstName) VALUES (52, 'Bruce')"
      b.batch_update "INSERT INTO Singers (SingerId, FirstName) VALUES ($1, $2)",
                     params: { p1: 53, p2: nil },
                     types: { p2: :STRING }
    end
  end

  # Spanner PostgreSQL follows the ORDER BY rules for NULL values of PostgreSQL. This means
  # that:
  # 1. NULL values are ordered last by default when a query result is ordered in ascending
  #    order.
  # 2. NULL values are ordered first by default when a query result is ordered in descending
  #    order.
  # 3. NULL values can be ordered first or last by specifying NULLS FIRST or NULLS LAST in the
  #    ORDER BY clause.

  ordered_names = []
  # This returns the singers in order Alice, Bruce, nil
  results = client.execute "SELECT FirstName FROM Singers ORDER BY FirstName"
  results.rows.each do |row|
    ordered_names << row[:firstname]
  end
  puts "Result 1: #{ordered_names}"

  ordered_names = []
  # This returns the singers in order nil, Bruce, Alice
  results = client.execute "SELECT FirstName FROM Singers ORDER BY FirstName DESC"
  results.rows.each do |row|
    ordered_names << row[:firstname]
  end
  puts "Result 2: #{ordered_names}"

  ordered_names = []
  # This returns the singers in order nil, Alice, Bruce
  results = client.execute "SELECT FirstName FROM Singers ORDER BY FirstName NULLS FIRST"
  results.rows.each do |row|
    ordered_names << row[:firstname]
  end
  puts "Result 3: #{ordered_names}"

  ordered_names = []
  # This returns the singers in order Alice, Ì‰Bruce, nil
  results = client.execute "SELECT FirstName FROM Singers ORDER BY FirstName NULLS LAST"
  results.rows.each do |row|
    ordered_names << row[:firstname]
  end
  puts "Result 4: #{ordered_names}"
end