Description
Type-safe & compile-time-checked wrapper around the Cassandra driver. That allows you to write raw CQL queries like:
Troy alternatives and similar packages
Based on the "Database" category.
Alternatively, view Troy alternatives based on common mentions on social networks and blogs.
-
Slick
Slick (Scala Language Integrated Connection Kit) is a modern database query and access library for Scala -
PostgreSQL and MySQL async
DISCONTINUED. Async database drivers to talk to PostgreSQL and MySQL in Scala. -
ScalikeJDBC
A tidy SQL-based DB access library for Scala developers. This library naturally wraps JDBC APIs and provides you easy-to-use APIs. -
scala-redis
A scala library for connecting to a redis server, or a cluster of redis nodes using consistent hashing on the client side. -
scredis
Non-blocking, ultra-fast Scala Redis client built on top of Akka IO, used in production at Livestream -
Scruid
Scala + Druid: Scruid. A library that allows you to compose queries in Scala, and parse the result back into typesafe classes. -
lucene4s
Light-weight convenience wrapper around Lucene to simplify complex tasks and add Scala sugar. -
GCP Datastore Akka Persistence Plugin
akka-persistence-gcp-datastore is a journal and snapshot store plugin for akka-persistence using google cloud firestore in datastore mode.
SaaSHub - Software Alternatives and Reviews
Do you think we are missing an alternative of Troy or a related project?
Popular Comparisons
README
Warning
Last stable code (as preseneted in ScalaExchange 2016) under "v0.5" tag.
The 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 instead.
What is Troy?
Type-safe & compile-time-checked wrapper around the Cassandra driver. That allows you to write raw CQL queries like:
@schemasafe val q =
query[Search, Result]("""
SELECT x, y, z
FROM test
WHERE x = ? AND y = ?;
""");
Validating them against your schema, defined as below:
@schema object Schema extends SchemaFromString(
"""
CREATE TABLE test (
x text PRIMARY KEY,
y int,
z list<text>
);
"""
)
and showing errors at compile-time like:
Main.scala:15: Column 'ops_typo' not found in table 'test.posts' OR Main.scala:15: Incompatible column type Int <--> troy.driver.CassandraDataType.Text
Check our [examples](examples) for more usecases.
Compile-time Codec registery
Troy wraps Cassandra's codecs in Typeclasses, to allow picking the correct codec at compile-time, rather than runtime.
This is also extensible, by defining an implicit HasTypeCodec[YourType, CassandraType]
.
Optional columns
Troy handles optional values automatically, by wrapping Cassandra's codec with null
checking.
All you need to do is define your classes to contain Option[T]
like.
case class Post(id: UUID, title: Option[String])
CQL Syntax
Troy targets (but not fully implements) CQL v3.4.3
Status
Troy is currently is very early stage, testing, issues and contributions are very welcome.
License
This code is open source software licensed under the [Apache 2.0 License]("http://www.apache.org/licenses/LICENSE-2.0.html").
*Note that all licence references and agreements mentioned in the Troy README section above
are relevant to that project's source code only.