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

psql-api

v0.9.11

Published

Postgres database access API

Downloads

42

Readme

psql-api

RAPID RESTful API for PostgreSQL

INSTALLATION ( install local is required --save)

          npm install psql-api --save

Requirements:

  • OS: Linux, Windows

  • NodeJS

  • OpenSSL should be installed before in order to allow the server to create it's first self-signed SSL certificate.

  • Tested with Posgresql 9.3 and up

  • Linux - set your computer to accept opening lower ports without root access for NodeJs (80/443), next code works for Ubuntu 14.

             sudo apt-get install libcap2-bin
             sudo setcap cap_net_bind_service=+ep /usr/local/bin/node

sample new server.js code:

          server = require("psql-api");
          server.start();

Install from git as standalone server:

          git clone https://github.com/QBisConsult/psql-api.git

Run this inside the new server folder:

           sudo npm install

Run the server with:

           node start.js

This server will open two ports, one for administration on HTTPS (443) and another for API requests.

The server can be managed at: https://server_Ip_or_domain name

It will use a self-signed SSL certificate generated at first start until you will provide an authorized one or change with your own.

If OpenSSL can not be found, you will need to provide a SSL certificate otherwise the server will not start. Put the certificate into "ssl" folder as service.crt and service.key files. The SSL certificate is a PEM encoded crt file.

You can change the server port and protocol (HTTP/HTTPS) for API access from settings page.

Please check the SSL documentation page for more information.

See SETTINGS chapter for this server SSL setup after installation.

FEATURES

Implements all CRUD operations (CREATE, READ, UPDATE, DELETE). Automatically imports the database structure and create a metadata of your database.Single point access, accept POST/PUT/GET/DELETE http methods and respond with a JSON data object.

Basic operations can be used from the start:

CREATE - insert records
READ - read one record by ID
UPDATE - update one record
DELETE - delete one record

The servers accepts batch of different commands at once and uses transactions by default.

Inject your code BEFORE and AFTER operations in order to customize access to each action.

Create queries and access them with simple GET commands.

Current version can be set to access data from one PostgreSQL server.

Management of the database structure requires a third party application like pgAdmin or others. This API server will check requests before sent them to the database against a metadata created at start in order to avoid unnecessary traffic with the database server, the server will need to update it's metadata if database changes occurs. This API server will not alter the database structures and it is no plan to do that in the future.

This RESTful API server can be used to offer WEB services for various kind of applications and devices over HTTP/HTTPS protocol like WEB, mobile or IoT applications that consumes WEB services.

License MIT