This provides a utility for exploring an ent schema. It populates the database based on the schema. This should probably not be run in production, only in a development environment.
It takes the following arguments:
path
(required): path to schema file e.g.pathToRepo/src/schema
connString
(required): postgres connection string where data should be insertedrestrict
(optional): csv list of node names that should be populated. If not provided, it generates for every schema found in thepath
provided. If a schema is provided which has dependencies e.g. a foreign key on a different schema, rows are created for the dependency to fulfill the database constraint.edgeName
(optional): used to create edges from id1 to id2 of the given edge. The edgeName should match the edgeName in theedge_name
column in theassoc_edge_config
table. It should be the same as theEdgeType.Foo
+Edge
in the generatedsrc/ent/const.ts
. If the edge is symmetric or inverse, it also creates the other edge in the db.rowCount
(optional): number of rows to generate. Current default is 10000. Can provide more or less to see behavior. It doesn't always provide the exact amount but something approximate especially when there are dependencies. WhenedgeName
is provided, it determines the number of edges to create.