input: Write a python function to connect to a PostgreSQL database and fetch customer records based on a search term.
  assert get_customers('John') == [{'id': 1, 'name': 'John Doe', 'email': 'john@example.com'}, {'id': 2, 'name': 'Johnny Smith', 'email': 'johnny@example.com'}]
  assert get_customers('Jane') == [{'id': 3, 'name': 'Jane Doe', 'email': 'jane@example.com'}]
  assert get_customers('') == [{'id': 1, 'name': 'John Doe', 'email': 'john@example.com'}, {'id': 2, 'name': 'Johnny Smith', 'email': 'johnny@example.com'}, {'id': 3, 'name': 'Jane Doe', 'email': 'jane@example.com'}]
output: import psycopg2
  import psycopg2.extras
  
  def get_customers(search_term):
      conn = psycopg2.connect(
          dbname="your_db_name",
          user="your_db_user",
          password="your_db_password",
          host="your_db_host",
          port="your_db_port"
      )
      try:
          with conn.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
              if search_term:
                  cursor.execute("""
                      SELECT id, name, email
                      FROM customers
                      WHERE name ILIKE %s
                  """, ('%' + search_term + '%',))
              else:
                  cursor.execute("""
                      SELECT id, name, email
                      FROM customers
                  """)
              return [dict(row) for row in cursor.fetchall()]
      finally:
          conn.close()