{"library":"pytrilogy","title":"pytrilogy","description":"A declarative, typed query language that compiles to SQL. Current version 0.3.246. Release cadence is frequent, pre-1.0 breaking changes may occur.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pytrilogy"],"cli":null},"imports":["from pytrilogy import compile"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pytrilogy import compile\n\nquery = '''\nimport std\n\n# Declare a variable\nlet x = 5\n\n# Return the variable as a column named \"val\"\nsource = from x in std.from_list([x]) select { val: x }\n'''\n\nresult = compile(query, dialect='postgres')\nprint(result.sql)","lang":"python","description":"Compile a simple Trilogy query to SQL. The compile function returns an object with .sql and .params attributes.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}