{"id":15056715,"url":"https://github.com/schemasafe/troy","last_synced_at":"2025-04-10T04:33:50.210Z","repository":{"id":68731557,"uuid":"53279003","full_name":"schemasafe/troy","owner":"schemasafe","description":"Type-safe and Schema-safe Scala wrapper for Cassandra driver","archived":false,"fork":false,"pushed_at":"2018-03-10T18:23:43.000Z","size":539,"stargazers_count":151,"open_issues_count":30,"forks_count":14,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-02T19:51:23.931Z","etag":null,"topics":["cassandra","cassandra-cql","cql","scala","schema"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/schemasafe.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":"2016-03-06T22:14:55.000Z","updated_at":"2024-04-26T09:26:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5cdfff1-52ae-4e1f-871b-77a2efe00899","html_url":"https://github.com/schemasafe/troy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemasafe%2Ftroy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemasafe%2Ftroy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemasafe%2Ftroy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schemasafe%2Ftroy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schemasafe","download_url":"https://codeload.github.com/schemasafe/troy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239140099,"owners_count":19588336,"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":["cassandra","cassandra-cql","cql","scala","schema"],"created_at":"2024-09-24T21:55:29.930Z","updated_at":"2025-02-16T14:31:11.844Z","avatar_url":"https://github.com/schemasafe.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/cassandra-scala/troy.svg?branch=master)](https://travis-ci.org/cassandra-scala/troy)\n[![Gitter](https://badges.gitter.im/cassandra-scala/troy.svg)](https://gitter.im/cassandra-scala/troy?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![Coverage Status](https://coveralls.io/repos/github/cassandra-scala/troy/badge.svg?branch=master)](https://coveralls.io/github/cassandra-scala/troy?branch=master)\n\n# Warning\n\nLast stable code [(as preseneted in ScalaExchange 2016)](https://skillsmatter.com/skillscasts/9039-introducing-troy-the-schema-safe-cassandra-toolkit) under \"v0.5\" tag.\n\nThe new approach (as presented in ScalaSwarm 2017, and Scala.World 2017) is here (in master branch), however is highly unstable at the moment. If you want something to play with, I recommend checking our [POC](https://github.com/schemasafe/poc) instead.\n\n\n# What is Troy?\n\nType-safe \u0026 compile-time-checked wrapper around the Cassandra driver. That allows you to write raw CQL queries like:\n```\n@schemasafe val q = \n  query[Search, Result](\"\"\"\n    SELECT x, y, z\n    FROM test\n    WHERE x = ? AND y = ?;\n  \"\"\");\n```\n\nValidating them against your schema, defined as below: \n```\n@schema object Schema extends SchemaFromString(\n  \"\"\"     \n    CREATE TABLE test (\n      x text PRIMARY KEY,\n      y int,\n      z list\u003ctext\u003e\n    );\n  \"\"\"\n)\n```\nand showing errors at *compile-time* like:\n\u003e Main.scala:15: Column 'ops_typo' not found in table 'test.posts'\nOR\n\u003e Main.scala:15: Incompatible column type Int \u003c--\u003e troy.driver.CassandraDataType.Text\n\nCheck our [examples](examples) for more usecases.\n\n\n## Compile-time Codec registery\nTroy wraps Cassandra's codecs in Typeclasses, to allow picking the correct codec at compile-time, rather than runtime.\nThis is also extensible, by defining an implicit `HasTypeCodec[YourType, CassandraType]`.\n\n### Optional columns\nTroy handles optional values automatically, by wrapping Cassandra's codec with `null` checking.\nAll you need to do is define your classes to contain `Option[T]` like.\n```\ncase class Post(id: UUID, title: Option[String])\n```\n\n## CQL Syntax\nTroy targets (but not fully implements) CQL v3.4.3\n\n## Status\nTroy is currently is very early stage, testing, issues and contributions are very welcome.\n\n## License ##\nThis code is open source software licensed under the [Apache 2.0 License](\"http://www.apache.org/licenses/LICENSE-2.0.html\").\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschemasafe%2Ftroy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschemasafe%2Ftroy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschemasafe%2Ftroy/lists"}