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

restlesspgorm

v0.9.25

Published

RestlessPgOrm is an ORM layer for PostgreSQL databases.

Downloads

4

Readme

RestlessPgOrm

RestlessPgOrm is a simple NodeJS ORM system for accessing PostgreSQL databases. It is slightly opinionated, with the following philosophies:

  • Databases should be self-contained: You should be able to get a database login and get to work.
  • Configuration should be minimal: You shouldn't require a schema configuration written in some DSL to use your database. The proofe should be in the pudding.
  • ORMs should stay out of the way: Database ORMs often try to impose a new way of accessing data. Not RestlessPgOrm. You can always drop down to SQL if you want.

Getting started

You can install RestlessPgOrm via npm:

npm install --save restlesspgorm

To get it working in your environment, it requires a few environment variables to be set:

  • RESTPGORM_DB_HOST: The database hostname
  • RESTPGORM_DB_PORT: The database port (optional, defaults to 5432),
  • RESTPGORM_DB_NAME: The database schema name
  • RESTPGORM_DB_USERNAME: The database user name
  • RESTPGORM_DB_PASSWORD: The database password
  • RESTPGORM_CACHE_FILE: The path to your database cache file (the ORM creates this file for you)

Since the library is built on pg-promise and uses a connection pool, you can also specify some other environment variables if you'd like:

  • RESTPGORM_DB_POOL_MAX: The number of connections in the pool (defaults to 5),
  • RESTPGORM_DB_POOL_IDLE_TIMEOUT: The period after which connections expire in milliseconds (defaults to 30000ms),

After you have installed the library and set the appropriate environment variables, you can cache your schema with the following command:

npx cacheSchema

This will create the file that the library will use to access your database.