Prisma active date range query
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/prisma-active-date-range-query
AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution
npx -y skills add ECNU-ICALK/AutoSkill --skill prisma-active-date-range-queryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
What its author says it does
Copied from the file, not written here
Constructs Prisma queries to fetch records that are currently active based on start and end dates relative to the current time.
SKILL.md
1.9 KB, as published. Nobody here has run it
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
startDateandendDate. - Start Date Constraint: The
startDatemust be less than or equal to the current date (lte: new Date()). - End Date Constraint: The
endDatemust be greater than or equal to the current date (gte: new Date()). This ensures records ending today or in the future are included. - 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
lteforendDateif the intent is to include future dates. - Do not exclude records where
endDateequals 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