Releases: holdfenytolvaj/pogi
bugfix release
fix issue with deleteAndGet without options specified
bugfix release
Fix default functions/tables for transactions
bugfix release
fix #6
better sql parsing
bugfix release
- fix deleteAndGet
- improve documentation
v2.2.0
- adding possibility to add a callback to the postProcessingResult. This will be called after every query on the result.
- small bugfix on the configuration interface
bugfix release
Fix missing import in PgUtils
experiment support for free text search
v2.1.0 experimental addition of free text search feature
Breaking change
In the first version of pogi the decision was to ignore the condition if the value was undefined in order for ease the use e.g.:
let query = {
powerfull: params.powerfull,
wise: params.wise
}
await pgdb.users.find(query);
would return a result if e.g. the form.wise
would be undefined. While this is comfortable
in many situation, it can cause critical issues e.g. for update
await pgdb.users.update({id:user.id}, {password});
would update all users password, in case of the user.id is undefined. (Although this can be mitigated
with the updateOne
function as well.) Still the best if no undefined value is allowed in the conditions.
Nevertheless to keep the compatibility, a parameter has been added to the QueryOptions
and the ConnectionOptions
: 'skipUndefined'. In the ConnectionOptions
it can be set to all
if needed (to keep the original behaviour). The value select
would allow undefined values for selects/count queries only but would be strict for update/deletes.
none
is the new default value, meaning undefined value considered as programming error and will throw an exception.
This setting can be specified on query level as well.
add new convenient functions
It should be a feature release.. (will be next time)
added conversion for
Condition | SQL |
---|---|
{'id ~~': ['1%','2%','3%']} | "id" LIKE ANY('{1%,2%,3%}') |
{'id !~~': ['1%','2%','3%']} | "id" NOT LIKE ALL('{1%,2%,3%}') |
{'id ~': ['^1','^2','^3']} | "id" LIKE ANY('{^1,^2,^3}') |
{'id !~': ['^1','^2','^3']} | "id" NOT LIKE ALL('{^1,^2,^3}') |
bugfix release
fix some error handling issue