{"id":15713707,"url":"https://github.com/naqvis/crystal-odbc","last_synced_at":"2025-06-20T17:11:28.560Z","repository":{"id":88081892,"uuid":"253570974","full_name":"naqvis/crystal-odbc","owner":"naqvis","description":"ODBC connector for Crystal","archived":false,"fork":false,"pushed_at":"2023-07-24T13:06:10.000Z","size":46,"stargazers_count":12,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T22:55:39.293Z","etag":null,"topics":["crystal","crystal-db","crystal-lang","crystal-language","crystal-odbc","odbc","odbc-driver","unixodbc"],"latest_commit_sha":null,"homepage":null,"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/naqvis.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":"2020-04-06T17:36:50.000Z","updated_at":"2025-04-25T00:40:42.000Z","dependencies_parsed_at":"2024-10-24T10:52:03.700Z","dependency_job_id":"5ef86b47-43cc-4a8c-8bfe-d937ac343076","html_url":"https://github.com/naqvis/crystal-odbc","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/naqvis/crystal-odbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-odbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-odbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-odbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-odbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naqvis","download_url":"https://codeload.github.com/naqvis/crystal-odbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naqvis%2Fcrystal-odbc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260985197,"owners_count":23092888,"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","crystal-db","crystal-lang","crystal-language","crystal-odbc","odbc","odbc-driver","unixodbc"],"created_at":"2024-10-03T21:33:02.363Z","updated_at":"2025-06-20T17:11:23.545Z","avatar_url":"https://github.com/naqvis.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crystal-odbc\n\nCrystal ODBC driver implements [crystal-db](https://github.com/crystal-lang/crystal-db) API and is a wrapper around [unixODBC](http://www.unixodbc.org).\n\nunixODBC is an open-source ODBC-library that you can run on non-Windows platforms. It is the glue between odbc (this shard) and your SQL driver.\n\n## Version matters! ##\nIf you want to use odbc with unixODBC make sure you are running unixODBC 2.3.7!\n\n## Installation\n\n1. Make sure you have unixODBC and SQL Driver (ODBC Driver/Connector) installed. Look into DBMS of your choice and find their ODBC driver installation instructions for your system.\n\n2. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     odbc:\n       github: naqvis/crystal-odbc\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"db\"\nrequire \"odbc\"\n\nDB.open \"odbc://DSN=dsn;UID=user;PWD=password\" do |db|\n  db.exec \"create table contacts (name text, age integer)\"\n  db.exec \"insert into contacts values (?, ?)\", \"John Doe\", 30\n\n  args = [] of DB::Any\n  args \u003c\u003c \"Sarah\"\n  args \u003c\u003c 33\n  db.exec \"insert into contacts values (?, ?)\", args\n\n  puts \"max age:\"\n  puts db.scalar \"select max(age) from contacts\" # =\u003e 33\n\n  puts \"contacts:\"\n  db.query \"select name, age from contacts order by age desc\" do |rs|\n    puts \"#{rs.column_name(0)} (#{rs.column_name(1)})\"\n    # =\u003e name (age)\n    rs.each do\n      puts \"#{rs.read(String)} (#{rs.read(Int32)})\"\n      # =\u003e Sarah (33)\n      # =\u003e John Doe (30)\n    end\n  end\nend\n```\nrefer to [crystal-db](https://github.com/crystal-lang/crystal-db) for further usage instructions.\n\n## Development\n\nTo run all tests:\n\n```\ncrystal spec\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/naqvis/crystal-odbc/fork\u003e)\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\n## Contributors\n\n- [Ali Naqvi](https://github.com/naqvis) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvis%2Fcrystal-odbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaqvis%2Fcrystal-odbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaqvis%2Fcrystal-odbc/lists"}