-
Put the above prisma-effect-generator.ts in your root of your project.
-
Install "@prisma/generator-helper" and "@prisma/internals" as dev dependecies.
-
Add this to your schema.prisma file
generator sqlSchema {# x is introduced to the environment
{ ..?e } → { x := 3 ; ..?e }
# y too ; ?e is not the same row variable as the one above
{ ..?e } → { y := 5 ; ..?e }
# matching the current context on one that contains an x and a y
# which allows us to add them to introduce y
{ x ; y ; ..?e } → { z := x + y ; ..?e } | local function start_tsgo() | |
| local root_files = { "tsconfig.json", "jsconfig.json", "package.json", ".git" } | |
| local paths = vim.fs.find(root_files, { stop = vim.env.HOME }) | |
| local root_dir = vim.fs.dirname(paths[1]) | |
| if root_dir == nil then | |
| -- root directory was not found | |
| return | |
| end |
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
| // Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
| import { sql } from "drizzle-orm"; | |
| const clearDb = async (): Promise<void> => { | |
| const query = sql<string>`SELECT table_name | |
| FROM information_schema.tables | |
| WHERE table_schema = 'public' | |
| AND table_type = 'BASE TABLE'; | |
| `; |
| import type { Kysely, RawBuilder } from "kysely"; | |
| import type { Account } from "next-auth"; | |
| import type { | |
| Adapter, | |
| AdapterSession, | |
| VerificationToken, | |
| AdapterUser, | |
| } from "next-auth/adapters"; | |
| import type { DB } from "shared"; |
| // Place your key bindings in this file to override the defaults | |
| [ | |
| { | |
| "key": "ctrl+h", | |
| "command": "workbench.action.focusLeftGroup", | |
| "when": "editorTextFocus && vim.active && vim.mode != 'Insert'" | |
| }, | |
| { | |
| "key": "ctrl+l", | |
| "command": "workbench.action.focusRightGroup", |
Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.
Source: tutorialspoint.com