Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
jugglingdb-postgres-atlassian
Advanced tools
PostgreSQL adapter for JugglingDB [forked from jugglingdb-postgres 0.1.0 for bugfix]
PostgreSQL adapter for JugglingDB.
To use it you need jugglingdb@0.2.x
.
Setup dependencies in package.json
:
{
...
"dependencies": {
"jugglingdb": "0.2.x",
"jugglingdb-postgres-atlassian": "latest"
},
...
}
Use:
var Schema = require('jugglingdb').Schema;
var schema = new Schema('postgres-atlassian', {
database: 'myapp_test',
username: 'postgres'
// host: 'localhost',
// port: 5432,
// password: s.password,
// database: s.database,
// ssl: true,
// debug: false
});
float
datatypes, ala the mysql adapter. Just add dataType: 'float'
to your column properties:var Model = schema.define('Model', {
realNumber: {type: Number, dataType: 'float'}
});
index: true
to the column properties. Unique single-column indexes are created by adding unique: true
to the column properties (it is unnecessary to also specify index: true
since it is implied). Multi-column indexes are added by specifying indexes
in the settings hash of the schema.define
method. Single-column indexes may also be specified this way if you want to have a little more control over their options. Each key in the indexes
hash is the name of the index, and the value is a hash which specifies the index properties:var Model = schema.define('Model', {
column1: {type: Number, index: true},
column2: {type: Number}
}, {
indexes: {
indexName1: {
columns: 'column1, column2',
type: 'btree'
}
}
});
The full list of supported index properties are:
{
columns: 'comma, delimited, list, of, columns',
keys: ['array', 'of', 'columns'], // takes precedence over "columns"!
type: 'TYPE', // 'btree', 'hash', etc
kind: 'KIND' // 'unique' is the only valid option
}
See the postgres documentation for more information about type
and kind
.
Model.all({where: {arbitrary: 'RANDOM STRING DOING ANYTHING'}}, function(err, models) {
...
});
You can still have columns named arbitrary
in your models; those will take precedence if found.
Note: This is a perfect moment to discuss the unwise nature of passing filter objects from the client to the server. Don't do it. Expose endpoints which then call all()
with known arguments.
userId
, or the same ip
with a created
date greater than one day ago:var where = {
or: [{
userId: 5
},{
ip: req.ip,
created: {
gt: oneDayAgo
}
}]
}
Model.all({where: where}, function(err, models) {
...
});
Similar to the arbitrary operator above, any column named or
in your model will take precedence if found.
npm test
Copyright (C) 2012 by Anatoliy Chakkaev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
FAQs
PostgreSQL adapter for JugglingDB [forked from jugglingdb-postgres 0.1.0 for bugfix]
We found that jugglingdb-postgres-atlassian demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.