adrianbrowning / prisma-ts-select

A TypeSafe primsa extension allowing more fine grain control of selects
MIT License
2 stars 0 forks source link

Select functions - Date and Time #6

Open adrianbrowning opened 4 months ago

adrianbrowning commented 4 months ago
Function In Type Out Type Example
NOW() None DateTime SELECT NOW();
CURDATE() None Date SELECT CURDATE();
DATE_ADD() Date, Interval Date SELECT DATE_ADD(NOW(), INTERVAL 1 DAY);
DATE_SUB() Date, Interval Date SELECT DATE_SUB(NOW(), INTERVAL 1 DAY);
YEAR() Date Integer SELECT YEAR(birthdate) FROM users;
MONTH() Date Integer SELECT MONTH(birthdate) FROM users;
DAY() Date Integer SELECT DAY(birthdate) FROM users;