matteoguadrini / pscouchdb Goto Github PK
View Code? Open in Web Editor NEWAdvanced CLI for CouchDB server
Home Page: https://matteoguadrini.github.io/PSCouchDB
License: GNU General Public License v3.0
Advanced CLI for CouchDB server
Home Page: https://matteoguadrini.github.io/PSCouchDB
License: GNU General Public License v3.0
$Value parameter is always converted to string. This appears to be by design, however, it's particularly painful if your documents contain numbers or bools.
File attachment that it does not have CRLF’s.
We’re finding that CRLF’s are stripped out of the file, and this causes us issues sometimes. (If we upload the file manually into Fouxton, we don’t have the issue.)
Add-CouchDBAttachment -Database $Database -Document $RecordId -Revision $Document._rev -Attachment $filename -Authorization $Authorization
VERBOSE: Set method to GET
VERBOSE: Set database to hardware_firmwaretype
VERBOSE: Set document to 1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
VERBOSE: Add authorization
VERBOSE: Request to CouchDB server:
GET /hardware_firmwaretype/1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
Host: localhost:5984
Param:
VERBOSE: Set method to PUT
VERBOSE: Set database to hardware_firmwaretype
VERBOSE: Set document to 1ca6f867-8295-456a-b7d9-b36f5cfa3f3b
VERBOSE: Set attachment to HardwareData/FirmwareType/I++/OriginalFile.FirIL
VERBOSE: Set revision to 71-9f348007305aa351124872a1d2b208a8
VERBOSE: Set parameters: rev=71-9f348007305aa351124872a1d2b208a8
VERBOSE: Add authorization
VERBOSE: Request to CouchDB server:
PUT /hardware_firmwaretype/1ca6f867-8295-456a-b7d9-b36f5cfa3f3b/OriginalFile.FirIL
Host: localhost:5984
Param: ?rev=71-9f348007305aa351124872a1d2b208a8
None
Add-CouchDBAttachment -> Send_CouchDBRequest -> PSCouchDBRequest -> AddAttachment(...)
When I download file attachment, has a CRLF’s.
Cmdlets raise an Error whenever the authorization param contains chars like -
, !
in password
Get-CouchDBDatabase -Database 'foobar' -Sever 'couch.any.io' -Port 5984 -Authorization 'user:foo-bar!'
Authorization string must be this format: "user:password"
In C:\Program Files\WindowsPowerShell\Modules\pscouchdb\2.3.0\PSCouchDB.psm1:1466 Zeichen:13
+ throw [System.Text.RegularExpressions.RegexMatchTimeoutEx ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], RegexMatchTimeoutException
+ FullyQualifiedErrorId : Authorization string must be this format: "user:password"
This is traceback exception:
Description of what is expected
Additional context
Cmdlets like Export-CouchDBDatabase
seems to parse the uri wrong for cases where the CouchDB host is published by a reverse proxy like https://generic.host.io:443/couch/<db>/<doc>
This is traceback exception:
The port itself should be added in the URIs host field an not appended after the path.
Additional context
Using Import-CouchDBDatabase
fails due to json format error generated by ExportDBDatabase
.
Export-CouchDBDatabase -Server 'old.couch.io' -Database 'stats' -Verbose -Port 5984 -Authorization (Get-Credential) -Path '.\stats.json'
Import-CouchDBDatabase -Server 'new.couch.io' -Port 443 -Ssl -Database 'stats' -Path .\stats.json -Authorization (Get-Credential) -Verbose -RemoveRevision
This is traceback exception:
[400] Bad Request: Bad request structure. The error can indicate an error with the request URL, path or headers.
CouchDB Response -> Bad Request
In C:\Program Files\WindowsPowerShell\Modules\pscouchdb\2.3.2\PSCouchDB.psm1:1334 Zeichen:13
+ throw ([PSCouchDBRequestException]::New($errcode.StatusCo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: ([400] Bad Reque... -> Bad Request:String) [], RuntimeException
+ FullyQualifiedErrorId : [400] Bad Request: Bad request structure. The error can indicate an error with the reque
st URL, path or headers.
CouchDB Response -> Bad Request
Description of what is expected
💡 Powershell 5.1 on any Windows system
UTF8 BOM
, If you manually change the encoding to utf8 without BOM the import works!Please include Send-CouchDBRequest in module exports.
This Cmdlet does not provide the full functionality available. Below link provides detail on the many other fields that would be amazing to have as part of the Cmdlet.
http://docs.couchdb.org/en/2.1.1/api/database/find.html?highlight=find
It would be spectacular if we could add support for views!
No clear way to enable HTTPS communication. It appears HTTP is set via $url in Send-CouchDBRequest and New-CouchDBReplication. Can we add a parameter to use HTTPS?
When adding a new Document and the -data param is provided actual JSON data "Document must be a JSON object" is thrown.
eg:
$data = Get-Service | select name; $data = $data | convertto-json -compress
New-CouchDBDocument -Server server -Database test -Document "test" -Data $data
Invoke-RestMethod : {"error":"bad_request","reason":"Document must be a JSON object"}
At C:\Program Files\WindowsPowerShell\Modules\PSCouchDB\1.6.0\PSCouchDB.psm1:444 char:16
$results = Invoke-RestMethod @options
~~~~~~~~~~~~~~~~~~~~~~~~~~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.