Git Product home page Git Product logo

pscouchdb's Introduction

PSCouchDB: Advanced CLI for CouchDB server

PSCouchDB

Docs: ReadTheDocs

Installation and simple usage

  1. Download and install CouchDB following the docs.
  2. Download and install latest PSCouchDB module by copying it under %Windir%\System32\WindowsPowerShell\v1.0\Modules for all users or under %UserProfile%\Documents\WindowsPowerShell\Modules for the current user or install through PowershellGallery.

INFORMATION: This module is not signed. Before import or execute cmdlet on this module, see about_signing session. To skip this part and continue, run Set-ExecutionPolicy -ExecutionPolicy Unrestricted ATTENTION: If you are using CouchDB version 2, use the PSCouchDB 1.X version; if instead you are using CouchDB version 3 or 4, use the PSCouchDB version 2.X```

  1. Now, configure database mode, in single node (cluster of one single node) or cluster, run this cmdlet:
# Single node cluster
Enable-CouchDBCluster -SingleNode -Authorization "admin:password"
# Cluster (with three node)
Enable-CouchDBCluster -Authorization "admin:password"

For more details, see the docs.

  1. Now, open powershell and create a first personal database:
New-CouchDBDatabase -Database test -Authorization "admin:password"
  1. Create a sample document for test database:
$Data = '{
	"name": "Arthur Dent",
	"planet": "Heart"
}'
New-CouchDBDocument -Database test -Document "Hitchhikers" -Data $Data -Authorization "admin:password"
  1. Add attachment file in our docuemnt:
$rev = (Get-CouchDBDocument -Database test -Document "Hitchhikers")._rev
"Ultimate Question of Life, the Universe and Everything" | Out-File C:\file.txt
New-CouchDBAttachment -Database test -Document "Hitchhikers" -revision $rev -Attachment C:\file.txt -Authorization "admin:password"
  1. Finally, get a document:
Get-CouchDBAttachment -Database test -Document "Hitchhikers" -Attachment file.txt

These are just some of the operations you can do with this CLI. PSCouchDB supports all API of CouchDB server. If you want to find out more, follow the docs.

Test PSCouchDB

Before test this module, install latest version of CouchDB server and latest installation of Pester module.

WARNING: Test this module in testing enviroment ONLY.

git clone "https://github.com/MatteoGuadrini/PSCouchDB.git"
cd "PSCouchDB/PSCouchDB/tests"
foreach ($f in (Get-ChildItem $PWD)) {
	& pwsh $f.FullName		# use powershell before 6.X
}

Complete documentation

For other operation, for more details and for learning all cmdlets and possibilities, see the docs.

Kanban board

If you are curious, if you want to contribute or simply see the features, look at the project's kanban board here: KANBAN.

Cmdlet help

If you want to have an overview of the module, do this:

help about_pscouchdb

Search for the cmdlets using a keyword pattern and then view the help:

Search-CouchDBHelp -Pattern Database | foreach {Get-Help $_.Name}

or see docs. For a little demonstration, see here

Licence

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Treeware

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.