edgedb-zod icon indicating copy to clipboard operation
edgedb-zod copied to clipboard

Some ideas

Open colinhacks opened this issue 1 year ago • 1 comments

Just some miscellaneous ideas!

  • Perhaps call the two schemas something like Read and Write. The "Create" and "Update" aren't quite right since computed properties can't be included in an insert call.
  • I'd include the EdgeDB SDL in the README as well so users can see directly see the correspondence between the EdgeDB and Zod types.
  • Why not make datetime correspond to Date? That's what the client library would expect. I'd also recommend using z.instance(edgedb.LocalDate) , z.instance(edgedb.LocalTime), etc for the various datatypes that correspond to custom classes. (The generated file can just have import * as edgedb from "edgedb" at the top.)

Docs

  • Perhaps explain the rational behind why links are excluded
  • Include installation instructions
  • "To run the CLI: edgedb-zod [options]" — this should probably be npx edgedb-zod
  • I recommend switching to red and green dots (🔴🟢) to make the comparison table a little more uniform. And expand "Most scalars" so there's more green dots :)
  • Maybe choose a simpler regex so the generated code is a bit less scary?

colinhacks avatar Nov 07 '22 02:11 colinhacks