1. A method of query analysis, comprising: employing at least one processor configured to execute computer-executable instructions stored in memory to perform the following acts: analyzing a query specified with a source programming language at compile time as a function of a type-based state machine that encodes query constraints of a target programming language.