-
Notifications
You must be signed in to change notification settings - Fork 66
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
Gel prisma #1162
base: master
Are you sure you want to change the base?
Gel prisma #1162
Conversation
Add the `prisma` command to the list of valid @edgedb/generate commands. It requires a `--file` and some way of connecting the client (DSN or whatever other method). The generated Prisma schema will be output as specified by `--file`.
f13c6bc
to
9fa1ca5
Compare
Test the basic CRUD capability of the exposed Prisma models.
9fa1ca5
to
80ad3b5
Compare
import type { Client } from "edgedb"; | ||
import * as fs from "node:fs"; | ||
|
||
const WARNINGS: string[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of collecting them, just print them into stderr as they happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can print them to stdout with console.log
, tbh. I don't think our debug output in our generators are very principled about that sort of thing.
const types = <JSONType[]>JSON.parse(await client.queryJSON(INTRO_QUERY)); | ||
const modules = <string[]>JSON.parse(await client.queryJSON(MODULE_QUERY)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why queryJSON
-> JSON.parse
instead of query
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mostly a translation from the Python version of this tool. There I was collecting things into dicts rather than native objects so that I could access things uniformly via [ ]
and not worry about fields. I realize that in JS version this is not necessary, so a query is probably right in this spot.
No description provided.