{"id":19134081,"url":"https://github.com/umbrellio/sequel-tablefunc","last_synced_at":"2026-06-08T16:30:13.052Z","repository":{"id":145753000,"uuid":"119738790","full_name":"umbrellio/sequel-tablefunc","owner":"umbrellio","description":"Sequel extension for crosstabs","archived":false,"fork":false,"pushed_at":"2018-02-08T07:56:03.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-03T12:14:07.503Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/umbrellio.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-31T20:21:50.000Z","updated_at":"2020-10-29T13:38:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e3a370e-5b97-4427-9902-bf584fc47aec","html_url":"https://github.com/umbrellio/sequel-tablefunc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fsequel-tablefunc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fsequel-tablefunc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fsequel-tablefunc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umbrellio%2Fsequel-tablefunc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umbrellio","download_url":"https://codeload.github.com/umbrellio/sequel-tablefunc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240214575,"owners_count":19766263,"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-11-09T06:25:22.823Z","updated_at":"2026-06-08T16:30:12.917Z","avatar_url":"https://github.com/umbrellio.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequel::Tablefunc [![Build Status](https://travis-ci.org/fiscal-cliff/sequel-tablefunc.svg?branch=master)](https://travis-ci.org/fiscal-cliff/sequel-tablefunc) [![Gem Version](https://badge.fury.io/rb/sequel-tablefunc.svg)](https://badge.fury.io/rb/sequel-tablefunc) [![Coverage Status](https://coveralls.io/repos/github/fiscal-cliff/sequel-tablefunc/badge.svg?branch=master)](https://coveralls.io/github/fiscal-cliff/sequel-tablefunc?branch=master)\n\nThis is sequel extension makes using crosstab function more convenient\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sequel-tablefunc'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nAssuming you have table which already have 2 categories. This table can be represented as a pivot table\n\n```ruby\n  User.select_group(:type_id, :status_id)\n      .select_append(:count.sql_function.*)\n      .order(:type_id)\n      .crosstab(User.select(:status_id).distinct.order(:status_id))\n      .all\n```\n\n| row_name     | status1     | status2 |\n| :------------- | :------------- | :------------- |\n| type1      | 5       | 10|\n| type2      | 1       | 2|\n\nIt is easy, isn't it?\n\n```ruby\n  User.select_group(:date_trunc.sql_function('year', :created_at), :status_id)\n      .select_append(:count.sql_function.*)\n      .order(:date_trunc.sql_function('year', :created_at))\n      .crosstab(User.select(:status_id)\n      .distinct\n      .order(:status_id))\n      .all\n```\n\n| row_name     | status1     | status2 |\n| :------------- | :------------- | :------------- |\n| 2012-01-01 00:00:00      | 6       | nil|\n| 2013-01-01 00:00:00      | nil       | 12|\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/sequel-tablefunc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fsequel-tablefunc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumbrellio%2Fsequel-tablefunc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumbrellio%2Fsequel-tablefunc/lists"}