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

@axway-api-builder-ext/api-builder-plugin-dc-postgres

v2.2.0

Published

PostgreSQL data connector for Axway API Builder

Downloads

32

Readme

PostgreSQL Connector

The PostgreSQL data connector is a plugin for API Builder that can connect to your PostgreSQL database instance and interrogate your schema that will automatically provision Models into to your project, and optionally, automatically generate a rich CRUD API to the underlying tables. The Models can be used programmatically, or can be used within the flow editor to interact with your database.

Minimum requirements

Supported versions

  • PostgreSQL 9.6
  • Other versions might be supported as well, please create an issue if encounter any.

Memory

  • ~7 MB

Disk space

  • ~10 MB

Supported features

  • Automatic generation of Models from SQL tables
  • Automatic generation of API for Models
  • Full CRUD operations on tables via Models
  • Connection pooling

Installation

npm install --no-optional @axway-api-builder-ext/api-builder-plugin-dc-postgres

A configuration file is generated for you and placed into the conf directory of your API Builder project. The configuration for your PostgreSQL is expected to be in environment variables or in the conf/.env file during development.

Configuration

Once the plugin is installed, the configuration file is located <project>/conf/postgres.default.js.

| Option name | Type | Description | | ----------- | ---- | ----------- | | connector | string | Must be: @axway-api-builder-ext/api-builder-plugin-dc-postgres | | connectionPooling | boolean | boolean Enables connection pooling for better performance and scalability. | | connectionLimit | number | Number of simultaneous connections when connectionPooling is enabled. | | host | string | The database host. | | port | number | The database post. | | database | string | The database instance name. | | scheme | string | The schema within your database to use | | user | string | The user with which to connect to the database. | | password | string | The user's password with which to connect to the database. | | generateModelsFromSchema | boolean | If enabled, API Builder will automatically interrogate the database and auto-generate Models from SQL tables. | | modelAutogen | boolean | If enabled, API Builder will automatically generate a full and rich CRUD API from the generated Models. |

Usage

After you configure the connector, you can start up your API Builder project and visit the console (normally found under http://localhost:8080/console). Your connector will be listed under the Connectors section of the console.

Your database tables will be listed under the Models section of the console. You can now click on the gear icon to the right of the table names and generate flow based APIs.

You can also reference the connector in a custom model.

const Account = APIBuilder.Model.extend('Account', {
  fields: {
    Name: { type: String, required: true }
  },
  connector: 'postgres'
});

If you want to map a specific model to a specific table, use metadata. For example, to map the account model to the table named accounts, set it such as:

const Account = APIBuilder.Model.extend('account', {
  fields: {
    Name: { type: String, required: false, validator: /[a-zA-Z]{3,}/ }
  },
  connector: 'postgres',
  metadata: {
    'mysql': {
      table: 'accounts'
    }
  }
});

Known issues and limitations

  1. Only supports SQL tables.
  2. Does not support views.
  3. Does not support stored procedures.

Contributing

Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.

Team

alt text Axway Team