{"id":20848363,"url":"https://github.com/gcv/cupboard","last_synced_at":"2025-05-12T02:32:30.189Z","repository":{"id":690839,"uuid":"335022","full_name":"gcv/cupboard","owner":"gcv","description":"Cupboard — an embedded database for Clojure","archived":false,"fork":false,"pushed_at":"2012-12-31T08:14:52.000Z","size":490,"stargazers_count":83,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-10T20:23:03.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/gcv.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":"2009-10-12T16:56:11.000Z","updated_at":"2022-12-09T09:26:51.000Z","dependencies_parsed_at":"2022-08-16T10:45:14.135Z","dependency_job_id":null,"html_url":"https://github.com/gcv/cupboard","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcv%2Fcupboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcv%2Fcupboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcv%2Fcupboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gcv%2Fcupboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gcv","download_url":"https://codeload.github.com/gcv/cupboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225116182,"owners_count":17423188,"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-11-18T02:25:42.877Z","updated_at":"2024-11-18T02:25:43.531Z","avatar_url":"https://github.com/gcv.png","language":"Clojure","funding_links":[],"categories":["数据库"],"sub_categories":["Spring Cloud框架"],"readme":"Cupboard is an embedded database library for Clojure, intended to make writing\nClojure objects to disk, and retrieving them, a relatively simple task. Cupboard\nis almost completely schemaless, supports unique and non-unique indices,\nquerying by one or more indices, and ACID transactional semantics.\n\nAt its lowest level, Cupboard uses Berkeley DB JE, and contains a fairly\ncomplete Clojure wrapper for the JE API. This API is available in the\n`cupboard.bdb.je` package; some projects may find this code useful on its\nown. The `cupboard.core` package provides a higher-level abstraction.\n\n\n\n## Sample Code\n\nThis code makes some struct-maps representing books, saves them into a database,\nand updates them.\n\n    (ns examples.cupboard.simple\n      (:use clojure.contrib.pprint)\n      (:require [cupboard.core :as cb])\n      (:use [cupboard.utils]))\n    \n    (cb/open-cupboard! \"/tmp/books\")\n    \n    (cb/defpersist book\n      ((:isbn :index :unique)\n       (:title :index :any)\n       (:author :index :any)))\n    \n    (cb/make-instance book [\"0393039854\", \"The First Folio\", \"Shakespeare, William\"])\n    (cb/make-instance book [\"0393925870\", \"The Canterbury Tales\", \"Chaucer\"])\n    (cb/make-instance book [\"143851557X\", \"Troilus and Criseyde\", \"Chaucer\"])\n    (cb/make-instance book [\"019280619X\", \"Paradise Lost\", \"Milton, John\"])\n    \n    (println \"this returns maps\")\n    (pprint (cb/query (starts-with :isbn \"039\")))\n    \n    (println \"this returns struct-map values\")\n    (pprint (cb/query (= :author \"Chaucer\") :struct book))\n    \n    (println \"this updates the :author slot\")\n    (cb/query (= :author \"Chaucer\")\n              :callback #(cb/passoc! % :author \"Chaucer, Geoffrey\"))\n    \n    (println \"this verifies that the update worked\")\n    (pprint (cb/query (starts-with :author \"Chaucer\")))\n    \n    (cb/close-cupboard!)\n\nThis example is available in `examples/examples/cupboard/simple.clj`.\n`examples/examples/cupboard/gutenberg.clj` uses a few more of Cupboard's features.\n\n\n\n## Dependencies\n\n* Clojure 1.4.0\n* Leiningen\n\n\n\n## Getting Started\n\nJust add `[cupboard \"1.0beta1\"]` to your `project.clj`. Alternatively, add the\nfollowing to your `pom.xml` file:\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecupboard\u003c/groupId\u003e\n      \u003cartifactId\u003ecupboard\u003c/artifactId\u003e\n      \u003cversion\u003e1.0beta1\u003c/version\u003e\n    \u003c/dependency\u003e\n\n\n\n## Documentation\n\nCupboard's documentation is still a work in progress. Please refer to the `doc`\ndirectory in the source distribution.\n\n\n\n## License\n\nCupboard is distributed under the MIT license, and so has few restrictions\nitself. Its Berkeley DB dependency, however, is licensed by Oracle \u0026mdash; see\n[Oracle's Berkeley DB Licensing Information\npage](http://www.oracle.com/technology/software/products/berkeley-db/htdocs/licensing.html)\nfor details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcv%2Fcupboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgcv%2Fcupboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgcv%2Fcupboard/lists"}