Name: ethereum-user-db-service
Owner: Auth0
Description: npm module used to perform database operations in mariadb
Created: 2016-11-21 12:58:57.0
Updated: 2018-01-16 08:47:44.0
Pushed: 2017-05-19 09:34:55.0
Homepage: null
Size: 9
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
install eth-db-service -g
The module assumes that mariaDB is running on the host under alias: user-db. Make sure you name the MariaDB image with this alias in your docker-compose deployment!
t DbService = require('eth-db-service');
dbService = new DbService();
Every method returns a promise with the result.
rvice.checkIfMobileMappingTableExists()
n(function(result) {
if(result.lenght == 0) {
console.log("Tabled does not exist!";)
}
//users is an array of user objects
atch(function handleError(error) {
//your error handling goes here
rvice.checkIfUserCredentialsTableExists()
n(function(result) {
if(result.lenght == 0) {
console.log("Tabled does not exist!";)
}
//users is an array of mapping objects
atch(function handleError(error) {
//your error handling goes here
The table will have two rows:
rvice.createMobileMappingTable(message,address,password)
n(function() {
//do something aftewards
atch(function handleError(error) {
//your error handling goes here
The table will have two rows:
rvice.createUserCredentialsTable(message,address,password)
n(function() {
//do something aftewards
atch(function handleError(error) {
//your error handling goes here
rvice.insertUserCredentials(email, authenticationKey)
n(function() {
//do something aftewards
atch(function handleError(error) {
//your error handling goes here
rvice.insertMapping(address, value)
n(function() {
//do something aftewards
atch(function handleError(error) {
//your error handling goes here
rvice.getUserCredentialsByEmail(email)
n(function(user) {
var email = user.emai;
var authenticationKey = user.authenticationKey;
atch(function handleError(error) {
//your error handling goes here
rvice.getMappingByAddress(address)
n(function(mapping) {
var address = mapping.address;
var secondaryKey = mapping.value;
atch(function handleError(error) {
//your error handling goes here
rvice.getUserCredentials()
n(function(users) {
//users is an array of user objects
atch(function handleError(error) {
//your error handling goes here
rvice.getMappings()
n(function(mapping) {
//users is an array of mapping objects
atch(function handleError(error) {
//your error handling goes here