-
Notifications
You must be signed in to change notification settings - Fork 186
Integrating phantom in your project
The resolvers needed for Phantom are the Typesafe defaults, Sonatype, Twitter and our very own. The below list should make sure you have no dependency resolution errors.
resolvers ++= Seq(
Resolver.typesafeRepo("releases"),
Resolver.sonatypeRepo("releases")
)
For most things, all you need is the main phantom-dsl
module. This will bring in the default module with all the query generation ability, as well as phantom-connectors
and database objects that help you manage your entire database layer on the fly. All other modules implement enhanced integration with other tools, but you don't need them to get started.
libraryDependencies ++= Seq(
"com.outworkers" %% "phantom-dsl" % phantomVersion
)
The full list of available modules is:
libraryDependencies ++= Seq(
"com.outworkers" %% "phantom-connectors" % phantomVersion,
"com.outworkers" %% "phantom-dsl" % phantomVersion,
"com.outworkers" %% "phantom-example" % phantomVersion,
"com.outworkers" %% "phantom-finagle" % phantomVersion,
"com.outworkers" %% "phantom-jdk8" % phantomVersion,
"com.outworkers" %% "phantom-thrift" % phantomVersion,
"com.outworkers" %% "phantom-streams" % phantomVersion,
"com.outworkers" %% "phantom-sbt" % phantomVersion
)
If you include phantom-finagle
, make sure to add the following resolvers:
resolvers += "twitter-repo" at "http://maven.twttr.com"
In your plugins.sbt
, you will also need this if you plan to use phantom-sbt
:
def outworkersPattern = {
val pList = Resolver.mavenStyleBasePattern) :: Nil
Patterns(pList, pList, true)
}
resolvers ++= Seq(
Resolver.url("Maven Ivy Outworkers", url(Resolver.DefaultMavenRepositoryRoot))(outworkersPattern)
)
addSbtPlugin("com.outworkers" %% "phantom-sbt" % phantomVersion)
Spray users will probably be affected by a conflict in shapeless versions. To fix the conflict, add the following dependency to your build, which will allow you to use phantom and Spray together without any issues.
libraryDependencies ++= Seq(
"io.spray" %% "spray-routing-shapeless2" % SprayVersion
)
To stay up-to-date with our latest releases and news, follow us on Twitter: @outworkers.
- Issues and questions
- Adopters
- Roadmap
- Changelog
- Tutorials
- Commercial support
- Using phantom in your project
- Primitive columns
- Optional primitive columns
- Collection columns
- Collection operators
- Automated schema generation
- Indexing columns
- Data modeling with phantom
- Querying with phantom
- Asynchronous iterators
- Batch statements
- Apache Thrift integration
- Apache ZooKeeper integration
- The phantom testkit