@staticmethod
def get_by_name(cursor, name):
    """Retrieve the a job_source by its name and return Id."""
    query = 'SELECT id FROM system.job_source WHERE name=%s'
    args = name,
    cursor.execute(query, args)
    if cursor.rowcount == 1:
        datasource_id, = cursor.fetchone()
        return datasource_id
