-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update PostgresStorageAdapter.js #2093
Conversation
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
Current coverage is 92.07%@@ master #2093 diff @@
==========================================
Files 93 93
Lines 6777 6775 -2
Methods 1193 1194 +1
Messages 0 0
Branches 1433 1432 -1
==========================================
- Hits 6240 6238 -2
Misses 537 537
Partials 0 0
|
if (result.length === 1) { | ||
return result[0].schema; | ||
} else { | ||
return this._client.one('SELECT * FROM "_SCHEMA" WHERE "className"=$<className>', { className }, res=>res.schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add some spaces here: res=>res.schema
?
DO you want tho throw back the error and handle it correctly? (at lease with a |
The result from method |
Looks good to me, merging. We can still change the getClass API if we want, though, it's not stable/public yet. |
NVM reverted, this will change behaviour. The expected behaviour is to reject with undefined if the class doesn't exist, and reject with something else if there was some other error. As I said, though, we can change that. |
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
If it really needs to reject with `undefined`, then this is the right way. Usually one just returns the result, let the caller provide the `.catch` ;) This way real errors can be swallowed, not very good ;)
If it really needs to reject with
undefined
, then this is the right way. Usually one just returns the result, let the caller provide the.catch
;)This way real errors can be swallowed, not very good ;)