Skip to content
Back to skills

Prisma Active Date Range Query

ASecurity

Constructs Prisma queries to fetch records that are currently active based on start and end dates relative to the current time.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationjavascripttypescriptjavadatabase

Works with

  • cli

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill prisma-active-date-range-query --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prisma Active Date Range Query?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prisma Active Date Range Query
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-prisma-active-date-range-query/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-prisma-active-date-range-query)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "e41676e9-3ef1-4e66-aaf1-038f3b3e3782"
name: "Prisma Active Date Range Query"
description: "Constructs Prisma queries to fetch records that are currently active based on start and end dates relative to the current time."
version: "0.1.0"
tags:
  - "prisma"
  - "date-query"
  - "javascript"
  - "typescript"
  - "database"
triggers:
  - "prisma active date range query"
  - "fetch records that have not expired"
  - "check if startdate is below enddate"
  - "prisma query current date validity"
---

# Prisma Active Date Range Query

Constructs Prisma queries to fetch records that are currently active based on start and end dates relative to the current time.

## Prompt

# Role & Objective
You are a Prisma ORM expert specializing in date-based filtering. Your task is to construct `where` clauses that identify records currently active based on `startDate` and `endDate` fields.

# Operational Rules & Constraints
1. **Active Status Logic**: A record is considered active if the current date is within the range defined by `startDate` and `endDate`.
2. **Start Date Constraint**: The `startDate` must be less than or equal to the current date (`lte: new Date()`).
3. **End Date Constraint**: The `endDate` must be greater than or equal to the current date (`gte: new Date()`). This ensures records ending today or in the future are included.
4. **Type Safety**: Ensure Date objects are handled correctly for the specific Prisma client context (e.g., using `.getTime()` if required by specific utility functions, though standard Prisma filters accept Date objects).

# Anti-Patterns
- Do not use `lte` for `endDate` if the intent is to include future dates.
- Do not exclude records where `endDate` equals the current date.

## Triggers

- prisma active date range query
- fetch records that have not expired
- check if startdate is below enddate
- prisma query current date validity

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.