Export TigerGraph Schema to GSQL text formatted file

I’m running developer version of GSQL version: 3.0. Is there a capability to exporting TigerGraph schema into text readable GSQL code? If not, would you consider adding such a feature, it would be greatly appreciated to help with Schema development and updates

Kind Regards,

Mitch

Not sure its the best method, but use the ls command from within the GSQL command line interface and save the output to a text file. I find it very useful to have a text readable schema description.

Thanks Mark for the tip, on the surface, that sounds like a great idea, however, when I create a graph and the corresponding vertex and edges all in GraphStudio, none of those components show up under the ‘gsql ls’ command. It seems that your graph has to have a Global view for it to show up under the gsql ls command. Additionally, the ‘gsql ls’ command does not list out the contents of my queries. I guess I can hand scrap them from the GraphStudio.

I would like to see a feature available in both the GraphStudio, and at the gsql command level to dump either all, or by name, my graph schema’s (including defined queries) into plan text.

Finally, the gsql ls command approach might work well for a single developer, however, I would have a hard time proposing this as an enterprise solution to my organization. This existing db products that we have in house allows us to “dump” the schema to plan text.

did you try this?

https://docs.tigergraph.com/admin/admin-guide/system-management/database-import-export#export-graph

Thank you so much! Yes, this is exactly what I’m looking for :-). Not sure how I missed it!

1 Like

Hi - just to follow up, its true that the output from my ls command show all vertexes, all edges, all attributes. Then to get the contents of the queries, i separately run show query * from the command line and save that to a separate file. But the export is clearly a better way.

If you connect to the same graph/subgraph, I don’t know why you wouldnt be seeing all the same output.

Hi,

I am working on a Python (and specifically, pyTigerGraph) based solution that will be able to write all graph details/metadata into a single file that can then be e.g. saved to a code repo for versioning. I plan to have it ready by the end of August. Keep an eye on pyTigerGraph’s repo.

Thanks SzilardTG,

I found that that Export command documented in the administration guide works really well for what I need. It dumps All components of the graph, global and local schema, queries, and data components. There are two features that I would like to have in the Export command. 1) To be able export a specific Graph and not the whole database. 2) It would be nice to be able to specify the field separator. The Export utility uses an ascii character ‘2D’ (Group separator). In most cases I don’t have comma’s in my data, so being able to specify a comma ‘2C’ would be a great benefit as to making easier to access the data in excel.

Kind Regards,

Mitch