def check_exists(connection, path):
	"""Check the file path in the SQL filepaths table.
	:param connection:
	:param path:
	:return: path id"""
	exists = '''SELECT EXISTS(SELECT 1 FROM filepaths
		WHERE filepath = ?);'''
	cursor = connection.cursor()
	cursor.execute(exists, (path,))
	return cursor.fetchone()