{"id":24084499,"url":"https://github.com/ilevd/hugsql-inline-plugin","last_synced_at":"2025-06-27T10:06:51.530Z","repository":{"id":63613070,"uuid":"569213777","full_name":"ilevd/hugsql-inline-plugin","owner":"ilevd","description":"Inline SQL parameters to SQL query string","archived":false,"fork":false,"pushed_at":"2022-11-26T07:34:54.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T20:19:23.645Z","etag":null,"topics":["clojure","hugsql","inline"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilevd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-22T10:33:11.000Z","updated_at":"2022-11-26T07:32:55.000Z","dependencies_parsed_at":"2023-01-23T00:16:10.477Z","dependency_job_id":null,"html_url":"https://github.com/ilevd/hugsql-inline-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ilevd/hugsql-inline-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilevd%2Fhugsql-inline-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilevd%2Fhugsql-inline-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilevd%2Fhugsql-inline-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilevd%2Fhugsql-inline-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilevd","download_url":"https://codeload.github.com/ilevd/hugsql-inline-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilevd%2Fhugsql-inline-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262235786,"owners_count":23279566,"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":["clojure","hugsql","inline"],"created_at":"2025-01-10T00:37:26.680Z","updated_at":"2025-06-27T10:06:51.487Z","avatar_url":"https://github.com/ilevd.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hugsql-inline-plugin\n\n[![Clojars Project](https://img.shields.io/clojars/v/org.clojars.ilevd/hugsql-inline-plugin.svg)](https://clojars.org/org.clojars.ilevd/hugsql-inline-plugin)\n\n[HoneySQL](https://github.com/seancorfield/honeysql#format) allows you to format the query as a \nstring with no parameters (e.g. to use the SQL statement in a SQL console) \nby passing `:inline true` as an option to sql/format:\n\n```clojure\n\n(sql/format {:select [:a :b :c]\n             :from   [:foo]\n             :where  [:= :foo.a \"baz\"]}\n            {:inline true})\n=\u003e \n[\"SELECT a, b, c FROM foo WHERE foo.a = 'baz'\"]\n```\n\nThe purpose of this plugin is to do the same for [HugSQL](https://github.com/layerware/hugsql).\n\nJust require the library in namespace to load it before using HugSQL:\n\n```clojure\n(ns yournamespace.core\n  (require [husql-inline-plugin.core]))\n```\n\nAnd use it with `:inline true` option: \n\n```clojure\n(hugsql/sqlvec \"SELECT :sql:sql, :i*:cols FROM table WHERE id IN (:v*:ids) AND t = :t:tuple AND ts = (:t*:tuple-list)\"\n               {:inline true}\n               {:sql        \"count()\"\n                :cols       [\"id\" \"name\"]\n                :ids        [10, 20, 30]\n                :key        :keyword\n                :tuple      [\"string\" true 104 nil]\n                :tuple-list [[1 \"a\"] [2 \"b\"]]})\n=\u003e\n[\"SELECT count(), id, name FROM table WHERE id IN (10,20,30) AND t = ('string',TRUE,104,NULL) AND ts = ((1,'a'),(2,'b'))\"]                \n```\n\nAnd without `:inline` option it would be: \n\n\n```clojure\n(hugsql/sqlvec \"SELECT :sql:sql, :i*:cols FROM table WHERE id IN (:v*:ids) AND t = :t:tuple AND ts = (:t*:tuple-list)\"\n               {:sql        \"count()\"\n                :cols       [\"id\" \"name\"]\n                :ids        [10, 20, 30]\n                :key        :keyword\n                :tuple      [\"string\" true 104 nil]\n                :tuple-list [[1 \"a\"] [2 \"b\"]]})\n=\u003e\n[\"SELECT count(), id, name FROM table WHERE id IN (?,?,?) AND t = (?,?,?,?) AND ts = ((?,?),(?,?))\"\n 10\n 20\n 30\n \"string\"\n true\n 104\n nil\n 1\n \"a\"\n 2\n \"b\"]            \n```\n\n## License\n\nCopyright © 2022 ilevd\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filevd%2Fhugsql-inline-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filevd%2Fhugsql-inline-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filevd%2Fhugsql-inline-plugin/lists"}