With the advent of GPTs, I find it much faster and easier to use Database Custom Queries. ChatGPT and Claude are great at creating complex queries with near 0% errors.
Give them access to your codebase, and they do fairly well creating/editing the full API file, as long as you provide examples from previously created APIs.
Claude even suggested using views to avoid nested logic, similar to
CREATE VIEW expenses_with_category_match AS
SELECT *
FROM "Finance-Expenses"
WHERE "BudgetCat_ID" = {{$_GET.filter_budget_category}}
OR "SecondaryBudgCat_ID" = {{$_GET.filter_budget_category}};
The query would then be:
SELECT *
FROM expenses_with_category_match
WHERE "Expense_Description" ILIKE '%' || {{$_GET.filter_description}} || '%'
AND "DateOfPurchase" BETWEEN {{$_GET.filter_date_purchased_start}} AND {{$_GET.filter_date_purchased_end}};
We are talking about SQL, not coding your entire app. Of course you should understand what it's doing, but AI is the future. It's the modern-day calculator or computer. Not using it will leave you way behind in the coming years.