Coder Social home page Coder Social logo

couchbaselabs / couchbase-mobile-tools Goto Github PK

View Code? Open in Web Editor NEW
41.0 16.0 62.0 13.05 MB

A repo for hosting both supported and unsupported tools made by Couchbase

License: Apache License 2.0

C++ 45.27% CMake 3.53% Shell 0.58% PowerShell 0.23% C# 35.15% Makefile 0.23% Python 10.31% Java 4.71%

couchbase-mobile-tools's Introduction

The Couchbase Mobile Tool Repo

Master branch: This branch tracks the master branch of couchbase-lite-core, which is currently development versions of Couchbase Lite 2.8. For the Couchbase Lite 2.7 versions, check out the master-mercury branch.

This repo is a collection of tools developed by the Couchbase mobile team. Official support is not guaranteed by presence in this repo, and each tool gains official support (i.e. paid support help, etc) on a case-by-case basis. For more information, open one of the following pages:

Binary Releases

For convenience we've uploaded some pre-built binaries to the Releases tab. As these tools are unsupported, the binaries may or may not be up to date.

NOTE: The source code for the tools is Apache-licensed, as specified in LICENSE. However, the pre-built cblite binaries are linked with the Enterprise Edition of Couchbase Lite, so the usage of those binaries will be guided by the terms and conditions specified in Couchbase's Enterprise License.

Building the Tools

First: if you haven't already checked out submodules, run git submodule update --init --recursive.

Interactively

There is a Python script at the root of the repo called build.py which if run with no arguments will guide you through the build process.

