Skip to content

Commit

Permalink
Merge pull request #34 from jambonz/feat/system-info
Browse files Browse the repository at this point in the history
Feat/system info
  • Loading branch information
davehorton authored Jun 26, 2024
2 parents ddc6bc1 + e60419c commit 4a7f5ef
Show file tree
Hide file tree
Showing 6 changed files with 386 additions and 185 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ module.exports = function(mysqlConfig, logger, writeMysqlConfig = null) {
lookupCarrierByAccountLcr: require('./lib/lookup-carrier-by-account-lcr').bind(null, pool, logger),
lookupOutboundCarrierForAccount: require('./lib/lookup-outbound-carrier-for-account').bind(null, pool, logger),
lookupClientByAccountAndUsername: require('./lib/lookup-client-by-account-username').bind(null, pool, logger),
lookupSystemInformation: require('./lib/lookup-system-information').bind(null, pool, logger)
};
};
12 changes: 12 additions & 0 deletions lib/lookup-system-information.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const debug = require('debug')('jambonz:db-helpers');

const sql = 'SELECT * FROM system_information';

async function lookupSystemInformation(pool, logger) {
const pp = pool.promise();
const [r] = await pp.execute(sql);
debug(`results: ${JSON.stringify(r)}`);
return r.length > 0 ? r[0] : null;
}

module.exports = lookupSystemInformation;
Loading

0 comments on commit 4a7f5ef

Please sign in to comment.