I need to write a command-line utility which redefines/updates the graph schema.
For doing this I need to:
- drop the graph
- drop existing tuples
- define new tuples
- define a new graph
The problem is in the "drop existing tuples" stage. I do it by running the following command for all tuple names which I have to recreate:
gsql 'DROP TUPLE < tupleName >'
This works well for Tigergraph v3.1.2 because DROP TUPLE MyTuple
drops MyTuple
if it exists or ignores the statement otherwise.
But for Tigergraph v3.5.1 this strategy doesn't work because it fails if MyTuple
doesn't exist.
So now I need to run DROP TUPLE
only for those tuples which were created before.
But the problem is that there is no way to list all tuples (e.g. there is no Show tuples
command).
And I cannot use DROP ALL
because I need to update only the specific graph and don't touch everything else.