This repository has been archived by the owner on Dec 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial services for sqldatabase and rdfstore
- Loading branch information
1 parent
fbca481
commit 1fd0f4a
Showing
4 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(function () { | ||
'use strict' | ||
/** | ||
* LovefieldService - description | ||
* | ||
* @return {type} description | ||
*/ | ||
function LovefieldService () { | ||
|
||
var lf = require('lovefield') | ||
|
||
return { | ||
/** | ||
* initialize function - description | ||
* | ||
* @param {type} dbName description | ||
* @return {type} description | ||
*/ | ||
initialize: function (dbName) { | ||
return lf.schema.create(dbName); | ||
} | ||
} | ||
} | ||
module.exports = LovefieldService | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
(function () { | ||
'use strict' | ||
/** | ||
* RDFStoreService - description | ||
* | ||
* @return {type} description | ||
*/ | ||
function RDFStoreService () { | ||
|
||
var rdfStore = require('rdfStore') | ||
/** | ||
* DataService - description | ||
* | ||
* @param {type} dbName description | ||
* @return {type} description | ||
*/ | ||
function DataService (dbName) { | ||
var promise = new Promise((resolve, reject) => { | ||
rdfStore.Store({ persistent: true, name: dbName }) | ||
.then((result) => { | ||
resolve(result) | ||
}) | ||
.catch((err) => { | ||
console.log(err) | ||
reject(err) | ||
}) | ||
}) | ||
return promise | ||
} | ||
return { | ||
/** | ||
* initialize function - description | ||
* | ||
* @param {type} dbName description | ||
* @return {type} description | ||
*/ | ||
initialize: function (dbName) { | ||
return new DataService(dbName) | ||
} | ||
} | ||
} | ||
module.exports = RDFStoreService | ||
})() |