{"id":13836873,"url":"https://github.com/omeid/go-yarn","last_synced_at":"2026-01-06T00:55:45.496Z","repository":{"id":29322135,"uuid":"32855654","full_name":"omeid/go-yarn","owner":"omeid","description":"Embeddable filesystem mapped key-string store. Ideal for embedding code like sql, lua, et al.","archived":false,"fork":false,"pushed_at":"2019-10-15T00:42:18.000Z","size":22,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-05T15:05:22.565Z","etag":null,"topics":[],"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/omeid.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":"2015-03-25T09:44:28.000Z","updated_at":"2024-06-17T20:43:54.000Z","dependencies_parsed_at":"2022-09-20T10:55:19.858Z","dependency_job_id":null,"html_url":"https://github.com/omeid/go-yarn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omeid%2Fgo-yarn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omeid%2Fgo-yarn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omeid%2Fgo-yarn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omeid%2Fgo-yarn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omeid","download_url":"https://codeload.github.com/omeid/go-yarn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225647960,"owners_count":17502158,"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":[],"created_at":"2024-08-04T15:00:56.130Z","updated_at":"2026-01-06T00:55:45.488Z","avatar_url":"https://github.com/omeid.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/omeid/go-yarn?status.svg)](https://godoc.org/github.com/omeid/go-yarn) [![Coverage Status](https://coveralls.io/repos/omeid/go-yarn/badge.png)](https://coveralls.io/r/omeid/go-yarn) [![Build Status](https://drone.io/github.com/omeid/go-yarn/status.png)](https://drone.io/github.com/omeid/go-yarn/latest)\n# Yarn\nFilesystem mapped key-string store. Ideal for embedding code like sql.\n\n### Why?\nBecause programming in string literals sucks.\n\nLack of syntax highlighting, auto-completion, and other helpful tools when writing SQL or other programming languages make the task tedious and error prone, Yarn is here to help you pull your SQL strings into `*.sql` files and other code in appropriate files so you can use the right tools when coding.\n\n\n### Documentation\nSee the [GoDoc](https://godoc.org/github.com/omeid/go-yarn)\n\n\n### Example\n\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/omeid/go-yarn\"\n)\n\nvar sqls = yarn.Must(http.Dir(\"./sqls\"), \"*.sql\")\n\nfunc main() {\n\tsqls.MustHave(\"users_table.sql\", \"query_all.sql\", \"query_user.sql\") //Panics otherwise.\n\n    //Or the following if you're into that sort of stuff.\n    /*\n  \terr := sqls.Has(\"users_table.sql\", \"query_all.sql\", \"query_user.sql\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n    */\n\n\tres, err := sql.Exec(sqls.Must(\"users_table.sql\"), params...)\n\t//Just deal with it.\n}\n```\n\n#### _Moar_ Files to ship, Smack That, you say?\nDon't worry.  \nI hate complicated stuff too and there is a reason Yarn is using a Virtual Filesystem, http.FileSystem namely, to allow embedding!   \nYou can simply use [go-resources](https://github.com/omeid/go-resources) to embed all your sql and other codes files,\n\nMake sure you read the  _\"Live\" development of resources_ section for friction-free development.\n\n\n\n### Catalog\n\nIf you prefer to use a single file with chunks of code (e.g sql statements, lua functions, or so forth), please see the [catalog](catalog/README.md) pacakge.\n\n### Contributing\nPlease consider opening an issue first, or just send a pull request. :)\n\n### Credits\nSee [Contributors](https://github.com/omeid/go-yarn/graphs/contributors).  \nInspired by [smotes/purse](https://github.com/smotes/purse).\n\n### LICENSE\n  [MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomeid%2Fgo-yarn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomeid%2Fgo-yarn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomeid%2Fgo-yarn/lists"}