--[=[
	Gets a sub-datastore that will write at the given name point
	@param name string
	@return DataStoreStage
]=]

function DataStoreStage:GetSubStore(name)
	assert(type(name) == "string", "Bad name")

	if self._stores[name] then
		return self._stores[name]
	end

	if self._takenKeys[name] then
		error(("[DataStoreStage.GetSubStore] - Already have a writer for %q"):format(name))
	end

	local newStore = DataStoreStage.new(name, self)
	self._takenKeys[name] = true
	self._maid:GiveTask(newStore)

	self._stores[name] = newStore

	return newStore
end
