-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactivity #30
Comments
@vpetrovykh I've been looking at how the tutorial works to get an idea for the Easy EdgeDB version, which will probably be about the 3rd major PR after the current one (before that will be one to move to 3.0 syntax and nice things like the splat operator, then one more to add a few chapters to make Easy EdgeDB 2.0). I've been experimenting a bit and looks like inserts can just be manually placed inside the generated .edgeql file after which the only complaint you get is to change the migration hash to the one it instructs you to use. If that's so then I wonder if the whole thing could be done over two files with each chapter being its own module? Here's a simple version:
Then it generates the edgeql file and the inserts can be manually put in:
After that I'm not sure if there's a way to unknowingly insert a And then if every chapter schema ends up in a single file then it could become the single source of truth and would make maintaining each separate chapter schema that much easier: just copy and paste from the main file that the interactive database uses. Do you think this approach could work? |
It's great to have those exercises at the end of each chapter. Most of them are small enough that they could be done "on paper" without actually having access to REPL.
They definitely present a good opportunity for making this book interactive. In addition to some instructions of how to try these in EdgeDB REPL locally we could have the online version of the book use the same mechanism we currently use in the "interactive tutorial" to provide an interactive way to do the exercises. Each exercise is short, easily fits on a single screen and we could have an extra button for showing the "official solution" with explanations. We already have the file with the schema & data needed for the exercises, so that can be used to populate the database.
The examples in the main body of the chapter should not be interactive, though, as messing up one of them would lead to issues down the line.
The text was updated successfully, but these errors were encountered: