{"id":20522750,"url":"https://github.com/testxio/testx-postgres-keywords","last_synced_at":"2026-04-16T23:33:27.951Z","repository":{"id":32897171,"uuid":"36491767","full_name":"testxio/testx-postgres-keywords","owner":"testxio","description":"A library that extends testx with keywords for testing Postgres databases.","archived":false,"fork":false,"pushed_at":"2017-10-12T13:40:58.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T10:48:31.287Z","etag":null,"topics":["postgres","testx"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/testxio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-29T08:35:49.000Z","updated_at":"2017-03-14T13:19:50.000Z","dependencies_parsed_at":"2022-08-07T18:16:05.846Z","dependency_job_id":null,"html_url":"https://github.com/testxio/testx-postgres-keywords","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testxio%2Ftestx-postgres-keywords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testxio%2Ftestx-postgres-keywords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testxio%2Ftestx-postgres-keywords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/testxio%2Ftestx-postgres-keywords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/testxio","download_url":"https://codeload.github.com/testxio/testx-postgres-keywords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242128317,"owners_count":20076177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgres","testx"],"created_at":"2024-11-15T22:36:40.741Z","updated_at":"2026-04-16T23:33:22.925Z","avatar_url":"https://github.com/testxio.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"@testx/keywords-postgres\n=====\n\nA library that extends testx with keywords for testing [Postgres](https://www.postgresql.org/) databases.\n\n## How does it work\nFrom the directory of the art code install the package as follows:\n```sh\nnpm install @testx/keywords-postgres --save\n```\n\nAfter installing the package you add these keywords to testx by adding the following line to your protractor config file:\n\n```\ntestx.keywords.add(require('@testx/keywords-postgres'))\n```\n\n## Example **testx** script:\n```\n- execute sql:\n    sql: SELECT 1;\n    expected result:\n      - ?column?: 1\n    save result to: saved\n- execute sql:\n    sql: SELECT 1;\n    expected result: '{{saved}}'\n- execute sql:\n    sql: |-\n      DROP TABLE IF EXISTS test;\n      CREATE TABLE test (first varchar(20), second integer);\n      INSERT INTO test(first, second) VALUES ('test1', 12), ('test2', 34);\n      SELECT * FROM test;\n    expected result:\n      - first: test1\n        second: 12\n      - first: test2\n        second: 34\n```\n\n## Keywords\n\n| Keyword                | Argument name | Argument value  | Description |\n| ---------------------- | ------------- | --------------- |------------ |\n| execute sql            |               |                 | Connect to the database, execute the SQL query/statement and optionally check the expected result and/or save it in the test context. |\n|                        | connection string | Connection string in the format of *postgres://user:password@host:port/database*.| Optional. If not set, the **postgresConnectionString** command line (or config file) parameter will be used.|\n|                        | sql             | SQL query/statement to execute. | Required. |\n|                        | expected result | Expected result of the query. | Optional. It will be compared to the result of the query. The keyword will fail if they are different. The expected result should be a list of rows. Every row is an object (see the [example](#example)). |\n|                        | save result to  | *varname* | Optional. The name of a context variable, that will be used to save the result of the query. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestxio%2Ftestx-postgres-keywords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftestxio%2Ftestx-postgres-keywords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftestxio%2Ftestx-postgres-keywords/lists"}