npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

newman-reporter-sql-postgresql

v1.0.4

Published

based on https://github.com/vs4vijay/newman-reporter-sql by tomaszsluszniak added httpd request Id for trace and personal use

Downloads

8

Readme

newman-reporter-sql-postgresql

This package based on tomaszsluszniak/newman-reporter-sql;. It was customized to work with multiple SQL Engines such MySQL, MariaDB, PostgreSQL and Microsoft SQL Server i just added httprequestid for my personal usage.

SQL reporter for Newman that sends the test results information to SQL which can be used in Grafana/PowerBI to build dashboard.


Getting Started

  1. Install newman
  2. Install newman-reporter-sql-postgresql

Prerequisites

  1. node and npm
  2. newman - npm install -g newman
  3. Install the desired SQL engine:
$ npm install --save pg pg-hstore  # PostgreSQL
$ npm install --save mysql2
$ npm install --save mariadb
$ npm install --save tedious  # Microsoft SQL Server

Installation

npm install -g newman-reporter-sql-postgresql

Installation should be done globally if newman is installed globally, otherwise install without -g option.


Usage

Specify -r sql option while running the collection

newman run <collection-url> -r sql-postgresql \
  --reporter-sql-dialect <mysql | mariadb | postgres | mssql> \
  --reporter-sql-server <server-name> \
  --reporter-sql-port <server-port> \
  --reporter-sql-name <database-name> \
  --reporter-sql-table <table-name> \
  --reporter-sql-username <username> \
  --reporter-sql-password <password>

MSSQL Example:

newman run https://www.getpostman.com/collections/631643-f695cab7-6878-eb55-7943-ad88e1ccfd65-JsLv -r sql-postgresql \
  --reporter-sql-dialect mssql \
  --reporter-sql-server localhost \
  --reporter-sql-port 1433 \
  --reporter-sql-name newman_reports \
  --reporter-sql-table api_results \
  --reporter-sql-username sa \
  --reporter-sql-password p@ssw0rd

PostgreSQL Example:

docker run --name postgres -e POSTGRES_PASSWORD=test1234 -p 5432:5432 -d postgres
newman run https://www.postman.com/collections/cb208e7e64056f5294e5 -r sql-postgresql \
  --reporter-sql-dialect postgres \
  --reporter-sql-server localhost \
  --reporter-sql-port 5432 \
  --reporter-sql-name postgres \
  --reporter-sql-table test1234 \
  --reporter-sql-username postgres \
  --reporter-sql-password test1234 \
  --reporter-sql-test-name "test name"

Options:

Option | Remarks --- | --- --reporter-sql-dialect | SQL Engine. One of: mysql, mariadb, postgres, mssql. --reporter-sql-server | IP Address or Host of SQL Server. --reporter-sql-port | Port number. Usually: 3306 for MySQL and MariaDB, 5432 for PostgreSQL, 1433 for Microsoft SQL Server. --reporter-sql-name | Database name. Already existing database. --reporter-sql-table | Table name. Table will be created automatically. --reporter-sql-username | Username created for SQL database (e.g. sa). --reporter-sql-password | Password of the user (e.g. p@ssw0rd). --reporter-sql-debug (Optional) | Reporter debug mode (default: false). --reporter-sql-test-name (Optional) | It can be useful for reporting collected data from a specific test. Example 5 iterations.