alixi
alixi12mo ago

here's another example schema flowchart

here's another example schema flowchart! from one of my projects
No description
3 Replies
burnstony#1975
burnstony#197511mo ago
I installed the package and added console.log(schemaToMermaid(schema)); to my schema file, but I dont see it logging the mermaid code anywhere can you maybe elaborate in the README how to use this
alixi
alixiOP11mo ago
hey! I'm going to update the README soon but here's a command that you can run in your terminal that should print out the schema:
echo "import s from './convex/schema';import {schemaToMermaid} from 'convex-schema-mermaid';console.log(schemaToMermaid(s))" | npx esbuild --bundle | node
echo "import s from './convex/schema';import {schemaToMermaid} from 'convex-schema-mermaid';console.log(schemaToMermaid(s))" | npx esbuild --bundle | node
you can also place the console.log(schemaToMermaid(schema)) inside a convex function and then run that function from the convex dashboard, and you'll see it logged on the dashboard logs page
David Alonso
David Alonso11mo ago
@jamwt y'all should add this to the convex dashboard - we're changing our schema constantly and it's a huge pain to keep it up to date in another flowchart tool It's very hard to have internal discussions over 200+ lines of schema code as you can imagine...

Did you find this page helpful?