Hub rules-prisma

rules-prisma

v3 public Verified

Prisma

Prisma is a next-generation ORM that helps developers build faster and make fewer errors. These rules govern database modeling, migrations, and type-safe query generation for Node.js and TypeScript.

@sigmashakeinc 2 pulls 5 rules published Apr 8, 2026 synced Oct 11, 2026 sigmashakeinc/rules/rulesets/rules-prisma →
Severity
3 error 2 warn 0 info
demo.cast
Prisma is a next-generation ORM that helps developers build faster and make fewer errors. These rules govern database modeling, migrations, and type-safe query generation for Node.js and TypeScript.

Rules index

5 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

prisma

no-hardcoded-datasource-url error block

Hardcoded database URL with credentials in schema.prisma will be committed to version control and exposed in CI logs. Use an environment variable reference: url = env("DATABASE_URL") and store the credential in .env (git-ignored) or a secrets manager.

Rule source requires an active Pro or Enterprise subscription.
no-prisma-query-raw-unsafe error block

$queryRawUnsafe passes the query string directly to the database driver with no parameterisation — SQL injection risk (CWE-89). Use Prisma.$queryRaw`SELECT ... WHERE id = ${id}` (tagged template) which automatically generates parameterised queries.

Rule source requires an active Pro or Enterprise subscription.
no-prisma-raw-outdated-api warning log

prisma.raw() was removed in Prisma 2.x. Replace with Prisma.sql`` tagged template literals used inside $queryRaw or $executeRaw. See the Prisma migration guide for raw query patterns.

Rule source requires an active Pro or Enterprise subscription.
no-prisma-raw-template-concat error block

String interpolation inside $executeRaw or $queryRaw with request/user data is a SQL injection vulnerability (CWE-89). Prisma only parameterises template literals when called as a tagged template with no concatenation. Use $queryRaw`SELECT ... WHERE id = ${Prisma.sql`${id}`}` or pass values as separate array parameters to $queryRawUnsafe (with full input validation).

Rule source requires an active Pro or Enterprise subscription.
prisma-block-unsafe-patterns warning ask

$executeRawUnsafe executes a raw SQL string without any parameterisation — it is the most direct SQL injection vector in Prisma (CWE-89). Switch to $executeRaw with tagged-template parameters: prisma.$executeRaw`UPDATE ... SET x = ${value}` which Prisma parameterises automatically.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Oct 11, 2026
Hash
70b5c0f8755e6d65e71c21b026ca5642fa2302e7b755d30fa43b011693751306
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-prisma/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-prisma. The published version only bumps when a maintainer resyncs.

No commit history available.