{"id":16193449,"url":"https://github.com/pyramation/jsqltest","last_synced_at":"2025-04-07T15:18:03.992Z","repository":{"id":57286220,"uuid":"295577310","full_name":"pyramation/jsqltest","owner":"pyramation","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-15T04:01:14.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T21:33:02.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyramation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-15T01:05:57.000Z","updated_at":"2020-09-15T04:01:17.000Z","dependencies_parsed_at":"2022-09-10T01:00:48.545Z","dependency_job_id":null,"html_url":"https://github.com/pyramation/jsqltest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fjsqltest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fjsqltest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fjsqltest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyramation%2Fjsqltest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyramation","download_url":"https://codeload.github.com/pyramation/jsqltest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247675598,"owners_count":20977378,"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":[],"created_at":"2024-10-10T08:14:54.905Z","updated_at":"2025-04-07T15:18:03.964Z","avatar_url":"https://github.com/pyramation.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsqltest\n\nMeant for testing within `sqitch` or `launchql` projects\n\nExample:\n\n```js\nimport cases from 'jest-in-case';\nimport { TestDatabase } from 'jsqltest';\nimport { resolve as resolveSql } from '@launchql/db-utils';\njest.setTimeout(30000);\n\nlet teardown, db, conn;\nconst objs = {};\n\nbeforeAll(async () =\u003e {\n  const sql = await resolveSql(__dirname + '/../', 'deploy');\n  conn = new TestDatabase({ database: 'my-first-test' });\n  await conn.createdb();\n  await conn.installExt(conn.config, [\n    'plpgsql', 'uuid-ossp', 'pgcrypto', 'citext', 'hstore'\n  ])\n  await conn.seed(sql);\n  await conn.connect();\n});\n\nbeforeEach(async () =\u003e {\n  await conn.begin();\n});\n\nafterEach(async () =\u003e {\n  await conn.rollback();\n});\n\nafterAll(async () =\u003e {\n  await conn.teardown();\n});\n\ncases(\n  'jsqltest(header)',\n  async (opts) =\u003e {\n    const post = await conn.db.insertOne('app_public.my_table', {\n      header: opts.header,\n      body: 'here is my post'\n    });\n    expect(post).toBeTruthy();\n  },\n  [\n    { header: 'title1' },\n    { header: 'title2' },\n    { header: 'title3' },\n    { header: 'title4' },\n    { header: 'title5' },\n    { header: 'title6' },\n    { header: 'title7' },\n    { header: 'title8' },\n    { header: 'title9' },\n    { header: 'title10' },\n    { header: 'title11' },\n    { header: 'title12' },\n    { header: 'title13' },\n    { header: 'title14' },\n    { header: 'title15' },\n    { header: 'title16' }\n  ]\n);\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fjsqltest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyramation%2Fjsqltest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyramation%2Fjsqltest/lists"}