Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node-couchdb-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vegofy-Public
node-couchdb-management
Commits
3e8a0048
Commit
3e8a0048
authored
Sep 11, 2020
by
Sachinda
Committed by
Stephan Handuwala
Sep 11, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Master
parent
56c0b881
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
49 deletions
+85
-49
index.js
index.js
+84
-48
package.json
package.json
+1
-1
No files found.
index.js
View file @
3e8a0048
...
@@ -138,10 +138,14 @@ module.exports = {
...
@@ -138,10 +138,14 @@ module.exports = {
await
validateDbmodel
(
singleElement
);
await
validateDbmodel
(
singleElement
);
loopinfo
[
'db_name'
]
=
singleElement
.
db_name
loopinfo
[
'db_name'
]
=
singleElement
.
db_name
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'Db Model Validation Error'
;
loopinfo
[
'debug_info'
]
=
error
;
// throw error;
infologs
.
push
(
loopinfo
);
continue
;
return
reject
(
error
);
// loopinfo['error'] = 'Db Model Validation Error';
// loopinfo['debug_info'] = error;
// infologs.push(loopinfo);
// continue;
}
}
var
db
=
await
dbconnectionMaker
(
singleElement
.
user_name
,
singleElement
.
password
,
singleElement
.
service_url
,
singleElement
.
service_port
);
var
db
=
await
dbconnectionMaker
(
singleElement
.
user_name
,
singleElement
.
password
,
singleElement
.
service_url
,
singleElement
.
service_port
);
...
@@ -149,10 +153,13 @@ module.exports = {
...
@@ -149,10 +153,13 @@ module.exports = {
var
dbexist
=
await
checkDbexist
(
db
,
singleElement
.
db_name
);
var
dbexist
=
await
checkDbexist
(
db
,
singleElement
.
db_name
);
loopinfo
[
'dbexist'
]
=
true
;
loopinfo
[
'dbexist'
]
=
true
;
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'Db Exist check error'
;
loopinfo
[
'debug_info'
]
=
error
;
return
reject
(
error
);
infologs
.
push
(
loopinfo
);
//throw error;
continue
;
// loopinfo['error'] = 'Db Exist check error';
// loopinfo['debug_info'] = error;
// infologs.push(loopinfo);
// continue;
}
}
...
@@ -162,10 +169,15 @@ module.exports = {
...
@@ -162,10 +169,15 @@ module.exports = {
await
dbcreate
(
db
,
singleElement
.
db_name
);
await
dbcreate
(
db
,
singleElement
.
db_name
);
loopinfo
[
'create db '
]
=
true
;
loopinfo
[
'create db '
]
=
true
;
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'Db Create Error'
;
loopinfo
[
'debug_info'
]
=
error
;
return
reject
(
error
);
infologs
.
push
(
loopinfo
);
continue
;
//throw error;
// loopinfo['error'] = 'Db Create Error';
// loopinfo['debug_info'] = error;
// infologs.push(loopinfo);
// continue;
}
}
// db does not exist create new one
// db does not exist create new one
}
}
...
@@ -180,10 +192,12 @@ module.exports = {
...
@@ -180,10 +192,12 @@ module.exports = {
var
insertViewmodel
=
await
insertDocument
(
select_db
,
singleElement
.
view_document
);
var
insertViewmodel
=
await
insertDocument
(
select_db
,
singleElement
.
view_document
);
viewinfodoc
=
'Document not found insert as new'
;
viewinfodoc
=
'Document not found insert as new'
;
}
catch
(
error
)
{
}
catch
(
error
)
{
viewinfodoc
=
{
return
reject
(
error
);
'error'
:
'Insert View model error 1'
,
//throw error;
"debug"
:
error
// viewinfodoc = {
};
// 'error': 'Insert View model error 1',
// "debug": error
// };
}
}
//console.log('insertViewmodel :>> ', insertViewmodel);
//console.log('insertViewmodel :>> ', insertViewmodel);
}
else
{
}
else
{
...
@@ -198,10 +212,13 @@ module.exports = {
...
@@ -198,10 +212,13 @@ module.exports = {
console
.
log
(
'insertViewmodel :>> '
,
insertViewmodel
);
console
.
log
(
'insertViewmodel :>> '
,
insertViewmodel
);
viewinfodoc
=
'Document found does not Equals to old one'
;
viewinfodoc
=
'Document found does not Equals to old one'
;
}
catch
(
error
)
{
}
catch
(
error
)
{
viewinfodoc
=
{
'error'
:
'Insert View model error 2'
,
return
reject
(
error
);
"debug"
:
error
//throw error;
};
// viewinfodoc = {
// 'error': 'Insert View model error 2',
// "debug": error
// };
}
}
}
else
{
}
else
{
...
@@ -210,8 +227,10 @@ module.exports = {
...
@@ -210,8 +227,10 @@ module.exports = {
}
}
loopinfo
[
'view_document'
]
=
viewinfodoc
;
loopinfo
[
'view_document'
]
=
viewinfodoc
;
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'view_document check exist error'
;
return
reject
(
error
);
loopinfo
[
'debug_info'
]
=
error
;
// throw error;
// loopinfo['error'] = 'view_document check exist error';
// loopinfo['debug_info'] = error;
}
}
}
}
/* index_document */
/* index_document */
...
@@ -224,10 +243,13 @@ module.exports = {
...
@@ -224,10 +243,13 @@ module.exports = {
indexinfodoc
=
'Document not found insert as new'
;
indexinfodoc
=
'Document not found insert as new'
;
console
.
log
(
'index_document :>> '
,
index_document
);
console
.
log
(
'index_document :>> '
,
index_document
);
}
catch
(
error
)
{
}
catch
(
error
)
{
indexinfodoc
=
{
return
reject
(
error
);
'error'
:
'Insert Index document error'
,
"debug"
:
error
// throw error;
};
// indexinfodoc = {
// 'error': 'Insert Index document error',
// "debug": error
// };
}
}
}
else
{
}
else
{
var
rev
=
doc
.
_rev
;
var
rev
=
doc
.
_rev
;
...
@@ -241,10 +263,12 @@ module.exports = {
...
@@ -241,10 +263,12 @@ module.exports = {
indexinfodoc
=
'Document found does not Equals to old one'
;
indexinfodoc
=
'Document found does not Equals to old one'
;
console
.
log
(
'insertmodel :>> '
,
insertmodel
);
console
.
log
(
'insertmodel :>> '
,
insertmodel
);
}
catch
(
error
)
{
}
catch
(
error
)
{
indexinfodoc
=
{
return
reject
(
error
);
'error'
:
'Insert View model error'
,
//throw error;
"debug"
:
error
// indexinfodoc = {
};
// 'error': 'Insert View model error',
// "debug": error
// };
}
}
}
else
{
}
else
{
indexinfodoc
=
'Document found Equals to old one'
;
indexinfodoc
=
'Document found Equals to old one'
;
...
@@ -252,8 +276,10 @@ module.exports = {
...
@@ -252,8 +276,10 @@ module.exports = {
}
}
loopinfo
[
'index_document'
]
=
indexinfodoc
;
loopinfo
[
'index_document'
]
=
indexinfodoc
;
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'index_document check exist error'
;
return
reject
(
error
);
loopinfo
[
'debug_info'
]
=
error
;
//throw error;
// loopinfo['error'] = 'index_document check exist error';
// loopinfo['debug_info'] = error;
}
}
}
}
/* update handler */
/* update handler */
...
@@ -267,10 +293,13 @@ module.exports = {
...
@@ -267,10 +293,13 @@ module.exports = {
console
.
log
(
'index_document :>> '
,
insertmodel
);
console
.
log
(
'index_document :>> '
,
insertmodel
);
updatehandleinfodoc
=
'Document not found insert as new'
;
updatehandleinfodoc
=
'Document not found insert as new'
;
}
catch
(
error
)
{
}
catch
(
error
)
{
updatehandleinfodoc
=
{
'error'
:
'Insert Update handler document error'
,
return
reject
(
error
);
"debug"
:
error
//throw error;
};
// updatehandleinfodoc = {
// 'error': 'Insert Update handler document error',
// "debug": error
// };
}
}
}
else
{
}
else
{
var
rev
=
doc
.
_rev
;
var
rev
=
doc
.
_rev
;
...
@@ -284,31 +313,38 @@ module.exports = {
...
@@ -284,31 +313,38 @@ module.exports = {
console
.
log
(
'insertmodel :>> '
,
insertmodel
);
console
.
log
(
'insertmodel :>> '
,
insertmodel
);
updatehandleinfodoc
=
'Document found does not Equals to old one'
;
updatehandleinfodoc
=
'Document found does not Equals to old one'
;
}
catch
(
error
)
{
}
catch
(
error
)
{
updatehandleinfodoc
=
{
return
reject
(
error
);
'error'
:
'Insert Update handler document error'
,
//throw error;
"debug"
:
error
// updatehandleinfodoc = {
};
// 'error': 'Insert Update handler document error',
// "debug": error
// };
}
}
}
else
{
}
else
{
updatehandleinfodoc
=
'Document found Equals to old one'
;
updatehandleinfodoc
=
'Document found Equals to old one'
;
}
}
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
loopinfo
[
'error'
]
=
'Update handler check exist error'
;
loopinfo
[
'debug_info'
]
=
error
;
return
reject
(
error
);
//throw error;
// loopinfo['error'] = 'Update handler check exist error';
// loopinfo['debug_info'] = error;
}
}
loopinfo
[
'Update_handler_document'
]
=
updatehandleinfodoc
;
loopinfo
[
'Update_handler_document'
]
=
updatehandleinfodoc
;
}
}
infologs
.
push
(
loopinfo
);
infologs
.
push
(
loopinfo
);
}
catch
(
error
)
{
}
catch
(
error
)
{
infologs
.
push
({
return
reject
(
error
);
"db_name"
:
singleElement
.
db_name
,
// infologs.push({
"error"
:
error
// "db_name": singleElement.db_name,
})
// "error": error
console
.
log
(
'error'
,
error
)
// })
// console.log('error', error)
}
}
}
}
return
resolve
(
infologs
);
return
resolve
(
infologs
);
})
})
}
}
}
}
package.json
View file @
3e8a0048
{
{
"name"
:
"couch_db_create"
,
"name"
:
"couch_db_create"
,
"version"
:
"1.0.
0
"
,
"version"
:
"1.0.
1
"
,
"description"
:
"ls -l"
,
"description"
:
"ls -l"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment