[Couchdb Wiki] Update of "FrontPage" by JoanTouzet
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification. The "FrontPage" page has been changed by JoanTouzet: https://wiki.apache.org/couchdb/FrontPage?action=diff=149=150 = Apache CouchDB = - '''This entire wiki is deprecated. Do not trust ANY information you find here as it is all likely seriously out of date or inaccurate.''' + '''This entire wiki is deprecated. Do not trust ANY information you may still find here as it is most likely seriously out of date or inaccurate.''' - '''For documentation of the Apache CouchDB program itself, see:''' https://docs.couchdb.org/ + '''For the official Apache CouchDB documentation, see:''' https://docs.couchdb.org/ - '''For information about project management of Apache CouchDB, some pages have migrated to:''' https://cwiki.apache.org/confluence/display/COUCHDB/ + '''For information about project management of Apache CouchDB, client libraries, or pages of historical note, visit:''' https://cwiki.apache.org/confluence/display/COUCHDB/ == Apache Foundation == * [[http://www.apache.org/foundation/thanks.html|Apache Foundation Sponsors!]]
[Couchdb Wiki] Update of "EntityRelationship" by JoanTouzet
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification. The "EntityRelationship" page has been changed by JoanTouzet: https://wiki.apache.org/couchdb/EntityRelationship?action=diff=23=25 - <> + Moved to http://docs.couchdb.org/en/stable/ddocs/views/nosql.html - = Modeling Entity Relationships in CouchDB = - <> - - This page is mostly a translation of Google's [[http://code.google.com/appengine/articles/modeling.html|Modeling Entity Relationships]] article in CouchDB terms. It could use more code examples and more examples of actual output. Since this is a wiki, feel free to update this document to make things clearer, fix inaccuracies etc. This article is also related to [[http://wiki.apache.org/couchdb/Transaction_model_use_cases|Transaction model use cases]] discussion, as it involves multiple document updates. - - As a quick summary, this document explains how to do things that you would normally use SQL JOIN for. - - == Why would I need entity relationships? == - Imagine you are building a snazzy new web application that includes an address book where users can store their contacts. For each contact the user stores, you want to capture the contacts name, birthday (which they mustn't forget!) their address, telephone number and company they work for. When the user wants to add an address, they enter the information in to a form and the form saves the information in a model that looks something like this: - - {{{#!highlight javascript - { - "_id":"some unique string that is assigned to the contact", - "type":"contact", - "name":"contact's name", - "birth_day":"a date in string form", - "address":"the address in string form (like 1600 Ampitheater Pkwy., Mountain View, CA)", - "phone_number":"phone number in string form", - "company_title":"company title", - "company_name":"name of the company", - "company_description":"some explanation about the company", - "company_address":"the company address in string form" - } - }}} - (Note that ''type'' doesn't mean anything to CouchDB, we're just using it here for our own convenience. ''_id'' is the only thing CouchDB looks at) - - That's great, your users immediately begin to use their address book and soon the datastore starts to fill up. Not long after the deployment of your new application you hear from someone that they are not happy that there is only one phone number. What if they want to store someone's work telephone number in addition to their home number? No problem you think, you can just add a work phone number to your structure. You change your data structure to look more like this: - - {{{ - "phone_number":"home phone in string form", - "work_phone_number":"work phone in string form", - }}} - Update the form with the new field and you are back in business. Soon after redeploying your application, you get a number of new complaints. When they see the new phone number field, people start asking for even more fields. Some people want a fax number field, others want a mobile field. Some people even want more than one mobile field (boy modern life sure is hectic)! You could add another field for fax, and another for mobile, maybe two. What about if people have three mobile phones? What if they have ten? What if someone invents a phone for a place you've never thought of? Your model needs to use relationships. - - == One to Many == - The answer is to allow users to assign as many phone numbers to each of their contacts as they like. - - In CouchDB, there are 2 ways to achieve this. - - 1. Use separate documents - 1. Use an embedded array - - === One to Many: Separate documents === - When using separate documents, you could have documents like this for the phone numbers: - - {{{#!highlight javascript - { - "_id":"the phone number", - "type":"phone", - "contact_id":"id of the contact document that has this phone number", - "phone_type":"string describing type of phone, like home,work,fax,mobile,..." - } - }}} - (Note the use of the ''_id'' field to store the phone number. Phone numbers are unique (when prefixed with country and area code) and therefore this makes a great ''natural key'') - - The key to making all this work is the contact property. By storing the contact id in it, you can refer to the owning contact in a unique way, since ''_id'' fields are unique in CouchDB databases. - - Creating the relationship between a contact and one of its phone numbers is easy to do. Let's say you have a contact named "Scott" who has a home phone and a mobile phone. You populate his contact info like this (using Perl and Net::CouchDB): - - {{{#!highlight perl - $db->insert({type => 'contact', _id => 'Scott', name => 'My Friend Scott'}); - $db->insert({type => 'phone', _id => '(650) 555 - 2200', contact_id => 'Scott', phone_type => 'home'}); - $db->insert({type => 'phone', _id => '(650) 555 - 2201', contact_id =>
[Couchdb Wiki] Update of "EntityRelationship" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "EntityRelationship" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/EntityRelationship?action=diff=25=26 Comment: Moved to http://docs.couchdb.org/en/stable/ddocs/views/nosql.html - Moved to http://docs.couchdb.org/en/stable/ddocs/views/nosql.html
[Couchdb Wiki] Update of "FUQ" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "FUQ" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/FUQ?action=diff=12=13 Comment: Migrated fully to https://docs.couchdb.org/en/latest - <> - = Frequently Unasked Questions = - On IRC and the Mailing List, these are the Questions People should have asked to help them stay Relaxed. - - <> - - == Documents == - - 1. What is the benefit of using the _bulk_docs API instead of PUTting single documents to CouchDB? - . Aside from the HTTP overhead and roundtrip you are saving, the main advantage is that CouchDB can handle the B tree updates more efficiently, decreasing rewriting of intermediary and parent nodes, both improving speed and saving disk space. - - 1. Why can't I use MVCC in CouchDB as a revision control system for my docs? - . The revisions CouchDB stores for each document are removed when the database is compacted. The database may be compacted at any time by a DB admin to save hard drive space. If you were using those revisions for document versioning, you'd lose them all upon compaction. In addition, your disk usage would grow with every document iteration and (if you prevented database compaction) you'd have no way to recover the used disk space. - - 1. Does compaction remove deleted documents’ contents? - . We keep the latest revision of every document ever seen, even if that revision has '"_deleted":true' in it. This is so that replication can ensure eventual consistency between replicas. Not only will all replicas agree on which documents are present and which are not, but also the contents of both. - - . Deleted documents specifically allow for a body to be set in the deleted revision. The intention for this is to have a "who deleted this" type of meta data for the doc. Some client libraries delete docs by grabbing the current object blob, adding a '"_deleted":true' member, and then sending it back which inadvertently (in most cases) keeps the last doc body around after compaction. - - == Views == - 1. In a view, why should I not {{{emit(key,doc)}}} ? - - . The key point here is that by emitting {{{,doc}}} you are duplicating the document which is already present in the database (a .couch file), and including it in the results of the view (a .view file, with similar structure). This is the same as having a SQL Index that includes the original table, instead of using a foreign key. - - The same effect can be acheived by using {{{emit(key,null)}}} and ?include_docs=true with the view request. This approach has the benefit of not duplicating the document data in the view index, which reduces the disk space consumed by the view. On the other hand, the file access pattern is slightly more expensive for CouchDB. It is usually a premature optimization to include the document in the view. As always, if you think you may need to emit the document it's always best to test. - - == Tools == - 1. I decided to roll my own !CouchApp tool or CouchDB client in . How cool is that? - - . Pretty cool! In fact its a great way to get familiar with the API. However - wrappers around the HTTP API are not necessarily of great use as CouchDB already makes this very easy. Mapping CouchDB semantics onto your language's native data structures is much more useful to people. Many languages are already covered and we'd really like to see your ideas and enhancements incorporated into the existing tools if possible, and helping to keep them up to date. Ask on the mailing list about contributing! - - == Log Files == - 1. Those Erlang messages in the log are pretty confusing. What gives? - . While the Erlang messages in the log can be confusing to someone unfamiliar with Erlang, with practice they become very helpful. The CouchDB developers do try to catch and log messages that might be useful to a system administrator in a friendly format, but occassionally a bug or otherwise unexpected behavior manifests itself in more verbose dumps of Erlang server state. These messages can be very useful to CouchDB developers. If you find many confusing messages in your log, feel free to inquire about them. If they are expected, devs can work to ensure that the message is more cleanly formatted. Otherwise, the messages may indicate a bug in the code. - In many cases, this is enough to identify the problem. For example, OS errors are reported as tagged tuples error,enospc or error,enoacces which respectively is "You ran out of disk space", and "CouchDB doesn't have permission to access that resource". Most of these errors are derived from C used to build the Erlang VM and are documented in {{{errno.h}}} and related header files. [[http://www.ibm.com/developerworks/aix/library/au-errnovariable/|IBM]] provides a good introduction to these, and the relevant
[Couchdb Wiki] Update of "CouchHack_April_2009" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchHack_April_2009" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchHack_April_2009?action=diff=17=18 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/CouchHack+April+2009 - CouchHack is small CouchDB hacker event planned for April 19th - 22nd in Asheville NC. - We will be renting a house for hacking, playing video games, building sofa forts and crashing. Anyone who wants to hack on or with CouchDB is welcome to come. Beds in the house are limited, first come first serve - - Current Hackers: - - * Jan Lehnardt - attending 19th - 21. Interested in linking against Mac OS X ICU, Erlang View Server, partial replication -- Teaching CouchDB - * J. Chris Anderson - attending 19 - 22 - Interested in Partitioning / Clustering, and p2p messaging CouchApp development. - * Damien Katz - attending 19 - 22. Interested in JSearch/FT Indexing support, and working on third party apps. - * Paul Davis - attending 19 - 22. External indexing integration. Another project TBA. - * Benjamin Young - attending the 20th (at least). Interested in hosting, management, and CouchDB as a CMS content repo replacement for MySQL (et al). - * Brad Anderson - attending 19 - 21. Partitioning / Clustering, Erlang View Server - - We will mostly be working on CouchDB related stuff, some of it core to CouchDB, some of it external projects involving CouchDB. - - Want to influence CouchDB but can't come? Consider becoming a CouchHack sponsor and help pay for the house or travel expenses. - - If you are interested in hacking or sponsoring, contact Jan Lehnardt j...@apache.org. - - List of [[CouchHack_April_2009_Sponsors]]. - - === CouchDB Work Done at CouchHack - - * Split `main.js` out into lots of little file. (And then Jan taught me how Makefile work) - * Adding a batch PUT mode (which delays commit so that we can do a bulk index update) -
[Couchdb Wiki] Update of "CouchCamp2010" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchCamp2010" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchCamp2010?action=diff=9=10 Comment: Migrated to https://cwiki.apache.org/confluence/display/COUCHDB/CouchCamp+2010 - All info about CouchCamp is accessible here: - http://www.couch.io/couchcamp - - A few speakers have been invited to speak but the majority of the time will be "unconference" style group participation and discussion. - - = Unconference Whiteboard = - - this space is in intended to serve as a space to flush out ideas for group discussions. people should feel free to add comments and questions to any section. - - === CouchDB on mobile === - - What phones/devices are/can be targeted? - Alternate implementations or ports of the current Apache (erlang) CouchDB? - - === HTML5 CouchDB === - - IndexedDatabase and IDBCouch. - WebStorage. - - === CouchDB and the web security model === - - What do we need to do to allow CouchApps to play in the web sandbox. Eg if I'm running a banking CouchApp and a chat CouchApp, and the chat CouchApp has a bug that allows the person you are chatting with to inject HTML/JS into your browser, how do we keep that from being a vector for attack on your banking data? - - === Ideas and priorities for CouchDB 2.0 === - - Now that we're releasing 1.0, it's time to think about what the next 5 years of CouchDB development will bring. Alternate indexers? Binary attachment storage options? Refactoring to use web-machine? Of course, real decisions will be made on the dev@ list, but there's nothing like a campfire and some beers to get the ideas flowing. - -* Replaceable storage (e.g., use ets for transient database documents) - -* Realtime interactions with live db or filtered replica - * Filtered replication to diskless copy (data discovery via filtering) - * Browsing JSON document structure to discern data patterns (auto-documentation) - * Statistics of db contents (interactive mapreduce) - * Sandbox of real document subset - * iterative code development - * testing - * error reproduction - -* A model of error handling with the goal of conveying information to the user - -* Command-line JSON-aware tools tuned to Couch interfaces - - === GeoCouch and why it rules === - - Once you add some location information to your documents, you can ask your GeoCouch to give you a list of documents that are located in an area. Let's talk about how to integrate geo data into your applications, and why bringing CouchDB to the GIS world is important. - - === All about BigCouch === - - [[http://github.com/cloudant/bigcouch|BigCouch]] is a highly-available clustering and sharding system for CouchDB built by the folks at Cloudant. We'll talk about the design choices behind the project, demo a local Big``Couch cluster, and chat about where the project is headed. - - === How to contribute to CouchDB === - - Want to help with CouchDB, but need some hints on getting started? We'll give a tour of the codebase and show you how to find and fix bugs in the Erlang implementation. Also you can do a lot to help CouchDB, just by writing JavaScript, so we'll show you that too. Hopefully this will demystify the codebase, and you can start hacking on CouchDB. -
[Couchdb Wiki] Update of "CouchIn15Minutes" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchIn15Minutes" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchIn15Minutes?action=diff=7=8 Comment: See http://docs.couchdb.org/en/stable/intro/index.html - <> - = Couch DB Quick Start = - - (Tested with 0.9.0 on [[http://www.ubuntu/org'|Ubuntu]], wikified from my [[http://www.jroller.com/robertburrelldonkin/entry/couchdb_in_15_minutes|blog]]) - - == Install (very basic) == - 1. [[http://couchdb.apache.org/downloads.html|Download]], unpackage and cd to the directory - 1. Read the README then follow the instructions (for Unbuntu, use [[http://dbpedia.org/page/Debian|Debian]]) - 1. (Ubuntu) Remember to apt-get the require libraries before building - 1. Start Couch from the command line and check everything looks good - - == Create a new Database == - 1. Create new database - 1. Browse http://localhost:5984/_utils/ - 1. Click "Create Database" - 1. Enter "example" - - == "Hello, World!" (of course) == - 1. Now for "Hello, World!" - 1. Couch is RESTful so you'll need a HTTP client. These instructions are for telnet (those who dislike the command line could use [[http://localhost:5984/_utils/database.html?example/_design_docs|futon]] or, if you're using Mac OS X, [[http://ditchnet.org/httpclient/|HTTPClient]]). - 1. Type: {{{$ telnet localhost 5984}}} - 1. Response: {{{ - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'.}}} - 1. CutNPaste: {{{ - PUT /example/some_doc_id HTTP/1.0 - Content-Length: 29 - Content-Type: application/json - - {"greetings":"Hello, World!"} }}} - 1. Response: {{{ - HTTP/1.0 201 Created - Server: CouchDB/0.9.0 (Erlang OTP/R12B) - Etag: "1-518824332" - Date: Wed, 24 Jun 2009 13:33:11 GMT - Content-Type: text/plain;charset=utf-8 - Content-Length: 51 - Cache-Control: must-revalidate - - {"ok":true,"id":"some_doc_id","rev":"1-518824332"} - Connection closed by foreign host.}}} - 1. Browse http://localhost:5984/example/some_doc_id to see {{{ - {"_id":"some_doc_id","_rev":"1-518824332","greetings":"Hello, World!"} }}} - - == Document creation recap == - 1.Huh? - 1. Couch is a RESTful so to create a document PUT (as above) or POST - 1. Couch uses a JSON API. So PUT a document as JSON and GET results as JSON - 1. To view the data, use a view (Doh!) - 1. Each document has a unique "_id" - 1. Each document is versioned with a "_rev" - - == Create a View and...view it == - 1. Relax and take a look at the view - 1. (Well, actually I'm going to use a "show" but it'll demonstrate the flavour) - 1. Again {{{ - $ telnet localhost 5984 - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'. - PUT /example/_design/render HTTP/1.0 - Content-Length: 77 - Content-Type: application/json - - {"shows" : {"salute" : "function(doc, req) {return {body: doc.greetings}}"}} }}} - 1. Response: {{{ - HTTP/1.0 201 Created - Server: CouchDB/0.9.0 (Erlang OTP/R12B) - Etag: "1-2041852709" - Date: Wed, 01 Jul 2009 06:08:59 GMT - Content-Type: text/plain;charset=utf-8 - Content-Length: 55 - Cache-Control: must-revalidate - - {"ok":true,"id":"_design/render","rev":"1-2041852709"} - Connection closed by foreign host. }}} - 1. Browse http://localhost:5984/example/_design/render/_show/salute/some_doc_id - - == Summary of what a View is and does == - 1. What Just Happened? - 1. A "show" directly renders a document using JavaScript - 1. "Shows" are added to a design document (in this case "/_design/render" via the "shows" property) - 1. "body: doc.greetings" fills the response body with the "greetings" property - 1. GET _design/render/_show/salute/some_doc_id to use the "salute" show to render the "some_doc_id" document added above -
[Couchdb Wiki] Update of "CouchHack_April_2009_Sponsors" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchHack_April_2009_Sponsors" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchHack_April_2009_Sponsors?action=diff=4=5 Comment: Migrated to https://cwiki.apache.org/confluence/display/COUCHDB/CouchHack+April+2009 - Big thanks to the CouchHack April 2009 Sponsors! - [[http://www.bigbluehat.com/|{{http://wiki.apache.org/couchdb-data/attachments/CouchHack_April_2009_Sponsors/attachments/bigbluehat.png}}]] - <>'''web manufacturing company''' - - We are impressed by CouchDB's use of "pure" web technologies, and are considering CouchDB for a future backend for our [[http://www.blueinkcms.com/|BlueInk]] Content Management System. - - [[http://cybernetics.hudora.biz/|{{http://i.hdimg.net/480x320/MF35ZEBY4Z5RVWBCZ47O3PMEWSLGPZK701.jpeg}}]] - <>'''Hudora Cybernetics''' - - We run [[http://blogs.23.nu/c0re/topics/couchdb/|some]] major infrastructure in our company with CouchDB backends - e.g. the image above is served from a CouchDB instance. We are gratefull to the superb CouchDB team and wish them happy hacking! - - (If you are a sponsor, feel free to add yourself with any promotional links you see fit). -
[Couchdb Wiki] Update of "CouchHack" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchHack" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchHack?action=diff=2=3 Comment: Migrated to https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=39621775=contextnavchildmode - CouchHack is a CouchDB hacker event. - * [[CouchHack_April_2009]] -
[Couchdb Wiki] Update of "CouchDB_meetups" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchDB_meetups" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchDB_meetups?action=diff=3=4 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Meetups - This page has moved to: https://cwiki.apache.org/confluence/display/COUCHDB/Meetups
[Couchdb Wiki] Update of "ConfiguringDistributedSystems" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ConfiguringDistributedSystems" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ConfiguringDistributedSystems?action=diff=6=7 Comment: Migrated to http://docs.couchdb.org/en/stable/cluster/index.html - #redirect Configuring_distributed_systems - This is a stub for a page to discuss how to actually get couchdb running in a distributed fashion. - Distributed CouchDB implementations: - - * CouchDB currently scales for reads, by allowing synchronization between multiple servers. - - * CouchDB does not currently support partitioning. - - (couch-dev post from Jan Lehnardt - July 2008) - {{{ - At the moment, CouchDB runs best on a single machine - with multiple machines for a cluster using replication to - synchronise data. Erlang allows a VM to run on multiple - machines and we do not yet take advantage of that fact. - This is an area that is worth investigating. - - The road map is at http://incubator.apache.org/couchdb/roadmap.html - - ... scaling parts are Future Feature work. - A couple of people have voiced interest in contributing there - especially the database partitioning, but nothing has come - out of that yet. - }}} - - == Editorial Notes == - - * I see that there is replication via the 'replication' functionality on the http://localhost:5984/_utils console interface, but how does one distribute a database across, say 10 hosts? - * Is there a way to specify the number of copies of a piece of data? (Presumes not all hosts have copies of each piece of data) - * Is there a piece of this that can be configured in the couch.ini file, such than when the topology changes (ie. server add or removal) that things can be put back into sync? - - Excerpts from the Architectural Document, http://incubator.apache.org/couchdb/docs/overview.html : - - {{{ - Using just the basic replication model, many traditionally single server database applications can be made distributed with almost no extra work. - }}} - - * Let's try to document this. What do we mean by '''distributed'''? - - === Distributed defined === - - Here's what some people might ''assume'' we mean by distributed data store: - - * We (couchdb) have a client which will '''shard''' the data by key, and direct it to the correct server (shard), such that the writes of the system will '''scale'''. That is that there are many ''writers'', in a collision-free update environment. - * Reads may scale if they outnumber the writes using some form of replication for read-only-clients. - * If a master data store node is lost, then the client (or some proxy mechanism) can switch over to a new master data store, which is ''really up to date'' (ie. milliseconds), and the client will continue without a hitch. -
[Couchdb Wiki] Update of "Configuring_distributed_systems" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Configuring_distributed_systems" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Configuring_distributed_systems?action=diff=4=5 Comment: CouchDB 2.x is distributed; see http://docs.couchdb.org/en/stable/cluster/index.html - <> - This is a stub for a page to discuss how to actually get couchdb running in a distributed fashion. - - Distributed CouchDB implementations: - - * CouchDB currently scales for reads, by allowing synchronization between multiple servers. - - * CouchDB does not currently support partitioning. - - (couch-dev post from Jan Lehnardt - July 2008) - {{{ - At the moment, CouchDB runs best on a single machine - with multiple machines for a cluster using replication to - synchronise data. Erlang allows a VM to run on multiple - machines and we do not yet take advantage of that fact. - This is an area that is worth investigating. - - The road map is at https://issues.apache.org/jira/browse/COUCHDB?report=com.atlassian.jira.plugin.system.project:roadmap-panel - - ... scaling parts are Future Feature work. - A couple of people have voiced interest in contributing there - especially the database partitioning, but nothing has come - out of that yet. - }}} - - == Editorial Notes == - - * I see that there is replication via the 'replication' functionality on the http://localhost:5984/_utils console interface, but how does one distribute a database across, say 10 hosts? - * Is there a way to specify the number of copies of a piece of data? (Presumes not all hosts have copies of each piece of data) - * Is there a piece of this that can be configured in the couch.ini file, such than when the topology changes (ie. server add or removal) that things can be put back into sync? - - Excerpts from the Architectural Document, http://incubator.apache.org/couchdb/docs/overview.html : - - {{{ - Using just the basic replication model, many traditionally single server database applications can be made distributed with almost no extra work. - }}} - - * Let's try to document this. What do we mean by '''distributed'''? - - === Distributed defined === - - Here's what some people might ''assume'' we mean by distributed data store: - - * We (couchdb) have a client which will '''shard''' the data by key, and direct it to the correct server (shard), such that the writes of the system will '''scale'''. That is that there are many ''writers'', in a collision-free update environment. - * Reads may scale if they outnumber the writes using some form of replication for read-only-clients. - * If a master data store node is lost, then the client (or some proxy mechanism) can switch over to a new master data store, which is ''really up to date'' (ie. milliseconds), and the client will continue without a hitch. -
[Couchdb Wiki] Update of "ErlInitDebug" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ErlInitDebug" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ErlInitDebug?action=diff=1=2 Comment: Migrated to http://docs.couchdb.org/en/stable/install/troubleshooting.html - If CouchDB doesn't start up early on in it's launch, it's useful for developers to see the messy details of what is going on. - Firstly ensure that CouchDB is set to log at debug level in your system's {{{local.ini}}}: - - {{{ - [log] - level = debug - }}} - - Then you'll need to know where your platform stores its couchdb libraries, easiest by checking output of {{{grep ERL_LIBS `which couchdb`}}} and adapting this as required. You should only run these commands as the user account that CouchDB will actually run as, to avoid breaking permissions for subsequent runs: - - {{{ - erl -env ERL_LIBS $ERL_LIBS:/usr/local/Cellar/couchdb/1.3.x/lib/couchdb/erlang/lib -couch_ini -init_debug -emu_args -smp auto +W i +v -s couch - }}} - - The output will be similar to this, for a working system: - - {{{ - Executing: /usr/local/Cellar/erlang/R16B/lib/erlang/erts-5.10.1/bin/beam.smp /usr/local/Cellar/erlang/R16B/lib/erlang/erts-5.10.1/bin/beam.smp -W i -v -- -root /usr/local/Cellar/erlang/R16B/lib/erlang -progname erl -- -home /Users/dch -- -couch_ini -init_debug -smp auto -s couch - - warning: -v (only in debug compiled code) - {progress,preloaded} - {progress,kernel_load_completed} - {progress,modules_loaded} - {start,heart} - {start,error_logger} - {start,application_controller} - {progress,init_kernel_started} - {apply,{application,load,[{application,stdlib,[{description,"ERTS CXC 138 10"},{vsn,"1.19.1"},{id,[]},{modules,[array,base64,beam_lib,binary,c,calendar,dets,dets_server,dets_sup,dets_utils,dets_v8,dets_v9,dict,digraph,digraph_utils,edlin,edlin_expand,epp,eval_bits,erl_bits,erl_compile,erl_eval,erl_expand_records,erl_internal,erl_lint,erl_parse,erl_posix_msg,erl_pp,erl_scan,erl_tar,error_logger_file_h,error_logger_tty_h,escript,ets,file_sorter,filelib,filename,gb_trees,gb_sets,gen,gen_event,gen_fsm,gen_server,io,io_lib,io_lib_format,io_lib_fread,io_lib_pretty,lib,lists,log_mf_h,math,ms_transform,orddict,ordsets,otp_internal,pg,pool,proc_lib,proplists,qlc,qlc_pt,queue,random,re,sets,shell,shell_default,slave,sofs,string,supervisor,supervisor_bridge,sys,timer,unicode,win32reg,zip]},{registered,[timer_server,rsh_starter,take_over_monitor,pool_master,dets]},{applications,[kernel]},{included_applications,[]},{env,[]},{maxT,infinity},{maxP,infinity}]}]}} - {progress,applications_loaded} - {apply,{application,start_boot,[kernel,permanent]}} - Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace] - - {apply,{application,start_boot,[stdlib,permanent]}} - {apply,{c,erlangrc,[]}} - {progress,started} - Eshell V5.10.1 (abort with ^G) - 1> - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - supervisor: {local,sasl_safe_sup} - started: [{pid,<0.48.0>}, -{name,alarm_handler}, -{mfargs,{alarm_handler,start_link,[]}}, -{restart_type,permanent}, -{shutdown,2000}, -{child_type,worker}] - - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - supervisor: {local,sasl_safe_sup} - started: [{pid,<0.49.0>}, -{name,overload}, -{mfargs,{overload,start_link,[]}}, -{restart_type,permanent}, -{shutdown,2000}, -{child_type,worker}] - - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - supervisor: {local,sasl_sup} - started: [{pid,<0.47.0>}, -{name,sasl_safe_sup}, -{mfargs, -{supervisor,start_link, -[{local,sasl_safe_sup},sasl,safe]}}, -{restart_type,permanent}, -{shutdown,infinity}, -{child_type,supervisor}] - - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - supervisor: {local,sasl_sup} - started: [{pid,<0.50.0>}, -{name,release_handler}, -{mfargs,{release_handler,start_link,[]}}, -{restart_type,permanent}, -{shutdown,2000}, -{child_type,worker}] - - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - application: sasl - started_at: nonode@nohost - - =PROGRESS REPORT 21-Mar-2013::10:29:05 === - supervisor: {local,inets_sup} - started: [{pid,<0.56.0>}, -{name,ftp_sup}, -{mfargs,{ftp_sup,start_link,[]}}, -{restart_type,permanent}, -
[Couchdb Wiki] Update of "FrequentlyAskedQuestions" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "FrequentlyAskedQuestions" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/FrequentlyAskedQuestions?action=diff=21=22 Comment: Migrated to https://docs.couchdb.org/ - #redirect Frequently_asked_questions - ## page was renamed from FAQ - ## page was renamed from Faq - A handy FAQ for all your CouchDB related questions. - * [[#what_is_couchdb|What is CouchDB?]] - * [[#is_couchdb_ready_for_production|Is CouchDB Ready for Production?]] - * [[#what_does_couch_mean|What Does Couch Mean?]] - * [[#what_language|What Language is CouchDB Written in?]] - * [[#what_platform|What Platforms are Supported?]] - * [[#what_license|What is the License?]] - * [[#how_much_stuff|How Much Stuff can I Store in CouchDB?]] - * [[#how_sequences|How Do I Do Sequences?]] - * [[#how_replication|How Do I Use Replication?]] - * [[#how_spread_load|How can I spread load across multiple nodes?]] - * [[#how_fast_views|How Fast are CouchDB Views?]] - * [[#why_no_mnesia|Why Does CouchDB Not Use Mnesia?]] - * [[#i_can_has_no_http|Can I talk to CouchDB without going through the HTTP API?]] - * [[#update_views_more_often|I want to update my view indexes more often than only when a user reads it. How do I do that best?]] - * [[#secure_remote_server|I use CouchDB on a remote server and I don't want it to listen on a public port for security reasons. Is there a way to connect to it from my local machine or can I still use Futon with it?]] - * [[#slow_view_building|Creating my view index takes ages, WTF?]] - - If you have a question not yet answered in this FAQ please hit the edit button and add your question at the end. Check back in a few days, someone may have provided an answer. - - <> - == What is CouchDB? == - - CouchDB is a document-oriented, Non-Relational Database Management Server (NRDBMS). The [[http://incubator.apache.org/couchdb/docs/intro.html|Introduction]] and [[http://incubator.apache.org/couchdb/docs/overview.html|Overview]] provide a high level overview of the CouchDB system. - - <> - == Is CouchDB Ready for Production? == - - Alpha Release. CouchDB has not yet reached version 1.0. There will likely be data-storage format changes and incompatible HTTP API changes between now and 1.0. However, there are projects successful using CouchDB in a variety of contexts. See InTheWild for a partial list of projects using CouchDB. - - <> - == What Does Couch Mean? == - - It's an acronym, Cluster Of Unreliable Commodity Hardware. This is a statement of Couch's long term goals of massive scalablility and high reliability on fault-prone hardware. The distributed nature and flat address space of the database will enable node partitioning for storage scalabilty (with a map/reduce style query facility) and clustering for reliability and fault tolerance. - - <> - == What Language is CouchDB Written in? == - - Erlang, a concurrent, functional programming language with an emphasis on fault tolerance. Early work on CouchDB was started in C but was replaced by Erlang OTP platform. Erlang has so far proven an excellent match for this project. - - CouchDB's default view server uses Mozilla's Spidermonkey Javscript library which is written in C. It also supports easy integration of view servers written in any language. - - <> - == What Platforms are Supported? == - - Most POSIX systems, this includes GNU/Linux and OS X. - - Windows is not officially supported but it should work, please let us know. - - <> - == What is the License? == - - [[http://www.apache.org/licenses/LICENSE-2.0.html|Apache 2.0]] - - <> - == How Much Stuff can I Store in CouchDB? == - - With node partitioning, virtually unlimited. For a single database instance, the practical scaling limits aren't yet known. - - <> - == How Do I Do Sequences? == - - Or, where is my AUTO_INCREMENT?! With replication sequences are hard to realize. Sequences are often used to ensure unique identifiers for each row in a database table. CouchDB generates unique ids from its own and you can specify your own as well, so you don't really need a sequence here. If you use a sequence for something else, you might find a way to express in CouchDB in another way. - - <> - == How Do I Use Replication? == - - {{{ - POST /_replicate?source=$source_database=$target_database - }}} - - Where $source_database and $target_database can be the names of local database or full URIs of remote databases. Both databases need to be created before they can be replicated from or to. - - <> - == How can I spread load across multiple nodes? == - - Using an http proxy like nginx, you can load balance GETs across nodes, and direct all POSTs, PUTs and DELETEs to a master node. CouchDB's triggered replication facility can keep multiple read-only servers in sync with a single master server, so by replicating from master -> slaves
[Couchdb Wiki] Update of "AndroidOtpPatch" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidOtpPatch" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidOtpPatch?action=diff=6=7 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]] - {{{ - diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in - index fb8d718..4ed25c9 100644 - --- a/erts/emulator/Makefile.in - +++ b/erts/emulator/Makefile.in - @@ -352,6 +352,7 @@ EMULATOR_EXECUTABLE = beam$(TF_MARKER).dll - else - ifeq ($(CC), agcc) - EMULATOR_EXECUTABLE = libbeam$(TF_MARKER).so - +EMULATOR_EXECUTABLE_REG = beam$(TF_MARKER) - else - EMULATOR_EXECUTABLE = beam$(TF_MARKER) - endif - @@ -374,7 +375,11 @@ ifeq ($(FLAVOR)-@ERTS_BUILD_SMP_EMU@,smp-no) - all: - @echo '*** Omitted build of emulator with smp support' - else - +ifeq ($(CC), agcc) - +all: generate erts_lib zlib pcre $(BINDIR)/$(EMULATOR_EXECUTABLE) $(BINDIR)/$(EMULATOR_EXECUTABLE_REG) $(UNIX_ONLY_BUILDS) - +else - all: generate erts_lib zlib pcre $(BINDIR)/$(EMULATOR_EXECUTABLE) $(UNIX_ONLY_BUILDS) - +endif - ifeq ($(OMIT_OMIT_FP),yes) - @echo '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *' - @echo '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *' - @@ -453,6 +458,7 @@ release_spec: all - $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELEASE_PATH)/usr/include - $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELSYSDIR)/include - $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_EXECUTABLE) $(RELSYSDIR)/bin - + $(INSTALL_PROGRAM) $(BINDIR)/$(EMULATOR_EXECUTABLE_REG) $(RELSYSDIR)/bin - ifeq ($(ERLANG_OSTYPE), unix) - $(INSTALL_PROGRAM) $(BINDIR)/$(CS_EXECUTABLE) $(RELSYSDIR)/bin - endif - @@ -1013,6 +1019,13 @@ ifeq ($(CC), agcc) - $(BINDIR)/$(EMULATOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS) - $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE) \ - $(HIPEBEAMLDFLAGS) $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) $(LIBS) -shared - + - +$(OBJDIR)/beam.o: - + $(CC) $(CFLAGS) $(INCLUDES) -c beam/beam.c -o $(OBJDIR)/beam.o - + - +$(BINDIR)/$(EMULATOR_EXECUTABLE_REG): $(OBJDIR)/beam.o - + $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE_REG) \ - + $(HIPEBEAMLDFLAGS) $(LDFLAGS) $(DEXPORT) $(OBJDIR)/beam.o $(LIBS) -L$(BINDIR) -lbeam - else - $(BINDIR)/$(EMULATOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS) - $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE) \ - diff --git a/erts/emulator/sys/unix/erl_child_setup.c b/erts/emulator/sys/unix/erl_child_setup.c - index 7c6e4a2..c1a1549 100644 - --- a/erts/emulator/sys/unix/erl_child_setup.c - +++ b/erts/emulator/sys/unix/erl_child_setup.c - @@ -116,7 +116,11 @@ main(int argc, char *argv[]) - execv(argv[CS_ARGV_NO_OF_ARGS],&(argv[CS_ARGV_NO_OF_ARGS + 1])); - } - } else { - +#ifdef ANDROID_ARM - + execl("/system/bin/sh", "sh", "-c", argv[CS_ARGV_CMD_IX], (char *) NULL); - +#else - execl("/bin/sh", "sh", "-c", argv[CS_ARGV_CMD_IX], (char *) NULL); - +#endif - } - return 1; - } - diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c - index 31ab5d0..9a260a2 100644 - --- a/erts/emulator/sys/unix/sys.c - +++ b/erts/emulator/sys/unix/sys.c - @@ -1539,7 +1539,11 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op - } - } - } else { - +#ifdef ANDROID_ARM - + execle("/system/bin/sh", "sh", "-c", cmd_line, (char *) NULL, new_environ); - +#else - execle("/bin/sh", "sh", "-c", cmd_line, (char *) NULL, new_environ); - +#endif - } - child_error: - _exit(1); - @@ -1660,7 +1664,12 @@ static ErlDrvData spawn_start(ErlDrvPort port_num, char* name, SysDriverOpts* op - fcntl(i, F_SETFD, 1); - - qnx_spawn_options.flags = _SPAWN_SETSID; - +#ifdef ANDROID_ARM - +/* Are we really in QNX? Then we don't need this special case here... */ - +if ((pid = spawnl(P_NOWAIT, "/system/bin/sh", "/system/bin/sh", "-c", cmd_line, - +#else - if ((pid = spawnl(P_NOWAIT, "/bin/sh", "/bin/sh", "-c", cmd_line, - +#endif -(char *) 0)) < 0) { - erts_free(ERTS_ALC_T_TMP, (void *) cmd_line); - reset_qnx_spawn(); - diff --git a/erts/emulator/beam/beam.c b/erts/emulator/beam/beam.c - new file mode 100644 - index 000..167b96e - --- /dev/null - +++ b/erts/emulator/beam/beam.c - @@ -0,0 +1,2 @@ - +void erl_start(int argc, char** argv); - +int main(int argc, char** argv) { erl_start(argc, argv); } - diff --git a/lib/crypto/c_src/Makefile.in b/lib/crypto/c_src/Makefile.in - index 0b39808..5d9658e 100644 - --- a/lib/crypto/c_src/Makefile.in - +++ b/lib/crypto/c_src/Makefile.in - @@ -108,7 +108,7 @@ $(OBJDIR)/%.o: %.c - - $(LIBDIR)/crypto_drv.so: $(OBJS) - $(INSTALL_DIR) $(LIBDIR) - - $(LD) $(LDFLAGS) -o
[Couchdb Wiki] Update of "ApplicationSchema" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApplicationSchema" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApplicationSchema?action=diff=4=5 Comment: Better resource: http://guide.couchdb.org/ - A simple example of a CouchDB application schema. - The way CouchDB works is still a bit cryptic for many of us coming from the RDBMS world. So the idea of this page is to write the schema of a typical application the RDBMS way and rewrite it the Document oriented way. I was thinking about a simple blog application: - - * Users can post many articles - * Articles can have many comments - * Articles can have many tags and tags can have many articles - - == RDBMS Schema == - - * Users (''id'', ''name'', ''password'') - * Articles (''id'', ''title'', ''body'', ''posted_on'', ''user_id'') (''user_id'' being a foreign key) - * Comments (''id'', ''title'', ''body'', ''posted_on'', ''user_id'', ''article_id') (''user_id'' and ''article_id'' being foreign keys) - * Tags (''id'', ''name'') - * tags_associations(''id'', ''article_id'', ''tag_id'', ''user_id'') - - == Relevant Threads == - - This part needs to be expanded by people who better understand the subject. - - This thread describes how to manage comments: - - * [[http://groups.google.com/group/couchdb/browse_thread/thread/84cf1bb522d1fbbf|Question/Concern: Document Sizes]] - - These threads describe how to manage tags: - - * [[http://groups.google.com/group/couchdb/browse_thread/thread/84cf1bb522d1fbbf/c9bf8e95e421b675?lnk=gst=patcito=3#c9bf8e95e421b675|Question/Concern: Document Sizes]] - * [[http://groups.google.com/group/couchdb/browse_thread/thread/a11521505db8eb3c/07c29b951c4707e1#07c29b951c4707e1|Basic Application Schema Example for the wiki]] - - == CouchDB Schema == - - These examples use the database ''blog''. - - === Data Storage === - - Users - - {{{ - _id: autogenerated_user_id1 - type: "user" - name: "J. D. Citizen" - password: "qwerty" - }}} - - Articles - - {{{ - _id: autogenerated_article_id1 - user_id: autogenerated_user_id1 - type: "article" - title: "RDBMSs SUCK OMG" - body: "I thought what I'd do was, I'd pretend I was one of those deaf- - mutes." - created: "Fri Oct 12 04:46:58 +1000 2007" - comments: comment_id1, comment_id2, etc - tags: [ "rdbms", "things that suck" ] - }}} - - Comments - - {{{ - _id: autogenerated_comment_id1 - article_id: autogenerated_article_id1 - user_id: autogenerated_user_id2 - type: "comment" - title: "i liek ur blog" - body: "i liek ur blog a lot LOL. please ad me on my space. clik hear for hot girl action LOL" - created: "Fri Oct 12 04:46:59 +1000 2007" - }}} - - Bear in mind that due to the flat nature of the document storage that there are no "tables" to do a SELECT from. Most of the real power of CouchDB is in it's views. - - === Views === - - Views are be stored into design documents for grouping and giving a sense of structure. Design documents are regular documents in CouchDB, it knows they are design documents because you preface the document's ''_id'' attr with ''_design/''. - - Let's add a group of views for our tags. Everybody wants to be able to fetch all documents tagged ''rdbms'' so lets add a view that will get us there. - - _design/tags - - {{{ - "views": { -"to_docs": " - function(doc) { - for( var i=0; i < doc.tags.length; i++) { - emit(doc.tags[i], null); - } - }" - } - }}} - - This view would be accessed by going to ''/blog/_design/tags/to_docs''. The returned content would look like: - - {{{ - {"view":"_design/tags/to_docs_inc","total_rows":9, "offset":0, - "rows":[ - {"_id":"autogenerated_article_id1","_rev":"684343246","key":"things that suck"}, - {"_id":"autogenerated_article_id1","_rev":"684343246","key":"rdbms"} - }}} - - Note, 2 rows returned for the same article. This is intended. CouchDB will let us filter the data in our views a bit with extra query parameters. Going to ''/blog/_design/tags/to_docs?key="rdbms"'' yields only documents tagged ''rdbms''. - - Say we're returning a lot of records here and want to reduce them by including the title (or if no title exists, the name) attribute of the thing that was tagged along with the results. Change the following line in the ''to_docs'' query above: - - {{{ - // emit(doc.tags[i], null); - // becomes - emit(doc.tags[i], doc.title || doc.name); - }}} - - Optionally, this view could be named to_docs_with_title so as to be available only if the extra data is desired. - - Using the sample view given above many other views would likely be implemented. I give only a few sample URLs as follows, implementation is left as an exercise: - - * /blog/_design/comments/on_article?key="autogenerated_article_id1" - * /blog/_design/comments/by_user?key="autogenerated_user_id1" - *
[Couchdb Wiki] Update of "AndroidEnv" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidEnv" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidEnv?action=diff=1=2 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]]. - This script simply sets up a good environment for building with Android. - - {{{ - paths=" - $HOME/software/android/scripts - $HOME/software/android/other/apk - $HOME/software/android/sdk/platform-tools - $HOME/software/android/sdk/platforms/android-8/tools - $HOME/software/android/sdk/sources/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin - $HOME/software/android/sdk/tools - " - - for i in $paths - do - if [[ -d $i ]]; then - PATH=$PATH:$i - fi - done - - export PATH - - # Java stuff for building Android from sources - echo "For building Android from sources:" - echo "$ export JAVA_HOME=$HOME/software/jdk1.5.0_22" - echo "$ export ANDROID_JAVA_HOME=\$JAVA_HOME" - echo "$ export PATH=\$JAVA_HOME/bin:$PATH" - echo "$ cd $HOME/software/android/sdk/sources" - echo "$ source build/envsetup.sh" - echo "$ lunch" - echo "$ make" - }}} -
[Couchdb Wiki] Update of "AndroidReleasePatch" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidReleasePatch" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidReleasePatch?action=diff=7=8 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]] - {{{ - diff -ru release.bak/sdcard/Android/data/com.your.namespace/couchdb/bin/couchdb release/sdcard/Android/data/com.your.namespace/couchdb/bin/couchdb - --- release.bak/sdcard/Android/data/com.your.namespace/couchdb/bin/couchdb 2011-02-05 01:26:00.0 -0700 - +++ release/sdcard/Android/data/com.your.namespace/couchdb/bin/couchdb 2011-02-08 16:42:00.0 -0700 - @@ -12,6 +12,9 @@ - # License for the specific language governing permissions and limitations under - # the License. - - +export HOME=/data/data/com.your.namespace - +export LD_LIBRARY_PATH=$HOME/erlang/erts-5.7.5/bin:$HOME/couchdb/bin:$HOME/couchdb/lib/couchdb/bin - +export PATH=$HOME/erlang/bin:$HOME/couchdb/bin:$PATH - BACKGROUND=false - DEFAULT_CONFIG_DIR=/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/default.d - DEFAULT_CONFIG_FILE=/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/default.ini - @@ -222,8 +225,8 @@ - touch $PID_FILE - interactive_option="+Bd -noinput" - fi - - command="/home/matt/projects/couch/android-build/couchdb/../otp/bootstrap/bin/erl $interactive_option $ERL_START_OPTIONS \ - --env ERL_LIBS /sdcard/Android/data/com.your.namespace/couchdb/lib/couchdb/erlang/lib -couch_ini $start_arguments -s couch" - +command="erl $interactive_option $ERL_START_OPTIONS \ - +-env ERL_LIBS /data/data/com.your.namespace/couchdb/lib/couchdb/erlang/lib -couch_ini $start_arguments -s couch" - if test "$BACKGROUND" = "true" -a "$RECURSED" = "false"; then - $0 $background_start_arguments -b -r $RESPAWN_TIMEOUT -p $PID_FILE \ - -o $STDOUT_FILE -e $STDERR_FILE -R & - diff -ru release.bak/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/local.ini release/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/local.ini - --- release.bak/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/local.ini 2011-02-05 01:26:00.0 -0700 - +++ release/sdcard/Android/data/com.your.namespace/couchdb/etc/couchdb/local.ini 2011-02-08 15:58:30.0 -0700 - @@ -5,23 +5,30 @@ - ; overwritten on server upgrade. - - [couchdb] - +database_dir = /sdcard/Android/data/com.your.namespace/couchdb/var/lib/couchdb - +view_index_dir = /sdcard/Android/data/com.your.namespace/couchdb/var/lib/couchdb - +util_driver_dir = /data/data/com.your.namespace/couchdb/lib/couchdb - ;max_document_size = 4294967296 ; bytes - +uri_file = /sdcard/Android/data/com.your.namespace/couchdb/var/lib/couchdb/couch.uri - - [httpd] - -;port = 5984 - -;bind_address = 127.0.0.1 - +port = 5999 - +bind_address = 127.0.0.1 - ; Uncomment next line to trigger basic-auth popup on unauthorized requests. - ;WWW-Authenticate = Basic realm="administrator" - - +[log] - +file = /sdcard/Android/data/com.your.namespace/couchdb/var/log/couchdb/couch.log - +level = debug - + - [couch_httpd_auth] - ; If you set this to true, you should also uncomment the WWW-Authenticate line - ; above. If you don't configure a WWW-Authenticate header, CouchDB will send - ; Basic realm="server" in order to prevent you getting logged out. - ; require_valid_user = false - - -[log] - -;level = debug - - - +[query_servers] - +javascript = /data/data/com.your.namespace/couchdb/bin/couchjs_wrapper /data/data/com.your.namespace/couchdb/share/couchdb/server/main.js - - ; To enable Virtual Hosts in CouchDB, add a vhost = path directive. All requests to - ; the Virual Host will be redirected to the path. In the example below all requests - diff -ruN release.bak/sdcard/Android/data/com.your.namespace/couchdb/bin/couchjs release/sdcard/Android/data/com.your.namespace/couchdb/bin/couchjs - --- release.bak/sdcard/Android/data/com.your.namespace/couchdb/bin/couchjs 2011-02-05 01:26:00.0 -0700 - +++ release/sdcard/Android/data/com.your.namespace/couchdb/bin/couchjs 2011-02-05 01:37:12.0 -0700 - @@ -1,4 +1,4 @@ - -#! /bin/sh -e - +#!/system/bin/sh -e - - # Licensed under the Apache License, Version 2.0 (the "License"); you may not - # use this file except in compliance with the License. You may obtain a copy of - @@ -63,7 +63,7 @@ - } - - run_couchjs () { - -exec /sdcard/Android/data/com.your.namespace/couchdb/lib/couchdb/bin/couchjs $@ - +exec LD_LIBRARY_PATH=/data/data/com.your.namespace/couchdb/lib/couchdb/bin /data/data/com.your.namespace/couchdb/lib/couchdb/bin/couchjs $@ - } - - parse_script_option_list () { - diff -ruN release.bak/sdcard/Android/data/com.your.namespace/couchdb/bin/couchjs_wrapper
[Couchdb Wiki] Update of "AndroidCouchPatch" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidCouchPatch" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidCouchPatch?action=diff=4=5 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]] - {{{ - diff --git a/configure.ac b/configure.ac - index c609a08..a31bc7b 100644 - --- a/configure.ac - +++ b/configure.ac - @@ -118,6 +118,21 @@ Is the Mozilla SpiderMonkey library installed?])])])])]) - - AC_SUBST(JS_LIB_BASE) - - +AC_CHECK_LIB([$JS_LIB_BASE], [JS_FreezeObject], - +AC_DEFINE([HAVE_JS_FREEZE_OBJECT], [1], [Define whether we have JS_FreezeObject])) - + - +AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewGlobalObject], - +AC_DEFINE([HAVE_JS_NEW_GLOBAL_OBJECT], [1], [Define whether we have JS_NewGlobalObject])) - + - +AC_CHECK_LIB([$JS_LIB_BASE], [js_fgets], - +AC_DEFINE([HAVE_JS_FGETS], [1], [Define whether js_fgets is available to use])) - + - +AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength], - +AC_DEFINE([HAVE_JS_GET_STRING_CHARS_AND_LENGTH], [1], [Define whether we have JS_GetStringCharsAndLength])) - + - +AC_CHECK_LIB([$JS_LIB_BASE], [JS_NewCompartmentAndGlobalObject], - +AC_DEFINE([HAVE_COMPARTMENTS], [1], [Define whether we have JS_NewCompartmentAndGlobalObject])) - + - if test x${IS_WINDOWS} = xTRUE; then - if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then - # seamonkey 1.7- build layout on Windows - @@ -189,6 +204,13 @@ AC_COMPILE_IFELSE( - CFLAGS="$OLD_CFLAGS" - AC_LANG_POP(C) - - +AC_ARG_WITH([android], [AC_HELP_STRING([--with-android=PATH] - +[set Android system build path])],[ - +ICU_CONFIG="" - +ICU_LOCAL_CFLAGS="-I$withval/external/icu4c/common -I$withval/external/icu4c/i18n" - +ICU_LOCAL_LDFLAGS="-L$withval/out/target/product/generic/system/lib" - +ICU_LOCAL_BIN= - +], [ - AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PATH], - [set PATH to the Win32 native ICU binaries directory])], [ - ICU_CONFIG="" # supposed to be a command to query options... - @@ -200,13 +222,19 @@ AC_ARG_WITH([win32-icu-binaries], [AC_HELP_STRING([--with-win32-icu-binaries=PAT - ICU_LOCAL_CFLAGS=`$ICU_CONFIG --cppflags-searchpath` - ICU_LOCAL_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` - ICU_LOCAL_BIN= - -]) - +])]) - - AC_SUBST(ICU_CONFIG) - AC_SUBST(ICU_LOCAL_CFLAGS) - AC_SUBST(ICU_LOCAL_LDFLAGS) - AC_SUBST(ICU_LOCAL_BIN) - - +AC_ARG_WITH([android-curl], [AC_HELP_STRING([--with-android-curl=PATH] - +[set PATH to directory where curl is built for android])], [ - +CURL_CFLAGS="-I$withval/include -DCURL_STATICLIB" - +CURL_LIBDIR="$withval/lib" - +CURL_LDFLAGS="-L$CURL_LIBDIR -lcurl" - +], [ - AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH], - [set PATH to the Win32 native curl directory])], [ - # default build on windows is a static lib, and that's what we want too - @@ -216,12 +244,15 @@ AC_ARG_WITH([win32-curl], [AC_HELP_STRING([--with-win32-curl=PATH], - ], [ - AC_CHECK_CURL([7.18.0]) - CURL_LDFLAGS=-lcurl - -]) - +])]) - - AC_SUBST(CURL_CFLAGS) - AC_SUBST(CURL_LIBS) - AC_SUBST(CURL_LDFLAGS) - - +#Probably should fix this up better in the future for cross-compiles in general - +#instead of just keeping this exception for android - +if test "x$CC" != "xagcc"; then - case "$(uname -s)" in -Linux) - LIBS="$LIBS -lcrypt" - @@ -234,6 +265,7 @@ case "$(uname -s)" in - LIBS="$LIBS -lcrypto" -;; - esac - +fi - - AC_PATH_PROG([ERL], [erl]) - - diff --git a/src/couchdb/priv/couch_js/http.c b/src/couchdb/priv/couch_js/http.c - index 6c2a8a8..5a2112d 100644 - --- a/src/couchdb/priv/couch_js/http.c - +++ b/src/couchdb/priv/couch_js/http.c - @@ -43,6 +43,10 @@ char* METHODS[] = {"GET", "HEAD", "POST", "PUT", "DELETE", "COPY", NULL}; - #define DELETE 4 - #define COPY5 - - +#ifdef JSFUN_CONSTRUCTOR - +#define JSFUN_FAST_NATIVE 0 - +#endif - + - static JSBool - go(JSContext* cx, JSObject* obj, HTTPData* http, char* body, size_t blen); - - @@ -50,10 +54,21 @@ static JSString* - str_from_binary(JSContext* cx, char* data, size_t length); - - static JSBool - +#ifdef JSFUN_CONSTRUCTOR - +constructor(JSContext* cx, uintN argc, jsval* vp) - +#else - constructor(JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval) - +#endif - { - HTTPData* http = NULL; - JSBool ret = JS_FALSE; - +#ifdef JSFUN_CONSTRUCTOR - +JSObject* obj = JS_NewObjectForConstructor(cx, vp); - +if(!obj) { - +JS_ReportError(cx, "Failed to create 'this' object"); - +goto error; - +} - +#endif - - http = (HTTPData*) malloc(sizeof(HTTPData)); - if(!http) - @@ -80,6 +95,9 @@ error: - if(http) free(http); - - success: - +#ifdef JSFUN_CONSTRUCTOR - +JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(obj)); -
[Couchdb Wiki] Update of "AndroidMozillaPatch" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidMozillaPatch" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidMozillaPatch?action=diff=4=5 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]] - {{{ - --- mozilla-central-bb9089ae2322/nsprpub/pr/src/io/prlog.c2011-01-21 16:40:14.0 -0700 - +++ mozilla-central-bb9089ae2322.bak/nsprpub/pr/src/io/prlog.c 2011-01-31 13:53:30.0 -0700 - @@ -42,7 +42,7 @@ - #include "prprf.h" - #include - #ifdef ANDROID - -#include - +//#include - #endif - - /* - @@ -135,7 +135,7 @@ - if (fd == _pr_stderr) { \ - char savebyte = buf[nb]; \ - buf[nb] = '\0'; \ - -__android_log_write(ANDROID_LOG_INFO, "PRLog", buf); \ - +printf("PRLog: %s", buf);\ - buf[nb] = savebyte; \ - } else { \ - PR_Write(fd, buf, nb); \ - --- mozilla-central-bb9089ae2322/js/src/jscntxt.cpp 2011-01-21 16:40:14.0 -0700 - +++ mozilla-central-bb9089ae2322.bak/js/src/jscntxt.cpp 2011-01-31 13:49:52.0 -0700 - @@ -46,7 +46,7 @@ - #include - #include - #ifdef ANDROID - -# include - +//# include - # include - # include - #endif // ANDROID - @@ -2218,12 +2218,14 @@ - // Check for the known-bad kernel version (2.6.29). - std::ifstream osrelease("/proc/sys/kernel/osrelease"); - std::getline(osrelease, line); - -__android_log_print(ANDROID_LOG_INFO, "Gecko", "Detected osrelease `%s'", - -line.c_str()); - +//__android_log_print(ANDROID_LOG_INFO, "Gecko", "Detected osrelease `%s'", - +//line.c_str()); - +printf("Gecko: Detected osrelease `%s'", line.c_str()); - - if (line.npos == line.find("2.6.29")) { - // We're using something other than 2.6.29, so the JITs should work. - -__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are not broken"); - +//__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are not broken"); - +printf("Gecko: JITs are not broken"); - return false; - } - - @@ -2243,8 +2245,9 @@ - }; - for (const char** hw = [0]; *hw; ++hw) { - if (line.npos != line.find(*hw)) { - -__android_log_print(ANDROID_LOG_INFO, "Gecko", - -"Blacklisted device `%s'", *hw); - +//__android_log_print(ANDROID_LOG_INFO, "Gecko", - +//"Blacklisted device `%s'", *hw); - +printf("Gecko: Blacklisted device `%s'", *hw); - broken = true; - break; - } - @@ -2254,8 +2257,9 @@ - std::getline(cpuinfo, line); - } while(!cpuinfo.fail() && !cpuinfo.eof()); - - -__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are %sbroken", - -broken ? "" : "not "); - +//__android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are %sbroken", - +//broken ? "" : "not "); - +printf("Gecko: JITs are %sborken", broken ? "" : "not "); - - return broken; - #endif // ifndef ANDROID - --- mozilla-central/nsprpub/pr/src/Makefile.in.bak2011-02-02 15:39:53.0 -0700 - +++ mozilla-central/nsprpub/pr/src/Makefile.in2011-02-02 15:40:07.0 -0700 - @@ -205,9 +205,9 @@ - OS_LIBS = ws2.lib - endif - - -ifeq ($(OS_TARGET),Android) - -OS_LIBS += -llog - -endif - +#ifeq ($(OS_TARGET),Android) - +#OS_LIBS += -llog - +#endif - - ifeq ($(OS_TARGET),MacOSX) - OS_LIBS = -framework CoreServices -framework CoreFoundation - --- mozilla-central/js/src/configure.in.bak 2011-02-02 15:41:20.0 -0700 - +++ mozilla-central/js/src/configure.in 2011-02-02 15:41:43.0 -0700 - @@ -291,11 +291,10 @@ - CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CFLAGS" - CXXFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions -march=armv5te -mthumb-interwork $CXXFLAGS" - - -dnl Add -llog by default, since we use it all over the place. - dnl Add --allow-shlib-undefined, because libGLESv2 links to an - dnl undefined symbol (present on the hardware, just not in the - dnl NDK.) - -LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS" - +
[Couchdb Wiki] Update of "AndroidAgcc" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AndroidAgcc" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AndroidAgcc?action=diff=1=2 Comment: Moved to https://cwiki.apache.org/confluence/display/COUCHDB/Old+Android+Compile+Info - For use with [[Installing_on_Android]] - The Android toolchain is a little complicated so I used http://plausible.org/andy/agcc to simplify the process. Here is my patch against that script: - - {{{ - --- agcc.old 2011-01-23 19:47:49.0 -0700 - +++ agcc 2011-01-29 15:43:58.0 -0700 - @@ -39,7 +39,10 @@ - my $DROID = $1; - - my $ALIB = "$DROID/out/target/product/generic/obj/lib"; - -my $TOOLCHAIN = "$DROID/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1"; - +my $TOOLCHAIN = "$DROID/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0"; - + - +print STDERR "ALIB $ALIB\n"; - +print STDERR "TOOLCHAIN ... $TOOLCHAIN\n"; - - my @include_paths = ( - "-I$DROID/system/core/include", - @@ -85,6 +88,7 @@ - "-mthumb-interwork", - "-fpic", - "-fno-exceptions", - +"-fno-short-enums", # See www for why we added this - "-ffunction-sections", - "-funwind-tables", # static exception-like tables - "-fstack-protector", # check guard variable before return - @@ -114,7 +118,7 @@ - "-nostdlib", - "$ALIB/crtend_android.o", - "$ALIB/crtbegin_dynamic.o", - -"$TOOLCHAIN/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a", - +"$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a", - "-lc", - "-lm"); - - @@ -129,7 +133,7 @@ - "-lc", - "-lm", - "-Wl,--no-undefined", - -"$TOOLCHAIN/lib/gcc/arm-eabi/4.2.1/interwork/libgcc.a", - +"$TOOLCHAIN/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a", - "-Wl,--whole-archive"); # .a, .o input files go *after* here - - # Now implement a quick parser for a gcc-like command line - }}} -
[Couchdb Wiki] Update of "Advanced_Shows_and_Lists_Throwing_Redirects" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Advanced_Shows_and_Lists_Throwing_Redirects" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Advanced_Shows_and_Lists_Throwing_Redirects?action=diff=5=6 Comment: Migrated to https://docs.couchdb.org/en/latest/ddocs/ddocs.html - <> - ## page was renamed from Advanced Shows and Lists: Throwing Redirects - ## page was renamed from Throw a 404 or a redirect - = Advanced Shows and Lists: Throwing Redirects = - - == Throw a 404 error == - - To throw a 404 from inside a _show or _list func .. the easiest way is: - - {{{ - throw (['error', 'not_found', 'Some message like Page not found']) - }}} - - That will be caught by the top level loop thing and turned into a nice response. - - == Return a redirect == - - There's no top level catcher thing for redirects, so you can't *throw a redirect*, you have to 'return' it. - - To do a redirect, there's a library function that will do it for you: - - {{{ - var redirect = require("vendor/couchapp/lib/redirect"); - return redirect.permanent('http://some.new/place'); - }}} - - You can use the path lib to help get some neat urls, have a look at vendor/couchapp/lib/path.js source .. - - What this actually does is the equivalent of: - - {{{ - return { code : 301, headers : { "Location" : 'http://some.new/place' } }; - }}} - - The 'code' is the http response code, the http response would be something like: - - {{{ - HTTP/1.1 301 Moved Permanently - Vary: Accept - Server: CouchDB/1.0.1 (Erlang OTP/R13B) - Location: http://foot:5984/products/dvrs/standalone-h.264-16-channel-dvr - Etag: "CYFPH3WEUO9R5B8S26QWV3NK4" - Date: Sat, 11 Sep 2010 04:51:37 GMT - Content-Type: application/json - Content-Length: 0 - }}} - - = Case study, Making a Redirect Throwable = - - If you're deep in a lib/mystuff.js func, I use this sort of style for a certain checker function. - - In this example I have different product lines in my rewrites, of the form: - - {{{ - [ - { - "from": "/products/dvrs", - "to": "_list/dvrs", - "method": "GET" - }, - { - "from": "/products/dvrs/new", - "to": "_show/dvr-new", - "method": "GET" - }, - { - "from": "/products/dvrs/new", - "to": "_show/dvr-save", - "method": "POST" - }, - { - "from": "/products/dvrs/*", - "to": "_show/dvr/*", - "method": "GET" - }, - // Then a bunch of similar things for other product lines (like /products/cameras/ etc ..) - ] - }}} - - The trouble is if someone uses the wrong url for the type of product, I want to put them right, this will help keep the - search engine optimization good too. So if someone goes: - - {{{ - http://mysite.kom/products/cameras/id_of_a_dvr - }}} - - It will call the _show/camera method with the id of a document that has {type: 'dvr'}. Which is bad because I use a - different template but also bad because SEO will freak out if it ends up in google. - - To fix it I did the following: - - In my _show or _list func I put: - - {{{ - var rewrite = require("lib/rewritehelper").init(req); - // If we're trying to use this view to see something other than a dvr, make sure we're looking at the right type - try {rewrite.checkType(doc, 'camera');} catch (e) {return e;} - }}} - - I know people will yell at me for puting too much on one line. But I'm using this in all my _show and _list funcs, I - want it to be nice and short. - - In my *lib/rewritehelper.js* file I check the type and all that and if it's wrong I throw an exception, which the _show - func catches and returns as is. Here's the full code for my lib function so far: - - {{{ - /* Helps you get the rewrites right. - - Complements the rewrites.json .. really both should be updated at the same time. Saves having to update every place you - put a path to something. - - */ - - exports.init = function(req) { - - rewrite = {}; - - rewrite.url4doc = function (_id, prodType) { - /* Returns a url to a product, takes doc._id and doc._type */ - // See if it's a product - switch (prodType) { - case "forum-topic": - case "forum-post": - return "http://; + req.headers.Host + "/forums/" + prodType + "s/" + _id; - case "support": - return "http://; + req.headers.Host + "/support/" + prodType + "s/" + _id; - case "dvr": - case "camera": - return "http://; + req.headers.Host + "/products/" + prodType + "s/" + _id; -
[Couchdb Wiki] Update of "API_Cheatsheet" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "API_Cheatsheet" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/API_Cheatsheet?action=diff=14=15 Comment: see http://docs.couchdb.org/en/stable/api/index.html - = API Cheatsheet = - <> - See [[HTTP_view_API]] for the view options that apply to many ''GET'' operations. - - == CouchDB Server Level == - - ||/||Info||GET||Get MOTD and version - ||/_all_dbs||Databases||GET||Get a list of databases - ||/_config||Config||GET||Get configuration data - ||/_uuids||UUIDs||GET /_uuids?count=1||Get a number of UUIDs - ||/_replicate||Replication||POST /_replicate source=x=y||Replicate, see [[Replication]] - ||/_stats||Statistics||GET /_stats||Statistics overview - ||/_active_tasks||Active tasks||GET /_active_tasks||Active task list (compaction, replication, etc.) - - == Database Level == - - '''Note''': Document names must always have embedded '''/''' translated to '''%2F'''. E.g. "GET /'''db'''/foo%2fbar" for the document named "foo/bar". Attachment names may have embedded slashes. - - ||/'''db'''||Creation||PUT /'''db'''||Database creation - ||/'''db'''||Deletion||DELETE /'''db'''||Database deletion - ||/'''db'''||Info||GET /'''db'''||Database information - ||/'''db'''||Change feed||GET /'''db'''/_changes||Feed of changes in the database - ||/'''db'''/_compact||Compaction||POST /'''db'''/_compact||Data compaction - ||/'''db'''/_bulk_docs||Bulk document update||POST /'''db'''/_bulk_docs [{"foo": "bar"}]||Update many documents at once - ||/'''db'''/_temp_view||Temporary view||POST /'''db'''/_temp_view {'''view-code'''}||Run an ad-hoc view - ||/'''db'''/_view_cleanup||Cleanup view data||POST /'''db'''/_view_cleanup||Cleanup old view data (see [[Compaction]]) - ||/'''db'''/_design/'''design-doc'''/_view/'''view'''||View||GET /'''db'''/_design/'''design-doc'''/_view/'''view'''||View query (see [[HTTP_view_API]])||(in 0.9.x, this was /'''db'''/_view/'''design-doc'''/'''view''')|| - - See [[HTTP_database_API]] for more information. - - == Documents Level == - - ||/'''db'''/_all_docs||Documents||GET /'''db'''/_all_docs||List of all documents - ||/'''db'''||Get document||GET /'''db'''/'''doc'''||Retrieve a document - ||/'''db'''||Create document||POST /'''db''' {"foo": "bar"}||Create new document - ||/'''db'''/'''doc'''||Update document||PUT /'''db'''/'''doc''' {"foo": "test"}||Save updated document - ||/'''db'''/'''doc'''||Delete document||DELETE /'''db'''/'''doc'''?rev=REVISION||Delete document -
[Couchdb Wiki] Update of "alexis_m" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "alexis_m" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/alexis_m?action=diff=2=3 - #format wiki - #language fr - == Alexis Metaireau == - Email: <> - Jabber: <> - - Website http://www.notmyidea.org - - ... - - - CategoryHomepage -
[Couchdb Wiki] Update of "ApiVueHttp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApiVueHttp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApiVueHttp?action=diff=9=10 Comment: See http://docs.couchdb.org/en/stable/intro/overview.html#views - #language fr - Ce document est une introduction sur l'API de vue HTTP de CouchDB. - == Bases == - Les vues sont l'outil de base pour interroger et reporter des documents CouchDB. - - Les vues sont définies avec des fonctions Javascript. Voici une fonction très simple, qui retourne l'ensemble des documents : - - {{{ - function(doc) { - emit(null, doc); - } - }}} - Voir [[Vues]] pour plus d'informations. - - == Créer des vues == - Pour créer une vue permanente, les fonctions doivent d'abord être sauvées dans des documents spéciaux appelés ''documents design''. L'ID de ces documents doit commmencer par ''_design/'' et ces documents doivent avoir des attributs spécifiques contenant un membre ''map'' et optionnellement un membre ''reduce'' pour contenir les fonctions de vues. Toutes les vues dans un document design sont indexées à chaque fois qu'elles sont interrogées. - - Un document design qui définit les vues ''all'', ''by_lastname'', et ''total_purchases'' peut ressembler à cela: - - {{{ - { - "_id":"_design/company", - "_rev":"12345", - "language": "javascript", - "views": - { - "all": { - "map": "function(doc) { if (doc.Type == 'customer') emit(null, doc) }" - }, - "by_lastname": { - "map": "function(doc) { if (doc.Type == 'customer') emit(doc.LastName, doc) }" - }, - "total_purchases": { - "map": "function(doc) { if (doc.Type == 'purchase') emit(doc.Customer, doc.Amount) }", - "reduce": "function(keys, values) { return sum(values) }" - } - } - } - }}} - La propriété ''language'' indique à CouchDB le langage des fonctions de vue, ce qui est utilisé pour sélectionnner le ServeurDeVue approprié (définit dans le fichier ''couch.ini''). Par défaut CouchDB utilise Javascript, et cette propriété peut donc être omise pour les vues Javascript. - - == Modifier/Changer les Vues == - Pour changer une vue ou plusieurs vues, modifiez juste le document (voir ApiDocumentHttp) où elles sont stockées et enregistrez une nouvelle révision. - - == Accéder/Interroger == - Une fois que le document définissant les vues enregistré dans la base, la vue ''all'' peut être récupérée via l'URL : - - . http://localhost:5984/ma_bd/_view/company/all - - Exemple : - - {{{ - GET /ma_bd/_view/company/all HTTP/1.0 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - Ce qui entraine la réponse suivant : - - {{{ - HTTP/1.1 200 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Length: 318 - Connection: close - - { - "total_rows": 3, - "offset": 0, - "rows": [{ - "id":"64ACF01B05F53ACFEC48C062A5D01D89", - "key": null, - "value": { - "LastName":"Katz", - "FirstName":"Damien", - "Address":"2407 Sawyer drive, Charlotte NC", - "Phone":012555754211 - } - }, { - "id":"5D01D8964ACF01B05F53ACFEC48C062A", - "key": null, - "value": { - "LastName":"Kerr", - "FirstName":"Wayne", - "Address":"123 Fake st., such and such", - "Phone":88721320939 - } - }, { - "id":"EC48C062A5D01D8964ACF01B05F53ACF", - "key": null, - "value": - { - "LastName":"McCracken", - "FirstName":"Phil", - "Address":"1234 Fake st., such and such", - "Phone":7766552342 - } - } - ] - } - }}} - == Vues Ad Hoc == - Les requêtes temporaires (ex. les vues que vous ne souhaitez pas enregistrer dans CouchDB) peuvent être réalisées à travers la vue spéciale ''_temp_view'' : - - {{{ - POST /some_database/_temp_view HTTP/1.0 - Content-Length: 48 - Date: Mon, 10 Sep 2007 17:11:10 +0200 - Content-Type: application/json - - { - "map" : "function(doc) { if (doc.foo=='bar') { emit(null, doc.foo); } }" - } - }}} - Pouvant entraîner la réponse suivante : - - {{{ - { - "total_rows": 1, - "offset": 0, - "rows": [{ - "id": "AE1AD84316B903AD46EF396CAFE8E50F", - "key": null, - "foo": "bar" - } - ] - } - }}} - == Options de requêtes == - Les colonnes peuvent être une suite de valeur, il n'y a pas de limites au nombre de valeurs ou sur le volume des données que peuvent contenir les colonnes. - - Les options suivantes peuvent être passées à l'URL de la requête : - - * key=valeur-de-clé - * keys=tableau-de-clés - * startkey=valeur-de-clé - * startkey_docid=document-id - * endkey=valeur-de-clé - * endkey_docid=document-id - * limit=nombre-de-documents-maximum-à -retourner - * stale=ok|update_after - * descending=true|false - * skip=nombre-de-documents-à -passer - * group=true - * group_level= - * reduce=true|false - *
[Couchdb Wiki] Update of "ApiCheatSheet" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApiCheatSheet" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApiCheatSheet?action=diff=4=5 Comment: https://docs.couchdb.org/en/latest/api/index.html - #redirect API_Cheatsheet - = CouchDB Server Level Requests = - == info == - - GET / - - == all_dbs == - - GET /_all_dbs - - == replicate == - - POST /_replicate - - = CouchDB Database Level Requests = - - == compact == - - POST /'''db'''/_compact - - == create == - - PUT /'''db''' - - == drop == - - DELETE /'''db''' - - == info == - - GET /'''db''' - - == all_docs == - - GET /'''db'''/_all_docs - - == open_doc == - - GET /'''db'''/'''doc_id''' - - == save_doc (CREATE) == - - POST /'''db''' - - == save_doc (UPDATE) == - - PUT /'''db'''/'''doc_id''' - - == remove_doc == - - DELETE /'''db'''/'''doc_id''' - - == bulk_docs == - - POST /'''db'''/_bulk_docs - - == query (aka temporary view) == - - POST /'''db'''/_temp_view - - == view == - - GET /'''db'''/_view/'''name''' -
[Couchdb Wiki] Update of "ApiRestHttp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApiRestHttp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApiRestHttp?action=diff=2=3 Comment: See http://docs.couchdb.org/en/stable/api/index.html - #language fr - L'API princpale pour accéder programmatiquement à CouchDB est l'API [[http://en.wikipedia.org/wiki/Representational_State_Transfer|REST]]. - - C'est vrai "REST on the Couch" (jeu de mot: sieste sur le sofa). Est-ce que cela ne sonne pas bien. Laissez moi vous offrir de la limonades et quelques apéritifs. - Voir aussi: - - * ApiBaseDeDonnéeHttp - * ApiDocumentHttp - * ApiVueHttp -
[Couchdb Wiki] Update of "ApiDocumentHttp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApiDocumentHttp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApiDocumentHttp?action=diff=6=7 Comment: See http://docs.couchdb.org/en/stable/api/index.html - #language fr - Une introduction à l'api Document HTTP. - - == Nommage/Addressage == - - Les documents stockés dans CouchDB ont une DocID. Les DocIDs sont des identifiants uniques sous formes de chaines de caractères sensibles à la casse qui identifient un document. Deux documents ne peuvent avoir le même identifiant dans une même base de données. - - {{{ - http://localhost:5984/test/some_doc_id - http://localhost:5984/test/another_doc_id - http://localhost:5984/test/BA1F48C5418E4E68E5183D5BD1F06476 - }}} - - Les URL ci_dessus pointent vers ''some_doc_id'', ''another_doc_id'' and ''BA1F48C5418E4E68E5183D5B!D1F06476'' dans la base ''test''. - - === Id Document valide === - - Q: Quelle est la règle pour une id document valide ? L'exemple suggère-t-il que cela soit restreint à ''[a-zA-Z0-9_]'' ? Quid des caractères UTF8 multi-octets ? Des caractères non alphanumériques tel que ''_'' ? - - R: Il n'y a pour l'instant pas de restriction sur les ids de documents au niveau base de donnée. Cependant je n'ai pas testé ce qui arrive quand on utilise des caractères multi-octets dans l'URL. Cela peut fonctionner, mais plus probablement il sera nécessaire de coder ou échapper les caractères quelques part. Pour l'instant je me cantonne aux caractères valides dans une URI et rien de "spécial". - - Les noms de bases de données ont des restrictions strictes afin de simpilfier l'association nom-fichier. Comme les bases de données peuvent être repliquées à travers différents systèmes d'exploitation, la façon de nommer les fichiers doit utiliser le plus petit commun dénominateur. - - == JSON == - - Un document CouchDB est un simple objet JSON. (Accompagnées des informations de révision si ''?full=true'' dans les arguments de l'URL. - - Voici un exemple de document : - - {{{ - { - "_id":"discussion_tables", - "_rev":"D1C946B7", - "Subject":"I like Planktion", - "Author":"Rusty", - "PostedDate":"2006-08-15T17:30:12-04:00", - "Tags":["plankton", "baseball", "decisions"], - "Body":"I decided today that I don't like baseball. I like plankton." - } - }}} - - Un document peut être n'importe quel objet JSON, mais les champs de premier niveau ayant un nom commençant par ''_'' sont réservés à CouchDB. Les exemples évidents sont les champs ''_id'' et ''_rev'', comme on l'a vu ci-dessus. - - Autre exemmple : - - {{{ - { - "_id":"discussion_tables", - "_rev":"D1C946B7", - "Subrise":true, - "Sunset":false, - "FullHours":[1,2,3,4,5,6,7,8,9,10], - "Activities": [ -{"Name":"Football", "Duration":2, "DurationUnit":"Hours"}, -{"Name":"Breakfast", "Duration":40, "DurationUnit":"Minutes", "Attendees":["Jan", "Damien", "Laura", "Gwendolyn", "Roseanna"]} - ] - } - }}} - - Attention, par défaut la structure est à plat; dans ce cas l'attribut ''Activities'' est une structure donnée par l'utilisateur. - - == Tous les documents == - - Pour obtenir une liste de tous les documents dans la base utilisez l'URI spéciale ''_all_docs'' : - - {{{ - GET somedatabase/_all_docs HTTP/1.0 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - - Qui retourne une liste de tous les documents avec leurs ids révisons, trié par DocId (sensible à la casse) : - - - {{{ - HTTP/1.1 200 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Type: application/json - Connection: close - - { - "total_rows": 3, "offset": 0, "rows": [ - {"id": "doc1", "key": "doc1", "value": {"_rev": "4324BB"}}, - {"id": "doc2", "key": "doc2", "value": {"_rev":"2441HF"}}, - {"id": "doc3", "key": "doc3", "value": {"_rev":"74EC24"}} - ] - } - }}} - - Utilisez l'argument ''descending=true'' pour inverser l'ordre dans cette table : - - Ce qui retourne la même chose que ci-dessus mais dans l'ordre inverse : - - {{{ - HTTP/1.1 200 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Type: application/json - Connection: close - - { - "total_rows": 3, "offset": 0, "rows": [ - {"id": "doc3", "key": "doc3", "value": {"_rev":"74EC24"}} - {"id": "doc2", "key": "doc2", "value": {"_rev":"2441HF"}}, - {"id": "doc1", "key": "doc1", "value": {"_rev": "4324BB"}}, - ] - } - }}} - - Les options ''startkey'' et ''count'' peuvent en outre être utilisées pour limiter le nombre de résultats obtenus : - - {{{ - GET somedatabase/_all_docs?startkey=doc2=2 HTTP/1.0 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - - Qui retourne : - - {{{ - HTTP/1.1 200 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Type: application/json - Connection: close - - { - "total_rows": 3, "offset": 1, "rows": [ - {"id": "doc2", "key": "doc2", "value": {"_rev":"2441HF"}}, - {"id": "doc3", "key": "doc3", "value": {"_rev":"74EC24"}} -
[Couchdb Wiki] Update of "ApiBaseDeDonnéeHttp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ApiBaseDeDonnéeHttp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ApiBaseDeDonn%C3%A9eHttp?action=diff=3=4 Comment: tant pis - #language fr - Une introduction à l'API Base de Données HTTP de CouchDB. - - == Nommage et Adressage == - - Le nom d'une base de données doit être composé de caractères minuscules (a-z), chiffres (0-9) ou n'importe lequel de ces caractères ''_$()+-/'' et doit finir avec un '/' dans l'URL. Le nom noit commencer avec des caractères. - - {{{ - http://couchserver/databasename/ - http://couchserver/another/databasename/ - http://couchserver/another/database_name(1)/ - }}} - - ''Les caractères en majuscules NE SONT PAS AUTORISÉS dans le nom d'une base de données.'' - - {{{ - http://couchserver/DBNAME/ (invalid) - http://couchserver/DatabaseName/ (invalid) - http://couchserver/databaseName/ (invalid) - }}} - - Attention le caractère ''/'' dans le nom d'une base doit être échappé lorsqu'il est utilisé dans une URL, si votre base est nommée ''his/her'' alors elle sera accessible à l'adresse ''http://localhost:5984/his%2Fher''. - - ''Raisons de ces restrictions'' - - Les noms de bases de données ont des restrictions strictes afin de simpilfier l'association nom-fichier. Comme les bases de données peuvent être repliquées à travers différents systèmes d'exploitation, la façon de nommer les fichiers doit utiliser le plus petit commun dénominateur. Par exemple, ne pas autoriser les caractères en majuscules les rends compatibles avec les systèmes de fichiers ne respectant pas la casse. - - - == Liste des bases de données == - - Pour obtenir la liste des bases de données dans un serveur CouchDB utilisez l'URI ''/_all_dbs'' : - - {{{ - GET /_all_dbs HTTP/1.01 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - - Réponse : - - {{{ - HTTP/1.1 200 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Length: 37 - Content-Type: application/json - Connection: close - - ["somedatabase", "anotherdatabase"] - }}} - - == PUT (Créer une nouvelle base de donnée) == - - Pour créer une nouvelle base de donnée, envoyez une requête PUT à l'URL de la base de donnée. Actuellement le contenu de la requête PUT est ignoré par le serveur web. - - En cas de succès le code HTTP ''201'' est retourné. Si la base de donnée existe déjà une erreur ''409'' est retournée. - - {{{ - PUT /somedatabase/ HTTP/1.0 - Content-Length: 0 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - - La réponse du seveur : - - {{{ - HTTP/1.1 201 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Length: 13 - Content-Type: application/json - Connection: close - - {"ok": true} - }}} - - == DELETE == - - Pour supprimer une base de données, envoyez une requête DELETE sur l'URL de la base de donnée. - - En cas de succès un code HTTP ''202'' est retourné. Si la base de données n'existe pas une erreur 404 est renvoyée. - - {{{ - DELETE /somedatabase/ HTTP/1.0 - Content-Length: 1 - Date: Thu, 17 Aug 2006 05:39:28 +GMT - }}} - - La réponse du serveur : - - {{{ - HTTP/1.1 202 OK - Date: Thu, 17 Aug 2006 05:39:28 +GMT - Content-Length: 67 - Content-Type: application/json - Connection: close - - {"ok": true} - }}} - - == Informations d'une base de données == - - Pour récuperer les informations d'une base de donnée, envoyer une requête GET sur l'URL de la base de donnée, ex: - - {{{ - GET /somedatabase/ HTTP/1.0 - }}} - - La réponse du serveur est un objet JSON similaire à celui-ci : - - {{{ - {"db_name": "dj", "doc_count":5, "doc_del_count":0, "update_seq":13, "compact_running":false, "disk_size":16845} - }}} - - == Compactage == - - Les bases de données peuvent être compactées afin de réduire l'usage disque. Pour plus de détail voir [[Compactage]]. -
[Couchdb Wiki] Update of "andywenk" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "andywenk" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/andywenk?action=diff=10=11 Comment: <3 andy - ##master-page:HomepageTemplate - #format wiki - #language en - == Andy Wenk == - Hey, I am Andy. I am a CouchDB Committer since November 2013 and my actual focus is translating and documenting CouchDB. My preferred language is Ruby and JavaScript, I am mainly developing Rails apps and I am super curious in learning Erlang. - - Email: <> - - Twitter: [[http://twitter.com/awenkhh|@awenkhh]] - - === Translation === - - * [[https://wiki.apache.org/couchdb/Translation|Translation info in this Wiki]] - * [[https://wiki.apache.org/couchdb/Translator_Invitation_Process|Translator Invitation Process in this Wiki]] - * [[https://translate.apache.org/projects/CouchDB|ASF Translations service for CouchDB]] - * [[http://wiki.apache.org/couchdb/ContributorWorkflow|git workflow]] - - === Other stuff === - * [[https://wiki.apache.org/couchdb/Promotion_Guide|Promotion Guide]] - * [[https://wiki.apache.org/couchdb/Committer_First_Steps|Committer First Steps]] - * [[https://wiki.apache.org/couchdb/Committer_Election_Process|Committer Election Process]] - * [[http://wiki.apache.org/couchdb/Test_procedure|Test a Source Release]] - * [[https://wiki.apache.org/couchdb/Marketing|Marketing]] - * [[https://wiki.apache.org/couchdb/ContributorsGroup|Wiki contributors list]] - * [[https://whimsy.apache.org/committers/subscribe|quickly subscribe to mailing-lists (for ASF committers)]] - * [[http://svn.apache.org/repos/asf/couchdb/supplement/logo/|CouchDB logos]] -
[Couchdb Wiki] Update of "AllInOne" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "AllInOne" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/AllInOne?action=diff=10=11 Comment: See https://couchdb.apache.org/ for all-in-one downlaoders now - CouchDb requires many bits to be installed. - Building an all in one , embeddable, no external dependencies packaging of CouchDB for each major desktop OS (Windows, MacOSX and Linux) would help make it easy for new users to get started. Installers would be a bonus. - - Pioneering work has already been done with CouchDbx : a self-contained MacOSX application with all the required bits.. - - The goal here is to document: - * the minimal bits that are required to install a self-contained, all-in-one, embeddable CouchDb - * the step-by-step instructions to build those packages - * installers creation - - Some sources of inspiration: - * the Erlang NSIS installer for windows - * ejabberd: http://www.ejabberd.im/ - - Installer technologies: - * package builder on macos - * nsis on windows - * shell archives on linux - - IP and licensing issues - * since there are 3rd party dependencies that may be problematic, installers will fetch at install time the 3rd party dependencies. - * see that page for ASF policies: http://www.apache.org/legal/3party.html - * and that email thread for specific incubator PMC comments: - * http://mail-archives.apache.org/mod_mbox/incubator-general/200807.mbox/%3c003801c8e1e2$0c98fb30$0dfbfdc0@computer%3e , - * http://mail-archives.apache.org/mod_mbox/incubator-general/200807.mbox/%3c3ef9fb5a-d441-4e67-be2a-b23984a7f...@sun.com%3e - * http://mail-archives.apache.org/mod_mbox/incubator-general/200807.mbox/%3cf2e8eedf0807091057q77737020s8007e255eb255...@mail.gmail.com%3e -
[Couchdb Wiki] Update of "Board_Report/2014_05" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report/2014_05" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report/2014_05?action=diff=10=11 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - ## page was copied from Board_Report_Template - <> - This page has moved to - - https://cwiki.apache.org/confluence/display/COUCHDB/2014_05 - - Please edit the content there ... thank you! -
[Couchdb Wiki] Update of "Committer_First_Steps" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Committer_First_Steps" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Committer_First_Steps?action=diff=18=19 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Committer+First+Steps - <> - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Committer+First+Steps -
[Couchdb Wiki] Update of "Board_Report/2014_02" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report/2014_02" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report/2014_02?action=diff=9=10 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - <> - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2014_02 -
[Couchdb Wiki] Update of "Board_Report/2013_11" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report/2013_11" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report/2013_11?action=diff=10=11 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - ## page was copied from Board_Report_Template - <> - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2013_11 -
[Couchdb Wiki] Update of "Board_Report/2013_05" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report/2013_05" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report/2013_05?action=diff=9=10 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - <> - this content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2013_05 -
[Couchdb Wiki] Update of "BuildingWindowsDependencyLibraries" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BuildingWindowsDependencyLibraries" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BuildingWindowsDependencyLibraries?action=diff=2=3 Comment: See github.com/apache/couchdb-glazier - Here're the quick procedures for building dependency libraries of couchDB on Windows with Visual C++ Express edition SP1: - You will need the following software installed on your system: - - *[[http://www.microsoft.com/express/vc/|Visual C++ Express Edition SP1]] - *[[http://activestate.com|ActivePerl]] - - == Buildeing libeay32.dll == - - Download OpenSSL source file from [[http://www.openssl.org/source|OpenSSL]]. - Extract the source archive to working directory. - - open Visual Studio's command prompt from Start menu. Change directory to the working directory. - do cofiguration : - {{{ - perl Configure VC-WIN32 - }}} - - You have options here to use some assembler like MASM or NASM to get better performance. - But we don't them neither to make the story simple: - - {{{ - ms\do_ms - }}} - - Then build. - - {{{ - nmake -f ms\ntdll.mak - }}} - - If you want to confirm that the build went went right, you can test: - - {{{ - nmake -f ms\ntdll.mak test - }}} - - Now you'll find libeay32.dll in \out32dll. - Please rememver that this procedure is one of the quickest one only to get libeay32.dll. - Refer to official documemts for the build options or installing OpenSSL to your system. - - == Buildeing js32.dll (Spider Monkey) == - - Download Spider Monkey source file from [[http://www.mozilla.org/js/spidermonkey/|Here]]. - From mirrors or the download URL, download something like js-1.7.0.tar and extract - the archive to working directory. - - open Visual Sudio's command prompt from Start menu. Change directory to the working directory. - - Now you must be ready to build, but actually not. According to [[http://blog.endflow.net/?p=55=en|this site]], you must fix - js.mak before you start building the binary. - - After fixing (or replacing js.mak), do build: - - {{{ - nmake -f "js.mak" CFG="jsshell - Win32 Debug" - }}} - - And you will find js32.dll and jsshell.exe in the Debug directory under the working directory. -
[Couchdb Wiki] Update of "BoardReportMay2008" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BoardReportMay2008" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BoardReportMay2008?action=diff=3=4 Comment: migrated to https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - Temporary page to collect our board report for May 2008 - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2008_05 -
[Couchdb Wiki] Update of "Board_Report/2013_08" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report/2013_08" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report/2013_08?action=diff=8=9 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - <> - this content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2013_08 -
[Couchdb Wiki] Update of "BoardReportNovember2008" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BoardReportNovember2008" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BoardReportNovember2008?action=diff=4=5 Comment: Migrated to https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - Temporary page to collect our board report for November 2008 - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/2008_11 -
[Couchdb Wiki] Update of "Board_Reports" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Reports" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Reports?action=diff=9=10 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/ASF+board+reports - <> - = Board Reports = - - This page lists Apache CouchDB board reports. - - Content that was provided to the board as privileged information has been omitted. - - See the [[Board_Report_Guide|Board Report Guide]] for help preparing a report. - - == By Date == - - * [[Board_Report/2014_05|May 2014]] - * [[Board_Report/2014_02|February 2014]] - * [[Board_Report/2013_11|November 2013]] - * [[Board_Report/2013_08|August 2013]] - * [[Board_Report/2013_05|May 2013]] -
[Couchdb Wiki] Update of "Board_Report_Guide" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report_Guide" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report_Guide?action=diff=10=11 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Guide - <> - this content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Guide -
[Couchdb Wiki] Update of "BranchManagement" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BranchManagement" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BranchManagement?action=diff=4=5 Comment: No longer in step with reality...we're not on SVN for years now XD - #redirect Branch_management - == Feature Branches == - The CouchDB project uses feature branches to develop experimental features or refactorings without disrupting stability of the main trunk code. - - All branches are kept directly under the `incubator/couchdb/branches/` directory in the repository. - - === Creating a Branch === - - Feature branches are usually based on trunk. To create a branch, something like the following svn incantation should be used: - - {{{ - svn cp https://svn.apache.org/repos/asf/incubator/couchdb/trunk \ - https://svn.apache.org/repos/asf/incubator/couchdb/branches/feature-name - }}} - - Note that it's preferable to create the branch by specifying the full URLs to `svn cp`, as that won't let you end up with a branch based on different revisions of trunk, possibly because you forgot to `svn up` before creating the copy. - - When that's done, checkout the new branch and initialize [[http://www.orcaware.com/svn/wiki/Svnmerge.py|svnmerge]], which we'll use to keep the branch in sync with trunk. For example: - - {{{ - svn co https://svn.apache.org/repos/asf/incubator/couchdb/branches/feature-name - cd feature-name - svnmerge init - svn commit -m "Initialized svnmerge." - }}} - - === Keeping the Branch in Sync === - - Changes made in trunk need to be ported to the branch. This is done by utilizing [[http://www.orcaware.com/svn/wiki/Svnmerge.py|svnmerge]]. - - To see the changes available for being merged, use the `svnmerge avail --log` command. - - To merge all the changes, use `svnmerge merge`. Or you can cherry-pick the changes to mark by specifying the revisions, for example `svnmerge merge -r 123-125,188`. If there's some change that you don't want to port (possibly because it no longer applies to the code on the branch), use `svnmerge block -r 122`. - - As always with merging (and patching), be careful about properly resolving conflicts. - - === Merging the Branch Back into Trunk === - - When the branch has reached a certain level of stability, it should be merged back into trunk (assuming there's consensus that the branch is good and ready). - - First, make sure that the feature branch is in sync with trunk, that is, merge any remaining changes on trunk to the branch as explained above. - - Then, switch into the directory containing your working copy of trunk, use `svn up` to learn the latest revision (we'll pretend that's 12345), and issue an `svn merge` command like the following: - {{{ - cd trunk - svn up - svn merge https://svn.apache.org/repos/asf/incubator/couchdb/trunk@12345 \ - https://svn.apache.org/repos/asf/incubator/couchdb/branches/feature-name@12345 - }}} - - After the merge is done, please remember to clear the `svnmerge`-related properties from the trunk directory, to avoid problems with future branches: - - {{{ - cd trunk - svnmerge uninit - }}} - - === Further Reading === - - See the [[http://svnbook.red-bean.com/en/1.4/svn.branchmerge.commonuses.html#svn.branchmerge.commonuses.patterns.feature|Feature Branches]] chapter in the [[http://svnbook.red-bean.com/|SVN book]], as well as the [[http://www.orcaware.com/svn/wiki/Svnmerge.py|svnmerge documentation]] for more information. -
[Couchdb Wiki] Update of "Board_Report_Template" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Board_Report_Template" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Board_Report_Template?action=diff=7=8 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Template - <> - This content has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Template -
[Couchdb Wiki] Update of "BreakingChangesUpdateTrunkTo0Dot9" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BreakingChangesUpdateTrunkTo0Dot9" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BreakingChangesUpdateTrunkTo0Dot9?action=diff=6=7 Comment: Migrated to http://docs.couchdb.org/en/latest/whatsnew/index.html - The latest CouchDB update brings a mature replication model for distributed updates. This involved quite a lot of changes to the internal handling of MVCC tokens. The result is what we think will be a stable and scalable model for distributed updates. It also means that both the replication API and the database file format have changed at the same time. - Normally when the database file format changes upgrading can be accomplished by launching two copies of CouchDB on two different ports and replicating between them. In this case that won't work as the replication API has changed. - - I've written a script to do the replication for you. It's linked there and embedded below. It's not perfectly awesome (see caveats later) but it does the trick and won't blow up on databases with lots of docs. Nor does it fill up your filesystem with intermediate data. - - == Usage == - First you need the latest CouchRest Ruby gem (0.2.2). I never met a packaging system I didn't hate, so I won't even suggest that you attempt to install CouchRest from a remote gem server. Instead do this: - - {{{ - git clone git://github.com/jchris/couchrest.git - cd couchrest - gem build couchrest.gemspec - sudo gem install couchrest-*.gem - }}} - - Now that you have the latest CouchRest, you can download the script (see the bottom of this page) save it into a file `couchdb_trunk_update_script.rb`, adjust the `OLD_HOST` and `NEW_HOST` to reflect your environment, and start it up. It does give some output every 100 docs, so you won't be totally at a loss to what's happening. - - {{{ - ruby couchdb_trunk_update_script.rb - }}} - - It assumes that none of the databases on your `OLD_HOST` exist on your `NEW_HOST`. If they do exist it will skip them. - - It also assumes that none of your individual attachments are larger than the memory you can dedicate to the Ruby runtime. Coding a streaming attachment solution would be a fair amount more work. If you need it patches are welcome but I think you might be better off with a different approach. My script batches updates into blocks of 100 docs. - - If you have giant attachments, I'd do the docs one at a time, and stream each attachment individually. It'd probably be easier to shell out to curl from Ruby than to try to code it as a Ruby `Net::HTTP` operation. - - Dueling Couches - To run CouchDB in two ports at once, you should run them in separate directories. The easiest way to do this from the source package is with the make dev target. You'll want to checkout CouchDB trunk in one directory, like so: - - {{{ - svn co https://svn.apache.org/repos/asf/couchdb/trunk - }}} - - And then there's a handy tag of the last time the old file format was available, so check it out in another directory: - - {{{ - svn co https://svn.apache.org/repos/asf/couchdb/tags/bulk_transactions - }}} - - Once you have make dev completed in both checkouts, copy your existing old-format databases (the `.couch` files) to the `tmp/lib` directory of the bulk_transactions checkout. When you run it with utils/run you should be able to browse those databases in Futon. - - Now, edit the trunk CouchDB's configuration so that it runs on port 5985 instead of 5984. This you can do by changing the `etc/couchdb/local_dev.ini` file that was created by `make dev`. Once that's done you can launch trunk CouchDB with `utils/run` - - == The Script == - {{{ - require 'rubygems' - require 'couchrest' - - # this is the CouchDB where all the old databases are - OLD_HOST = "http://127.0.0.1:5984; - - # this is the CouchDB we want to copy to - NEW_HOST = "http://127.0.0.1:5985; - - old_couch = CouchRest.new(OLD_HOST) - new_couch = CouchRest.new(NEW_HOST) - - databases = old_couch.databases - - databases.each do |dbname| - if new_couch.databases.include?(dbname) - puts "the database '#{dbname}' already exists on the target" - puts "patches welcome for picking this process up in the middle" - puts "for now if it fails in the middle you could just comment out these lines" - puts "but you'll do double work and end up with spurious conflicts" - puts - puts - else - upgrader = CouchRest::Upgrade.new(dbname, old_couch, new_couch) - upgrader.clone! - end - end - }}} - - - Output should look something like: - - {{{ - $ ruby upgrade.rb - canon - 1 docs - posting 1 bulk docs to http://jchrisa.net:5985/canon/_bulk_docs?all_or_nothing=true - commit-hooks - 2 docs - posting 2 bulk docs to http://jchrisa.net:5985/commit-hooks/_bulk_docs?all_or_nothing=true - drl - 297 docs - posting 100 bulk docs to
[Couchdb Wiki] Update of "BreakingChanges" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "BreakingChanges" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/BreakingChanges?action=diff=7=8 Comment: Migrated to http://docs.couchdb.org/en/latest/whatsnew/index.html - #redirect Breaking_changes - This page documents backwards-incompatible changes made during the evolution of CouchDB. While not all such changes will necessarily affect all users, most of them probably will. This page should show you what changed and how you'll need to adapt your code. - == Changes Between 0.7.x and 0.8.0 == - - === Database File Format === - - The database file format has changed. CouchDB itself does yet not provide any tools for migrating your data. In the meantime, you can use third-party scripts to deal with the migration, such as the dump/load tools that come with the development version (trunk) of [[http://code.google.com/p/couchdb-python/|couchdb-python]]. - - Migration Using the couchdb-python `dump`/`load` Tools - - First, some important notes on the way these tools operate: - * They work on a per-database basis, meaning you'll need to migrate all databases individually. - * The dump tool retrieves all documents, including attachments, from a database and writes them to standard output in MIME multipart format. - * The load tool expects that MIME multipart on the standard input stream, and recreates all the documents (including attachments) it contains. It should be used with an empty target database. - * Documents of course retain their unique identifiers. - * The revision history of the documents is completey discarded. - - '''Note''': ''Do not upgrade CouchDB until you've gotten your data out using the procedure described below!'' - - '''Also note''': ''Please keep backups of both the original database files and the dump files, at least until you've verified that the migration worked completely.'' - - To use the tools, you'll have to install `couchdb-python` (currently from trunk), which in turn requires [[http://www.python.org/|Python 2.4]] and the [[http://code.google.com/p/httplib2/|httplib2]] and [[http://cheeseshop.python.org/pypi/simplejson|simplejson]] packages. - - On the shell, enter the directory into which you checked out the `couchdb-python` code. First run to make sure the package is installed: - - {{{ - ./setup.py install - }}} - - Now, to dump the contents of a particular database into a file, run the following command: - - {{{ - python couchdb/tools/dump.py http://127.0.0.1:5984/dbname > dbname.dump - }}} - - Replace '''dbname''' with the name of the database to dump. This will create a file called `dbname.dump` in the current directory. - - After you've done this for all the databases you want to migrate, you can upgrade CouchDB. You will need to completely clear the directory where CouchDB stored the old databases, as it will probably choke on files using the old format. - - After the upgrade you can import all the data you previously exported. First, you'll need to create an empty database for every database dump you want to import. Then you execute the `load.py` script from the command-line as follows: - - {{{ - python couchdb/tools/load.py http://127.0.0.1:5984/dbname < dbname.dump - }}} - - Do that for all your databases, and you should be set. Please report any bugs in those scripts [[http://code.google.com/p/couchdb-python/issues/list|here]]. - - === Document Structure Changes === - - In the JSON structure for attachments, the member name `content-type` has been changed to `content_type` (note the underscore). This change was made for consistency with the general naming scheme in CouchDB, and enable easier access from Javascript code. - - === View Definition Changes === - - Views now support optional reduce. For this to work, the structure of view definitions in design documents had to change. An example is probably the best way to illustrate this: - - {{{ - { - "_id":"_design/foo", - "language":"javascript", - "views": { - "bar": { - "map":"function... ", - "reduce":"function..." - } - } - } - }}} - - Notable changes are the usage of a JSON object to define both the map and the reduce function instead of just a string for the map function. The `reduce` member may be omitted. - - The `language` member is no longer a MIME type, instead, only the language name is specified. The language name maps exactly to the name chosen for a view server registration in `couch.ini`. - - The `map(key, value)` function that map functions would use to produce output has been renamed to `emit(key, value)` to avoid confusion. - - {{{ - function(doc) { - emit(doc.foo, doc.bar); - } - }}} - - Temporary views now need to get `POST`ed a JSON document with `map` and `reduce` members instead of just `POST`ing the raw source of the map function: - -
[Couchdb Wiki] Update of "Breaking_changes" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Breaking_changes" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Breaking_changes?action=diff=30=31 Comment: Migrated to http://docs.couchdb.org/en/latest/whatsnew/index.html - <> - = Breaking Changes = - - See also the [[http://docs.couchdb.org/en/latest/changelog.html|official documentation]] for this topic. - - <> - - This page documents backwards-incompatible changes made during the evolution of CouchDB. While not all such changes will necessarily affect all users, most of them probably will. This page should show you what changed and how you'll need to adapt your code. - - == Changes Between 1.1.0 and 1.2.0 == - - === Backwards compatibility === - - * Dropped 0.9.0 database format support. - - === _users database === - - * User documents can now only be read by the respective users as well as admins, but not other or anonymous users. - * Views can only be defined and queried by admins. - * The `_changes` feed can only be queried by admins. - - === _replicator database === - - * Documents will now have a forced `owner` field that corresponds to their authenticated user name. - * Users that are not the owner of a replication document will not see confidential information like passwords or oath tokens. The rest of the information is visible though. Admins can see everything. - * Views can only be defined and queried by admins. - - === document and view file compression === - - * The new optional compression of disk files requires an upgrade of the on-disk format (5->6) which occurs on creation for new databases and views, and on compaction for existing ones - * This format is not supported in previous versions, so rollback would require replication to the previous CouchDB release, or restore from backup - * adding {{{compression = none}}} to your {{{local.ini [couchdb]}}} section disables compression but the ondisk format will still be upgraded as above - * file compression is enabled by default - - == Changes Between 1.0.0 and 1.1.0 == - - * Document id's are now validated during PUT. This means that some PUT requests will fail that previously succeeded. - - == Changes Between 0.11.0 and 1.0.0 == - - Note, to replicate with a 1.0 CouchDB instance you must first upgrade in-place your current CouchDB to 1.0 or 0.11.1 -- backporting so that 0.10.x can replicate to 1.0 wouldn't be that hard. All that is required is patching the replicator to use the application/json content type. - - * _log and _temp_views are now admin-only resources. - * _bulk_docs now requires a valid `Content-Type` header of `application/json`. - * jsonp is disabled by default. An .ini option was added to selectively enable it. - * The key, startkey and endkey properties of the request object passed to list and show functions now contain JSON objects representing the URL encoded string values in the query string. Previously, these properties contained strings which needed to be converted to JSON before using. - - == Changes Between 0.11.0 and 0.11.1 == - - * _log and _temp_views are now admin-only resources. - * _bulk_docs now requires a valid `Content-Type` header of `application/json`. - * jsonp is disabled by default. An .ini option was added to selectively enable it. - * The key, startkey and endkey properties of the request object passed to list and show functions now contain JSON objects representing the URL encoded string values in the query string. Previously, these properties contained strings which needed to be converted to JSON before using. - - - == Changes Between 0.10.x and 0.11.0 == - - === show, list, update and validation functions === - The `req` argument to show, list, update and validation functions now contains the member `method` with the specified HTTP method of the current request. Previously, this member was called `verb`. `method` is following RFC 2616 (HTTP 1.1) closer. - - === _admins -> _security === - The /db/_admins handler has been removed and replaced with a /db/_security object. Any existing `_admins` will be dropped and need to be added to the security object again. The reason for this is that the old system made no distinction between names and roles, while the new one does, so there is no way to automatically upgrade the old admins list. - - The security object has 2 special fields, `admins` and `readers`, which contain lists of names and roles which are admins or readers on that database. Anything else may be stored in other fields on the security object. The entire object is made available to validation functions. - - === json2.js === - JSON handling in the query server has been upgraded to use json2.js. This allows us to use faster native JSON serialization when it is available. - - In previous versions, attempts to serialize `undefined` would throw an exception, causing the doc that
[Couchdb Wiki] Update of "Built-In_Reduce_Functions" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Built-In_Reduce_Functions" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Built-In_Reduce_Functions?action=diff=7=8 Comment: Migrated to http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions - <> - = Built-In Reduce Functions = - - See also the [[http://docs.couchdb.org/en/latest/ddocs.html#reduce-and-rereduce-functions|official documentation]] for this topic. - - <> - - CouchDB has three built-in reduce functions. These are implemented in Erlang and run right inside CouchDB, so they are much faster than the equivalent JavaScript functions. - - == Usage == - To use built-in reduce functions, you simply need to replace your reduce function with the string {{{_count}}}, {{{_sum}}} or {{{_stats}}} (without any preceding or tailing whitespace). - - Here is an example design document using built-in reduce functions: - {{{ - { - "_id":"_design/company", - "_rev":"12345", - "language": "javascript", - "views": - { - "all_customers": { - "map": "function(doc) { if (doc.type == 'customer') emit(doc.id, 1) }", - "reduce" : "_count" - }, - "total_purchases_by_customer": { - "map": "function(doc) { if (doc.type == 'purchase') emit(doc.customer_id, doc.amount) }", - "reduce": "_sum" - } - } - } - }}} - - == Available Built-In Functions == - - === _sum === - {{{_sum}}} just adds up the emitted values, which must be numbers. - - The !JavaScript equivalent is: - {{{ - function(keys, values, rereduce) { - return sum(values); - } - }}} - - - === _count === - {{{_count}}} counts the number of emitted values. (It's like {{{_sum}}} for {{{emit(foo, 1)}}}.) It ignores the contents of the values, so they can by any type. - - The !JavaScript equivalent is: - {{{ - function(keys, values, rereduce) { - if (rereduce) { - return sum(values); - } else { - return values.length; - } - } - }}} - - - === _stats === - - {{{_stats}}} calculates some numerical statistics on your emitted values, which must be numbers. - - The reduce output is an object that looks like this: - {{{ - {"sum":2,"count":2,"min":1,"max":1,"sumsqr":2} - }}} - - {{{"sum"}}} and {{{"count"}}} are equivalent to the {{{_sum}}} and {{{_count}}} reductions. {{{"min"}}} and {{{"max"}}} are the minimum and maximum emitted values. {{{"sumsqr"}}} is the sum of the squares of the emitted values (useful for statistical calculations like standard deviation). -
[Couchdb Wiki] Update of "Building_from_source_on_Windows" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Building_from_source_on_Windows" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Building_from_source_on_Windows?action=diff=5=6 Comment: See https://github.com/apache/couchdb-glazier - <> - <> - - = CouchDB 1.0 onwards = - - Building CouchDB from source on Windows requires 4 different compilers and - attention to detail. Significant effort goes into setting up the toolchain - correctly to compile Erlang/OTP from source, so that the subsequent Erlang and - CouchDB builds ends up with matching Visual C++ Runtime components and a valid - Side-by-Side (SxS) configuration. - - This wiki page has been superseded by the - [[https://github.com/apache/couchdb/blob/master/INSTALL.Windows|INSTALL.Windows]] - file in the CouchDB source tree, and a - [[https://github.com/dch/glazier/|community-provided]] build process. - - The remaining notes are provided for historic reference only. - - = CouchDB 0.10 to 0.11.2 = - - As of couchdb 0.10, support for Windows is included in the standard build process. View [[https://github.com/apache/couchdb/blob/0.10.0/README|README]] in the root of the source tree for information about the dependencies and how to configure the build process. In summary, you will need to: - - * Install the cygwin environment. - - * Install the MS C compiler. - - * Install and possibly build a number of pre-requisites, such as curl, icu, spidermonkey, etc. - - * get the sources to erlang and couch - - * configure and build erlang according to the instructions. - - * configure and build couch according to the [[https://github.com/apache/couchdb/blob/0.10.0/README|README]] file in couch - - After executing 'make install', you will find a couchdb directory structure inside your erlang directory - that is, the couch build process simply installs its libraries into the erlang binaries you previously build. This directory structure should be ready to roll - it can be zipped up, packaged by an installer, etc. - - = Prior to CouchDB 0.10 = - - CouchDB does not natively install on Windows but it is possible to install it by hand. '''Be aware that many unit tests fail due to IO-related features that aren't supported by Erlang on Windows.''' - - Please update this guide as needed, we aim to collect feedback and roll the procedure into the official build. - - These instructions currently refer to paths as they'd be set up in a default installation of Erlang OTP 5.7.1, with the couchDB distribution installed at - - {{{ - C:\Program Files\erl5.7.1\lib\apache-couchdb-0.9.0 - }}} - - == Dependencies == - - You will need the following software installed on your system: - - * [[http://www.erlang.org/download.html|Erlang/OTP]] - * C Compiler/Linker (such as [[http://gcc.gnu.org/|GCC]] or [[http://msdn.microsoft.com/en-us/visualc/default.aspx|Visual C++]]) - * Make (such as [[http://www.gnu.org/software/make/|GNU Make]] or [[http://msdn.microsoft.com/en-us/library/dd9y37ha(VS.71).aspx|nmake]]) - * [[http://www.openssl.org/|OpenSSL]] - * [[http://www.icu-project.org/|ICU]] (Tested with [[http://www.icu-project.org/download/4.0.html|binary build of 4.2 release]].) - * [[http://www.mozilla.org/js/spidermonkey/|SpiderMonkey]] - - == Install CouchDB as an Erlang Library Directory == - - After installing Erlang you should having something similar to: - - {{{ - C:\Program Files\erl5.7.1 - }}} - - Copy the whole CouchDB source tree to: - - {{{ - C:\Program Files\erl5.7.1\lib\apache-couchdb-0.9.0 - }}} - - Make the following empty directories: - - {{{ - C:\Program Files\erl5.7.1\lib\mochiweb-0.01\ebin - }}} - - {{{ - C:\Program Files\erl5.7.1\lib\apache-couchdb-0.9.0\ebin - }}} - - == Provide ICU to Erlang == - - From ICU copy `icu*.dll` (and `libeay32.dll` for older versions of ICU) to: - - {{{ - C:\Program Files\erl5.7.1\erts-5.7.1\bin - }}} - - == Build SpiderMonkey == - - The SpiderMonkey distribution's Windows build stuff is broken. See [[http://blog.endflow.net/?p=55=en|this blog post]] for a working js.mak file. Don't bother trying to import the project file into a contemporary Visual Studio; just use the Visual Studio command line tools with the js.mak file referred to above. - - CouchDB uses a custom JavaScript driver, which provides unicode and buffering improvements. In the !SpiderMonkey distribution, rename src/js.c to src/js.c.bak, and copy {{{C:\Program Files\erl5.6.3\lib\couchdb-0.8.1\src\couchdb\couch_js.c}}} from the CouchDB distribution to src/js.c in the !SpiderMonkey distribution. Before running nmake, edit the new js.c and change {{{#include }}} to {{{#include "jsapi.h"}}}. - - Once you've built js.exe and js32.dll, copy them both to - - {{{ - C:\Program Files\erl5.7.1\erts-5.7.1\bin - }}} - - and rename js.exe to couch_js.exe. - - ''Here are the binaries built according to the blog post:
[Couchdb Wiki] Update of "ContributorWorkflow" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ContributorWorkflow" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ContributorWorkflow?action=diff=18=19 - <> - This page has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Source+Control -
[Couchdb Wiki] Update of "Building_The_Source_On_Nix" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Building_The_Source_On_Nix" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Building_The_Source_On_Nix?action=diff=2=3 Comment: See the README-DEV.md file in the main source repository - <> - === Building from source on *nix based systems. === - - Most *nix based systems have access to compilers like GCC, and other build utilities like Make to build software for a specific system. The following is a generic example of the required syntax used when building CouchDB with the Make utility. Please remember that you will need to satisfy any dependencies that CouchDB may have before you can successfully build and run CouchDB. - - Example 1 - {{{ - make clean && make distclean && ./bootstrap && ./configure && make check && make - }}} - - '''Tips/Hints''' - - * If you have trouble/wired errors building from source, it is always good starting point to reset the repository to a clean state and retry. - * *nix generally refers to Unix or Unix like systems including Linux, BSD, etc. -
[Couchdb Wiki] Update of "Build_Tests" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Build_Tests" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Build_Tests?action=diff=24=25 Comment: Replaced by Jenkins/Travis; see the apache/couchdb and apache/couchdb-ci repositories - <> - These are tests for the build system. - - You should only need to care about this if you are working on the build system. - - These tests should demonstrate that the core functionality is working. - - = Steps = - - Boot a new AWS instance. - - {{{ - export AM_DISTCHECK_CONFIGURE_FLAGS=--disable-tests - }}} - - Install Git and regular dependencies. - - {{{ - git clone http://git-wip-us.apache.org/repos/asf/couchdb.git - }}} - - Switch to the branch or tag you are testing. - - {{{ - ./bootstrap && ./configure && make - }}} - - This should fail. - - Install some required build dependencies. - - {{{ - ./bootstrap && ./configure && make - }}} - - This should fail. - - Install all required build dependencies. - - {{{ - ./bootstrap && ./configure && make distcheck - }}} - - This should fail. - - {{{ - ./bootstrap && ./configure && make dist - }}} - - Export the distribution artefact. - - {{{ - ./bootstrap && ./configure --enable-strictness && make - }}} - - This should fail. - - Install some optional build dependencies. - - {{{ - ./bootstrap && ./configure --enable-strictness && make - }}} - - This should fail. - - Install all optional build dependencies. - - {{{ - ./bootstrap && ./configure --enable-strictness && make distcheck - }}} - - Export the distribution artefact. - - You should now have two exported distribution artefacts. - - Terminate this AWS instance. - - Boot a new AWS instance. - - {{{ - export AM_DISTCHECK_CONFIGURE_FLAGS=--disable-tests - }}} - - Import both distribution artefacts. - - Install regular dependencies. - - Unpack both distribution artefacts. - - Run the following command in both distribution directories. - - {{{ - ./configure && make dist - }}} - - Switch to the distribution artefact with docs. - - {{{ - ./configure --prefix=/tmp/install/some-with && make install - }}} - - Switch to the distribution artefact without docs. - - {{{ - ./configure --prefix=/tmp/install/some-without && make install - }}} - - Install all optional build dependencies. - - Run the following command in both distribution directories. - - {{{ - ./configure && make distcheck - }}} - - Switch to the distribution artefact with docs. - - {{{ - ./configure --prefix=/tmp/install/all-with && make install - }}} - - Switch to the distribution artefact without docs. - - {{{ - ./configure --prefix=/tmp/install/all-without && make install - }}} - - {{{ - cd /tmp/install/some-with && find . > /tmp/install/some-with.files - cd /tmp/install/some-without && find . > /tmp/install/some-without.files - diff /tmp/install/some-with.files /tmp/install/some-without.files - }}} - - You should see a diff that lists all the documentation files that are missing. - - {{{ - cd /tmp/install/all-with && find . > /tmp/install/all-with.files - cd /tmp/install/all-without && find . > /tmp/install/all-without.files - diff /tmp/install/all-with.files /tmp/install/all-without.files - }}} - - There should be no output. -
[Couchdb Wiki] Update of "Build_Process" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Build_Process" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Build_Process?action=diff=1=2 Comment: Outdated; fully redone in couchdb 2.x998 - # Build Process - This page covers the different build processes for several forks of CouchDB while we look at approaches for merging them, & improving the usability & flexibility of the current toolchain. - - <> - <> - - - = Build summary = - - - VoilĂ , hopefully this thread can be a good start for merging rcouch, - bigcouch & apache couchdb and will ease merge of the other features imo. - - == Apache CouchDB build == - - * based on autotools - * install couchdb on the system - * use and require shared libraries installed on the system: - spidermonkey, openssl, curl, icu - * require Erlang installed on the target system - * Embedding couchdb is possible but difficult. - * no hot upgrade possible - * build on linux*, unix*, bsd*, macosx, windows on i386, amd64 - platforms. Building on other platorms is possible modulo hacks on the - libraries and erlang. Windows requires a [[http://wiki.apache.org/couchdb/Installing_on_Windows|specific environment]] - - == Rcouch build == - - * makefile based - * use [[https://github.com/basho/rebar/wiki|rebar]] - * build as an [[http://www.erlang.org/doc/design_principles/release_structure.html#id75442|OTP release]] : the runtime is distributed as part of - the release and custom Erlang application can be added to the build - easily, rebar is used for it. - * all libraries are fetched and built as static module that will be - statically linked: no need to install the libraries on the target - system once the release is built. The libraries are automatically - patched and built for each supported platforms. - * build on linux*, unix*, bsd*, solaris, macosx, windows possible but need to be - adapted - * can be embedded in other Erlang applications easily: propose a - [[https://github.com/refuge/couch_core|couch_core]] that can be used by any other platforms - * an rcouch build can be distributed and installed on the same platform - it has be been built for without requiring any other installation. - * can build a source release with all dependencies integrated. - * propose release templates to build [[https://github.com/refuge/rcouch_template|custom release]] - * hot upgrade possible - - - == Bigcouch build == - - * makefile based - * use rebar - * build an OTP release, rebar is used for it - * build couchjs using scons to find spidermonkey on the system - * libraries are not statically linked and path to find libs are set in - rebar.config - * build on linux*, unix*, bsd*, solaris - * can be embedded in other erlang apps, but requires libs installed in - fixed paths. Also the couch application is integrated on the release - so specific build require to fork this release. - * hot upgrade possible - - == New build system proposal == - - This proposal is based on the following requirements: - - * Possibility to embed couchdb in other erlang apps - * Create a full Erlang OTP release - * Support rebar - * Possibility to ship a static build of apache couchdb for each - supported platform - * Possibility to reuse installed libraries on targeted systems (good for - distributions packagers) - * Erlang dependencies should be always available and shipped with the - source release. - - The first 2 points requires in my opinion that we can build a full couchdb - core that can be included easily in other erlangs apps. It should also - be fetched without apache-couchdb build system. The perfect way to - handle it in the Erlang world today is by using rebar and create a - {{{rebar.config}}} eventually fetching needed dependencies etc. Also some will - want to build their release statically and not care about dependencies - to install when they distribute or build their own code. - - A rebar build need to know where to find shared or static libs. Some - paths can be set using env. It can be also possible to call external - scripts that will be used to build external C code and eventually set - some makefiles. rebar proposes a system of pluging to extend its - possibilities. - - To use shared libraries the 2 majors and working systems today are - autotools and cmake. While cmake is interresting I think that some of us - are pefectly fluent with autotools so it may be better to use them. - - I propose to mix autotools and rebar in the build process. Also I - propose to fetch erlang dependencies on build or on release instead of - having them in our sources like now. Erlang dependencies are for now: - mochiweb, oauth, ibrowse, snappy & ejson. - - - Imo the new build process could be the following: - - * autootools used to boostrap the build: create make file and set rebar - config files using templates. - * 2 rebar config files will be
[Couchdb Wiki] Update of "Commandline_CouchDB" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Commandline_CouchDB" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Commandline_CouchDB?action=diff=1=2 Comment: Nothing here? - Add notes about talking to CouchDB from the command line. - couchdbkit - curl & friends - httpie - yajl -
[Couchdb Wiki] Update of "Coding_Standards" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Coding_Standards" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Coding_Standards?action=diff=4=5 Comment: Outdated, unfortunately. We need a new one of these. - CouchDB comes with code in a variety of different languages. While the core is written in Erlang, there are some parts written in C, others written in HTML, CSS, and Javascript, and then there are also shell scripts, Makefiles, et cetera. - First, some general rules: - - 1. Always use spaces for indentation, not tabs, except in Makefiles. - 1. Use four spaces for indentation in Erlang and C code, two spaces in HTML, CSS, and Javascript. - 1. Try to keep lines shorter than 80 characters. - 1. When you edit a file, try to stick with the conventions used in the surrounding code. - 1. Avoid trailing spaces and newlines in your files. Good editors usually have a configuration option that prevents this from happening. - 1. Avoid mixing purely cosmetic changes (such as removing trailing white-space) with functional changes, as that makes review of the actual change (whether it’s a check-in or a patch) much more difficult. - - For more detailed coding conventions for Erlang code, please see the [[http://www.erlang.se/doc/programming_rules.shtml|Erlang Programming Rules and Conventions]]. -
[Couchdb Wiki] Update of "CommitPolicy" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CommitPolicy" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CommitPolicy?action=diff=2=3 Comment: See https://couchdb.apache.org/bylaws.html - <> - = Committer Git Policy = - - This page explains policies about receiving integrating your work (as a CouchDB committer) with non-committers' work, with an emphasis on using Git. - - Git (and GitHub) reduce the (technical) friction of receiving patches to CouchDB, so this page should clarify what to do and not to do to stay within Apache's policy. - - This page is derived from Paul Davis's [[http://mail-archives.apache.org/mod_mbox/couchdb-dev/201202.mbox/%3CCAJ_m3YBdyeJZMuEuGZiBC=fpkc7ZB=v+0qudjp9sqjsyb0i...@mail.gmail.com%3E|email about the topic]]. - - == Background == - - First things first, as a committer you have to remember the ICLA that - you signed. Its your responsibility to make sure that all code you - push to the repository is compliant with ASF policies and the legal - aspects those entails. - - Before Git, the general policy we used in CouchDB was to request that - non-trivial patches be ''submitted to JIRA'' and have people click the - checkbox. While this captures the general intent of things, it has - been declared an official position of the board that this is - ''unnecessary for accepting contributions''. It has also been decided that - the ''committer and author fields do not have to be tied to specific - Apache accounts''. - - The policy as it stands now is that we must be able to '''demonstrate - that there was a clear intent''' for the code in question to be - contributed. While there hasn't been an official position on how to - demonstrate intent I think there are a couple things that are fairly - obvious: - - === Traditional === - - 1. Same as always: Anything submitted to JIRA. The check box has been declared not a necessity though I think the input field is required, and if someone said "not-intended for inclusion" we should just clarify if that was an accident or not. - 2. Patches submitted to a mailing list. - - === New with Git === - - 1. If someone posts a link to a publicly available Git branch with language indicating their intent for it to be included, then we should feel free to add the repo as a remote and yank it in. While not absolutely necessary, it might be a good idea to rewrite the commit message to reference either the email or the original contributed commit sha (in case of a rebase) so that we can link the two. - 2. Jukka Zitting has recently been doing work on connecting GitHub Pull Requests to the dev@ mailing lists. Assuming this is the case I think we should feel free to take any code submitted in this manner. Thus our old "Submit that to JIRA" would be a "Send us a Pull Request". - - In contrast, we shouldn't feel free to just find code in a random - GitHub fork and push that onto ASF hardware. If there's something we - see that we want then we should ask for clarification (plus that's - only polite). - - === Bottom Line === - - As a committer you're responsible for the code that you - push to the repository. If you're not sure on a specific patch or - situation, bring it up to dev@ or similar venue and we can run it up - the flag pole until we find an answer. - - == FAQ == - - > Must the non-committer attach the exact same commit id? Or is it - > sufficient that it merely be the same diff (delta)? (I changed the ID - > when I rebased his commit and added my email to the committer header.) - - No. Commit SHA's are in no way important from a license perspective. - - > Before the JIRA license agreement, may we push non-committers' code to - > the repo at all? - > - - Kinda, see the "Pushing to ASF" section above. - - > Before the JIRA license agreement, may we push non-committers' code to - > the more official branches: master, 1.2.x, etc.? - > - > May we push whatever we want so long as the license agreement is - > signed (checked) before voting on a release artifact? - - Definitely not. Never push code to ASF hardware that you're not 100% certain is OK to be in the repository. That doesn't necessarily mean that it has to have the ASF license attached, but if you don't know that it can be in the repo, don't push it. - - - > Does the author or committer of a commit have to be an ASF person? - - No. -
[Couchdb Wiki] Update of "Committers" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Committers" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Committers?action=diff=14=15 Comment: See http://people.apache.org/phonebook.html?unix=couchdb - <> - * [[http://damienkatz.net/|Damien Katz]], `` - -Original developer and former project lead. - - * [[http://jan.prima.de/|Jan Lehnardt]], `` - -Worked on the original UNIX port and now works on all ends in CouchDB. He is a freelancing CouchDB consultant and gives presentations around the world. - - * [[http://tumbolia.org/nslater|Noah Slater]], `` - -Developed and maintains the Autotools build system and application infrastructure. He is CouchDB's release manager and maintains a number of related packages for Debian GNU/Linux. - - * [[http://www.cmlenz.net/|Christopher Lenz]], `` - -Developed and maintains Futon, the Web administration console. He works on the !JavaScript view engine, !SpiderMonkey and !MochiWeb integration in addition to an external Python client. - - * [[http://jchris.mfdz.com|J. Chris Anderson]], `` - - Upgraded the Erlang JSON term format. Integrates community patches, particularly related to the HTTP API and the !MapReduce system. Gives talks and presentations about CouchDB, with an eye toward recruiting more developers. - - * [[http://www.davispj.com/|Paul J. Davis]], `` - - Developed features for the HTTP API as well as helped with recent upgrades to the !MapReduce system. Spends time tracking down various bugs reported in JIRA. - - * Adam Kocoloski, `` - - Maintains and extends the replicator. Hacks on various other parts of the core database. - - * Mark Hammond, `` - - Windows support. - - * [[http://www.jasondavies.com/|Jason Davies]], `` - - Developed various authentication features including cookie-based authentication and OAuth support. - - * [[http://fdmanana.wordpress.com/|Filipe Manana]], `` - - Works mostly on the replicator, some parts of the core database and the security features. - - * Robert Newson, `` - - Contributes bug fixes and small features. - - * Randall Leeds, `` - - Squashes bugs and tunes performance. Tweaks API interoperabilities, forward-/backward-compatibility and developer interactions. Maintains CouchDB-Lounge. - - * Dave Cottlehuber, `` - - Stands on the shoulders of giants. Enjoys pushing red furniture through Windows. - - * Jason Smith, `` - - Develops features and fixes for the HTTP API: things to improve application developers' and system administrators' experience. - - * Benoit Chesneau, `` - - * Robert Dionne, `` - - * Russell Branca, `` - - * Dale Harvey, `` - - * Sue Lockwood, `` - - * [[http://dirkjan.ochtman.nl|Dirkjan Ochtman]], `` -Helps out with the documentation, manages releases. CouchDB-Python maintainer. - - * [[http://www.redcometlabs.com|Garren Smith]], `` -Works on Fauxton. - - * Gianugo Rabellino, `` - - * Alexander Shorin, `` - - * Simon Metson, `` - - * Mike Wallace, `` - - * Ryan Ramage, `` - - * Ted Leung, `` - - * Wendall Cada, `` - - * Joan Touzet, `` - - * [[http://blog.nms.de|Andy Wenk]], `` - - Helps to make CouchDB multilingual, IRC hangarounder and documentation worker - - * Nick North, `` - - Contributes small features and helps with the Windows distribution - - * [[http://maxthayer.org|Max Thayer]], `` - - * Robert Kowalski -
[Couchdb Wiki] Update of "CommonJS_Modules" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CommonJS_Modules" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CommonJS_Modules?action=diff=9=10 Comment: Replaced by http://docs.couchdb.org/en/latest/query-servers.html#require - <> - ## page was renamed from commonjs_modules - = CommonJS Modules = - - See also the [[http://docs.couchdb.org/en/latest/query-servers.html#require|official documentation]] for this topic. - - As of the 1.1 release of CouchDB you can use CommonJS 1.0 modules in your map, show, list, update, and validation functions. Reduce functions '''can NOT''' use modules. When using CommonJS in map function you must place your CommonJS under the views/lib property in your Design Document (see below). - - {{{#!highlight JavaScript - { -_id:"_design/test", -language: "javascript", -whatever : { - stringzone : "exports.string = 'plankton';", - commonjs : { -whynot : "exports.test = require('../stringzone')", -upper : "exports.testing = require('./whynot').test.string.toUpperCase()" - } -}, -shows: { - simple: "function() {return 'ok'};", - requirey : "function() { var lib = require('whatever/commonjs/upper'); return lib.testing; };" -}, -views: { - lib: { -foo: "exports.bar = 42;" - }, - test: { -map: "function(doc) { emit(doc._id, require('views/lib/foo').bar); }" - } -} - } - }}} - Within a show function you can require CommonJS modules that are defined within object in your design document. The id you pass to require() is a / delimited list of property names to resolve the module string within the design document. - - All imports are relative to the design document root unless they start with ./ or ../, these are referred to as "relative require" statements. Relative require statements only work within CommonJS modules they cannot be used directly inside your show, list, update and validation functions. - - See also: [[JavascriptPatternViewCommonJs|Javascript Pattern to share code between View Map function and other functions]] -
[Couchdb Wiki] Update of "CI" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CI" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CI?action=diff=3=4 Comment: Replaced by https://github.com/apache/couchdb-ci - <> - = CouchDB Continuous Integration = - - This page explains Apache CouchDB’s Continuous Integration setup at http://ci.couchdb.org:/ - (this is currently a private setup, all committers can request access. We will open this up gradually) - - Authors note: - THIS IS A WORK IN PROGRESS, everything might be wrong, all is up for grabs, please help, love, Jan. - - - == Goals == - - The overarching goal here is to allow us to ship more software faster and with more confidence. In particular: - - * Ensure that release branches are always in a shippable state. - * Ensure that release branches always build and test with their minimal dependency versions. - * Ensure that feature and bugfix branches build and test. - * Ensure that feature and bugfix branches can merge into their intended upstream release branch. - * Create platform / system binaries for supported OSs for easy testing of new features or for verifying bugs. - * Ensure that all branches work with all supported combinations of upstream dependency versions (see dependency Matrix below) - - * All of the above should be tested on all supported operating systems and versions. See Operating System Matrix below - - * Give developers and testers in-depth information on build failures. - - - == Non Goals == - - * Ponies. - - - == Dependency Matrix == - - CouchDB 1.4.x: - * Erlang R13B4, Erlang R15B03-1 - * Spidermonkey 1.7.0, 1.8.5 - * ICU (TBD) - - CouchDB 1.3.x: - * Erlang R13B4, Erlang R15B03-1 - * Spidermonkey 1.7.0, 1.8.5 - * ICU (TBD) - - CouchDB 1.2.x: - * Erlang R12B5, Erlang R15B03-1 - * Spidermonkey 1.7.0, 1.8.5 - * ICU (TBD) - - CouchDB 1.1.x: - * Erlang R13B2, Erlang R14B04 - * Spidermonkey 1.7.0, 1.8.5 - * ICU (TBD) - - (not strictly supported, but what the heck) - CouchDB 1.0.x: - * Erlang R12B5, Erlang R14B04 - * Spidermonkey 1.7.0 - * ICU (TBD) - - == Operating System Matrix == - - Linux: - * Ubuntu: 10.04 (Desktop 32/64 / Server 64) - * Ubuntu: 12.04 (Desktop 32/64 / Server 64) - * Ubuntu; 12.10 (Desktop 32/64 / Server 64) - - * Centos 6.3 (32/64) - * Centos 5.2 (32/64) - - * Debian - * Gentoo - - * FreeBSD 9.0, 8.3 - * Mac OS X: 10.8.2, 10.7.5, 10.6.5 (32/64) - - * Windows: 7, 8 (32/64). - - * OmniOS/Solaris - - - == Notes == - - Since we can’t build against one of multiple installed JS engines, we need a build slave for each tested JS engine. - - For multiple Erlang versions, we use “Matrix” builds. - - - == Roadmap == - - Set up all necessary build slaves. From the above, these are missing today: - * Debian - * Gentoo - * Mac OS X 10.6.5 - * Windows 7 - * OmniOS/Solaris - * FreebSD 8.3 - * others. - - Add integration jobs for feature and bug fix branches. - - Open up access to the public. - - Expand test configuration range (we currently only test one spidermonkey per host os) - - Migrate to ci.apache.org. - - - == How can I help? == - - All this is to get a CouchDB QA team going. So far the developers and users do QA, but no dedicated team takes on the task of caring about QA, creating testing infrastructure, etc. This could be you! - - Since this is a non-existent team, you can do anything end everything. You can help shape the - - - == The Build Job == - - Each one of these varies by build slave (i.e. Operating System and configuration), but what they all do is this: - - * Check out the latest version of CouchDB for its branch. Each Build Job only builds a single branch. - * Clean up the current workspace with git clean -fdx - * [Set environment variables] - * ./bootstrap - * ./configure [$ARGS] - * make distcheck - - At this point, we have an apache-couchdb-$VERSION_INFO.tar.gz that is packaged up like a release.tar.gz, its sources have been build successfully and all JS and Erlang tests have been run (with 1.2.0 and earlier, only the Erlang tests were run). THESE ARE NOT OFFICIAL APACHE RELEASES. - - * ./configure --prefix=/tmp/$ERLANG_VERSION - * make install - * tar czf /tmp/$ERLANG_VERSION - - Now we created a platform-dependent binary version that unpacks into /tmp that users and devs can run on their systems, given they have the same dependencies in the same places, e.g. to test out new features or verify bug fixes. THESE ARE NOT OFFICIAL APACHE RELEASES. - - * Normalize .tar.gz filenames - * Upload .tar.gz files to S3. - - This is so we can distribute the files easily. We might want to move that to ASF infrastructure as well. - - * Notify #couchdb-ci on irc.freenode.net - - This is so devs get real time info on builds. - - - == FaQ == - - === What is CI / Continuous Integration? === - - CI or Continuous Integration is the idea that with
[Couchdb Wiki] Update of "ClouchDB" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ClouchDB" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ClouchDB?action=diff=7=8 Comment: Replaced by https://cwiki.apache.org/confluence/display/COUCHDB/Lisp - <> - ## page was renamed from GettingStartedWithLisp - Getting started with Common Lisp and the CouchDB API. - - == Library == - - The code for Clouchdb, the Common Lisp CouchDB library, as well as full documentation and more detailed examples can be obtained from: - - http://common-lisp.net/project/clouchdb/ - - This library can also be installed with ASDF: - - {{{ - CL-USER> (asdf-install:install 'clouchdb) - CL-USER> (asdf:oos 'asdf:load-op '#clouchdb) - }}} - - == Using the Library == - - {{{ - ;; Create a workspace package - (defpackage :clouchdb-user (:use :cl :clouchdb)) - (in-package :clouchdb-user) - - ;; See what databases exist on default connection, which is - ;; host "localhost", port 5984 - (list-dbs) - - ;; Create database "myDb" - (set-connection :db-name "myDb") - (create-db) - - ;; Create a document in database "myDb" - (create-document '((:Subject . "I like Plankton") -(:Author . "Rusty") -(:PostedDate . "2006-08-15T17:30:12-04:00")" -(:Tags . ("plankton" "baseball" "decisions")) - :id "myDoc") - - ;; Get all documents in "myDb" - (get-all-documents) - - ;; Get document "myDoc" - (get-document "myDoc") - - ;; Delete document "myDoc" - (delete-document :id "myDoc") - - ;; List information about database "myDb" - (get-db-info :db-name "myDb") - }}} -
[Couchdb Wiki] Update of "CurrentReleases" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CurrentReleases" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CurrentReleases?action=diff=35=36 Comment: see https://couchdb.apache.org/ - ## page was renamed from Current Releases - ## page was renamed from releases - <> - This page has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Current+Releases -
[Couchdb Wiki] Update of "caolan" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "caolan" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/caolan?action=diff=1=2 - #format wiki - #language en - == Caolan == - Twitter: [[http://twitter.com/caolan|@caolan]] - - Website: [[http://caolanmcmahon.com|caolanmcmahon.com]] - - ... - - - CategoryHomepage -
[Couchdb Wiki] Update of "Compactage" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Compactage" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Compactage?action=diff=4=5 Comment: https://docs.couchdb.org/en/latest/search.html?q=compaction_keywords=yes=default - #language fr - == Présentation == - Le compactage réecrit le fichier de base de données en supprimant les anciennes révisions de documents et les documents effacés. C'est disponible dans CouchDB dans SVN depuis 2008-04-07 et depuis la version 0.8-incubating dans les sources téléchargeables. - - Le compactage est géré manuellement par base de données. La gestion de queue de compactage sur plusieurs bases de données est prévue. - - === Exemple === - - Le compactage est initié par une requête HTTP POST sur la sous-resource _compact de la base de données. En cas de succès un code HTTP 200 est retourné. - - {{{ - # POST http://localhost/ma_db/_compact via curl - curl -H "Content-Type: application/json" -X POST http://localhost/ma_db/_compact - #=> {"ok":true} - }}} - - une requête HTTP GET sur l'url de la base de données ( http://localhost/ma_db ) renvoie un tableau(hash) des états sous la forme suivante : - - {{{ - curl http://localhost/ma_db - #=> {"db_name":"ma_db","doc_count":0,"doc_del_count":1,"update_seq":3,"compact_running":false,"disk_size":14341} - }}} - - La clé compact_running est à true pendant le compactage. - - === Compactage de bases de données lourdement chargées en écritures === - - Compacter une base de données proche de sa limite en écritures n'est pas une bonne idée. Le processus de compactage peut ne pas prendre en compte les écritures, si jamais il les laisse passer, et peut en outre manquer d'espace disque. - - Le compactage doit s'effectuer sur une base de données qui n'a pas atteint sa limite en écritures. La charge en lectures ne l'empêchera pas de s'effectuer. - - CouchDB travaille ainsi pour avoir le moins d'impact sur les clients, la base de données reste en ligne et complètement opérationnelle en lecture/écriture. C'est un choix de conception d'empêcher le compactage d'une base de données lorsqu'elle a atteint sa limite en écritures. Il est recommandé d'effectuer ce compactage lors des heures où la base est moins chargée. - - Dans un environnement cluster, l'écriture peut être stoppée pour chaque noeud avant le compactage et autorisée à nouveau lorsque celui-ci est terminé. - - Dans le futur, un noeud CouchDB pourra être modifié pour stopper ou faire échouer les mises à jour si la charge en écriture est trop intense pour lui permettre de compléter celles-ci dans un délai raisonnable. -
[Couchdb Wiki] Update of "Compaction" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Compaction" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Compaction?action=diff=31=32 Comment: See the official documentation at https://docs.couchdb.org/en/latest/search.html?q=compaction_keywords=yes=default - <> - = Compaction = - - See also the official documentation for the - [[http://docs.couchdb.org/en/latest/api/database.html#post-db-compact|database]] and - [[http://docs.couchdb.org/en/latest/api/database.html#post-db-compact-design-doc|design document]] compaction topics. - - <> - - == Database Compaction == - Compaction compresses the database file by removing unused sections created during updates. Old revisions of documents are also removed from the database though a small amount of meta data is kept for use in conflict during [[Replication|replication]]. The number of revisions (default of 1000) can be configured using the [[HTTP_database_API#Accessing_Database-specific_options|_revs_limit URL endpoint]], available since version 0.8-incubating. - - Compaction is manually triggered per database. Support for queued compaction of multiple databases is planned. Please note that compaction will be run as a background task. - - === Example === - Compaction is triggered by an HTTP POST request to the _compact sub-resource of your database. On success, HTTP status 202 is returned immediately. Although the request body is not used you must still specify "application/json" as Content-Type for the request. - - {{{ - curl -H "Content-Type: application/json" -X POST http://localhost:5984/my_db/_compact - #=> {"ok":true} - }}} - GET requesting your database base URL (see [[HTTP_database_API#Database_Information]]) gives a hash of statuses that look like this: - - {{{ - curl -X GET http://localhost:5984/my_db - #=> {"db_name":"my_db", "doc_count":1, "doc_del_count":1, "update_seq":4, "purge_seq":0, "compact_running":false, "disk_size":12377, "instance_start_time":"1267612389906234", "disk_format_version":5} - }}} - The compact_running key will be set to true during compaction. - - === Compaction of write-heavy databases === - It is not a good idea to attempt compaction on a database node that is near full capacity for its write load. The problem is the compaction process may never catch up with the writes if they never let up, and eventually it will run out of disk space. - - Compaction should be attempted when the write load is less than full capacity. Read load won't affect its ability to complete, however. To have the least impact possible on clients, the database remains online and fully functional to readers and writers. It is a design limitation that database compaction can't complete when at capacity for write load. It may be reasonable to schedule compactions during off-peak hours. - - In a clustered environment the write load can be switched off for any node before compaction and brought back up to date with replication once complete. - - In the future, a single CouchDB node can be changed to stop or fail other updates if the write load is too heavy for it to complete in a reasonable time. - - == View compaction == - [[Introduction_to_CouchDB_views|Views]] need compaction like databases. There is a compact views feature introduced with CouchDB 0.10.0: - - {{{ - curl -H "Content-Type: application/json" -X POST http://localhost:5984/dbname/_compact/designname - #=> {"ok":true} - }}} - This compacts the view index from the current version of the design document. The HTTP response code is 202 Accepted (like compaction for databases) and a compaction background task will be created. Information on running compactions can be fetched with [[HTTP_view_API#Getting_Information_about_Design_Documents_.28and_their_Views.29|HTTP_view_API#Getting_Information_about_Design_Documents_(and_their_Views)]]. - - View indexes on disk are named after their MD5 hash of the view definition. When you change a view, old indexes remain on disk. To clean up all outdated view indexes (files named after the MD5 representation of views, that does not exist anymore) you can trigger a view cleanup: - - {{{ - curl -H "Content-Type: application/json" -X POST http://localhost:5984/dbname/_view_cleanup - #=> {"ok":true} - }}} - == Automatic Compaction == - Since CouchDB 1.2 it is possible to configure automatic compaction, so that compaction of databases and views is automatically triggered based on various criteria. Automatic compaction is configured in CouchDB's configuration files. The compaction daemon is responsible for triggering the compaction. It is automatically started, but disabled by default - - {{{ - [daemons] - #... - compaction_daemon={couch_compaction_daemon, start_link, []} - }}} - {{{ - [compaction_daemon] - ; The delay, in seconds, between each check for which database and view indexes - ; need to be compacted. -
[Couchdb Wiki] Update of "Complete_HTTP_API_Reference" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Complete_HTTP_API_Reference" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Complete_HTTP_API_Reference?action=diff=41=42 Comment: Outdated; see http://docs.couchdb.org/en/latest/api/reference.html instead - <> - = Complete HTTP API Reference = - - See also the [[http://docs.couchdb.org/en/latest/api/reference.html|official documentation]] for this topic. - - <> - == Server-level miscellaneous methods == - ||GET||/||Returns MOTD and version||HttpGetRoot|| - ||GET||/favicon.ico||Special path for providing a site icon||HttpGetFavicon|| - ||GET||/_all_dbs||Returns a list of all databases on this server||HttpGetAllDbs|| - ||GET||/_active_tasks||Returns a list of running tasks||HttpGetActiveTasks|| - ||POST||/_replicate||Start or cancel replications||[[Replication]]|| - ||*||/_replicator||The [[Replication#Replicator_database|database that controls replication at startup]]|| - ||GET||/_uuids||Returns a list of generated UUIDs||HttpGetUuids|| - ||POST||/_restart||Restart the server, requires admin privileges|| - ||GET||/_stats||Returns server statistics|| - ||GET||/_log||Returns the tail of the server's log file, requires admin privileges||HttpGetLog|| - ||GET||/_sleep||Returns success after waiting for a given number of milliseconds ''(removed since 1.0.0)''|| - ||GET||/_utils/'''file'''||Return static web pages that contain the CouchDB administration interface|| - - <> - == Server configuration == - ||GET||/_config||Returns the entire server configuration|| - ||GET||/_config/'''section'''||Returns a single section from server configuration|| - ||GET||/_config/'''section'''/'''key'''||Returns a single configuration value from given section in server configuration|| - ||PUT||/_config/'''section'''/'''key'''||Set a single configuration value in a given section to server configuration|| - ||DELETE||/_config/'''section'''/'''key'''||Delete a single configuration value from a given section in server configuration|| - - <> - == Authentication == - ||GET||/_session||Returns cookie based login user information||[[Session_API|Session]]|| - ||POST||/_session||Do cookie based user login||[[Session_API|Session]]|| - ||DELETE||/_session||Logout cookie based user||[[Session_API|Session]]|| - ||GET||/_oauth/access_token||XXX|| - ||GET||/_oauth/authorize||XXX|| - ||POST||/_oauth/authorize||XXX|| - ||*||/_oauth/request_token||XXX|| - ||*||/_users||The [[Security_Features_Overview#Authentication_database|authentication and authorization database]]|| - - <> - == Database methods == - ||GET||/'''db'''||Returns database information||[[HTTP_database_API#Database_Information|Database Information]]|| - ||PUT||/'''db'''||Create a new database||[[HTTP_database_API#PUT_.28Create_New_Database.29|Create New Database]]|| - ||DELETE||/'''db'''||Delete an existing database||[[HTTP_database_API#DELETE|Delete a Database]]|| - ||GET||/'''db'''/_changes||Returns changes for the given database||[[HTTP_database_API#Changes|Changes]]|| - ||POST||/'''db'''/_compact||Starts a compaction for the database, requires admin privileges||[[Compaction#Database_Compaction|Database Compaction]]|| - ||POST||/'''db'''/_compact/'''design-doc'''||Starts a compaction for all the views in the selected design document, requires admin privileges||[[Compaction#View_compaction|View Compaction]]|| - ||POST||/'''db'''/_view_cleanup||Removes view files that are not used by any design document, requires admin privileges||[[Compaction#View_compaction|View Cleanup]]|| - ||POST||/'''db'''/_temp_view||Execute a given view function for all documents and return the result, requires admin privileges|| - ||POST||/'''db'''/_ensure_full_commit||Makes sure all uncommited changes are written and synchronized to the disk|| - ||POST||/'''db'''/_bulk_docs||Insert multiple documents in to the database in a single request||[[HTTP_Bulk_Document_API#Modify_Multiple_Documents_With_a_Single_Request|Modify Multiple Documents With a Single Request]]|| - ||POST||/'''db'''/_purge||Purge some historical documents entirely from database history||[[Purge_Documents|Purge Documents]]|| - ||GET||/'''db'''/_all_docs||Returns a built-in view of all documents in this database|| - ||POST||/'''db'''/_all_docs||Returns certain rows from the built-in view of all documents||[[HTTP_Bulk_Document_API#Fetch_Multiple_Documents_With_a_Single_Request|Fetch Multiple Documents With a Single Request]]|| - ||POST||/'''db'''/_missing_revs||Given a list of document revisions, returns the document revisions that do not exist in the database|| - ||POST||/'''db'''/_revs_diff||Given a list of document revisions, returns differences between the given revisions and ones that are in the database||[[HttpPostRevsDiff]]|| - ||GET||/'''db'''/_security||Returns the special security object for the database||[[Security_Features_Overview#Authorization|Authorization]]|| -
[Couchdb Wiki] Update of "ConfigurationFileCouchIni" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "ConfigurationFileCouchIni" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/ConfigurationFileCouchIni?action=diff=4=5 Comment: Replaced by http://docs.couchdb.org/en/latest/config/index.html - #redirect Configurationfile_couch.ini - The default location of the couch.ini file is in /usr/local/etc/couch. It is the local configuration file for the couch server. - The default configuration file is shown, with each option described in detail. - - {{{ - ; etc/couchdb/couch.ini.tpl. Generated from couch.ini.tpl.in by configure. - [Couch] - ConsoleStartupMsg=Apache CouchDB is starting. - DbRootDir=/usr/local/var/lib/couchdb - Port=5984 - BindAddress=192.168.109.162 - DocumentRoot=/usr/local/share/couchdb/www - LogFile=/usr/local/var/log/couchdb/couch.log - UtilDriverDir=/usr/local/lib/couchdb/erlang/lib/couch-0.8.0-incubating/priv/lib - LogLevel=info - [Couch Query Servers] - javascript=/usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js - }}} - - === Couch section === - * {{{ConsoleStartupMsg}}} - * {{{DbRootDir}}} - * {{{Port}}} - * {{{BindAddress}}} - you probably need to change this to your outward facing network interface. - * {{{DocumentRoot}}} - * {{{LogFile}}} - * {{{UtilDriverDir}}} - * {{{LogLevel}}} - values 'info', 'debug' - - === Couch Query Servers section === - * {{{javascript}}} -
[Couchdb Wiki] Update of "Configurationfile_couch.ini" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Configurationfile_couch.ini" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Configurationfile_couch.ini?action=diff=12=13 Comment: Replaced by http://docs.couchdb.org/en/latest/config/index.html - <> - See also the [[http://docs.couchdb.org/en/latest/config/index.html|official documentation]] for this topic. - - The default location of the default.ini file is in /usr/local/etc/couchdb. It is the local configuration file for the CouchDB server. Please note that upgrading CouchDB will overwrite default.ini, so it is a good idea to make changes to local.ini (or to use your own INI file for each CouchDB instance running). - - The local configuration can also be restfully accessed via [[Complete_HTTP_API_Reference#configuration|the /_config URI]]. - - The default configuration file is shown, with each option described in detail. - - {{{ - ; etc/couchdb/default.ini.tpl. Generated from default.ini.tpl.in by configure. - - ; Upgrading CouchDB will overwrite this file. - - [couchdb] - database_dir = /usr/local/var/lib/couchdb - view_index_dir = /usr/local/var/lib/couchdb - util_driver_dir = /usr/local/lib/couchdb/erlang/lib/couch-0.10.0/priv/lib - max_document_size = 4294967296 ; 4 GB - max_attachment_chunk_size = 4294967296 ; 4GB - os_process_timeout = 5000 ; 5 seconds. for view and external servers. - max_dbs_open = 100 - delayed_commits = true - batch_save_size = 1000 ; number of docs at which to save a batch - batch_save_interval = 1000 ; milliseconds after which to save batches - - [httpd] - port = 5984 - bind_address = 127.0.0.1 - authentication_handlers = {couch_httpd_oauth, oauth_authentication_handler}, {couch_httpd_auth, default_authentication_handler} - default_handler = {couch_httpd_db, handle_request} - WWW-Authenticate = Basic realm="administrator" - - [log] - file = /usr/local/var/log/couchdb/couch.log - level = info - - [couch_httpd_auth] - authentication_db = users - secret = replace this with a real secret in your local.ini file - require_valid_user = false - - [query_servers] - javascript = /usr/local/bin/couchjs /usr/local/share/couchdb/server/main.js - - ; Changing reduce_limit to false will disable reduce_limit. - ; If you think you're hitting reduce_limit with a "good" reduce function, - ; please let us know on the mailing list so we can fine tune the heuristic. - [query_server_config] - reduce_limit = true - - ; enable external as an httpd handler, then link it with commands here. - ; note, this api is still under consideration. - ; [external] - ; mykey = /path/to/mycommand - - [daemons] - view_manager={couch_view, start_link, []} - external_manager={couch_external_manager, start_link, []} - db_update_notifier={couch_db_update_notifier_sup, start_link, []} - batch_save={couch_batch_save_sup, start_link, []} - query_servers={couch_query_servers, start_link, []} - httpd={couch_httpd, start_link, []} - stats_aggregator={couch_stats_aggregator, start, []} - stats_collector={couch_stats_collector, start, []} - - [httpd_global_handlers] - / = {couch_httpd_misc_handlers, handle_welcome_req, <<"Welcome">>} - favicon.ico = {couch_httpd_misc_handlers, handle_favicon_req, "/usr/local/share/couchdb/www"} - - _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "/usr/local/share/couchdb/www"} - _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req} - _active_tasks = {couch_httpd_misc_handlers, handle_task_status_req} - _config = {couch_httpd_misc_handlers, handle_config_req} - _replicate = {couch_httpd_misc_handlers, handle_replicate_req} - _uuids = {couch_httpd_misc_handlers, handle_uuids_req} - _restart = {couch_httpd_misc_handlers, handle_restart_req} - _stats = {couch_httpd_stats_handlers, handle_stats_req} - _log = {couch_httpd_misc_handlers, handle_log_req} - _sleep = {couch_httpd_misc_handlers, handle_sleep_req} - _session = {couch_httpd_auth, handle_session_req} - _oauth = {couch_httpd_oauth, handle_oauth_req} - _user = {couch_httpd_auth, handle_user_req} - - [httpd_db_handlers] - _view_cleanup = {couch_httpd_db, handle_view_cleanup_req} - _compact = {couch_httpd_db, handle_compact_req} - _design = {couch_httpd_db, handle_design_req} - _view = {couch_httpd_view, handle_db_view_req} - _temp_view = {couch_httpd_view, handle_temp_view_req} - _changes = {couch_httpd_db, handle_changes_req} - - ; The external module takes an optional argument allowing you to narrow it to a - ; single script. Otherwise the script name is inferred from the first path section - ; after _external's own path. - ; _mypath = {couch_httpd_external, handle_external_req, <<"mykey">>} - ; _external = {couch_httpd_external, handle_external_req} - - [httpd_design_handlers] - _view = {couch_httpd_view, handle_view_req} - _show = {couch_httpd_show, handle_doc_show_req} - _list = {couch_httpd_show, handle_view_list_req} - _info = {couch_httpd_db,
[Couchdb Wiki] Update of "CORS" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CORS" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CORS?action=diff=7=8 Comment: See https://docs.couchdb.org/en/stable/config/http.html#cross-origin-resource-sharing - <> - Note: CORS is supported only in CouchDB 1.3.x branches or releases, and at present is experimental support. This means that: - - * functionality is disabled by default - * support or API may change in subsequent releases - - WARNING!! This page is a temporary gathering spot for CORS documentation while the [[https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=shortlog;h=refs/heads/431-feature_cors|git branch]] is in development. It will get merged back into the cors branch when sufficiently clean, and will use the sphinx support being worked on in the [[https://git-wip-us.apache.org/repos/asf?p=couchdb.git;a=shortlog;h=refs/heads/docs|docs branch]]. - - <> - - = Introducing CORS = - - By supporting CORS functionality, a CouchDB instance can accept direct connections to protected DBs and instances, without the browser functionality being blocked due to the same origin constraint. CORS is [[http://caniuse.com/cors|widely supported]] today on over 90% of browsers. - - * dev list [[http://markmail.org/message/wzdge2nb3xkaqzlk|announcement]] from @benoitc - * JIRA [[https://issues.apache.org/jira/browse/COUCHDB-431]] - - = Features = - - * Simple requests for a couchdb instance - * Preflight requests for a couchdb instance - * Configuration for a specific CouchDB vhost - * All origins are excluded by default - - = Configuration = - - == Enabling CORS == - - To enable CORS support, you need to set the option {{{enable_cors = true}}} in the {{{[httpd]}}} section of {{{local.ini}}}, and {{{[cors]}}} section with {{{origins = *}}}. Note that by default, no origins are accepted, you must either use a wildcard or whitelist. - - {{{ - [httpd] - enable_cors = true - - [cors] - origins = * - - }}} - - == Tightening Access == - - === Restricting by Protocol, Host and optional Port === - - {{{ - [cors] - ; List of origins, separated by a comma (protocol, host, port) - ; refer to http://tools.ietf.org/html/rfc6454 for specification - origins = http://home.muse.net.nz:8000, https://localhost, http://www.number10.gov.uk:80 - }}} - - === Restricting Accepted Methods === - - {{{ - [cors] - ; List of accepted methods, comma-separated - ; refer to http://tools.ietf.org/html/rfc2616, rfc2817, rfc5789 - methods = GET, POST, PUT, DELETE - }}} - - === Restricting Accepted Headers === - - {{{ - [cors] - ; List of accepted headers separated by a comma - headers = TODO - }}} - - == Securing at the VHOST level == - - TODO - - To set the options for a vhost, you will need to create a section with the vhost name prefixed by "cors:" . Ex for the vhost example.com: - - {{{ - ; Configuration for a vhost - ;[cors:example.com] - ; credentials = false - ; List of origins separated by a comma - ;origins = - ; List of accepted headers separated by a comma - ; headers = - ; List of accepted methods - ; methods = - }}} - - == Credentials == - - TODO - - = Testing Your Implementation = - - The following snippet was lifted from [[http://www.html5rocks.com/en/tutorials/cors|html5rocks]] CORS tutorial: - - {{{ - - - - Testing CORS - - https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> - http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server;> - - - - // Create the XHR object. - function createCORSRequest(method, url) { - var xhr = new XMLHttpRequest(); - if ("withCredentials" in xhr) { - // XHR for Chrome/Firefox/Opera/Safari. - xhr.open(method, url, true); - } else if (typeof XDomainRequest != "undefined") { - // XDomainRequest for IE. - xhr = new XDomainRequest(); - xhr.open(method, url); - } else { - // CORS not supported. - xhr = null; - } - return xhr; - } - - // Make the actual CORS request. - function makeCorsRequest(uri) { - console.log("got uri: " + uri); - var xhr = createCORSRequest('GET', uri); - if (!xhr) { - alert('CORS not supported'); - return; - } - - // Response handlers. - xhr.onload = function() { - console.log('Response from CORS request to ' + uri + ': ' + xhr.responseText); - }; - - xhr.onerror = function() { - console.log('Woops, there was an error making the request to ' + uri + '.'); - }; - - xhr.send(); - } - - $(document).ready(function() { - makeCorsRequest('http://my.couchdb.org:5984/'); - }); - - - - -
[Couchdb Wiki] Update of "CouchDbx" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchDbx" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchDbx?action=diff=4=5 Comment: See https://github.com/janl/couchdb-mac-app - CouchDbx is an effort from JanLehnardt to package a self-contained MacOSX distro of CouchDb. - A first step towards an AllInOne CouchDb - See : - * http://jan.prima.de/~jan/plok/archives/142-CouchDBX-Revival.html - * http://couchprojects.googlecode.com/svn/trunk/unofficial-binary-releases/CouchDBX/
[Couchdb Wiki] Update of "Getting_started_with_Objective Caml" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Objective Caml" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Objective%20Caml?action=diff=2=3 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/OCaml - <> - Getting started with OCaml and the CouchDB API - - For making the HTTP calls required by the RESTful API, it's hard to beat Gerd Stolpmann's Http_client.Convenience module - (see http://docs.camlcity.org/docs/godipkg/3.11/godi-ocamlnet/doc/godi-ocamlnet/html/Http_client.Convenience.html ), shipped with the ocamlnet-2 library - (see http://docs.camlcity.org/docs/godipkg/3.11/godi-ocamlnet ). The examples below assume your database is running on the localhost, port 5984--and that your - database is named "mydatabase". Naturally, you're encouraged to change these to fit your specific needs. - - - === Creating a Database === - - {{{ - let result = - let server_url = "http://localhost:5984; in - let db_name = "mydatabase" in - Http_client.Convenience.http_put (server_url ^ "/" ^ db_name) "";; - - print_endline result - }}} - - === Deleting a Database === - - {{{ - let result = - let server_url = "http://localhost:5984; in - let db_name = "mydatabase" in - Http_client.Convenience.http_delete (server_url ^ "/" ^ db_name);; - - print_endline result - }}} - - === Creating a Document === - - {{{ - let result = - let url_doc = "http://localhost:5984/mydatabase/newdoc; in - let my_doc_json = "{ \"subject\":\"Plankton\", \"author\":\"Rusty\"," ^ - "\"body\":\"I decided today I like plankton and OCaml equally well.\" }" in - Http_client.Convenience.http_put url_doc my_doc_json;; - - print_endline result - }}} - - === Retrieving a Document === - The example below shows a bit more sophistication, illustrating how to use the json-wheel library (located at http://martin.jambon.free.fr/json-wheel.html). - - {{{ - type json doc = < subject:string; author:string; body:string > - let url_doc = "http://localhost:5984/mydatabase/newdoc; - let get url = - doc_of_json - (Json_io.json_of_string -(Http_client.Convenience.http_get (url))) - - let my_doc = (get url_doc) - let _= print_string ("Author: " ^ my_doc#author ^ "\n" ^ - "Subject: " ^ my_doc#subject ^ "\n" ^ - "Body: "^ my_doc#body^ "\n") - - - $ ./retrieve_doc - - Author: Rusty - Subject: Plankton - Body: I decided today I like plankton and OCaml equally well. - }}} - - Note: These examples can be compiled with the following: - {{{ - ocamlfind ocamlopt -o dest-file -linkpkg -package json-static,netclient -syntax camlp4o source-file.ml - }}} -
[Couchdb Wiki] Update of "Getting_started_with_NodeJS" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_NodeJS" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_NodeJS?action=diff=4=5 Comment: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97555281 - <> - Getting started with Nodejs and the CouchDB API. - - = cradle = - * [[http://cloudhead.io/cradle|documentation]] - * [[http://github.com/cloudhead/cradle|source on github]] - - = noddycouch = - * [[http://github.com/benoitc/noddycouch/|See noddycouch on github]] - - = nano = - * [[http://writings.nunojob.com/2011/08/nano-minimalistic-couchdb-client-for-nodejs.html|See tutorial about nano]] - * [[http://github.com/dscape/nano/|See nano on github]] - * [[http://search.npmjs.org/#/nano|See nano on npmjs.org]] -
[Couchdb Wiki] Update of "CouchDB_tools" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "CouchDB_tools" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/CouchDB_tools?action=diff=18=19 - <> - <> - - The content of this page has moved to https://cwiki.apache.org/confluence/display/COUCHDB/Useful+utilities -
[Couchdb Wiki] Update of "couch_edocs" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "couch_edocs" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/couch_edocs?action=diff=9=10 Comment: obsolete - = COUCHDB edocs summary of modules = - Please note this is a work in progress but over the next few days I hope to have all sections and modules documentation posted here. - == Comment suggestions == - * module comments - * By using the edoc '@doc' tag before the module you can add one or more lines of documentation for the module - - . e.g. - - . %% @doc This would be a line of documentation - - . %% More lines can be used if needed - - * function comments - * By using the edoc '@doc' tag before the function you can add one or more lines of documentation for the function - - . e.g. - - . %% @doc This would be a line of documentation - - . %% More lines can be used if needed - [[http://www.erlang.org/doc/apps/edoc/chapter.html|edoc reference]] - - [[http://couch.erldocs.com/|couchdb erldocs]] -
[Couchdb Wiki] Update of "Curator" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Curator" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Curator?action=diff=3=4 Comment: Outdated, see https://couchdb.apache.org - = The Curator = - **DRAFT** - - == Object of the wiki == - - describe application to curate the CouchDB eco-system or world: who is doing what, how. For libraries, tools speaking with Apache Couchdb, describe the compatibility with (which version, limitations) and link to tutorial, demo. - - == Features == - - * Get list of applications/libraries/services - * Categorize these applications/libraries/services - * Possibility by other users to review/comments/register an app-service-library - * Link to them/demo - * People behind - * Maintain maps of the ecosystsem - * Present last events - * blog? - - - Should be a couchapp. -
[Couchdb Wiki] Update of "Getting_started_with_Rebol" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Rebol" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Rebol?action=diff=4=5 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Rebol - <> - = Using plain Rebol3 = - This is how you can use CouchDB from plain Rebol3 (which is currently in public Alpha). - - And here you can get Rebol3 [[http://www.rebol.com/r3/downloads.html|Rebol3 Alpha download]] - - == How to read data from CouchDB using Rebol == - - {{{ - to-string read http://localhost:5984/db2/id - }}} - - == How to write data to CouchDB using Rebol == - - {{{ - to-string write http://localhost:5984/db2/id json-data - }}} - - == How to create a new CouchDB Database using Rebol == - - {{{ - to-string write http://localhost:5984/db2 [PUT [] ""] - }}} - - == A complete console session == - - {{{ - >> to-string write http://localhost:5984/hohtest [PUT] - == {{"ok":true}} - - >> to-string write http://localhost:5984/hohtest {{"_id":"hello","data":"Hello World!"}} - == {{"ok":true,"id":"hello","rev":"1-a67aaac28adabcdd8d0718187741d49d"}} - - >> to-string read http://localhost:5984/hohtest/hello - == {{"_id":"hello","_rev":"1-a67aaac28adabcdd8d0718187741d49d","data":"Hello World!"}} - - >> to-string write http://localhost:5984/hohtest [DELETE] - == {{"ok":true}} - }}} - - BTW, to-string is only needed to make it human readable. Without it, the return values would be binary. - - - = A Rebol3 module = - - And here you can get a Rebol3 module, to make it even easier. especially working with json data. - - [[http://www.rebol.org/view-script.r?script=couchdb3.r|couchdb3.r on rebol.org]] -
[Couchdb Wiki] Update of "Getting_started_with_PL_SQL" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_PL_SQL" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_PL_SQL?action=diff=3=4 Comment: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97555310 - Getting started with PL/SQL and the CouchDB API. - = PL/COUCH = - PLCouch is a simple way to save Oracle-Data in a document based database. With PLCouch, you can create, updet and delete documents, manage Databases. - - == Dependencies == - * http://code.google.com/p/pl-couch/ - - * https://sourceforge.net/projects/pljson/ - - == Sample Usage == - {{{ - SET SERVEROUTPUT ON SIZE 100 - DECLARE - -- - PROCEDURE ASSERTTRUE(B BOOLEAN) AS - BEGIN - IF(NOT B) THEN RAISE_APPLICATION_ERROR(-20111, 'Test error'); END IF; - END; - -- - PROCEDURE ASSERTFALSE(B BOOLEAN) AS - BEGIN - IF(B) THEN RAISE_APPLICATION_ERROR(-20111, 'Test error'); END IF; - END; - -- - BEGIN - -- - -- Connect to database - PL_COUCH_DB.INIT_DB(HOSTNAME => :HOST - ,PORT => :PORT - ,ADMIN => :admin - ,adminpwd => :adminpwd); - ASSERTTRUE(PL_COUCH_DB.PING_COUCHDB); - -- - DBMS_OUTPUT.PUT_LINE('couchDB-Version:' || PL_COUCH_DB.GET_VERSION); - -- Check Database - ASSERTTRUE(PL_COUCH_DB.PING_COUCHDB); - -- - databasename := 'test' || TO_CHAR(SYSDATE, 'YYMMDDHH24MISS') || 'x'; - DBMS_OUTPUT.PUT_LINE('Create Database: ' || databasename); - ASSERTTRUE(PL_COUCH_DB.CREATE_DB(DATABASENAME)); - -- - jList := PL_COUCH_DB.GET_ALL_DB; - -- - IF jList.count > 0 THEN - FOR I in 1 .. jList.count LOOP - listElement := jList.get_elem(I); - dummy := listElement.getvarchar2(charElement); - DBMS_OUTPUT.PUT_LINE('Database: ' || charElement); - END LOOP; - END IF; - -- - DBMS_OUTPUT.PUT_LINE('Drop Database: ' || databasename); - ASSERTTRUE(PL_COUCH_DB.DROP_DB(DATABASENAME)); - -- - END; - / - - PROMPT ENDE - }}} - More Samples see: http://code.google.com/p/pl-couch/downloads/list -
[Couchdb Wiki] Update of "Getting_started_with_VMware" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_VMware" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_VMware?action=diff=4=5 Comment: Appliance no longer exists - <> - Getting started with CouchDB and VMware Appliance. - - == Quickstart == - - * [[http://s3.amazonaws.com/vmware_appliances/Jeos%20Elastic%20Drive%20and%20CouchDB-0.7.3a.rar|Download the appliance]]. Size of the file is around 250Mb. - * Unpack it into proper directory (On my Windows workstation I have ''C:\Virtual Machines'' directory). - * In VMware Player use ''Commands > Open''. - * In VMware Server use ''File > Open > Browse'' and select your unpacked image - * In terminal use username ''khaz'' and password ''khaz''. For elevated privileges use ''sudo command''. - * At this point you should have all ready to go. To verify that service is running, you can run command inside terminal session ''wget http://localhost:5984/''. It should return document that looks like: - {{{ - {"couchdb": "Welcome", "version": "0.7.3a"} - }}} - - == Detailed Description == - - This appliance release has with CouchDB version 0.7.3a (rev. 649). It runs as a service under Ubuntu 7.10 Jeos and has a bonus addon - free version of Elastic Drive, that helps to establish persistence to remote storage services like Amazon S3 or Nirvanix, thus preserving the data that is stored in your CouchDB. - - * [[http://s3.amazonaws.com/vmware_appliances/Jeos%20Elastic%20Drive%20and%20CouchDB-0.7.3a.rar|Download the appliance]]. Size of the file is around 250Mb. - * Unpack it into proper directory (On my Windows workstation I have ''C:\Virtual Machines'' directory). You need to have some utility to decompress an archive, I use trial version of [[http://www.rarlab.com/download.htm|WinRAR]]. Same utility had limitations on zip archive size, so this is why you have .rar - * In VMware Player use ''Commands > Open''. - * In VMware Server use ''File > Open > Browse'' and select your unpacked image. - * In terminal use username ''khaz'' and password ''khaz''. For elevated privileges use ''sudo command''. - * At this point you should have all ready to go. To verify that service is running, you can run command inside terminal session ''wget http://localhost:5984/''. It should return document that looks like: - {{{ - {"couchdb": "Welcome", "version": "0.7.3a"} - }}} - If you are running Server Edition, and bridged Ethernet connection (so it uses external DHCP to obtain IP address), you can run ifconfig inside terminal session and see what IP address is assigned to this virtual instance. At this point it is easy to open new browser window and type in something like http://192.168.1.111:5984/. If you see the response like above it means all works as expected. -
[Couchdb Wiki] Update of "Getting_started_with_PLSQL" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_PLSQL" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_PLSQL?action=diff=22=23 Comment: Dead link - <> - ## page was renamed from Getting_started_with_PL/SQL - Getting started with Oracle PL/SQL and the CouchDB API. - - == Library == - === couch_orcl === - . [[http://projects.zekzekus.com/projects/couch-orcl/|http://projects.zekzekus.com/projects/couch-orcl]] -
[Couchdb Wiki] Update of "Getting_started_with_Lua" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Lua" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Lua?action=diff=4=5 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Lua - <> - Getting started with Lua and the CouchDB API. - - = Luchia = - - [[https://github.com/thehunmonkgroup/luchia|Luchia]] is a [[http://www.lua.org|Lua]] CouchDB framework. - - https://github.com/thehunmonkgroup/luchia - - == Features == - - * CRUD operations on databases. - * CRUD operations on documents - * CRUD operations on attachments (both inline and standalone). - * uuid generation (server side). - * Various utility functions. - * Easy install via [[http://luarocks.org|LuaRocks]] - - The package has a full test suite and [[http://thehunmonkgroup.github.io/luchia/doc/|online documentation]]. -
[Couchdb Wiki] Update of "Getting_started_with_ExtJS" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_ExtJS" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_ExtJS?action=diff=3=4 Comment: Outdated - example written against CouchDB 0.7.3 - <> - Getting started with ExtJS and the CouchDB API. - - == ExtJS == - - [[http://extjs.com|ExtJS]] is a javascript library that has the idea of data stores for accessing the data. The provided ExtJS data stores will pull data from a url, but require custom coding for each insert/update/delete as most frameworks don't have a consistent API for each different data type. So updates only occur to ExtJS data stores in memory and callbacks for user functions. Since CouchDB has a consistent API for every document and a flat schema, the data store can be updated to perform these actions in a simple and consistent manner. - - == Simple Data Store == - - This data store assumes a database named 'databasenamehere' and a view of 'locations/all', with a simple map to find all documents that contain a location field. - - Here is the call to create the data store: - {{{ - var store = new Ext.ux.data.CouchStore({ - db:'databasenamehere', - view: 'locations/all', - fields: [ - {name: '_id'}, // I'd love to get rid of this as well - {name: '_rev' }, // ditto - {name: 'location' }, - {name: 'address', }, - {name: 'latitude', type: 'float'}, - {name: 'longitude', type: 'float'} - ] - }); - Ext.ux.store.load({}); - }}} - - After the load call, all the documents are fetched into the store. - - An add becomes as follows: - {{{ - x = new store.record({ - location : 'work', -address : '123 over the rainbox' - }); - - store.add(x); - }}} - - An update is as follows: - {{{ - var r = store.getAt(0); - r.set('location', 'Yahoo!'); - store.commitChanges(); - }}} - - And finally deleting a document: - {{{ -var r = store.getAt(0); -store.remove(r); - }}} - - == CouchStore JavaScript == - This is the javascript code used to create the data store object that is compatible with CouchDB. This snippet was generated using ExtJS 2.1 and CouchDB 0.7.3a662588 - - {{{ - /** - The MIT License - - Copyright (c) 2008, Shawn P. Garbett (www.garbett.org), Jonathan Hicks - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - - Ext.namespace('Ext.ux', 'Ext.ux.data'); - - Ext.ux.data.CouchReader = function(meta, recordType){ - meta = meta || {}; - Ext.ux.data.CouchReader.superclass.constructor.call(this, meta, recordType || meta.fields); - }; - Ext.extend(Ext.ux.data.CouchReader, Ext.data.JsonReader, { - /** -* This override is primarily to default .value on values. -* Why so much copying is required seems like poor desing on the extjs libraries part -*/ - readRecords : function(o) - { - /** - * After any data loads, the raw JSON data is available for further custom processing. If no data is - * loaded or there is a load exception this property will be undefined. - * @type Object - */ - this.jsonData = o; - if(o.metaData) - { - delete this.ef; - this.meta = o.metaData; - this.recordType = Ext.data.Record.create(o.metaData.fields); - this.onMetaChange(this.meta, this.recordType, o); - } - var s = this.meta, Record = this.recordType, - f = Record.prototype.fields, fi = f.items, fl = f.length; - - // Generate extraction functions for the totalProperty, the root, the id, and for each field - if (!this.ef) - { - if(s.totalProperty) { this.getTotal = this.getJsonAccessor(s.totalProperty); } - if(s.successProperty) { this.getSuccess = this.getJsonAccessor(s.successProperty); } - this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p){return p;}; - -
[Couchdb Wiki] Update of "Getting_started_with_ColdFusion" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_ColdFusion" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_ColdFusion?action=diff=2=3 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Coldfusion - <> - See the CouchDB for Coldfusion wiki here: [[http://couchdb.riaforge.org/wiki/index.cfm/Main|CouchDB for Coldfusion]] -
[Couchdb Wiki] Update of "Getting_started_with_C#" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_C#" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_C%23?action=diff=10=11 Comment: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=97555303 - There are six known public C# libraries for using CouchDB: - 1. [[http://github.com/soitgoes/LoveSeat|LoveSeat]] - 2. [[http://github.com/arobson/Relax|Relax]] - 3. [[http://github.com/foretagsplatsen/Divan|Divan]] - 4. [[http://code.google.com/p/couchbrowse|SharpCouch]] (inactive) - 5. [[http://github.com/vdaron/DreamSeat|DreamSeat]] - 6. [[https://github.com/danielwertheim/mycouch|MyCouch]] - - == LoveSeat == - !LoveSeat - "Bringing Couchdb and .Net a little closer". Works well with Generics for populating Domain objects. (Even when nested!). IoC and TDD friendly. - - * Features -*Support for ETags! -*Support for Streaming attachments -*Generic support for translating view results to Domain objects. - - [[https://github.com/soitgoes/LoveSeat/downloads|download now]] - - For more information see the [[http://github.com/soitgoes/LoveSeat|README]]. - {{{ - git clone git://github.com/soitgoes/LoveSeat.git - }}} - - == Relax == - The Relax library (http://github.com/arobson/Relax) provides interfaces for both server control (administrative tasks, replication, etc.) and a repository model for working with CouchDB. As the author of Relax, I can say that you should definitely take a look at Relax as it provides an extensible, IoC friendly, repository pattern for working with domain model persistence against my favorite document store. - - * Features - * Convention based mapping for saving POCOs - * Base document types or interfaces for more control - * Support for caching (Symbiote integration will provide memcached support) - * Attachment support - * Bulk-document API - * Views - * Real-time database change stream - - Documentation is currently found at the Symbiote wiki: http://www.sharplearningcurve.com/wiki/Symbiote-Relax.ashx. There is also a comprehensive demo that's part of the source on github which shows some of Relax's more interesting capabilities, such as the ability to subscribe to changes in a database as they happen. - - {{{ - git clone git://github.com/arobson/Relax.git - }}} - - Relax does not currently provide Lucene support. Congrats to Henrik for supporting that in Divan! - - == Divan == - The git repository at http://github.com/foretagsplatsen/Divan has a relatively complete C# library for CouchDB using Newtonsoft.JSON and NUnit as its only external dependencies. Divan is actively maintained and in use at Foretagsplatsen (a swedish company using it in their core system). Being the author of Divan I claim it to be much more complete than !SharpCouch :) - - For more information see the [[http://github.com/foretagsplatsen/Divan|README]]. - {{{ - git clone git://github.com/foretagsplatsen/Divan.git - }}} - - == SharpCouch == - The project at http://code.google.com/p/couchbrowse contains a simple wrapper library for CouchDB, called !SharpCouch, and a GUI client which makes use of the library. The GUI client code should serve as a good usage example, although the wrapper class is documented and fairly self-explanatory anyway. - - You can get the source by issuing the following SVN command: - - {{{ - svn checkout http://couchbrowse.googlecode.com/svn/trunk/ couchbrowse - }}} - - The project was built with !SharpDevelop 2.2, but should work out of the box with Visual Studio 2005. Getting it to work with !MonoDevelop should be reasonably easy, but has not been tried yet. - - == DreamSeat == - - !DreamSeat is a CouchDB client for the .NET plateform. It is based on [[http://github.com/soitgoes/LoveSeat|LoveSeat]] from Martin Murphy. - Thanks to [[https://github.com/MindTouch/DReAM|Mindtouch Dream]], all the API calls can be executed asychronously or sychronously. - - === Main Features === - * Asynchronous or synchronous API - * JSON serialisation powered by [[http://json.codeplex.com/|Newtonsoft.Json]] - * Continuous Update Support - * Replication Management (using _replicator database for CouchDB 1.1) - * Tested with Mono on Linux - * ... - - [[https://github.com/vdaron/DreamSeat/archives/master|Download here]] or clone it - - {{{ - git clone git://github.com/vdaron/DreamSeat.git - }}} - - - == MyCouch == - - [[https://github.com/danielwertheim/mycouch|MyCouch]] asynchronous !CouchDb client for .Net - builds on top of the asynchronous HTTP client and uses JSON.Net to provide flexible serialization behaviour. It tries to keep the domain language of CouchDb instead of bringing in generic repositories and other confusing stuff. MyCouch lets you work with raw JSON and/or entities/POCOS without requiring any implementation of interfaces, base classes etc. MyCouch provides you with some
[Couchdb Wiki] Update of "Getting_started_with_Smalltalk" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Smalltalk" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Smalltalk?action=diff=3=4 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Smalltalk - <> - There is a nascent interface being built for [[http://www.cincomsmalltalk.com|Cincom Smalltalk]]. To try that out, you'll need to: - - * [[http://www.cincomsmalltalk.com/scripts/CommunityDownloadPage.ssp|Download Cincom Smalltalk]] - * Get an Account in the [[http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Public+Store+Repository|Cincom Smalltalk Public Repository]] - * Load the "CouchDB" package from the repository - - Once it's loaded, you can try things like this: - - {{{ - "A simple interface to Couch DB. To create, delete, and query databases, try:" - CouchDB.Interface default databases. - CouchDB.Interface default create: 'mydb'. - CouchDB.Interface default delete: 'mydb'. - CouchDB.Interface default database: 'mydb' - - "Further, you can then manipulate documents in a database, try:" - myDatabase := CouchDB.Interface default database: 'mydb'. - documentRecord := myDatabase save: myDatabase address. - myDatabase document: (documentRecord at: 'id'). - myDatabase delete: (documentRecord at: 'id') revision: (documentRecord at: 'rev'). - - - - }}} - - - The APIs for database are fully implemented, and, other than attachments, the APIs for documents are fully implemented as well -
[Couchdb Wiki] Update of "GettingStartedWithVmware" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithVmware" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithVmware?action=diff=3=4 Comment: Link no longer valid - #redirect Getting_started_with_VMware - Getting started with CouchDB and VMware Appliance. - == Quickstart == - - * [[http://s3.amazonaws.com/vmware_appliances/Jeos%20Elastic%20Drive%20and%20CouchDB-0.7.3a.rar|Download the appliance]]. Size of the file is around 250Mb. - * Unpack it into proper directory (On my Windows workstation I have ''C:\Virtual Machines'' directory). - * In VMware Player use ''Commands > Open''. - * In VMware Server use ''File > Open > Browse'' and select your unpacked image - * In terminal use username ''khaz'' and password ''khaz''. For elevated privileges use ''sudo command''. - * At this point you should have all ready to go. To verify that service is running, you can run command inside terminal session ''wget http://localhost:5984/''. It should return document that looks like: - {{{ - {"couchdb": "Welcome", "version": "0.7.3a"} - }}} - - == Detailed Description == - - This appliance release has with CouchDB version 0.7.3a (rev. 649). It runs as a service under Ubuntu 7.10 Jeos and has a bonus addon - free version of Elastic Drive, that helps to establish persistence to remote storage services like Amazon S3 or Nirvanix, thus preserving the data that is stored in your CouchDB. - - * [[http://s3.amazonaws.com/vmware_appliances/Jeos%20Elastic%20Drive%20and%20CouchDB-0.7.3a.rar|Download the appliance]]. Size of the file is around 250Mb. - * Unpack it into proper directory (On my Windows workstation I have ''C:\Virtual Machines'' directory). You need to have some utility to decompress an archive, I use trial version of [[http://www.rarlab.com/download.htm|WinRAR]]. Same utility had limitations on zip archive size, so this is why you have .rar - * In VMware Player use ''Commands > Open''. - * In VMware Server use ''File > Open > Browse'' and select your unpacked image. - * In terminal use username ''khaz'' and password ''khaz''. For elevated privileges use ''sudo command''. - * At this point you should have all ready to go. To verify that service is running, you can run command inside terminal session ''wget http://localhost:5984/''. It should return document that looks like: - {{{ - {"couchdb": "Welcome", "version": "0.7.3a"} - }}} - If you are running Server Edition, and bridged Ethernet connection (so it uses external DHCP to obtain IP address), you can run ifconfig inside terminal session and see what IP address is assigned to this virtual instance. At this point it is easy to open new browser window and type in something like http://192.168.:5984/. If you see the response like above it means all works as expected. -
[Couchdb Wiki] Update of "GettingStartedWithSmalltalk" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithSmalltalk" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithSmalltalk?action=diff=4=5 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Smalltalk - #redirect Getting_started_with_Smalltalk - There is a nascent interface being built for [[http://www.cincomsmalltalk.com|Cincom Smalltalk]]. To try that out, you'll need to: - * [[http://www.cincomsmalltalk.com/scripts/CommunityDownloadPage.ssp|Download Cincom Smalltalk]] - * Get an Account in the [[http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Public+Store+Repository|Cincom Smalltalk Public Repository]] - * Load the "CouchDB" package from the repository - - Once it's loaded, you can try things like this: - - {{{ - "A simple interface to Couch DB. To create, delete, and query databases, try:" - CouchDB.Interface default databases. - CouchDB.Interface default create: 'mydb'. - CouchDB.Interface default delete: 'mydb'. - CouchDB.Interface default database: 'mydb' - - "Further, you can then manipulate documents in a database, try:" - myDatabase := CouchDB.Interface default database: 'mydb'. - documentRecord := myDatabase save: myDatabase address. - myDatabase document: (documentRecord at: 'id'). - myDatabase delete: (documentRecord at: 'id') revision: (documentRecord at: 'rev'). - - - - }}} - - - The APIs for database are fully implemented, and, other than attachments, the APIs for documents are fully implemented as well -
[Couchdb Wiki] Update of "GettingStartedWithRuby" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithRuby" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithRuby?action=diff=5=6 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Ruby+Client - #redirect Getting_started_with_Ruby - Getting started with Ruby and the CouchDB API. - The following shows the basics of working with the raw CouchDB REST api from Ruby. If you want a richer interface that more tightly maps Couch documents into Ruby and also lets you save ruby objects directly to the database, you should check out the RubyLibrary. - - == Example Wrapper Class == - - {{{ - require 'net/http' - - module Couch - - class Server - def initialize(host, port, options = nil) - @host = host; - @port = port; - @options = options; - end - - def delete(uri) - request(Net::HTTP::Delete.new(uri)) - end - - def get(uri) - request(Net::HTTP::Get.new(uri)) - end - - def put(uri, json) - req = Net::HTTP::Put.new(uri) - req["content-type"] = "application/json" - req.body = json - request(req) - end - - def post(uri, json) - req = Net::HTTP::Post.new(uri) - req["content-type"] = "application/json" - req.body = json - request(req) - end - - def request(req) - res = Net::HTTP.start(@host, @port) {|http| - http.request(req) - } - if (not res.kind_of?(Net::HTTPSuccess)) - handle_error(req, res) - end - res - end - - private - - def handle_error(req, res) - e = RuntimeError.new("#{res.code}:#{res.message}\nMETHOD:#{req.method}\nURI:#{req.path}\n#{res.body}") - raise e - end - end - end - }}} - - == Creating a Database == - - To create a database called ''foo'': - - {{{ - server = Couch::Server.new("localhost", "5984") - server.put("/foo/", "") - }}} - - == Deleting a Database == - - To delete a database called ''foo'': - - {{{ - server = Couch::Server.new("localhost", "5984") - server.delete("/foo") - }}} - - == Creating a Document == - - To create a document in the database ''foo'' with the id ''document_id'': - - {{{ - server = Couch::Server.new("localhost", "5984") - doc = <<-JSON - {"type":"comment","body":"First Post!"} - JSON - server.put("/foo/document_id", doc) - }}} - - == Reading a Document == - - To read a document from database ''foo'' with the id ''document_id'': - - {{{ - server = Couch::Server.new("localhost", "5984") - res = server.get("/foo/document_id") - json = res.body - puts json - }}} -
[Couchdb Wiki] Update of "Getting_started_with_Ruby" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Ruby" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Ruby?action=diff=6=7 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Ruby+Client - <> - Getting started with Ruby and the CouchDB API. - - The following shows the basics of working with the raw CouchDB REST api from Ruby. If you want a richer interface that more tightly maps Couch documents into Ruby and also lets you save ruby objects directly to the database, you should check out the RubyLibrary. - - == Example Wrapper Class == - - {{{#!highlight ruby - require 'net/http' - - module Couch - - class Server - def initialize(host, port, options = nil) - @host = host - @port = port - @options = options - end - - def delete(uri) - request(Net::HTTP::Delete.new(uri)) - end - - def get(uri) - request(Net::HTTP::Get.new(uri)) - end - - def put(uri, json) - req = Net::HTTP::Put.new(uri) - req["content-type"] = "application/json" - req.body = json - request(req) - end - - def post(uri, json) - req = Net::HTTP::Post.new(uri) - req["content-type"] = "application/json" - req.body = json - request(req) - end - - def request(req) - res = Net::HTTP.start(@host, @port) { |http|http.request(req) } - unless res.kind_of?(Net::HTTPSuccess) - handle_error(req, res) - end - res - end - - private - - def handle_error(req, res) - e = RuntimeError.new("#{res.code}:#{res.message}\nMETHOD:#{req.method}\nURI:#{req.path}\n#{res.body}") - raise e - end - end - end - }}} - - == Creating a Database == - - To create a database called ''foo'': - - {{{ - server = Couch::Server.new("localhost", "5984") - server.put("/foo/", "") - }}} - - == Deleting a Database == - - To delete a database called ''foo'': - - {{{ - server = Couch::Server.new("localhost", "5984") - server.delete("/foo") - }}} - - == Creating a Document == - - To create a document in the database ''foo'' with the id ''document_id'': - - {{{ - server = Couch::Server.new("localhost", "5984") - doc = <<-JSON - {"type":"comment","body":"First Post!"} - JSON - server.put("/foo/document_id", doc) - }}} - - == Reading a Document == - - To read a document from database ''foo'' with the id ''document_id'': - - {{{ - server = Couch::Server.new("localhost", "5984") - res = server.get("/foo/document_id") - json = res.body - puts json - }}} -
[Couchdb Wiki] Update of "GettingStartedWithPython" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithPython" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithPython?action=diff=9=10 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Python - #redirect Getting_started_with_Python - Getting started with Python and the CouchDB API. - == Library == - === couchdb-python === - The code for the Python library can be obtained from: - - http://code.google.com/p/couchdb-python - - From a terminal window: - - {{{ - $ wget http://peak.telecommunity.com/dist/ez_setup.py - $ sudo python ez_setup.py - $ wget http://pypi.python.org/packages/2.5/C/CouchDB/CouchDB-0.4-py2.5.egg - $ sudo easy_install CouchDB-0.4-py2.5.egg - }}} - - This first downloads and installs the ''ez_setup.py'' script which runs python ''.egg'' files. The second part downloads the ''.egg'' file for CouchDB and installs it along with its dependencies. - - === pouch === - - http://code.google.com/p/pouch/ - - == Tutorial on using couchdb-python with Django == - - A tutorial on using Django (a Python framework) with CouchDb can be found at - - http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-with-django/ - - Alternatively you can view just the source for that example at - - http://github.com/lethain/comfy-django-example/tree/master - - == Example Wrapper Class == - - Demonstration of basic API-interaction using Python. - - {{{#!python - #! /usr/bin/python2.4 - - import httplib, simplejson # http://cheeseshop.python.org/pypi/simplejson - # Here only used for prettyprinting - - def prettyPrint(s): - """Prettyprints the json response of an HTTPResponse object""" - - # HTTPResponse instance -> Python object -> str - print simplejson.dumps(simplejson.loads(s.read()), sort_keys=True, indent=4) - - class Couch: - """Basic wrapper class for operations on a couchDB""" - - def __init__(self, host, port=5984, options=None): - self.host = host - self.port = port - - def connect(self): - return httplib.HTTPConnection(self.host, self.port) # No close() - - # Database operations - - def createDb(self, dbName): - """Creates a new database on the server""" - - r = self.put(''.join(['/',dbName,'/']), "") - prettyPrint(r) - - def deleteDb(self, dbName): - """Deletes the database on the server""" - - r = self.delete(''.join(['/',dbName,'/'])) - prettyPrint(r) - - def listDb(self): - """List the databases on the server""" - - prettyPrint(self.get('/_all_dbs')) - - def infoDb(self, dbName): - """Returns info about the couchDB""" - r = self.get(''.join(['/', dbName, '/'])) - prettyPrint(r) - - # Document operations - - def listDoc(self, dbName): - """List all documents in a given database""" - - r = self.get(''.join(['/', dbName, '/', '_all_docs'])) - prettyPrint(r) - - def openDoc(self, dbName, docId): - """Open a document in a given database""" - r = self.get(''.join(['/', dbName, '/', docId,])) - prettyPrint(r) - - def saveDoc(self, dbName, body, docId=None): - """Save/create a document to/in a given database""" - if docId: - r = self.put(''.join(['/', dbName, '/', docId]), body) - else: - r = self.post(''.join(['/', dbName, '/']), body) - prettyPrint(r) - - def deleteDoc(self, dbName, docId): - # XXX Crashed if resource is non-existent; not so for DELETE on db. Bug? - # XXX Does not work any more, on has to specify an revid - # Either do html head to get the recten revid or provide it as parameter - r = self.delete(''.join(['/', dbName, '/', docId])) - prettyPrint(r) - - # Basic http methods - - def get(self, uri): - c = self.connect() - headers = {"Accept": "application/json"} - c.request("GET", uri, None, headers) - return c.getresponse() - - def post(self, uri, body): - c = self.connect() - headers = {"Content-type": "application/json"} - c.request('POST', uri, body, headers) - return c.getresponse() - - def put(self, uri, body): - c = self.connect() - if len(body) > 0: - headers = {"Content-type": "application/json"} - c.request("PUT", uri, body, headers) - else: - c.request("PUT", uri, body) - return c.getresponse() - - def delete(self, uri): - c = self.connect() - c.request("DELETE", uri) - return c.getresponse() - }}} - - == Usage Example == - - {{{#!python - def test(): - foo = Couch('localhost', '5984') - - print "\nCreate database 'mydb':" - foo.createDb('mydb') - - print
[Couchdb Wiki] Update of "Getting_started_with_Python" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Python" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Python?action=diff=22=23 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Python - <> - Getting started with Python and the CouchDB API. - - == Library == - === couchdbkit === - . http://couchdbkit.org/ - - Start using Couchdbkit by reading the [[http://couchdbkit.org/docs/gettingstarted.html|Getting Started tutorial]]. - - For django use the [[http://www.couchdbkit.org/docs/django-extension.html|django extension]] of couchdbkit. Other extension exists for [[http://docs.formalchemy.org/ext/couchdb.html|formalchemy]]. - - === couchdb-python === - The code for the Python library can be obtained from: - - . http://code.google.com/p/couchdb-python - - From a terminal window: - - {{{ - $ wget http://peak.telecommunity.com/dist/ez_setup.py - $ sudo python ez_setup.py - $ wget http://pypi.python.org/packages/2.6/C/CouchDB/CouchDB-0.8-py2.6.egg - $ sudo easy_install CouchDB-0.8-py2.6.egg - }}} - This first downloads and installs the ''ez_setup.py'' script which runs python ''.egg'' files. The second part downloads the ''.egg'' file for CouchDB and installs it along with its dependencies. - - You can find the documentation [[http://packages.python.org/CouchDB/getting-started.html|here]], although make sure you use the latest version. A brief introduction: - - {{{ - import couchdb - - couch = couchdb.Server() # Assuming localhost:5984 - #Â If your CouchDB server is running elsewhere, set it up like this: - couch = couchdb.Server('http://example.com:5984/') - - # select database - db = couch['mydb'] - - #create a document and insert it into the db: - doc = {'foo': 'bar'} - db.save(doc) - }}} - - === couchquery === - A simple and dynamic access to CouchDB. - - . http://nicolaisi.github.io/couchquery/ - - === couchshelve === - An implementation of the python 'shelve' API using couchquery as a backend - - . http://www.randomwalking.com/snippets/couchshelve.text - - == Tutorial on using couchdb-python with Django == - A tutorial on using Django (a Python framework) with CouchDb can be found at - - . http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-with-django/ http://www.eflorenzano.com/blog/post/using-couchdb-django/ - - Alternatively you can view just the source for that example at - - . http://github.com/lethain/comfy-django-example/tree/master - - == Example Wrapper Class == - Demonstration of basic API-interaction using Python. (note: as of python 2.6, one can use "import json" for the same functionality in this script.) - - {{{#!python - #! /usr/bin/python2.6 - - import httplib, json - - def prettyPrint(s): - """Prettyprints the json response of an HTTPResponse object""" - - # HTTPResponse instance -> Python object -> str - print simplejson.dumps(json.loads(s.read()), sort_keys=True, indent=4) - - class Couch: - """Basic wrapper class for operations on a couchDB""" - - def __init__(self, host, port=5984, options=None): - self.host = host - self.port = port - - def connect(self): - return httplib.HTTPConnection(self.host, self.port) # No close() - - # Database operations - - def createDb(self, dbName): - """Creates a new database on the server""" - - r = self.put(''.join(['/',dbName,'/']), "") - prettyPrint(r) - - def deleteDb(self, dbName): - """Deletes the database on the server""" - - r = self.delete(''.join(['/',dbName,'/'])) - prettyPrint(r) - - def listDb(self): - """List the databases on the server""" - - prettyPrint(self.get('/_all_dbs')) - - def infoDb(self, dbName): - """Returns info about the couchDB""" - r = self.get(''.join(['/', dbName, '/'])) - prettyPrint(r) - - # Document operations - - def listDoc(self, dbName): - """List all documents in a given database""" - - r = self.get(''.join(['/', dbName, '/', '_all_docs'])) - prettyPrint(r) - - def openDoc(self, dbName, docId): - """Open a document in a given database""" - r = self.get(''.join(['/', dbName, '/', docId,])) - prettyPrint(r) - - def saveDoc(self, dbName, body, docId=None): - """Save/create a document to/in a given database""" - if docId: - r = self.put(''.join(['/', dbName, '/', docId]), body) - else: - r = self.post(''.join(['/', dbName, '/']), body) - prettyPrint(r) - - def deleteDoc(self, dbName, docId): - # XXX Crashed if resource is non-existent; not so for DELETE on db. Bug? - # XXX Does not work any more, on has to specify an revid - # Either do html head to get the recten revid or provide it as parameter - r =
[Couchdb Wiki] Update of "GettingStartedWithPhp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithPhp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithPhp?action=diff=7=8 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/PHP - #redirect Getting_started_with_PHP - Getting started with PHP and the CouchDB API. - == Setup == - - To get this example code running you need to install CouchDB on your system and have it running on port 5984. If you use a different machine or port, change the first two lines of code to your specific values. - - == What Does it Do? == - - This example first creates a !CouchSimple object that we're going to use for making connections to CouchDB on our machine, port 5984. Notice that this response is already encoded in JSON. CouchDB returns nothing but JSON wrapped in HTTP responses. - - It then tries to make a simple GET request to the root of the data store. - - We then look for a list of all databases in CouchDB and we find the one that ships with it, the ''test_suite_db''. CouchDB has all sorts of special URLs for specific tasks. The ''/_all_dbs'' URL gives us a list of all the databases. - - Next, we create a new database ''test'' using the HTTP method ''PUT''. Creating databases is that easy. - - Then we have a look all the documents in a database. To do so we send a GET request to the special URL ''/test/_all_docs''. We get an empty list. - - Time for action. We are now storing actual data, wrapped in JSON, in CouchDB. To do so, we make POST request to the test database and include a JSON object that has the special attribute ''"_id": "123"''. This is unique identifier each document in CouchDB has. If you don't specify one here, CouchDB does it for you. In the response you see, that CouchDB then tells you what ''_id'' was created. There is also the ''_rev'' attribute which can be used to specify a document's revision, but this is beyond the scope of this introduction. - - Assuming all goes well, we have another look at all the documents in the test database and 'lo and behold, our document is in. - - We then proceed to getting it back out again with a simple GET request to ''/test/123''. All documents you put into CouchDB can be retrieved like this. With their database and ''_id'' as the URL. - - At last, we delete our database. The HTTP DELETE method does the job. You can also DELETE single documents in the same way. - - {{{send("GET", "/"); - var_dump($resp); - // response: string(46) "{"couchdb": "Welcome", "version": "0.7.0a553"}" - - - // Get a list of all databases in CouchDb - $resp = $couch->send("GET", "/_all_dbs"); - var_dump($resp); - // response: string(17) "["test_suite_db"]" - - // Create a new database "test" - $resp = $couch->send("PUT", "/test"); - var_dump($resp); - // response: - // string(12) "{"ok":true} - // " - - // Get all documents in that database - $resp = $couch->send("GET", "/test/_all_docs"); - var_dump($resp); - // response: - // string(27) "{"total_rows":0,"rows":[]} - // " - - // Create a new document in the database test with the id 123 and some data - $resp = $couch->send("PUT", "/test/123", '{"_id":"123","data":"Foo"}'); - var_dump($resp); - // response: - // string(42) "{"ok":true,"id":"123","rev":"2039697587"} - // " - - // Get all documents in test again, seing doc 123 there - $resp = $couch->send("GET", "/test/_all_docs"); - var_dump($resp); - // response: - // string(91) "{"total_rows":1,"offset":0,"rows":[{"id":"123","key":"123","value":{"rev":"2039697587"}}]} - //" - - // Get back document with the id 123 - $resp = $couch->send("GET", "/test/123"); - var_dump($resp); - // response: - // string(47) "{"_id":"123","_rev":"2039697587","data":"Foo"} - // " - - // Delete our "test" database - $resp = $couch->send("DELETE", "/test/"); - var_dump($resp); - // response: string(12) "{"ok":true} - //" - - class CouchSimple - { - function CouchSimple($options) - { - foreach($options AS $key => $value) { - $this->$key = $value; - } - } - - function send($method, $url, $post_data = NULL) - { - $s = fsockopen($this->host, $this->port, $errno, $errstr); - - if(!$s) { - echo "$errno: $errstr\n"; - return false; - } - - $request = "$method $url HTTP/1.0\r\nHost: localhost\r\n"; - - if($post_data) { - $request .= "Content-Length: ".strlen($post_data)."\r\n\r\n"; - $request .= "$post_data\r\n"; - } else { - $request .= "\r\n"; - } - fwrite($s, $request); - - $response = ""; - while(!feof($s)) { - $response .= fgets($s); - } - - list($this->headers, $this->body) = explode("\r\n\r\n", $response); - return $this->body; - } - } - - ?> - }}} -
[Couchdb Wiki] Update of "GettingStartedWithJavaScript" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithJavaScript" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithJavaScript?action=diff=4=5 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/JavaScript?src=contextnavchildmode - #redirect Getting_started_with_JavaScript - Getting started with !JavaScript and the CouchDB API. - == Simple Wrapper == - - There is a simple !JavaScript wrapper around CouchDB included in the distribution. When you install the server it is installed as http://localhost:5984/_utils/script/couch.js. You can see examples of its use in ''couch_tests.js'': - - {{{ - var nc = {_id:"NC", cities:["Charlotte", "Raleigh"]}; - var ma = {_id:"MA", cities:["Boston", "Lowell", "Worcester", "Cambridge", "Springfield"]}; - var fl = {_id:"FL", cities:["Miami", "Tampa", "Orlando", "Springfield"]}; - - db.save(nc); - db.save(ma); - db.save(fl); - - ... - - var nc_cities = db.open('NC').cities; - }}} - - Obviously the ''couch.js'' API is by no means final since CouchDB itself is still in flux. - - == Rolling Your Own == - - CouchDB speaks JSON. JSON means !JavaScript Object Notation. CouchDB also speaks Plain Old HTTP, so getting going with !JavaScript is a walk in the park with the XML!HttpRequest object: - - {{{ - // instantiate a new XMLHttpRequest object - var req = new XMLHttpRequest() - // Open a GET request to "/all_dbs" - req.open("GET", "/_all_dbs") - // Send nothing as the request body - req.send("") - // Get the response - req.responseText - ["some_database", "another_database"] - }}} - - Going from here is just a matter using the normal CouchDB HttpRestApi to get what you want. - - There is numerous javascript libraries out there that wraps up both XML!HttpRequest and JSON in possibly nicer APIs, including: - - * [[http://www.prototypejs.org/|Prototype]] - * [[http://jquery.com/|JQuery]] - * [[http://dojotoolkit.org/|Dojo]] - * [[http://moofx.mad4milk.net/|Moo]] -
[Couchdb Wiki] Update of "Getting_started_with_PHP" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_PHP" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_PHP?action=diff=25=26 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/PHP - <> - Getting started with PHP and the CouchDB API. - - == CouchDB Libraries == - * PHPillow: http://arbitracker.org/phpillow.html (LGPL 3) - * PHP Object_Freezer: https://github.com/sebastianbergmann/php-object-freezer/tree (BSD) - * PHP On Couch: http://github.com/dready92/PHP-on-Couch/tree/master (GPLv2 or v3) - * PHP CouchDB Extension: http://www.topdog.za.net/php_couchdb_extension (PHP License 3.0) - * Sag for CouchDB: http://www.saggingcouch.com/ (Apache License 2.0) - * Doctrine2 CouchDB ODM: http://github.com/doctrine/couchdb-odm - * Chill: http://github.com/dancryer/Chill - * Settee: https://github.com/inadarei/settee - - == Setup == - To get this example code running you need to install CouchDB on your system and have it running on port 5984. If you use a different machine or port, change the first two lines of code to your specific values. - - == What Does it Do? == - This example first creates a !CouchSimple object that we're going to use for making connections to CouchDB on our machine, port 5984. Notice that this response is already encoded in JSON. CouchDB returns nothing but JSON wrapped in HTTP responses. - - It then tries to make a simple GET request to the root of the data store. - - We then look for a list of all databases in CouchDB and we find the one that ships with it, the ''test_suite_db''. CouchDB has all sorts of special URLs for specific tasks. The ''/_all_dbs'' URL gives us a list of all the databases. - - Next, we create a new database ''test'' using the HTTP method ''PUT''. Creating databases is that easy. - - Then we have a look all the documents in a database. To do so we send a GET request to the special URL ''/test/_all_docs''. We get an empty list. - - Time for action. We are now storing actual data, wrapped in JSON, in CouchDB. To do so, we make POST request to the test database and include a JSON object that has the special attribute ''"_id": "123"''. This is unique identifier each document in CouchDB has. If you don't specify one here, CouchDB does it for you. In the response you see, that CouchDB then tells you what ''_id'' was created. There is also the ''_rev'' attribute which can be used to specify a document's revision, but this is beyond the scope of this introduction. - - Assuming all goes well, we have another look at all the documents in the test database and 'lo and behold, our document is in. - - We then proceed to getting it back out again with a simple GET request to ''/test/123''. All documents you put into CouchDB can be retrieved like this. With their database and ''_id'' as the URL. - - At last, we delete our database. The HTTP DELETE method does the job. You can also DELETE single documents in the same way. - - {{{ - send("GET", "/"); - var_dump($resp); // response: string(46) "{"couchdb": "Welcome", "version": "0.7.0a553"}" - - // Get a list of all databases in CouchDb - $resp = $couch->send("GET", "/_all_dbs"); - var_dump($resp); // string(17) "["test_suite_db"]" - - // Create a new database "test" - $resp = $couch->send("PUT", "/test"); - var_dump($resp); // string(12) "{"ok":true}" - - // Get all documents in that database - $resp = $couch->send("GET", "/test/_all_docs"); - var_dump($resp); // string(27) "{"total_rows":0,"rows":[]}" - - // Create a new document in the database test with the id 123 and some data - $resp = $couch->send("PUT", "/test/123", '{"_id":"123","data":"Foo"}'); - var_dump($resp); // string(42) "{"ok":true,"id":"123","rev":"2039697587"}" - - // Get all documents in test again, seing doc 123 there - $resp = $couch->send("GET", "/test/_all_docs"); - var_dump($resp); // string(91) "{"total_rows":1,"offset":0,"rows":[{"id":"123","key":"123","value":{"rev":"2039697587"}}]}" - - // Get back document with the id 123 - $resp = $couch->send("GET", "/test/123"); - var_dump($resp); // string(47) "{"_id":"123","_rev":"2039697587","data":"Foo"}" - - // Delete our "test" database - $resp = $couch->send("DELETE", "/test/"); - var_dump($resp); // string(12) "{"ok":true}" - - class CouchSimple { - function CouchSimple($options) { -foreach($options AS $key => $value) { - $this->$key = $value; -} - } - -function send($method, $url, $post_data = NULL) { - $s = fsockopen($this->host, $this->port, $errno, $errstr); - if(!$s) { - echo "$errno: $errstr\n"; - return false; - } - - $request = "$method $url HTTP/1.0\r\nHost: $this->host\r\n"; - - if ($this->user) { - $request .= "Authorization: Basic ".base64_encode("$this->user:$this->pass")."\r\n";
[Couchdb Wiki] Update of "Getting_started_with_Perl" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Perl" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Perl?action=diff=8=9 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Perl - <> - Getting started with Perl and the CouchDB API. - - The following shows the basics of working with the raw CouchDB REST api from Perl. If you want a richer interface that more tightly maps Couch documents into Perl (so you don't have to deal with JSON manually, for example), you should pick your favourite out of the several implementations: [[http://search.cpan.org/~norbu/Store-CouchDB/lib/Store/CouchDB.pm|Store::CouchDB]], [[http://search.cpan.org/dist/CouchDB-Client/|CouchDB::Client]], [[http://search.cpan.org/dist/AnyEvent-CouchDB/|AnyEvent::CouchDB]], [[http://search.cpan.org/dist/DB-CouchDB-Schema/|DB::CouchDB::Schema]], or for POE lovers [[http://search.cpan.org/dist/POE-Component-Client-CouchDB/|POE::Component::Client::CouchDB]]. - - Note that these examples all use the new version of CouchDB, with a JSON interface rather than XML. - - == Example Wrapper Class == - You can save this to a file named ''CouchDB.pm'', then just use it from your program with ''use CouchDB;''. But if you're going to do anything more than mess around, I would recommend getting the Net::!CouchDb module from CPAN. - - {{{ - package CouchDB; - - use strict; - use warnings; - - use LWP::UserAgent; - - sub new { - my ($class, $host, $port, $options) = @_; - - my $ua = LWP::UserAgent->new; - $ua->timeout(10); - $ua->env_proxy; - - return bless { - ua => $ua, - host => $host, - port => $port, - base_uri => "http://$host:$port/;, -}, $class; - } - - sub ua { shift->{ua} } - sub base { shift->{base_uri} } - - sub request { - my ($self, $method, $uri, $content) = @_; - - my $full_uri = $self->base . $uri; - my $req; - - if (defined $content) { - #Content-Type: application/json - - $req = HTTP::Request->new( $method, $full_uri, undef, $content ); - $req->header('Content-Type' => 'application/json'); - } else { - $req = HTTP::Request->new( $method, $full_uri ); - } - - my $response = $self->ua->request($req); - - if ($response->is_success) { - return $response->content; - } else { - die($response->status_line . ":" . $response->content); - } - } - - sub delete { - my ($self, $url) = @_; - - $self->request(DELETE => $url); - } - - sub get { - my ($self, $url) = @_; - - $self->request(GET => $url); - } - - sub put { - my ($self, $url, $json) = @_; - - $self->request(PUT => $url, $json); - } - - sub post { - my ($self, $url, $json) = @_; - - $self->request(POST => $url, $json); - } - - 1; - }}} - == Creating a Database == - To create a database called ''foo'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->put("foo"); - }}} - == Deleting a Database == - To delete a database called ''foo'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->delete("foo"); - }}} - == Creating a Document == - To create a document in the database ''foo'' with the id ''document_id'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->put("foo/document_id",get("foo/document_id"); - }}} -
[Couchdb Wiki] Update of "GettingStartedWithPerl" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithPerl" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithPerl?action=diff=7=8 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Perl - #redirect Getting_started_with_Perl - Getting started with Perl and the CouchDB API. - The following shows the basics of working with the raw CouchDB REST api from Perl. If you want a richer interface that more tightly maps Couch documents into Perl (so you don't have to deal with JSON manually, for example), you should pick your favourite out of the several implementations: [[http://search.cpan.org/dist/Net-CouchDb/|Net::CouchDb]] (See also [[http://git.ndrix.com/?p=Net-CouchDB|Michael Hendricks' version]]), [[http://search.cpan.org/dist/CouchDB-Client/|CouchDB::Client]], [[http://search.cpan.org/dist/AnyEvent-CouchDB/|AnyEvent::CouchDB]], [[http://search.cpan.org/~zaphar/DB-CouchDB-Schema-0.2.1/lib/DB/CouchDB/Schema.pm|DB::CouchDB::Schema]], or for POE lovers [[http://search.cpan.org/dist/POE-Component-Client-CouchDB/|POE::Component::Client::CouchDB]]. - - Note that these examples all use the new version of CouchDB, with a JSON interface rather than XML. - - == Example Wrapper Class == - - You can save this to a file named ''CouchDB.pm'', then just use it from your program with ''use CouchDB;''. But if you're going to do anything more than mess around, I would recommend getting the Net::!CouchDb module from CPAN. - - {{{ - package CouchDB; - - use strict; - use warnings; - - use LWP::UserAgent; - - sub new { - my ($class, $host, $port, $options) = @_; - - my $ua = LWP::UserAgent->new; - $ua->timeout(10); - $ua->env_proxy; - - return bless { - ua => $ua, - host => $host, - port => $port, - base_uri => "http://$host:$port/;, -}, $class; - } - - sub ua { shift->{ua} } - sub base { shift->{base_uri} } - - sub request { - my ($self, $method, $uri, $content) = @_; - - my $full_uri = $self->base . $uri; - my $req; - - if (defined $content) { - #Content-Type: application/json - - $req = HTTP::Request->new( $method, $full_uri, undef, $content ); - $req->header('Content-Type' => 'application/json'); - } else { - $req = HTTP::Request->new( $method, $full_uri ); - } - - my $response = $self->ua->request($req); - - if ($response->is_success) { - return $response->content; - } else { - die($response->status_line . ":" . $response->content); - } - } - - sub delete { - my ($self, $url) = @_; - - $self->request(DELETE => $url); - } - - sub get { - my ($self, $url) = @_; - - $self->request(GET => $url); - } - - sub put { - my ($self, $url, $json) = @_; - - $self->request(PUT => $url, $json); - } - - sub post { - my ($self, $url, $json) = @_; - - $self->request(POST => $url, $json); - } - - 1; - }}} - - == Creating a Database == - - To create a database called ''foo'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->put("foo"); - }}} - - == Deleting a Database == - - To delete a database called ''foo'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->delete("foo"); - }}} - - == Creating a Document == - - To create a document in the database ''foo'' with the id ''document_id'': - - {{{ - my $db = CouchDB->new('localhost', '5984'); - $db->put("foo/document_id",get("foo/document_id"); - }}} -
[Couchdb Wiki] Update of "GettingStartedWithObjectiveCee" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithObjectiveCee" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithObjectiveCee?action=diff=3=4 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Objective-C - #redirect Getting_started_with_Objective-C - See [[http://code.brautaset.org/CouchObjC/]] for more information.
[Couchdb Wiki] Update of "Getting_started_with_Objective-C" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Objective-C" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Objective-C?action=diff=7=8 Comment: Migrated to https://cwiki.apache.org/confluence/display/COUCHDB/Objective-C - <> - If you don't want to use NSURLConnection directly (it's kind of a pain) there are a few Objective-C frameworks to choose from: - - * [[https://github.com/TouchCode/trundle|Trundle]] is being used by a few apps already. - * [[https://github.com/couchbaselabs/CouchCocoa|CouchCocoa]] is a newer framework, somewhat higher-level than Trundle. It's supported by Couchbase, but is free and open-source. - * [[http://code.brautaset.org/CouchObjC/|CouchObjC]] is an older project that doesn't seem to be maintained anymore. - - If you want to use CouchDB in an iOS app, with a local database, you'll likely want to use the [[https://github.com/couchbaselabs/iOS-Couchbase|Mobile Couchbase]] framework. -
[Couchdb Wiki] Update of "Getting_started_with_LISP" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_LISP" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_LISP?action=diff=6=7 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Lisp - <> - There are a number of Common Lisp libraries, as one would expect: - - * [[http://github.com/sykopomp/chillax|Chillax]] comprises both client and view-server, plus an extensible API for using your own objects as documents. Interesting [[https://sykosomatic.org/2010/10/chillax-and-protocols/|commentary]] on development approach. Latest release 2012/12/22, v0.4.6 - * [[http://common-lisp.net/project/clouchdb/|CLouchDB]] Latest release 2012/02/18 v0.0.16, with [[https://github.com/petereddy/clouchdb|source]]. - - Deprecated: - - These have not been updated recently, and unlikely to function with recent supported CouchDB releases, including basic things like attachments. - - * [[http://common-lisp.net/project/cl-couch/|Cl-Couch]] - Full suite, includes client, view-server and object layer. Not updated since 2008. See http://kzar.co.uk/blog/2008/12/26/lisp-couchdb-cl-couch-example/ and https://github.com/ryszard/Cl-Couch for examples and current source (no longer on darcs). - * [[http://nicolas.lamirault.free.fr/projects/cl-couchdb/|cl-couchdb]] similar issues. Not updated since 2007. -
[Couchdb Wiki] Update of "GettingStartedWithLisp" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "GettingStartedWithLisp" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/GettingStartedWithLisp?action=diff=7=8 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/Lisp - #redirect Getting_started_with_LISP - There are two Common Lisp CouchDB libraries: - = Full suites = - Client, view-server, object layer - - * [[Cl-Couch]] (client, view-server and object layer) - - = Clients = - * [[ClouchDB]] - * [[http://nicolas.lamirault.free.fr/projects/cl-couchdb/|cl-couchdb]] -
[Couchdb Wiki] Update of "Getting_started_with_Haskell" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_Haskell" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_Haskell?action=diff=5=6 Comment: Migrated to https://cwiki.apache.org/confluence/display/COUCHDB/CouchDB+clients - <> - Haskell bindings for CouchDB are available on [[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/CouchDB|Hackage]], the Haskell package library. - - [[http://hackage.haskell.org/packages/archive/CouchDB/latest/doc/html/Database-CouchDB.html|Documentation]] -
[Couchdb Wiki] Update of "Getting_started_with_LotusScript" by JoanTouzet
Dear wiki user, You have subscribed to a wiki page "Couchdb Wiki" for change notification. The page "Getting_started_with_LotusScript" has been deleted by JoanTouzet: https://wiki.apache.org/couchdb/Getting_started_with_LotusScript?action=diff=3=4 Comment: https://cwiki.apache.org/confluence/display/COUCHDB/LotusScript - <> - ## page was renamed from Getting Started With LotusScript - ## page was renamed from GettingStartedLotusScript - Getting started with !LotusScript and the CouchDB API. - - This is an example of wrapper classes that use LS2J to send requests to a CouchDB server from !LotusScript. This could be useful to move data between Domino databases and CouchDB databases. The !LotusScript code roughly tracks the structure of the Ruby code. - - == Basic API == - - {{{ - Option Public - Uselsx "*javacon" - }}} - - {{{ - Sub Initialize - %REM - LotusScript LS2J classes for CouchDb - Copyright (C) 2006 Alan Bell - Dominux Consulting - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - %ENDREM - 'right now this just implements the basic database operations - 'feel free to fix bugs and add functionailty to it in the Wiki - 'there is a total lack of releasing of objects right now so it will leak memory like a sieve - 'error handling would be nice too. - Dim cserver As couchserver - Set cserver=New couchserver("http://localhost","5984",";) - 'create a database - Call cserver.put("/ls2couch/","") - 'create a document - Call cserver.put("/ls2couch/document_id", |{"type":"comment","body":"First Post!"}|) - 'retrieve the document - Print cserver.cget("/ls2couch/document_id") - 'delete the database - Call cserver.del("/ls2couch/") - End Sub - }}} - - {{{ - Class couchserver - Private host As String - Private port As String - Private options As String - Private proxyserver As String - Private proxyport As String - Private jses As JAVASESSION - Private jclass As JAVACLASS - Private jurl As JAVAOBJECT - Private jcon As JAVAOBJECT - Sub new(host As String,port As String,options As String) - 'this corresponds to the initialise method in the Ruby classes - Me.host=host - Me.port=port - Me.options=options - Set Me.jses=New JAVASESSION() - End Sub - - Sub setproxy(proxyserver As String,proxyport As String) - 'this should do something. At the moment it does not. - Me.proxyserver=proxyserver - Me.proxyport=proxyport - End Sub - - Sub del(uri As String) - 'this corresponds to the delete method in the Ruby classes - Set Me.jclass=jses.GetClass("java/net/URL") - Set Me.jurl=Me.jclass.CreateObject("(Ljava/lang/String;)V",host+":"+port+uri) - Set jcon=jurl.openConnection() - Me.jcon.setRequestMethod("DELETE") - Call Me.jcon.connect() - Set ist=jcon.getInputStream()'oddly enough java doesn't do anything with a URL until you read from it. - Call ist.close() - End Sub - - Function cget(uri As String) As String - 'this corresponds to the get class in Ruby. "get" is a reserved word - Set Me.jclass=jses.GetClass("java/net/URL") - Set Me.jurl=Me.jclass.CreateObject("(Ljava/lang/String;)V",host+":"+port+uri) - Set jcon=jurl.openConnection() - Me.jcon.setRequestMethod("GET") - Call Me.jcon.connect() - Set ist=jcon.getInputStream()'oddly enough java doesn't do anything with a URL until you read from it. - Set Me.jclass=jses.GetClass("java/io/InputStreamReader") - Set ireader=Me.jclass.CreateObject("(Ljava/io/InputStream;)V",ist) - Set Me.jclass=jses.GetClass("java/io/BufferedReader") - Set bReader=Me.jclass.CreateObject("(Ljava/io/Reader;)V",ireader) - cget=bReader.readLine() - Call ist.close() - End Function - - Sub put (uri As String,xml As String) - Set Me.jclass=jses.GetClass("java/net/URL") - Set Me.jurl=Me.jclass.CreateObject("(Ljava/lang/String;)V",host+":"+port+uri) - Set jcon=jurl.openConnection() - Me.jcon.setRequestMethod("PUT") - Me.jcon.setdooutput(True) - Call Me.jcon.connect() - Set ost=jcon.getOutputStream() - Set Me.jclass=jses.GetClass("java/io/OutputStreamWriter") - Set owriter=Me.jclass.CreateObject("(Ljava/io/OutputStream;)V",ost) - Call owriter.write(xml,0,Len(xml)) - Call owriter.flush() - Call ost.write(32) -