{"id":13483068,"url":"https://github.com/measurechina/eventql-crystal","last_synced_at":"2025-03-27T13:33:29.645Z","repository":{"id":69537196,"uuid":"84840738","full_name":"MeasureChina/eventql-crystal","owner":"MeasureChina","description":"EventQL crystal driver","archived":false,"fork":false,"pushed_at":"2017-06-10T07:25:23.000Z","size":11,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T16:41:31.174Z","etag":null,"topics":["crystal","database","eventql"],"latest_commit_sha":null,"homepage":"http://eventql.io/","language":"Crystal","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/MeasureChina.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}},"created_at":"2017-03-13T15:10:00.000Z","updated_at":"2019-02-11T03:53:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed7456f0-f0c8-4229-93c6-93440b2d89ac","html_url":"https://github.com/MeasureChina/eventql-crystal","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeasureChina%2Feventql-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeasureChina%2Feventql-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeasureChina%2Feventql-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeasureChina%2Feventql-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeasureChina","download_url":"https://codeload.github.com/MeasureChina/eventql-crystal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245854819,"owners_count":20683417,"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":["crystal","database","eventql"],"created_at":"2024-07-31T17:01:07.987Z","updated_at":"2025-03-27T13:33:29.370Z","avatar_url":"https://github.com/MeasureChina.png","language":"Crystal","funding_links":[],"categories":["Database Drivers/Clients"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/MeasureChina/eventql-crystal.svg?branch=master)](https://travis-ci.org/MeasureChina/eventql-crystal)\n\n# eventql-crystal\n\nEventQL driver for Crystal ([eventql.io](http://eventql.io))\n\n\nBased on the official ruby driver  \nhttps://github.com/eventql/eventql/tree/master/drivers/ruby\n\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  eventql-crystal:\n    github: measurechina/eventql-crystal\n```\n\n\n## Usage\n\n```crystal\nrequire \"eventql-crystal\"\n\n# init\nclient = EventQL.connect({\n  \"host\" =\u003e \"localhost\",\n  \"port\" =\u003e \"9175\",\n  \"database\" =\u003e \"sensors\",\n})\n\n# insert rows\nbody = [\n  {\n    database: \"test\",\n    table: \"sensors\",\n    data: {\n      time: Time.now.to_utc.to_s(\"%FT%XZ\"),\n      session_id: \"s1\",\n      url: \"/page1\",\n    }\n  }\n].to_json\n\nresult = client.insert!(body)\n\n# query\nquery = client.query(\"SELECT COUNT(1) FROM sensors;\")\nresponse = query.execute!\n\n# [{\"type\" =\u003e \"table\", \"columns\" =\u003e [\"COUNT(1)\"], \"rows\" =\u003e [[\"1\"]]}]\n\nquery = client.query(\"SELECT * FROM sensors;\")\nresponse = query.execute!\n\n\n```\n\n\n## TODO:\n  - [ ] table create/drop/list\n  - [ ] table add_field/remove_field\n  - [ ] Time conversion util\n  - [ ] time zone util\n  - [ ] MapReduce query\n  - [ ] json mapping helper\n\n\n## Contributing\n\n1. Fork it ( https://github.com/measurechina/eventql-crystal/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeasurechina%2Feventql-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeasurechina%2Feventql-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeasurechina%2Feventql-crystal/lists"}