import random


def get_rows(num_rows, num_fields, max_field_length, alphabet_str, deterministic):
	""" Creates rows of data (strings) to model SQL rows. 
		alphabet_str: The string to select characters from.
		deterministic: If True, the rows will cycle through the alphabet in a reproducable pattern. If False, the rows will be chosen at random """
	rows = []
	for row_num in range(num_rows):
		row = []
		for field_num in range(num_fields):
			if not deterministic:
				row.append(''.join(random.choice(alphabet_str) 
							for n in range(random.randrange(max_field_length))))
			else:
				row.append(''.join(alphabet_str[n % len(alphabet_str)]
							for n in range((row_num + field_num), (row_num + field_num + max_field_length))))
		rows.append(tuple(row))
	return rows