Skip to content

Commit

Permalink
update readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
martdo02 committed Oct 30, 2023
1 parent 69b35bd commit f101a5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
29 changes: 10 additions & 19 deletions packages/postgressql/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Node Sql Setup

This module is created to allow other projects to easily utilize SQL when writing test cases. Additionally, a utility function is used to test using this.

[![npm package][npm-image]][npm-url]
[![GitHub Actions](https://github.com/hpcc-systems/MAF/workflows/Build/badge.svg)](https://github.com/hpcc-systems/MAF/actions)
[![Dependencies][dep-image]][dep-url]
# MAF PostgreSQL Setup

This module is created to allow other projects to easily utilize PostgreSQL when writing test cases. Additionally, a utility function is used to test using this.

# Setup

Expand All @@ -20,37 +15,33 @@ Keytar is used to store access to the username and password for sql. Alternative
- POSTGRESQL_SQL_USERNAME: Your username for postgresql
- POSTGRESQL_SQL_PASSWORD: Your password for postgresql
- USE_ENV_VARIABLES: Set to `TRUE` to use environment variables instead of keytar.
```

To setup an sql config please run the following from your project root:
```
node node_modules/@ln-maf/postgresql/config.js
```
Or create a JSON with the name `postgresql.sqlConfig.json` in the root directory of your project. The following is an example of the JSON:
```
{
"sql": {
"host": "localhost",
"port": 5432,
"database": "database"
}
"host": "localhost",
"port": 5432,
"database": "database"
}
```
Note: Please run the Setup step first.

## Steps
Add a step definition file with the following line:
Add a step definition import file with the following line so that the following postgresql steps are available:
```
require('@ln-maf/postgresql)
```

## Given postgresql config from [{jsonObject}](../validations/JSONObject.md)
Utilizes the sql system associated with the item provided. By default will use `postgresql.sqlConfig.json` in the root directory of the project if none is provided.
Utilizes the sql system associated with the item provided. By default will use `postgresql.sqlConfig.json` in the root directory of the project if none is provided.

## When postgresql query from [{jsonObject}](../validations/JSONObject.md) is run
Runs a query from the provided item. Allows templated args as per the global cucumber projects. Stores the results in `this.results.lastRun`. Usable in cucubmer as `${lastRun}` or the it keyword.
Runs a query from the provided item. Allows templated args as per the global cucumber projects. Stores the results in `this.results.lastRun`. Usable in cucumber as `${lastRun}` or the it keyword.

[npm-image]:https://img.shields.io/npm/v/@ln-maf/postgresql.svg
[npm-url]:https://www.npmjs.com/package/@ln-maf/postgresql-sql
[dep-image]:https://david-dm.org/hpcc-systems/MAF.svg?path=packages%2Fpostgresql
[dep-url]:https://david-dm.org/hpcc-systems/MAF?path=packages%2Fpostgresql
[dep-url]:https://github.com/hpcc-systems/MAF/tree/main/packages/postgressql
2 changes: 1 addition & 1 deletion packages/postgressql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "2.0.0",
"version": "2.0.1",
"description": "PostgreSQL support / step definitions for MAF",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit f101a5a

Please sign in to comment.