{"id":17683040,"url":"https://github.com/shomali11/xsql","last_synced_at":"2025-05-12T14:12:49.708Z","repository":{"id":57515195,"uuid":"108474156","full_name":"shomali11/xsql","owner":"shomali11","description":"SQL Query Results Pretty Printing","archived":false,"fork":false,"pushed_at":"2019-06-08T14:15:02.000Z","size":9,"stargazers_count":34,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-12T14:12:44.033Z","etag":null,"topics":["pretty","pretty-print","sql","sql-format"],"latest_commit_sha":null,"homepage":"","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/shomali11.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}},"created_at":"2017-10-26T22:55:30.000Z","updated_at":"2025-03-09T04:19:06.000Z","dependencies_parsed_at":"2022-09-26T18:31:52.712Z","dependency_job_id":null,"html_url":"https://github.com/shomali11/xsql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fxsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fxsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fxsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shomali11%2Fxsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shomali11","download_url":"https://codeload.github.com/shomali11/xsql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253754220,"owners_count":21958842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["pretty","pretty-print","sql","sql-format"],"created_at":"2024-10-24T09:44:11.391Z","updated_at":"2025-05-12T14:12:49.682Z","avatar_url":"https://github.com/shomali11.png","language":"Go","readme":"# xsql [![Build Status](https://travis-ci.com/shomali11/xsql.svg?branch=master)](https://travis-ci.com/shomali11/xsql) [![Go Report Card](https://goreportcard.com/badge/github.com/shomali11/xsql)](https://goreportcard.com/report/github.com/shomali11/xsql) [![GoDoc](https://godoc.org/github.com/shomali11/xsql?status.svg)](https://godoc.org/github.com/shomali11/xsql) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nSQL Query Results Pretty Printing\n\n## Dependencies\n\n* `util` [github.com/shomali11/util](https://github.com/shomali11/util)\n\n# Examples\n\n## Example 1\n\n```go\npackage main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"github.com/shomali11/xsql\"\n\t\"log\"\n)\n\nconst (\n\tdataSourceFormat = \"user=%s password=%s dbname=%s sslmode=disable\"\n)\n\nfunc main() {\n\tdataSource := fmt.Sprintf(dataSourceFormat, \"\u003cUSERNAME\u003e\", \"\u003cPASSWORD\u003e\", \"\u003cDATABASE_NAME\u003e\")\n\tdb, err := sql.Open(\"\u003cDRIVER\u003e\", dataSource)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdefer db.Close()\n\n\trows, err := db.Query(\"SELECT * FROM test\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tresults, err := xsql.Pretty(rows)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(results)\n}\n```\n\nOutput:\n\n```\n id  |      name      |         title         |         created_at          | number | decimal | active\n-----+----------------+-----------------------+-----------------------------+--------+---------+--------\n   1 | Raed Shomali   | Sr. Software Engineer | 2017-10-24T20:59:43.37154Z  |     11 | 789.123 | true\n   2 | Dwayne Johnson | The Rock              | 2017-10-24T21:00:31.530534Z |   1000 |     3.7 | true\n 300 | Steve Austin   | Stone Cold            | 2017-10-26T19:42:51.993465Z |  55000 |   55.55 | false\n(3 rows)\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshomali11%2Fxsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshomali11%2Fxsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshomali11%2Fxsql/lists"}