{"id":16163945,"url":"https://github.com/rawleyfowler/mojo-couchdb","last_synced_at":"2025-10-10T21:02:25.284Z","repository":{"id":178810672,"uuid":"661197865","full_name":"rawleyfowler/Mojo-CouchDB","owner":"rawleyfowler","description":"A Mojolicious wrapper for CouchDB connections","archived":false,"fork":false,"pushed_at":"2023-11-02T02:20:46.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T08:54:22.731Z","etag":null,"topics":["couchdb","mojolicious","perl"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rawleyfowler.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,"governance":null}},"created_at":"2023-07-02T05:11:24.000Z","updated_at":"2023-10-30T13:39:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ecdb440-3717-4c51-b743-c982b4f8aaac","html_url":"https://github.com/rawleyfowler/Mojo-CouchDB","commit_stats":null,"previous_names":["rawleyfowler/mojo-couchdb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawleyfowler%2FMojo-CouchDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawleyfowler%2FMojo-CouchDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawleyfowler%2FMojo-CouchDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rawleyfowler%2FMojo-CouchDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rawleyfowler","download_url":"https://codeload.github.com/rawleyfowler/Mojo-CouchDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595374,"owners_count":20963942,"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":["couchdb","mojolicious","perl"],"created_at":"2024-10-10T02:44:50.845Z","updated_at":"2025-10-10T21:02:20.248Z","avatar_url":"https://github.com/rawleyfowler.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mojo::CouchDB\n\nA Mojolicious wrapper around [Mojo::UserAgent](https://docs.mojolicious.org/Mojo/UserAgent) that makes using [CouchDB](https://couchdb.apache.org/) from\nPerl, a lot of fun.\n\n```perl\nuse Mojo::CouchDB;\n\n# Create a CouchDB instance\nmy $couch = Mojo::CouchDB-\u003enew('http://localhost:6984', 'username', 'password');\nmy $db = $couch-\u003edb('books');\n\n$db-\u003ecreate_db; # Create the database on the server\n\n# Make a document\nmy $book = {\n\ttitle =\u003e 'Nineteen Eighty Four',\n\tauthor =\u003e 'George Orwell'\n};\n\n# Save your document to the database\n$book = $db-\u003esave($book);\n\n# If _id is assigned to a hashref, save will update rather than create\nsay $book-\u003e{_id}; # Assigned when saving or getting\n$book-\u003e{title} = 'Dune';\n$book-\u003e{author} = 'Frank Herbert'\n\n# Re-save to update the document\n$book = $db-\u003esave($book);\n\n# Get the document as a hashref\nmy $dune = $db-\u003eget($book-\u003e{_id});\n\n# You can also save many documents at a time\nmy $books = $db-\u003esave_many([{title =\u003e 'book', author =\u003e 'John'}, { title =\u003e 'foo', author =\u003e 'bar' }])-\u003e{docs};\n```\n\n## Installation\n\n```bash\n$ cpanm Mojo::CouchDB\n```\n\n## Basics\n\nThis is an example of a [Mojolicious::Lite](https://docs.mojolicious.org/Mojolicious/Lite) application using\n[Mojo::CouchDB](#).\n\n```perl\nuse v5.36;\nuse Mojolicious::Lite -signatures;\nuse Mojo::CouchDB;\n\nmy $couch = Mojo::Couch-\u003enew('http://127.0.0.1:5984', 'username', 'password');\n\nhelper user_db =\u003e sub { state $user_db = $couch-\u003edb('users') };\n\nget '/:user' =\u003e sub {\n\tmy $c    = shift;\n\tmy $user = $c-\u003euser_db-\u003eget($c-\u003eparam('user'))\n\t\t|| return $c-\u003erendered(404);\n\treturn $c-\u003erender(json =\u003e $user);\n};\n\napp-\u003estart;\n```\n\nIt is recommended to use a helper when using Mojo::CouchDB with Mojolicious.\n\n## Author\n\nRawley Fowler\n\n## Credits\n\nSebastion Riedel (the creator of Mojolicious).\n\nThe Apache Foundation for making CouchDB.\n\n## Copyright and License\n\nCopyright (C) 2023, Rawley Fowler\n\nThis library is free software; you may distribute, and/or modify it under the terms of the Artistic License version 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawleyfowler%2Fmojo-couchdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frawleyfowler%2Fmojo-couchdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frawleyfowler%2Fmojo-couchdb/lists"}