Gathering detailed insights and metrics for seneca-store-query
Gathering detailed insights and metrics for seneca-store-query
Gathering detailed insights and metrics for seneca-store-query
Gathering detailed insights and metrics for seneca-store-query
npm install seneca-store-query
Typescript
Module System
Node Version
NPM Version
74.8
Supply Chain
99
Quality
74.7
Maintenance
25
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
48 Commits
4 Forks
3 Watching
1 Branches
2 Contributors
Latest Version
0.0.5
Package Id
seneca-store-query@0.0.5
Size
5.41 kB
NPM Version
3.8.3
Node Version
5.10.0
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
A Seneca.js data storage plugin
seneca-store-query is a plugin for the Seneca MVP toolkit that extends the query capabilites of the seneca-standard-query. It currently works with seneca-postgres-store and seneca-mysql-store
1Usage: 2 3 var Seneca = require('seneca') 4 var si = Seneca() 5 6 var DBConfig = { 7 name: 'senecatest', 8 host: 'localhost', 9 username: 'senecatest', 10 password: 'senecatest', 11 port: 5432 12 } 13 ... 14 15 si.use(require('seneca-postgres-store'), DBConfig) 16 si.use(require('seneca-store-query')) 17 si.ready(function() { 18 var product = si.make('product') 19 ... 20 }) 21 ...
This plugin extends the basic standard store functionality with support for more complex queries.
list$ is extended with the following comparison operators:
.list$({ f1: {ne$: v1} })
for not-equal..list$({ f1: {eq$: v1} })
for equal..list$({ f1: {lte$: 5} })
for less than or equal..list$({ f1: {lt$: 5} })
for less than..list$({ f1: {gte$: 5} })
for greater than or equal..list$({ f1: {gt$: 5} })
for greater than..list$({ f1: {in$: [10, 20]} })
for in. in$ operator accepts only values of type array..list$({ f1: {nin$: ['v1', 'v2']} })
for not-in. nin$ operator accepts only values of type array.Notes:
sort$
, limit$
, skip$
and fields$
can be used together.list$ is extended with the following logical operators:
.list$({ or$: [{name: 'something'}, {price: 200}]})
.list$({ and$: [{name: 'something'}, {price: 200}]})
Notes:
A complex example:
1ent.list$( 2 { 3 or$: [ 4 {name: 'something'}, 5 { 6 and$: [ 7 {price: {gte$: 100}}, 8 {name: 'other'} 9 ] 10 }, 11 {color: { ne$: 'red' }} 12 ], 13 sort$: {name: 1}, 14 fields$: ['name', 'color'] 15 }, function(err, list){ 16 // do something with result... 17 } )
By default queries are limited to 20 values. This can be bypassed by passing the nolimit
option, which if set to true will not limit any queries.
To filter the fields returned from the list
operation, pass a fields$
array of column names to return. If no fields$
are passed, all fields are returned (i.e. select *
is used). e.g.
query.fields$ = ['id', 'name']
Note: The implicit id that is generated on save$ has an uuid value. To override this you must provide entity.id$ with a desired value.
We encourage participation. If you feel you can help in any way, be it with examples, extra testing, or new features please get in touch.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/18 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More