{"id":16073108,"url":"https://github.com/rolfschmidt/rolfs-tablesearch","last_synced_at":"2025-09-03T02:17:57.265Z","repository":{"id":193483427,"uuid":"688853277","full_name":"rolfschmidt/Rolfs-TableSearch","owner":"rolfschmidt","description":"Zammad Package which will add new API endpoints for searching database tables.","archived":false,"fork":false,"pushed_at":"2023-09-08T13:35:42.000Z","size":35,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-15T21:05:33.402Z","etag":null,"topics":["szpm","zammad","zammad-package","zpm"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/rolfschmidt.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-08T08:39:27.000Z","updated_at":"2023-09-08T10:09:33.000Z","dependencies_parsed_at":"2024-11-19T02:01:30.806Z","dependency_job_id":null,"html_url":"https://github.com/rolfschmidt/Rolfs-TableSearch","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"d52a5e554c878a877e97992da99dbda4c563a0c7"},"previous_names":["rolfschmidt/rolfs-tablesearch"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolfschmidt%2FRolfs-TableSearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolfschmidt%2FRolfs-TableSearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolfschmidt%2FRolfs-TableSearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rolfschmidt%2FRolfs-TableSearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rolfschmidt","download_url":"https://codeload.github.com/rolfschmidt/Rolfs-TableSearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241990813,"owners_count":20053994,"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":["szpm","zammad","zammad-package","zpm"],"created_at":"2024-10-09T08:03:34.789Z","updated_at":"2025-03-05T08:21:13.240Z","avatar_url":"https://github.com/rolfschmidt.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rolfs-TableSearch\n\nThis package contains the functionality to search database tables of zammad via REST.\n\nBe aware that this package is still in early development and will be reworked heavily in the next releases.\n\nTo use the endpoints you will need a admin with the permissions `admin.table_search`.\n\n**Note: Do only use this package with PostgresSQL. There will be no MySQL support anymore, since it already deprecated.**\n\n## How to install the package\n\n1. Click in your admin interface to the area **Admin -\u003e Packages**.\n\n2. [Download the current version](https://github.com/rolfschmidt/Rolfs-TableSearch/releases) for the package which is compatible to your zammad version.\n\n3. Install the package.\n\n4. Run all displayed commands in the UI on your shell and restart your zammad service.\n\n## Endpoints\n\n### All tables\n\nThis endpoint shows all tables existing in zammad.\n\n```bash\n$ curl -s -uadmin@example.com:test http://ubuntu-rs:3000/api/v1/tables | jq .\n{\n  \"ticket_flags\": \"Ticket::Flag\",\n  \"ticket_priorities\": \"Ticket::Priority\",\n  \"ticket_shared_draft_starts\": \"Ticket::SharedDraftStart\",\n  \"ticket_shared_draft_zooms\": \"Ticket::SharedDraftZoom\",\n  \"ticket_states\": \"Ticket::State\",\n  \"ticket_state_types\": \"Ticket::StateType\",\n  \"ticket_time_accounting_types\": \"Ticket::TimeAccounting::Type\",\n  \"ticket_time_accountings\": \"Ticket::TimeAccounting\",\n  \"tickets\": \"Ticket\",\n  ...\n}\n```\n\n### Table columns\n\nTo get an overview over all columns of an table you can use this endpoint.\n\n```bash\n$ curl -s -u\"admin@example.com:test\" http://ubuntu-rs:3000/api/v1/tables/ticket_priorities/columns | jq .\n{\n  \"id\": \"integer\",\n  \"name\": \"string\",\n  \"default_create\": \"boolean\",\n  \"ui_icon\": \"string\",\n  \"ui_color\": \"string\",\n  \"note\": \"string\",\n  \"active\": \"boolean\",\n  \"updated_by_id\": \"integer\",\n  \"created_by_id\": \"integer\",\n  \"created_at\": \"datetime\",\n  \"updated_at\": \"datetime\"\n}\n```\n\n### Select one row\n\nIf you only need one row then there is also a show endpoint:\n\n```bash\n$ curl -s -u\"admin@example.com:test\" http://ubuntu-rs:3000/api/v1/tables/ticket_priorities/1 | jq .\n{\n  \"id\": 1,\n  \"name\": \"1 low\",\n  \"default_create\": false,\n  \"ui_icon\": \"low-priority\",\n  \"ui_color\": \"low-priority\",\n  \"note\": null,\n  \"active\": true,\n  \"updated_by_id\": 1,\n  \"created_by_id\": 1,\n  \"created_at\": \"2023-09-04T10:45:15.514Z\",\n  \"updated_at\": \"2023-09-04T10:45:15.548Z\"\n}\n```\n\n### Search endpoint\n\nThis is the magic endpoint which you can use for every table and where you can use the operators.\n\n```bash\n$ curl -s -uadmin@example.com:test http://ubuntu-rs:3000/api/v1/tables/ticket_priorities?id=1 | jq .\n[\n  {\n    \"id\": 1,\n    \"name\": \"1 low\",\n    \"default_create\": false,\n    \"ui_icon\": \"low-priority\",\n    \"ui_color\": \"low-priority\",\n    \"note\": null,\n    \"active\": true,\n    \"updated_by_id\": 1,\n    \"created_by_id\": 1,\n    \"created_at\": \"2023-09-04T10:45:15.514Z\",\n    \"updated_at\": \"2023-09-04T10:45:15.548Z\"\n  }\n]\n```\n\n#### Pagination\n\nto paginate thorugh the results you can use the `offset` (default: 0) and `limit` (default: 500) parameter.\n\n```bash\n$ curl -s -uadmin@example.com:test http://ubuntu-rs:3000/api/v1/tables/ticket_priorities?id=1\u0026offset=1\u0026limit=100 | jq .\n```\n\n## Current operators\n\n### Exact match\n\nExact values match for all columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?id=1\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?id_not=1\n```\n\n### Date match\n\nRange condtions for date columns.\n\n`ge, gt, le, lt`\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?created_ge=2023-09-04T10:45:16.017Z\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?created_gt=2023-09-04T10:45:16.017Z\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?created_le=2023-09-04T10:45:16.017Z\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?created_lt=2023-09-04T10:45:16.017Z\n```\n\n### Search match\n\nFulltext search string columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?search=Welcome\n```\n\n### Contains match\n\nContains for string columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?title_contains=Welcome\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?title_contains_not=Welcome\n```\n\n### Regex match\n\nRegex match for string columns\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?name_regex=(low|high)\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?name_regex_not=(low|high)\n```\n\n### Empty match\n\nEmpty match for string columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?note_empty=1\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?note_empty_not=1\n```\n\n### Null match\n\nEmpty match for all columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?note_null=1\nhttp://ubuntu-rs:3000/api/v1/tables/ticket_priorities?note_null_not=1\n```\n\n### In array match\n\nIn array for all columns.\n\n```\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?id_in=1,2,3\nhttp://ubuntu-rs:3000/api/v1/tables/tickets?id_in_not=1,2,3\n```\n\n# LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolfschmidt%2Frolfs-tablesearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frolfschmidt%2Frolfs-tablesearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frolfschmidt%2Frolfs-tablesearch/lists"}