
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@acastellon/postgresql
Advanced tools
Postgresql database connector focus on simplify the access to Document Storages as JSON fields
Postgresql database connector focus on simplify the access to Document Storages as JSON fields
saved for example as 'config.postgresql.js'
module.exports = {
,CERTIFICATION_PATH : '/opt/<project>/Certificate'
,RDS_CLOUD_CONNECTION : {
, ACCESS_KEY_ID : <YOUR-ACCESS-KEY>
, SECRET_ACCESS_KEY : <YOUR-SECRET-ACCESS-KEY>
, REGION : 'eu-west-1',
}
, POSTGRE_URL: '127.0.0.1' | '....eu-west-1.rds.amazonaws.com'
, POSTGRE_PORT : 5432
, POSTGRE_USER: 'root'
, POSTGRE_PASSWORD: 'root' // Only needed if it's not RDS based
, POSTGRE_DATABASE: 'test'
, TRACES : true
}
const config = require('./config.postgresql.js');
const db = require('@acastellon/module-postgresql')(config);
findByDocKeys(tableName, where [, docName, conditions ])
* @param tableName - Name of the table in Postgre to look inside
* @param where - JSON object that contains the parameters to be found on the JSON Document
* @param docName - name of the column on table that contains the JSON data, by default: 'document'
* @param conditions - conditions for all where values on the select , by default: ' || ', use _AND or _OR constants from db instance
* @return an object or List of results as JSON objects
findAllFieldsByDocKeys(tableName, where [, docName, conditions ])
* @param tableName - Name of the table in Postgre to look inside
* @param where - JSON object that contains the parameters to be found on the JSON Document
* @param docName - name of the column on table that contains the JSON data, by default: 'document'
* @param conditions - conditions for all where values on the select , by default: ' || ', use _AND or _OR constants from db instance
* @return an object or List of results as JSON objects with all collateral FIELDS (if exists) from the same table (not only the JSON document)
findByColumns(tableName, where [, conditions ])
* @param tableName - Name of the table in Postgre to look inside
* @param where - JSON object that contains the parameters to be found on the JSON Document
* @param conditions - conditions for all where values on the select , by default: ' || ' , use _AND or _OR constants from db instance
* @return an object or List of results as JSON objects
saveDocument(document, tableName, where[, docName])
* @param document - document to be saved
* @param tableName - Name of the table
* @param where - JSON object that contains the parameters to be found on the JSON Document
* @param docName - name of the column on table that contains the JSON data, by default: 'document'
* @return - true if te operation was sucessfully done
save(values, tableName [, where])
* @param values - to update or to be saved as a pair key-values on an Object
* @param tableName - Name of the table
* @param where - JSON object that contains the parameters to use in the filter search, by default = {}
* @return - true if te operation was sucessfully done
Use it carefully, if you include into the where clause just a portion of the data, it will delete ALL documents that has the same pattern Preferable to use an approach of an additional column as UUID to proceed to delete, instead to use matches of the properties on the document (if you're not sure that one of the property is unique).
remove(tableName, where, docName)
* @param tableName - Name of the table
* @param where - JSON object that contains the parameters to use in the filter
* @param docName - name of the column on table that contains the JSON data, if it's NULL means to search by column values on table not inside the document.
* @return - true if te operation was sucessfully done
Use it carefully, only in case that a need of a complex SQL sentence.
execute(sql, params)
* @param sql - SQL sentence to be executed
* @param params - parameters to use in the SQL sentence ($1, $2, etc) as an Array of values or Objects.
* @return an object or List of results as JSON objects
FAQs
Postgresql database connector focus on simplify the access to Document Storages as JSON fields
The npm package @acastellon/postgresql receives a total of 9 weekly downloads. As such, @acastellon/postgresql popularity was classified as not popular.
We found that @acastellon/postgresql 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.