Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ectypes-postgres

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ectypes-postgres - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

ectypes-postgres.js.iml

14

package.json
{
"name": "ectypes-postgres",
"description": "An ectypes strategy for node-postgres",
"version": "0.1.2",
"version": "1.0.0",
"homepage": "https://github.com/nicholas/ectypes-postgres",

@@ -24,5 +24,2 @@ "author": {

"main": "lib/ectypes_postgres",
"engines": {
"node": "0.8.0"
},
"scripts": {

@@ -32,9 +29,12 @@ "test": "mocha test/"

"keywords": [],
"peerDependencies": {
"ectypes": "~1.x"
},
"dependencies": {
"pg": "~0.8.4",
"faker": "*",
"lingo": "0.0.5",
"nconf": "~0.6.4",
"ectypes": "1.0.0",
"faker2": "~0.5.0"
"pg": "*",
"should": "^8.0.2"
}
}

@@ -5,2 +5,31 @@ # ectypes-postgres

## Installing
`npm install ectypes-postgres`
## Running tests
Steps.
1) ectypes-postgres uses ectypes as a peer dependency, so if you want to run tests locally you will have to manually
`npm install ectypes`.
2) Identify the connection string.
The postgres strategy connects via a connectionString that is passed into a constructor function.
For example, in the tests:
```
strategy = new PGStrategy(process.env['DBCONN']);
```
If you want the tests to run you will need to work out this value (see step 3). Similarly, if you want to develop
against this lib you will need to come up with a way to identify this value.
3) Run mocha
`NODE_ENV=test DBCONN=postgres://nicholasf:@localhost/keno_api_link_test mocha`
See the tests, https://github.com/brianc/node-postgres and https://github.com/nicholasf/ectypes.js

@@ -7,0 +36,0 @@

@@ -6,7 +6,6 @@ var PGStrategy = require('../lib/ectypes_postgres.js');

, faker2 = require('faker2')
, env = require('./../config/env')
, ctx = ectypes.createContext()
, pg = require('pg');
strategy = new PGStrategy(env.connectionString);
strategy = new PGStrategy(process.env['DBCONN']);

@@ -30,3 +29,3 @@ ctx.load(strategy);

pg.connect(env.connectionString, function(err, client){
pg.connect(process.env['DBCONN'], function(err, client){
client.query(sql, function(err, result){

@@ -42,3 +41,2 @@ done();

var rowCount = parseInt(project.rowCount);
console.log("And the winner is! ", rowCount);
rowCount.should.equal(1);

@@ -45,0 +43,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc