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 with respect to constraints of a target query programming language to determine validity of the query at compile time with a type-based state machine, wherein the type-based state machine is generated as a function of the target query programming language by encoding the constraints of the target query programming language in terms of data types as states and methods as transitions between the states.