wasp/waspc/packages/prisma
Martin Šošić 994a58f0dc
Wasp ai cli mage (#1601)
* Improved Wasp AI CLI experience.

* fix

* Added CLI Usage, polished CLI commands.

* Added choice of temperature.

* Added styling.

* Added more sophisticated, terminal-only styling.

* fix

* Updated Mage to use new Wasp CLI + added some messaging to CLI.

* fix

* Created wasp-ai/README, updated waspc/README.

* Moved wasp-ai/ to mage/.

* Final polishing (docs, readmes, messaging).

* fix

* Added tests for LogMsg.

* Updated versions of test apps to 0.12.

* fix

* fix

* Update mage/README.md

* fix

* fix
2023-12-22 15:14:38 +01:00
..
src Wasp AI: got prisma format working, fixed recovery on http errors 2023-07-07 01:24:26 +02:00
test Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00
.gitignore Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00
eslintrc.cjs Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00
jest.config.js Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00
package-lock.json Wasp ai cli mage (#1601) 2023-12-22 15:14:38 +01:00
package.json Merge branch 'main' into wasp-ai 2023-12-11 20:19:46 +01:00
README.md Wasp AI: got prisma format working, fixed recovery on http errors 2023-07-07 01:24:26 +02:00
tsconfig.json Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00

This package contains useful tools for working with Prisma, especially PSL.

Setup

Run npm install.

Usage

Run npm run build to compile TS to JS. Do this after any changes to TS files, or if you have never run it before.

format

Run npm start format and pass prisma schema source (so PSL) via stdin. It can even be an incomplete schema -> e.g. just model declarations.

This will run prisma format on it and return formatted schema (PSL) + any warnings/errors. Note: prisma format does not just format stuff, but even fix some simple mistakes like incomplete relations!

Response, on stdout, will be JSON of the following shape:

{
  "formattedSchemaPsl": "<psl>",
  "errors": "<all errors as one big string>"  // undefined if no errors.
}