{"id":25376778,"url":"https://github.com/terrierscript/prisma-mysql-explain","last_synced_at":"2025-10-30T08:31:25.929Z","repository":{"id":58302872,"uuid":"530695539","full_name":"terrierscript/prisma-mysql-explain","owner":"terrierscript","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-02T13:43:40.000Z","size":178,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-18T14:28:14.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terrierscript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-30T14:31:04.000Z","updated_at":"2024-04-12T04:04:38.000Z","dependencies_parsed_at":"2023-01-17T19:31:41.106Z","dependency_job_id":null,"html_url":"https://github.com/terrierscript/prisma-mysql-explain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fprisma-mysql-explain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fprisma-mysql-explain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fprisma-mysql-explain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terrierscript%2Fprisma-mysql-explain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terrierscript","download_url":"https://codeload.github.com/terrierscript/prisma-mysql-explain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238945642,"owners_count":19556701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-15T04:39:18.650Z","updated_at":"2025-10-30T08:31:25.525Z","avatar_url":"https://github.com/terrierscript.png","language":"TypeScript","readme":"# prisma-mysql-explain\n\nExecute mysql explain for [Prisma](https://www.prisma.io/)\n\n### WARNING\nThis library is for development environments.\n\n**Don't use production environment.**\n\n## usage\n\n```ts\nimport { createExplain } from \"prisma-mysql-explain\"\n\nconst createPrisma = () =\u003e {\n  // Need query event log\n  const prisma = new PrismaClient({\n    log: [{ level: \"query\", emit: \"event\" }]\n  })\n\n  const prismaExplain = creatExplainQuery(prisma, {cacheType: \"params\"})\n\n  prisma.$on(\"query\", async (event) =\u003e {\n    const result = await prismaExplain.explain(event)\n    if (!result) {\n      return\n    }\n    console.log(result)\n  })\n  \n  return prisma\n}\n```\n\n\n## API\n\n### `createExplain(prisma: PrismaClient, option: Option?) `\n\n**Option**\n\n* cacheType\n  * query(default) - Cache with query\n  * param - Cache with query and params\n  * none - Disable cahce\n\n**Return**\n\n* `explain: (event: Prisma.QueryEvent) =\u003e ExplainResult[]`\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fprisma-mysql-explain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterrierscript%2Fprisma-mysql-explain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterrierscript%2Fprisma-mysql-explain/lists"}