MCPcopy Create free account
hub / github.com/dwyl/learn-postgresql / select_org

Function select_org

server/db.js:110–119  ·  view source on GitHub ↗

* select_org retrieves the org for a given url. * @param {string} url - url of the repo (e.g: /dwyl) * @param {function} callback - callback function to be executed on success.

(url, callback)

Source from the content-addressed store, hash-verified

108 * @param {function} callback - callback function to be executed on success.
109 */
110function select_org (url, callback) {
111 connect( function select_repo_after_connected () {
112 const query = `SELECT * FROM orgs WHERE url = $1 ORDER BY id ASC LIMIT 1`;
113 console.log(query, url);
114 PG_CLIENT.query(query, [url], function(error, result) {
115 utils.log_error(error, result, new Error().stack);
116 return utils.exec_cb(callback, error, result);
117 });
118 });
119}
120
121/**
122 * insert_repo saves an repo's stats to the repos table.

Callers 1

insert_relationshipsFunction · 0.85

Calls 1

connectFunction · 0.85

Tested by

no test coverage detected