{"id":16447264,"url":"https://github.com/junekelly/clj-bedquilt","last_synced_at":"2025-07-22T08:02:58.518Z","repository":{"id":16937956,"uuid":"19699810","full_name":"JuneKelly/clj-bedquilt","owner":"JuneKelly","description":"A JSON store on PostgreSQL","archived":false,"fork":false,"pushed_at":"2014-09-28T12:07:07.000Z","size":368,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T11:44:15.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/JuneKelly.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":"2014-05-12T13:30:48.000Z","updated_at":"2014-09-28T12:16:58.000Z","dependencies_parsed_at":"2022-07-26T11:32:03.084Z","dependency_job_id":null,"html_url":"https://github.com/JuneKelly/clj-bedquilt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JuneKelly/clj-bedquilt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fclj-bedquilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fclj-bedquilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fclj-bedquilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fclj-bedquilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuneKelly","download_url":"https://codeload.github.com/JuneKelly/clj-bedquilt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuneKelly%2Fclj-bedquilt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266454595,"owners_count":23931331,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-10-11T09:50:14.148Z","updated_at":"2025-07-22T08:02:58.405Z","avatar_url":"https://github.com/JuneKelly.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bedquilt\n\nA JSON document store on top of PostgreSQL, using Clojure.\n\n## Usage\n\nLets presume we have a PostgreSQL 9.3 installation, with a database\n`bedquilt_test`, created as:\n```sql\nCREATE DATABASE bedquilt_test\n  WITH OWNER = some_user\n       ENCODING = 'UTF8'\n       TABLESPACE = pg_default\n       LC_COLLATE = 'C'\n       LC_CTYPE = 'C'\n       CONNECTION LIMIT = -1\n       TEMPLATE template0;\n```\n\n\nImport the `bedquilt.core` namespace:\n```clojure\n(require '[bedquilt.core :as bq])\n```\n\nGet a connection to a database:\n```clojure\n(def db (bq/get-db {:db-host \"localhost\"\n                    :db-name \"bedquilt_test\"\n                    :user \"some_user\"\n                    :password \"password\"}))\n```\n\nInsert some documents:\n```clojure\n(bq/save! db :people {:name \"John Doe\", :age 27})\n; =\u003e \"Xj0VokRuU05wSLzBrMyfvQ\"\n\n(bq/save! db :people {:name \"Jane Roe\", :age 31, :likes [\"baseball\", \"music\"]})\n; =\u003e \"7FhRRcD0D5253Mm6woyN5Q\"\n```\nNew collections (tables) are automatically created on first write.\n\nIds are automatically generated, unless the document includes an `_id` field:\n```clojure\n(bq/save! db :people {:_id \"mike.blow@example.com\" :name \"Mike Blow\", :age 53})\n; =\u003e \"mike.blow@example.com\"\n```\n\nQuery for existing documents by their `_id` field:\n```clojure\n(bq/find-one db :people \"mike.blow@example.com\")\n; =\u003e {:_id \"mike.blow@example.com\", :name \"Mike Blow\", :age 53}\n```\n\n\nDelete existig documents:\n```clojure\n(bq/delete! db :people \"mike.blow@example.com\")\n; =\u003e true\n```\n\n## Tests\nTo run the test suite, first set up a test database\nand set the following environment variables:\n- `DB_HOST`\n- `DB_NAME`\n- `DB_USER`\n- `DB_PASSWORD`\n\nThen run `lein spec`\n\n\n## Warning!\n- This is alpha-quality work right now, don't use in production\n- The performance is pretty bad, I'll figure out how to make in not suck later\n- Currently there is no API for querying based on the contents\n  of the JSON documents. We're working on it.\n\n\n## License\n\nCopyright © 2014 Shane Kilkelly\n\nMIT License, do whatever you want.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunekelly%2Fclj-bedquilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunekelly%2Fclj-bedquilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunekelly%2Fclj-bedquilt/lists"}