To install the dependencies for the build script, run pip install -r requirements.txt. (Or use pip3 if you don't have pip.)

Then run python build.py (or python3 build.py) to build.

At the end of any interactive run, the script will print the non-interactive invocation to the screen for future reference. In the future you could just re-enter that command, if you like.

With CMake or Xcode

For a description of how to build without the script, see BUILDING.md

Compiler Requirements

Linux

The recommended configuration is clang and libc++. Here is a table of versions:

Name Minimum Recommended
GCC 7 7 or higher
Clang 3.9* 5 or higher

* Requires libstdc++-7 or libc++ from clang 5 or higher

Windows

Compiler versions on Windows have recently taken a turn beginning with Visual Studio 2017. However, it appears that compiler versions from here forward will be contained within a ten digit minor version range. Visual Studio 2017 was released with MSVC 14.10.25008 and is currently at MSVC 14.16.27027 while Visual Studio 2019 was released with MSVC 14.20.27508.

For the purposes of these tools, anything 14.10 or above is fine.

The C++ runtime installer for end users has been combined into one big installer for all of version 14 which overwrites the previous one instead of an installer per runtime like it used to be, so that makes checking if it is installed in an installer a bit more of a hassle.

If you've installed VS 2017, you are good to go for compiling. For distribution you will need to check the MSVC version and install the VS2015-2019 C++ runtime distributable if needed.

macOS

Xcode 11.4 or later recommended.

couchbase-mobile-tools's People

Contributors

bmeike avatar borrrden avatar jayahariv avatar jianminzhao avatar laurennguyen14 avatar mhocouchbase avatar pasin avatar pddstudio avatar pkjvit avatar rajagp avatar snej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

couchbase-mobile-tools's Issues

Extra characters while decoding warn and error log files

Version:
cbl-log #100

Steps to reproduce:

  1. run cbl-log decoder tool for warning and error binary files

Expected Result:
You should see the output of the file should get decoded to text format

Actual Result:
See the log on both warn and error witch etrac characters
^[[1m^[[31mWARNING^[[0m: -> warn file
^[[1m^[[31mERROR^[[0m: -> error file

logs:
xamain-error.log
xamarin-warn.txt

This issue is happening on all platforms of cbl-log decoder except on windows .
Tested on Centos, macOs, ubuntu
Happening with all platforms of cbl warn and error logs, other logs looks fine

Allow building with existing LiteCore checkout

The build.sh script always checks out and builds LiteCore. It would be convenient for those already developing with LiteCore if it could use an existing LiteCore checkout; something like

./build.sh --litecore /stuff/couchbase-lite-core

Link errors building with build.sh

The build instructions in BUILDING.md are out of date — the shell scripts have been moved to the ci/ directory. This has caused customer confusion.

More seriously, the build fails at the link stage with a fatal error; apparently it is trying to write the output to a file cblite when there is already a directory at the same path. The below output comes from Linux, but I got the same error on macOS.

[100%] Linking CXX executable cblite
/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../bin/ld: cannot open output file cblite: Is a directory
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

cblite+query: Error: N1QL syntax error near character

Something wrong with documentation or cblite.
According to README.cblite.md query --limit 10 '["=", [".type"], "airline"]' should works:

$  cblite travel-sample.cblite2
(cblite) query --limit 10 '["=", [".type"], "airline"]'

in reality:

evgeniy@15inch /tmp/couchbase-mobile-tools/build $ ./cblite /tmp/test.cblite2
Opened read-only database /tmp/test.cblite2/
(cblite) query --limit 10 '["=", [".type"], "airline"]'
               ^
Error: N1QL syntax error near character 1
Error: N1QL syntax error near character 1
(cblite) query '["=", [".type"], "airline"]'
               ^
Error: N1QL syntax error near character 1

"mutex lock failed" error while replicating document with multiple updates

Steps to reproduce

1. Setup CB cluster & Configure SG
2. Create a document using POST API via SG
3. Create a cblite db on local server using cblite serve
     ./cblite/build/cblite serve  --create db.cblite2
4. Replicate between SG -> db.cblite2
     ./cblite/build/cblite push  ws://172.23.100.204:4985/db db.cblite2
5. Validate number of records on db.cblite2 ->Should be  equal to number of documents created in Step2
6. Update existing document using update API via SG (more than twice)
     PUT sghost:4985/bd/doc_id?=rev_id
7. run replication between SG -> db.cblite2 again

On step7 below error message is thrown . This issue happens only when a document is updated more than once . Ideally irrespective of number of updates on a single doc replication should still get the latest revision .

ErrorMessage

mv-mbp-sharathsulochana:~ sharathsulochana$ ./cblite/build/cblite push  ws://sghost/db db.cblite2
...
11:23:25.156137| [Sync] ERROR: {IncomingRev#1}==> litecore::repl::IncomingRev ->ws://sghost:4985/db/_blipsync @0x7ff132f0f670
11:23:25.156641| [Sync] ERROR: {IncomingRev#1} Threw C++ exception: mutex lock failed: Invalid argument

Opening encrypted databases 2.8 with cblite

Hello,
My app uses the .Net Couchbase Lite Enterprise 2.8.6 SDK and the encryption works great.
when I use my encryption key with cblite.exe, I get the following error.
cblite.exe --encrypted mabase.cblite2
Database password or hex key:
13:57:48.003790| [DB] ERROR: SQLite error (code 26): file is not a database in "SELECT count(*) FROM sqlite_master"
13:57:48.005162| [DB] ERROR: {DB#1} Could not decrypt database with AES256
I have downloaded cblite.exe from this link
https://github.com/couchbaselabs/couchbase-mobile-tools/releases/tag/cblite-2.8EE-alpha
Can you explain me the problem ?
Thanks

CBlite CLI issue with -cacert flag in windows

I am trying to pass pem file using the –cacert flag in below command but getting errors , Please advise how to pass the pem file in CLI

Example
cblite cp --cacert<prod.cert> --user : -v wss://<prod_url>/syncdb

cannot build on Mac OS X (10.14.6/Mojave)

When trying to build on OS X, I encounter the following errors:

  Generator

    Unix Makefiles

  does not support platform specification, but platform

    x64

  was specified.


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

How do I properly set up to build on a Mac?

Opening encrypted databases with `cblite`

Hello all, I'm attempting to build cblite so that it is capable of using enterprise features of Couchbase Lite. Specifically, I'd like to be able to inspect encrypted databases.

I found a preprocessor define that needs to be set to enable this, COUCHBASE_ENTERPRISE, and I've set it in the CMakeLists.txt file in the "cblite" subdirectory. After attempting to build with this new define, I found that SQLITE_HAS_CODEC also needed to be defined. That got me a bit further, but the build now cannot find an entire directory in the "vendor" subdirectory called "couchbase-lite-core-EE," which I assume is an alternate version of the "couchbase-lite" submodule already present in that directory.

Can someone help me locate that repository so that I can build for enterprise? I would expect it to be located here: https://github.com/couchbase alongside "couchbase-lite-core," but it isn't.

cant do cmake on ubuntu 22.04

[ 74%] Building CXX object LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/DatabaseCookies.cc.o
make[3]: *** [LiteCore/CMakeFiles/LiteCoreObjects.dir/build.make:1168: LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/ChangesFeed.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.hh:14,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.cc:14:
/root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:16: error: ‘numeric_limits’ is not a member of ‘std’
133 | = std::numeric_limits::max();
| ^~~~~~~~~~~~~~
/root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:46: error: expected primary-expression before ‘>’ token
133 | = std::numeric_limits::max();
| ^
/root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:49: error: ‘::max’ has not been declared; did you mean ‘std::max’?
133 | = std::numeric_limits::max();
| ^~~
| std::max
In file included from /usr/include/c++/11/algorithm:62,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/vendor/fleece/API/fleece/slice.hh:18,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/C/include/c4Error.h:21,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/C/include/c4Base.h:15,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/C/Cpp_include/c4Base.hh:21,
from /root/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.cc:13:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
make[3]: *** [LiteCore/CMakeFiles/LiteCoreObjects.dir/build.make:1196: LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/Checkpointer.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:378: LiteCore/CMakeFiles/LiteCoreObjects.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:307: CMakeFiles/cblite.dir/rule] Error 2
make: *** [Makefile:169: cblite] Error 2


To call this build non-interactively, next time use build.py --debug cblite


cblite ls Pattern matching is broken

looks like Pattern matching in ls is not working as expected. It provides the opposite result of what I expect.

e.g. cblite ls syncdb.cblite2
Customer::87738_157 Customer::895206_157 Customer::970450_157 Route::38083_157

cblite ls syncdb.cblite2 Customer::87738_15
Customer::895206_157 Customer::970450_157 Route::38083_157

cblite ls syncdb.cblite2 Route*
Customer::895206_157 Customer::970450_157

cblite ls syncdb.cblite2 *
(No documents with IDs matching "*")

Looks like the matching is putting in a NOT by default

Build failed on mac

Build is failing with below error in mac . Also noticed it fails to find below perl script while bilding from build.sh after cloning it from master branch

Can't open perl script "/Users/sharathsulochana/cblite/scripts/config.pl": No such file or directory 

/Users/sharathsulochana/cblite/cblite/cbliteTool.cc:101:18: error: redefinition of 'run'
}int CBLiteTool::run() {
                 ^
/Users/sharathsulochana/cblite/cblite/cbliteTool.cc:71:17: note: previous definition is here
int CBLiteTool::run() {
                ^
1 error generated.
make[3]: *** [CMakeFiles/cblite.dir/cblite/cbliteTool.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/cblite.dir/all] Error 2
make[1]: *** [CMakeFiles/cblite.dir/rule] Error 2
make: *** [cblite] Error 2
~/cblite

cblite: array_agg does not work

was using something similar to:
SELECT a,array_agg(b) FROM _default AS a LEFT JOIN _default AS b ON b.a_id=Meta(a).id GROUP BY a

The cblite tool throws an exception "[SQL] ERROR: array_agg: exception!".

Was trying to debug it with gdb.
Internal it seem to pass a integer-key dict to the array_agg function and fails about non-set shared keys.
(will post source location later, not enough time for it atm)

"cat" displays deleted doc as empty

cblite cat on a deleted doc displays something like

{
  "_id": "airport_10000"
}

which does not make it clear the document is deleted. It should probably print an error.

Can't run cblite on macOS Ventura

I downloaded macOS_86_64.zip on an M1 and I'm getting a seg fault when running cblite cp *.json test.cblite2

[1] 97078 segmentation fault cblite cp resources test.cblite2

IEXP-@2x

Docs - bubble up Query --explain

I poked around and found what I needed.
I'm sure other would like to use the CBL-Tool to do the same.

(cblite) query --explain SELECT * FROM _
SELECT fl_result(fl_root(.body)) FROM kv_default AS _ WHERE (.flags & 1 = 0)

2|0|0| SCAN TABLE kv_default AS _

{"FROM":[{"COLLECTION":"_"}],"WHAT":[["."]]}

`cp` should support TLS/SSL replication

The replicator in the cblite tool does not support TLS.

This is because it provides its own C4Socket implementation, having no Couchbase Lite layer to provide it. For this we use civetweb as a lightweight cross-platform HTTP/WebSocket library. Unfortunately the TLS support in civetweb is (IIRC) difficult to configure since it uses OpenSSL. We never enabled it because we didn't need it for unit tests and we decided it was too heavyweight to build into CBL. But we should enable it in the litecore tool.

(Moved here from https://github.com/couchbase/couchbase-lite-core/issues/587)

Error message presents after decoding iOS info log file

Version:
cbl-log #100

logs-ios-binary.zip

Steps to reproduce:

run cbl-log decoder tool for iOS cbl_info_*.cbllog binary files

Expected Result:
cbl_info_*.cbllog gets decoded to text format without error

Actual Result:
cbl_info_*.cbllog gets decoded to text format successfully, HOWEVER, the following error message presents afterwards:
Error: Uncaught C++ exception: ios_base::clear: unspecified iostream_category error

Notes:

  1. This error is only seen when I decode iOS info log files.
  2. This error is seen when I run cbl-log tool on Windows, on Ubuntu and on Mac.
  3. This error doesn't block binary file decoding, I obtain decoded iOS info successfully.

Issue building cblite on Windows 11 with MinGW

Hey, having some small problems with building cblite on Windows 11 with MinGW. This is what I'm getting whenever I try to setup

\cblite\build> cmake .. -G "MinGW Makefiles"
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/sonic/Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-15.0.7-mingw-w64ucrt-10.0.0-r4/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/sonic/Downloads/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-15.0.7-mingw-w64ucrt-10.0.0-r4/mingw64/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /Program Files/Git/cmd/git.exe (found version "2.30.1.windows.1")
No environment variables found, using git commit only
CMake Warning at /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/CMakeLists.txt:56 (message):
  No VERSION set, defaulting to 0.0.0


CMake Warning at /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/cmake/generate_edition.cmake:38 (message):
  No VERSION set, defaulting to 0.0.0...
Call Stack (most recent call first):
  /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/CMakeLists.txt:71 (generate_edition)


CMake Warning at /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/cmake/generate_edition.cmake:47 (message):
  No BLD_NUM set...
Call Stack (most recent call first):
  /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/CMakeLists.txt:71 (generate_edition)


-- Wrote /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/cblite/build/generated_headers/repo_version.h...
CMake Error at /Users/sonic/OneDrive/Documents/GitHub/couchbase-mobile-tools/vendor/couchbase-lite-core/CMakeLists.txt:143 (message):
  Unable to determine a supported platform from Windows


-- Configuring incomplete, errors occurred!

Anyone know what I could do or look at to remedy this?

cblite - use session tokens for authentication

We have below requirements in CB database as part of our project, would require your help on the same.

  1. Authorizing using session token - Currently we are using below userID-password authentication CLI command to generate continues pull replication.
    cblite cp --continuous -v --user userID:password -v dbname.cblite2

Now we are changing authentication method using session tokens.

It appears that cblite does not allow user authentication with session tokens.
Can the ability to authenticate with session tokens be added to cblite?

Compilation of cblite fails

Ob Ubuntu 22.04.1 (running on WSL2).

[ 73%] Building CXX object LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/ChangesFeed.cc.o
In file included from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ChangesFeed.hh:14,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ChangesFeed.cc:19:
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:16: error: ‘numeric_limits’ is not a member of ‘std’
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                ^~~~~~~~~~~~~~
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:46: error: expected primary-expression before ‘>’ token
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                                              ^
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:49: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                                                 ^~~
      |                                                 std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/vendor/fleece/API/fleece/RefCounted.hh:15,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatedRev.hh:14,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:14,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ChangesFeed.hh:14,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ChangesFeed.cc:19:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
[ 74%] Building CXX object LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/Checkpoint.cc.o
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/c4Replicator.cc:111:65: warning: ‘visibility’ attribute ignored [-Wattributes]
  111 | CBL_CORE_API const char* const kC4ReplicatorActivityLevelNames[6] = {
      |                                                                 ^
[ 74%] Building CXX object LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/Checkpointer.cc.o
make[2]: *** [LiteCore/CMakeFiles/LiteCoreObjects.dir/build.make:1168: LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/ChangesFeed.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.hh:14,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.cc:14:
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:16: error: ‘numeric_limits’ is not a member of ‘std’
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                ^~~~~~~~~~~~~~
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:46: error: expected primary-expression before ‘>’ token
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                                              ^
/home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/ReplicatorTypes.hh:133:49: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  133 |         = std::numeric_limits<CollectionIndex>::max();
      |                                                 ^~~
      |                                                 std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/vendor/fleece/API/fleece/slice.hh:18,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/C/include/c4Error.h:21,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/C/include/c4Base.h:15,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/C/Cpp_include/c4Base.hh:21,
                 from /home/florian/tools/couchbase-mobile-tools/vendor/couchbase-lite-core/Replicator/Checkpointer.cc:13:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [LiteCore/CMakeFiles/LiteCoreObjects.dir/build.make:1196: LiteCore/CMakeFiles/LiteCoreObjects.dir/Replicator/Checkpointer.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:378: LiteCore/CMakeFiles/LiteCoreObjects.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Update replicator API calls for compatibility with latest LiteCore

Hi,

I have this error when building the tool;

...
[100%] Building CXX object CMakeFiles/cblite.dir/litecp/RemoteEndpoint.cc.o
[100%] Building CXX object CMakeFiles/cblite.dir/vendor/linenoise-ng/src/ConvertUTF.cpp.o
[100%] Building CXX object CMakeFiles/cblite.dir/vendor/linenoise-ng/src/linenoise.cpp.o
/root/cblite/litecp/DBEndpoint.cc:276:12: error: no member named 'onDocumentEnded' in 'C4ReplicatorParameters'
    params.onDocumentEnded = [](C4Replicator *repl,
    ~~~~~~ ^
1 error generated.
CMakeFiles/cblite.dir/build.make:302: recipe for target 'CMakeFiles/cblite.dir/litecp/DBEndpoint.cc.o' failed
make[3]: *** [CMakeFiles/cblite.dir/litecp/DBEndpoint.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:117: recipe for target 'CMakeFiles/cblite.dir/all' failed
make[2]: *** [CMakeFiles/cblite.dir/all] Error 2
CMakeFiles/Makefile2:129: recipe for target 'CMakeFiles/cblite.dir/rule' failed
make[1]: *** [CMakeFiles/cblite.dir/rule] Error 2
Makefile:175: recipe for target 'cblite' failed
make: *** [cblite] Error 2

I have issued these commands;

$ git clone https://github.com/couchbaselabs/cblite.git
$ cd cblite
$ ./build.sh

The OS is Debian 9 64-bit.

Note, I have built custom libc++ using https://stackoverflow.com/a/43769803.

Regards

build script should default to checking out compatible branch of LiteCore

Having the build.sh script check out the master branch of LiteCore is risky — every time we change the LiteCore API on the master branch, it breaks the tool's build. (See #4 for an example.)

Since the build script decides which revision of LiteCore to check out, why not have it check out a compatible revision/branch/tag? All it takes is changing the default value of BRANCH to something compatible. As we update the tool to work with the latest LiteCore, we can update that value in the same commit.

cblite: N1QL parse fails with `AND` after `END`

The following query fails to parse:

SELECT name WHERE ANY review IN reviewList SATISFIES review='review2042' END AND NOT (unitPrice<10) AND test_id='where_func' ORDER BY name
                                                                             ^^
N1QL syntax error
Error parsing N1QL

Note that the following query succeeds:

SELECT name, reviewList FROM product WHERE (EVERY review in product.reviewList SATISFIES length(review)>9 END) AND test_id="where_func" ORDER BY name limit 3

The latter has the array triad inside of parenthesis

CBL CLI Docs for PULL & PUSH

Team ,

I was using the CBL-CLI tool trying to do a simple pull from SG with:

(cblite) cp --user bob:12345 ws://localhost:4984/sync_gateway

But it was only pushing to SG.

I looked around the source code and saw the verbs pull and push so the below worked.

(cblite) pull --user bob:12345 ws://localhost:4984/sync_gateway

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.