Knack Data Language / Knack JS Framework

I have been thinking for some time that the biggest improvement to Knack at the moment would be the inclusion of an approachable language for manipulating data. All through the history of end user oriented databases, the most successful have had their own language - there was dBase, Access (with VBA), Access Web Apps (which I've moved from with the excellent Data Macros), etc. What these all have in common is built in language constructs to retrieve and manipulate data.

The key is to success is to make the learning curve gentle - moving from UI based tools to the language should be a huge leap.

I'm not sure I'm necessarily suggesting a whole new language - you could 'simply' add a Knack JS Framework which packaged up some often used scenarios (like retrieving filtered records from an object and looping through them for example). It would also be a great help if you started to build the code features out in an 'event driven' way - in other words being able to attach code to 'events' in the UI (for example the Submit event for a form or click event for a menu button or Action Link) rather than having to code for the event (and having all code in one text area is not very user friendly either).

There could be functions which would retrieve data and loop through it (if that's possible), update the record(s), delete them etc. Plus be able to perform calculations that aren't possible with the UI tools.

A use-case I've lived with for years is calculating the duration of a period of leave (I've built HR systems for many years). This involves retrieving employee's working patterns, the dates of public holidays (usually a table holding a record for each date) and then determining, for each date within the range of dates of the leave, whether it counts as a leave day or not.

I generally hold a separate record for each Day of the absence period. This allows you to hold the specific number of hours absent for each day and also report correctly between dates. This means that the above checks also include the creation of a number of connected (child) Absence Day records while looping through the dates - setting the Date field from the loop value etc..

All this implies that the processes are generally Synchronous (the code needs to wait for the results before continuing).

With some database languages this is reasonably simple (I've done it in Access VBA, Access Web Apps Data Macros and also Zoho Deluge). I had a go in JS for Knack and eventually decided it was just too difficult.

Knack is already a great tool for building many solutions but this would take it to the next level.