Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/hck 3426 re couchbase 7 instance re #5

Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
976a95b
package: add lodash library
serhii-filonenko Jan 29, 2024
c617f9d
RE: update re modal config
serhii-filonenko Jan 29, 2024
2b5ce56
RE: implement get document kinds method
serhii-filonenko Jan 29, 2024
8b9bc16
RE: add types for document kind data methods
serhii-filonenko Jan 29, 2024
c4716de
package: add async library
serhii-filonenko Jan 29, 2024
a5784a8
RE: create rest api helper
serhii-filonenko Jan 29, 2024
6f4e5d1
RE: add retrive collections by doc kind using rest api
serhii-filonenko Jan 29, 2024
b7b1b4d
RE: implement retrive documents from default collection
serhii-filonenko Feb 1, 2024
fc873c6
RE: implement retrive documents for scopes and collections
serhii-filonenko Feb 1, 2024
08004d5
RE: fix typo
serhii-filonenko Feb 1, 2024
bac227b
package: install antler
serhii-filonenko Feb 2, 2024
aa54e75
RE: implement antlr parser
serhii-filonenko Feb 2, 2024
b4f5adf
RE: implement collection indexes reversing
serhii-filonenko Feb 2, 2024
ac2c5a3
RE: fix incorrect error message
serhii-filonenko Feb 2, 2024
c6feaf7
RE: add constant for default key name
serhii-filonenko Feb 2, 2024
75eb690
RE: implement re from n1ql files
serhii-filonenko Feb 2, 2024
ce32c90
RE: add split default scope names to avoid their combining
serhii-filonenko Feb 2, 2024
0de3b14
package: add parser folder to eslint ignore
serhii-filonenko Feb 2, 2024
c0dc236
package: remove unneded libs
serhii-filonenko Feb 2, 2024
3c0108b
config: add container level keys config
serhii-filonenko Feb 2, 2024
393d4c0
RE: add document kinds value to db collections data
serhii-filonenko Feb 2, 2024
e9eb77f
RE: add logging for test connection
serhii-filonenko Feb 2, 2024
b9097ba
RE: add safety getting scopes for document kinds
serhii-filonenko Feb 2, 2024
e322081
Merge branch 'develop' into Feature/HCK-3426-re-couchbase-7-instance-…
serhii-filonenko Feb 2, 2024
1903fa4
package: install hackolade couchbase deps
serhii-filonenko Feb 6, 2024
70b9ddc
parser: remove license data
serhii-filonenko Feb 6, 2024
f8e2749
RE: fix names of params
serhii-filonenko Feb 6, 2024
34d00d5
RE: add require of couchbase lib
serhii-filonenko Feb 6, 2024
5069883
RE: replace complex iterations by async reduce
serhii-filonenko Feb 6, 2024
7115891
RE: reduce complexity for retriving doc kinds by manual infer
serhii-filonenko Feb 6, 2024
d6df181
types: fix typing for some methods
serhii-filonenko Feb 6, 2024
1ba0a40
package: uninstall redundant couchbase types lib
serhii-filonenko Feb 6, 2024
8dc0577
package: add exact lib versions
serhii-filonenko Feb 6, 2024
b29eb8c
RE: fix create of empty scopes after reversing from file
serhii-filonenko Feb 7, 2024
8d09b9f
package: remove couchbase native module
serhii-filonenko Feb 7, 2024
c490b5a
build: add .ts files to excluded extensions
serhii-filonenko Feb 7, 2024
88d7dda
package: add types lib to dev dependencies
serhii-filonenko Feb 7, 2024
79c3eac
Merge branch 'develop' into Feature/HCK-3426-re-couchbase-7-instance-…
bigorn0 Feb 7, 2024
9f48506
RE: add retrive selected bucket collections if selected collections a…
serhii-filonenko Feb 7, 2024
9dbc6b9
Merge branch 'Feature/HCK-3426-re-couchbase-7-instance-get-document-k…
serhii-filonenko Feb 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.idea
node_modules
reverse_engineering/node_modules
reverse_engineering/antlr/parser
forward_engineering/node_modules
build
release
2 changes: 1 addition & 1 deletion localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"MODAL_WINDOW___SUBDOCUMENT_IN_CHILD": "Sub-document in child",
"MODAL_WINDOW___ARRAY_IN_PARENT": "Array in parent",
"MODAL_WINDOW___CREATE_COLLECTION": "Create Couchbase Collection",
"MODAL_WINDOW___INCLUDE_EMPTY_COLLECTION": "Include empty documents",
"MODAL_WINDOW___INCLUDE_EMPTY_COLLECTION": "Include empty collections",
"MODAL_WINDOW___CREATE_BUCKET": "Create Couchbase Scope",
"MODAL_WINDOW___ALL_COLLECTIONS": "and all nested collections",
"MODAL_WINDOW___COLLECTION_NAME_ERROR": "Collection name is empty or is a reserved word",
Expand Down
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,8 @@
]
},
"features": {
"nestedCollections": false,
"forwardEngineering": {
"jsonSchema": {
"keepParentType": {
"binary": {}
}
}
},
"enableReverseEngineering": true,
"enableForwardEngineering": true,
"enableReverseEngineeringDetectionSchemaByContent": false,
"enableReversingDateTypeAsISODate": true,
"supportInferRelationships": true,
"enableREQueryAndSortCriteria": true
"enableArrayCollections": false
}
},
"description": "Hackolade plugin for Couchbase v7+ with scopes and collections",
Expand All @@ -46,6 +34,7 @@
},
"devDependencies": {
"@hackolade/hck-esbuild-plugins-pack": "0.0.1",
"@types/couchbase": "^2.4.9",
"esbuild": "0.19.12",
"esbuild-plugin-clean": "1.0.1",
"eslint": "8.56.0",
Expand All @@ -54,5 +43,10 @@
"lint-staged": "14.0.1",
"prettier": "3.2.4",
"simple-git-hooks": "2.9.0"
},
"dependencies": {
"antlr4": "^4.9.2",
"async": "^3.2.5",
"lodash": "^4.17.21"
}
}
18 changes: 17 additions & 1 deletion properties_pane/container_level/containerLevelConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ making sure that you maintain a proper JSON format.
[
{
"lowerTab": "Details",
"containerLevelKeys": [],
"structure": [
{
"propertyKeyword": "name",
Expand Down Expand Up @@ -342,6 +341,23 @@ making sure that you maintain a proper JSON format.
"shouldValidate": false,
"propertyType": "checkbox"
}
],
"containerLevelKeys": [
{
"labelName": "Key",
"propertyName": "Key",
"propertyKeyword": "key",
"defaultName": "KEY",
"propertyPrimaryKey": true,
"propertyType": "text",
"typeName": "type",
"typeOptions": ["string"],
"defaultType": "string",
"disabledFieldOption": true,
"validation": {
"disableNameValidationForReservedWords": true
}
}
]
}
]
9 changes: 9 additions & 0 deletions reverse_engineering/antlr/antlrErrorListener.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const antlr4 = require('antlr4');

class ExprErrorListener extends antlr4.error.ErrorListener {
syntaxError(recognizer, offendingSymbol, line, column, msg, err) {
throw new Error(`line ${line}:${column} ${msg}`);
}
}

module.exports = ExprErrorListener;
23 changes: 23 additions & 0 deletions reverse_engineering/antlr/buildParser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# * run with `sh buildParser.sh`

# !important: don't forget to change `import` and `export` to `require` and `module.exports` after the parser is built

# https://www.antlr.org/download/antlr-4.9.2-complete.jar
#
# set antlr4 aliases
# export CLASSPATH=".:/usr/local/lib/antlr-4.9.2-complete.jar:$CLASSPATH"
# alias antlr4='java -jar /usr/local/lib/antlr-4.9.2-complete.jar'
# alias grun='java org.antlr.v4.gui.TestRig'

# build parser
java -jar /usr/local/lib/antlr-4.9.2-complete.jar -Dlanguage=JavaScript \
-lib grammars \
-o parser/ \
-visitor \
-no-listener \
-Xexact-output-dir \
grammars/n1ql.g4

npx prettier --write ./parser/**/*.js
Loading