Your table is not public, only its owner is able to write to it, this is the :protected-mode, which is the default, there are also two further access modes:
public
Any process can read or write to the table.
protected
The owner process can read and write to the table. Other processes can only read the table. This is the default setting for the access rights.
private
Only the owner process can read or write to the table.
The tid is the table id which is returned from the :ets.new/2 call. For a named table the tid is the table name but for an unnamed table it is a reference. To access a table even if it is :public you always need the tid.
thank you ^^, I still don’t know the elixir code structure, something like, define one-same variable, and call it across the code, umm yeah, I try to learn as fast as possible, but forget the basics
What’s basically said here is that you make a table without the :public and :named_table options (so basically only with [:set]) but you will have to store the result of :ets.new and pass it around (that’s the reference to the ETS table). You can use a small GenServer or Agent to store the table reference and encapsulate it in a module so you can then do MySecretTable.get_ref() for example.