{"id":21306377,"url":"https://github.com/davidemoro/play_sql","last_synced_at":"2025-03-15T19:42:53.227Z","repository":{"id":57453402,"uuid":"116974720","full_name":"davidemoro/play_sql","owner":"davidemoro","description":"pytest-play support for SQL expressions and assertions","archived":false,"fork":false,"pushed_at":"2019-01-25T23:16:40.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-09T23:48:54.009Z","etag":null,"topics":["pytest","python","sql","sqlalchemy","testing"],"latest_commit_sha":null,"homepage":"https://github.com/pytest-dev/pytest-play","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidemoro.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-10T15:24:09.000Z","updated_at":"2019-02-22T23:00:57.000Z","dependencies_parsed_at":"2022-08-29T06:51:07.480Z","dependency_job_id":null,"html_url":"https://github.com/davidemoro/play_sql","commit_stats":null,"previous_names":["tierratelematics/play_sql"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidemoro%2Fplay_sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidemoro","download_url":"https://codeload.github.com/davidemoro/play_sql/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243784100,"owners_count":20347409,"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":["pytest","python","sql","sqlalchemy","testing"],"created_at":"2024-11-21T16:23:32.995Z","updated_at":"2025-03-15T19:42:53.202Z","avatar_url":"https://github.com/davidemoro.png","language":"Python","readme":"========\nplay sql\n========\n\n\n.. image:: https://img.shields.io/pypi/v/play_sql.svg\n        :target: https://pypi.python.org/pypi/play_sql\n\n.. image:: https://travis-ci.org/davidemoro/play_sql.svg?branch=develop\n       :target: https://travis-ci.org/davidemoro/play_sql\n\n.. image:: https://readthedocs.org/projects/play-sql/badge/?version=latest\n        :target: https://play-sql.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://codecov.io/gh/davidemoro/play_sql/branch/develop/graph/badge.svg\n        :target: https://codecov.io/gh/davidemoro/play_sql\n\n\npytest-play support for SQL expressions and assertions\n\nMore info and examples on:\n\n* pytest-play_, documentation\n* cookiecutter-qa_, see ``pytest-play`` in action with a working example if you want to start hacking\n\n\nFeatures\n--------\n\nThis project defines a new pytest-play_ command:\n\n::\n\n    - type: sql\n      provider: play_sql\n      database_url: postgresql://$db_user:$db_pwd@$db_host/$db_name\n      query: SELECT id, title FROM invoices\n      variable: invoice_id\n      variable_expression: results.first()[0]\n      assertion: invoice_id == $invoice_id\n\nwhere:\n\n* ``database_url`` follows the format described \n  http://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls\n* ``variable_expression`` is a Python expression\n    * ``results.fetchone()`` returns an array whose elements matches with the next row's\n      columns and it could be invoked many times until there will be no more rows (eg: first call\n      ``(1, 'first',)``, second call ``(2, 'second')``)\n    * ``results.first()`` returns an array whose elements matches with the first row's colums and it\n      can be invoked exactly one time\n    * ``results.fetchall()`` returns an array of tuples whose elements matches with the selected\n      colums (eg: ``[(1, 'first'), (2, 'second'), (3, 'third')]``)\n\nTwitter\n-------\n\n``pytest-play`` tweets happens here:\n\n* `@davidemoro`_\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the cookiecutter-play-plugin_ (based on `audreyr/cookiecutter-pypackage`_ project template).\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`cookiecutter-play-plugin`: https://github.com/davidemoro/cookiecutter-play-plugin\n.. _pytest-play: https://github.com/davidemoro/pytest-play\n.. _cookiecutter-qa: https://github.com/davidemoro/cookiecutter-qa\n.. _`@davidemoro`: https://twitter.com/davidemoro\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidemoro%2Fplay_sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidemoro%2Fplay_sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidemoro%2Fplay_sql/lists"}