Giter VIP home page Giter VIP logo

jsreport-postgres-store's Introduction

⚠️ This repository has been moved to the monorepo jsreport/jsreport

jsreport-postgres-store

NPM Version Build Status

jsreport template store extension allowing to persist data in PostgreSQL database

Installation

npm install jsreport-postgres-store

Then alter jsreport configuration

{
	"store": {
		"provider": "postgres"
	},
	"extensions": {
		"postgres-store": {
			"host": "localhost",
			"port": 5433,
			"database": "jsreport",
			"user": "postgres",
			"password": "password"
		}
	}
}

After jsreport initializes you should see tables like jsreport.TemplateType and other in jsreport database.

Schema changes

If you do changes to the database schema by enabling additional extensions you need to drop the affected tables and let jsreport to reinitialize them.

jsreport-core

You can apply this extension also manually to jsreport-core

var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-postgres-store')({ host: '...'}))

jsreport-postgres-store's People

Contributors

bjrmatos avatar pofider avatar vitaly-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

jsreport-postgres-store's Issues

Unable to share template if I use postgres as data store.

Getting the following error.

2018-10-09T09:37:47.233Z - error: Error during processing request at http://0.0.0.0:5488/api/templates/sharing/SyCSPaO5X/access/read, details: AssertionError [ERR_ASSERTION]: Error while trying to add a non-existant node to a query at constructor.Node.add (/app/node_modules/sql/lib/node/index.js:17:3) at constructor.Node.addAll (/app/node_modules/sql/lib/node/index.js:74:10) at constructor.select (/app/node_modules/sql/lib/node/query.js:92:12) at Table.select (/app/node_modules/sql/lib/table.js:180:18) at module.exports (/app/node_modules/odata-to-sql/lib/query.js:20:34) at Object.query (/app/node_modules/odata-to-sql/lib/transformer.js:42:14) at Cursor.toArray (/app/node_modules/jsreport-sql-store/lib/sqlProvider.js:21:29) at replay (/app/node_modules/jsreport-core/lib/store/collection.js:58:21) at listenerPromise.then (/app/node_modules/jsreport-core/lib/store/collection.js:65:50) at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31) at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18) at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:614:10) at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:693:18) at Promise._fulfill (/app/node_modules/bluebird/js/release/promise.js:638:18) at Promise._resolveCallback (/app/node_modules/bluebird/js/release/promise.js:432:57)

Configure variables from ENV

I have my database settings stored within the environment. Is there a way to retrieve those to use within this extension to avoid saving in the config file? i.e - if the json file were a js file, I could use process.env.DATABASE

db hint

var pg = require('pg-promise')({promise: q})

The parameter name is promiseLib, not promise ;)

Support for SSL

our postgres database requires SSL connection. This is typically a setting that requires referencing a ca certificate file in order to connect. Is it possible to connect with those settings?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.