AutoSkill 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.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8/prisma-active-date-range-query" ~/.claude/skills/ecnu-icalk-autoskill-prisma-active-date-range-query && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt3.5_8/prisma-active-date-range-query/SKILL.mdsource content
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
- Active Status Logic: A record is considered active if the current date is within the range defined by
andstartDate
.endDate - Start Date Constraint: The
must be less than or equal to the current date (startDate
).lte: new Date() - End Date Constraint: The
must be greater than or equal to the current date (endDate
). This ensures records ending today or in the future are included.gte: new Date() - Type Safety: Ensure Date objects are handled correctly for the specific Prisma client context (e.g., using
if required by specific utility functions, though standard Prisma filters accept Date objects)..getTime()
Anti-Patterns
- Do not use
forlte
if the intent is to include future dates.endDate - Do not exclude records where
equals the current date.endDate
Triggers
- prisma active date range query
- fetch records that have not expired
- check if startdate is below enddate
- prisma query current date validity