Giter Club home page Giter Club logo

geoslick's People

Contributors

ahinz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

geoslick's Issues

Functions in Prepared Statements

I've been trying to use geom.asGeoJson() in a query that gets turned into a prepared statement. The problem is that I get

ERROR: function st_asgeojson(bytea, integer) is not unique at character 31
HINT: Could not choose a best candidate function. You might need to add explicit type casts.

in my Postgres logs.

Here's what Postgres is trying to do:

STATEMENT: select x2."name", x2."state", ST_AsGeoJson(ST_AsEWKB(x2."geom"),1), x2."country", x3."email", x4."term", x5."career" from "term" x4, "career" x5, "cities" x2, "students" x3 where (((x4."term" = $1) and (x5."career" = $2)) and (x2."id" = $3)) and (((x3."city" = x2."id") and (x3."term" = x4."id")) and (x3."career" = x5."id"))

The query works wonderfully if it's not in a prepared statement.

GeoSlick doesn't work properly with IntelliJ

Everything seems to be compiling properly, but if you will try to edit code which uses GeoSlick with IntelliJ then you will see a lot of red color ;) It is because of this fragment:

class SimpleQL extends super.SimpleQL with Implicits {
    type Postgis = PostgisDriver.Postgis
    type PostgisTable[T] = PostgisDriver.PostgisTable[T]
}

// (...)

override val simple = new SimpleQL
import simple._

I'm not sure if overriding val here is so good idea. It's quite similar to cake pattern, where def should be always preferred. If you would change this code to something like that:

class ExtendedQL extends super.SimpleQL with Implicits {
    type Postgis = PostgisDriver.Postgis
    type PostgisTable[T] = PostgisDriver.PostgisTable[T]
}

// (...)

val extended = new ExtendedQL
import extended._

and then fix few imports, then IntelliJ will be fixed.
And I think it will be also safer, since there will be no risk of some weird name collisions.

Delete doesn't work

object Test extends Table[(String, Int, Int, Geometry, Array[Byte], Boolean)]("test") with   
Postgis {                                                                                    
  def key = column[String]("key", O.PrimaryKey)                                                                                                 
  def geom = geoColumn[Geometry]("geom", 0)                                                                 
  def * = key ~ geom                                     
}                                                                                                                                     

When trying to delete something:

val q = for (d <- Test if d.key === doc.key.toString) yield d                                
q.delete                                                                                     

I get:

scala.slick.SlickException: A query for a DELETE statement must resolve to a comprehension
with a single table -- Unsupported shape: Comprehension(fetch = None, offset = None)
at scala.slick.driver.BasicStatementBuilderComponent$QueryBuilder.buildDelete(BasicSt
atementBuilderComponent.scala:321)
at scala.slick.driver.BasicProfile$class.buildDeleteStatement(BasicProfile.scala:18)
at geoslick.PostgisDriver$.buildDeleteStatement(postgis.scala:275)
at scala.slick.driver.BasicInvokerComponent$DeleteInvoker.built$lzycompute(BasicInvok
erComponent.scala:50)
at scala.slick.driver.BasicInvokerComponent$DeleteInvoker.built(BasicInvokerComponent
.scala:50)
at scala.slick.driver.BasicInvokerComponent$DeleteInvoker.deleteStatement(BasicInvoke
rComponent.scala:52)
at scala.slick.driver.BasicInvokerComponent$DeleteInvoker.delete(BasicInvokerComponen
t.scala:54)
at Main$$anonfun$1.apply(Main.scala:40)
[..]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.