Last active
December 28, 2019 02:42
-
-
Save naderghanbari/e1fca2ea0eb703c94fcf0ebd76436624 to your computer and use it in GitHub Desktop.
Scala, Slick, and PostGIS :: PostGISProfile.scala + SlickSchema.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package infra.slick | |
import com.github.tminglei.slickpg._ | |
trait PostGISProfile extends ExPostgresProfile with PgPostGISSupport { | |
object ExtendedAPI extends API with PostGISImplicits | |
override val api = ExtendedAPI | |
} | |
object PostGISProfile extends PostGISProfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package infra.slick | |
import java.util.UUID | |
import domain.Building | |
import org.locationtech.jts.geom.Point | |
import PostGISProfile.api._ | |
trait SlickSchema { | |
class BuildingsTable(tag: Tag) extends Table[Building](tag, "buildings") { | |
def id = column[UUID]("id", O.PrimaryKey) | |
def name = column[String]("name") | |
def coordinate = column[Point]("coordinate") | |
def * = (id, name, coordinate) <> (Building.tupled, Building.unapply) | |
} | |
val Buildings = TableQuery[BuildingsTable] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment