pg-stored-procedure

1.0.0 • Public • Published

pg-stored-procedure Build Status codecov

CLI for scaffolding out PostgreSQL stored procedures

CLI

Install

$ npm install --global pg-stored-procedure

Usage

$ pgsp --help

  Usage
    $ pgsp [name]

  Options
    --path / -p  Path to SQL file output
      (Outputs to clipboard if omitted)

  Examples
    $ pgsp get_user_info
    $ pgsp get_user_info -p .

Code

Install

npm install pg-stored-procedure

Usage

const pgsp = require('pg-stored-procedure');
 
pgsp('foo_bar');
//=>
// DROP TYPE IF EXISTS type_foo_bar CASCADE;
// CREATE TYPE type_foo_bar AS (
 
// );
 
// CREATE OR REPLACE FUNCTION foo_bar(
 
// ) RETURNS SETOF type_foo_bar AS $FUNCTION$
// DECLARE
 
// BEGIN
 
// END;
// $FUNCTION$ LANGUAGE plpgsql;

API

pgsp(functionName)

functionName

Type: string

Name of the stored procedure.

License

MIT © Hoishin

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    0

Package Sidebar

Install

npm i pg-stored-procedure

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hoishin