def get_insert_components(options):
	""" Takes a list of 2-tuple in the form (option, value) and returns a
	triplet (colnames, placeholders, values) that permits making a database
	query as follows: c.execute('INSERT INTO Table ({colnames}) VALUES
	{placeholders}', values). """
	col_names = ','.join(opt[0] for opt in options)
	placeholders = ','.join('?' for i in range(len(options)))
	if len(col_names) > 0:
		col_names = ',' + col_names
	if len(placeholders) > 0:
		placeholders = ',' + placeholders
	values = tuple(opt[1] for opt in options)
	return col_names, placeholders, values