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

web_plsql

v0.5.1

Published

The Express Middleware for Oracle PL/SQL

Downloads

28

Readme

NPM Version NPM Downloads Linux Build Build status Coverage Status

Oracle PL/SQL Gateway Middleware for the Express web framework for Node.js

This Express Middleware is a bridge between a PL/SQL application running in an Oracle Database and an Express web server for Node.js. It is an open-source alternative to mod_plsql, the Embedded PL/SQL Gateway and ORDS, allowing you to develop PL/SQL web applications using the PL/SQL Web Toolkit (OWA) and Oracle Application Express (Apex), and serve the content using the Express web framework for Node.js.

Please feel free to try and suggest any improvements. Your thoughts and ideas are most welcome.

Release History

See the changelog.

Installation

Prerequisites

There are several prerequisites needed to both compile and run the Oracle database driver. Please visit the node-oracledb INSTALL.md page for more information. On where Oracle is looking for the client consult: https://oracle.github.io/node-oracledb/doc/api.html#oracleclientloading

Installing

  • Create and move to a new directory
  • Create a new npm project (npm init)
  • Install package (npm install web_plsql)
  • Install the PL/SQL examples (sqlplus node_modules/web_plsql/examples/sql/install.sql)
  • Start the sample server (node node_modules/web_plsql/examples/sample)
  • Invoke a browser and open the page http://localhost:8000/base

Configuration

How does a mod_plsql DAD configuration compare to the web_plsql app

<Location /pls/sample>
  SetHandler                    pls_handler
  Order                         deny,allow
  Allow                         from all
  PlsqlDatabaseUsername         sample
  PlsqlDatabasePassword         sample
  PlsqlDatabaseConnectString    ORCL
  PlsqlAuthenticationMode       Basic
  PlsqlDefaultPage              sample.pageindex
  PlsqlDocumentTablename        doctable
  PlsqlErrorStyle               DebugStyle
  PlsqlNlsLanguage              AMERICAN_AMERICA.UTF8
</Location>
const fs = require('fs');
const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const multipart = require('connect-multiparty');
const cookieParser = require('cookie-parser');
const compression = require('compression');
const morgan = require('morgan');

const oracledb = require('oracledb');
const webplsql = require('../lib');

/*
*	Allocate the Oracle database pool
*/

const databasePool = oracledb.createPool({
	user: 'sample',
	password: 'sample',
	connectString: 'ORCL',
	poolMin: 10,
	poolMax: 1000,
	poolIncrement: 10,
	queueRequests: false,
	queueTimeout: 1000
});

databasePool.catch(e => {
	console.error(`Unable to create database pool.\n${e.message}`);
	process.exit(1);
});

/*
*	Start the server
*/

const PORT = 8000;
const PATH = '/pls/sample';
const OPTIONS = {
	defaultPage: 'sample.pageIndex',
  doctable: 'docTable',
  errorStyle: 'debug'
};

// create express app
const app = express();

// add middleware
app.use(multipart());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(cookieParser());
app.use(compression());
app.use(morgan('combined', {stream: fs.createWriteStream(path.join(process.cwd(), 'access.log'), {flags: 'a'})}));

// add the oracle pl/sql express middleware
app.use(PATH + '/:name?', webplsql(databasePool, OPTIONS));

// serving static files
app.use('/static', express.static(path.join(process.cwd(), 'examples/static')));

// listen on port
console.log(`Waiting on http://localhost:${PORT}${PATH}`);
app.listen(PORT);

Missing features

Supported mod_plsql configuration options:

  • PlsqlDatabaseConnectString -> specified when creating the oracledb connection pool
  • PlsqlDatabaseUserName -> specified when creating the oracledb connection pool
  • PlsqlDatabasePassword -> specified when creating the oracledb connection pool
  • PlsqlDefaultPage -> use the "doctable" configuration option
  • PlsqlDocumentTablename -> use the "defaultPage" configuration option
  • PlsqlErrorStyle -> use the "errorStyle" configuration option
  • PlsqlLogEnable -> use a HTTP request logger middleware for node.js like morgan
  • PlsqlLogDirectory -> use a HTTP request logger middleware for node.js like morgan
  • PlsqlPathAlias -> use the "pathAlias.alias" configuration option
  • PlsqlPathAliasProcedure -> use the "pathAlias.procedure" configuration option

Features in mod_plsql that are planned t be available in web_plsql:

  • PlsqlDocumentPath
  • PlsqlDocumentProcedure
  • PlsqlExclusionList
  • PlsqlRequestValidationFunction
  • Support for APEX 5.
  • Default exclusion list.
  • Basic and custom authentication methods, based on the OWA_SEC package and custom packages.

Configuration options that will not be supported:

  • PlsqlIdleSessionCleanupInterval
  • PlsqlAfterProcedure
  • PlsqlAlwaysDescribeProcedure
  • PlsqlBeforeProcedure
  • PlsqlCGIEnvironmentList
  • PlsqlSessionCookieName
  • PlsqlSessionStateManagement
  • PlsqlTransferMode

License

MIT