{"id":46534037,"url":"https://github.com/sqlc-dev/teesql","last_synced_at":"2026-03-06T23:08:17.141Z","repository":{"id":330040467,"uuid":"1115985512","full_name":"sqlc-dev/teesql","owner":"sqlc-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-16T20:26:16.000Z","size":6927,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T14:44:19.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sqlc-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-14T00:34:25.000Z","updated_at":"2026-01-16T20:25:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sqlc-dev/teesql","commit_stats":null,"previous_names":["sqlc-dev/teesql","kyleconroy/teesql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sqlc-dev/teesql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlc-dev%2Fteesql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlc-dev%2Fteesql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlc-dev%2Fteesql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlc-dev%2Fteesql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlc-dev","download_url":"https://codeload.github.com/sqlc-dev/teesql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlc-dev%2Fteesql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30202539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-06T23:08:16.471Z","updated_at":"2026-03-06T23:08:17.126Z","avatar_url":"https://github.com/sqlc-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# teesql\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/sqlc-dev/teesql.svg)](https://pkg.go.dev/github.com/sqlc-dev/teesql)\n\nA T-SQL parser for Go that produces JSON AST output compatible with Microsoft's [SqlScriptDOM](https://learn.microsoft.com/en-us/dotnet/api/microsoft.sqlserver.transactsql.scriptdom).\n\n## Installation\n\n```bash\ngo get github.com/sqlc-dev/teesql\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/sqlc-dev/teesql/parser\"\n)\n\nfunc main() {\n\tsql := \"SELECT id, name FROM users WHERE active = 1\"\n\n\tscript, err := parser.Parse(context.Background(), strings.NewReader(sql))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tjson, err := parser.MarshalScript(script)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(json))\n}\n```\n\nOutput:\n\n```json\n{\n  \"Batches\": [\n    {\n      \"Statements\": [\n        {\n          \"QueryExpression\": {\n            \"SelectElements\": [\n              {\"ColumnType\": 2, \"Identifier\": {\"Value\": \"id\"}},\n              {\"ColumnType\": 2, \"Identifier\": {\"Value\": \"name\"}}\n            ],\n            \"FromClause\": {\n              \"TableReferences\": [\n                {\"SchemaObject\": {\"BaseIdentifier\": {\"Value\": \"users\"}}}\n              ]\n            },\n            \"WhereClause\": {\n              \"SearchCondition\": {\n                \"FirstExpression\": {\"ColumnType\": 2, \"Identifier\": {\"Value\": \"active\"}},\n                \"ComparisonType\": 0,\n                \"SecondExpression\": {\"Value\": \"1\"}\n              }\n            }\n          }\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Using encoding/json\n\nYou can also use the standard library directly:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/sqlc-dev/teesql/parser\"\n)\n\nfunc main() {\n\tsql := \"SELECT 1\"\n\n\tscript, err := parser.Parse(context.Background(), strings.NewReader(sql))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tout, err := json.MarshalIndent(script, \"\", \"  \")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(string(out))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlc-dev%2Fteesql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlc-dev%2Fteesql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlc-dev%2Fteesql/lists"}