* 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)
| 108 | * @param {function} callback - callback function to be executed on success. |
| 109 | */ |
| 110 | function 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. |
no test coverage detected