{"id":15722139,"url":"https://github.com/eyeseast/datasette-query-files","last_synced_at":"2025-08-03T21:41:14.623Z","repository":{"id":62592639,"uuid":"499911426","full_name":"eyeseast/datasette-query-files","owner":"eyeseast","description":"Write Datasette canned queries as plain SQL files","archived":false,"fork":false,"pushed_at":"2022-07-02T20:40:51.000Z","size":24,"stargazers_count":13,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-21T16:41:51.475Z","etag":null,"topics":["datasette","datasette-plugin","python","sql","sqlite"],"latest_commit_sha":null,"homepage":"","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/eyeseast.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":"2022-06-04T18:52:07.000Z","updated_at":"2024-07-05T20:44:59.000Z","dependencies_parsed_at":"2022-11-03T22:34:31.420Z","dependency_job_id":null,"html_url":"https://github.com/eyeseast/datasette-query-files","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"simonw/datasette-plugin-template-repository","purl":"pkg:github/eyeseast/datasette-query-files","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyeseast%2Fdatasette-query-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyeseast%2Fdatasette-query-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyeseast%2Fdatasette-query-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyeseast%2Fdatasette-query-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyeseast","download_url":"https://codeload.github.com/eyeseast/datasette-query-files/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyeseast%2Fdatasette-query-files/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268618269,"owners_count":24279243,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["datasette","datasette-plugin","python","sql","sqlite"],"created_at":"2024-10-03T22:04:20.611Z","updated_at":"2025-08-03T21:41:14.524Z","avatar_url":"https://github.com/eyeseast.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# datasette-query-files\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-query-files.svg)](https://pypi.org/project/datasette-query-files/)\n[![Changelog](https://img.shields.io/github/v/release/eyeseast/datasette-query-files?include_prereleases\u0026label=changelog)](https://github.com/eyeseast/datasette-query-files/releases)\n[![Tests](https://github.com/eyeseast/datasette-query-files/workflows/Test/badge.svg)](https://github.com/eyeseast/datasette-query-files/actions?query=workflow%3ATest)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/eyeseast/datasette-query-files/blob/main/LICENSE)\n\nWrite Datasette canned queries as plain SQL files.\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n\n    datasette install datasette-query-files\n\nOr using `pip` or `pipenv`:\n\n    pip install datasette-query-files\n    pipenv install datasette-query-files\n\n## Usage\n\nThis plugin will look for [canned queries](https://docs.datasette.io/en/stable/sql_queries.html#canned-queries) in the filesystem, in addition any defined in metadata.\n\nLet's say you're working in a directory called `project-directory`, with a database file called `my-project.db`. Start by creating a `queries` directory with a `my-project` directory inside it. Any SQL file inside that `my-project` folder will become a canned query that can be run on the `my-project` database. If you have a `query-name.sql` file and a `query-name.json` (or `query-name.yml`) file in the same directory, the JSON file will be used as query metadata.\n\n```\nproject-directory/\n  my-project.db\n  queries/\n    my-project/\n      query-name.sql # a query\n      query-name.yml # query metadata\n```\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n\n    cd datasette-query-files\n    python3 -m venv venv\n    source venv/bin/activate\n\nNow install the dependencies and test dependencies:\n\n    pip install -e '.[test]'\n\nTo run the tests:\n\n    pytest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyeseast%2Fdatasette-query-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyeseast%2Fdatasette-query-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyeseast%2Fdatasette-query-files/lists"}