squeryl

Squeryl: Run query explicitly

别说谁变了你拦得住时间么 提交于 2019-12-05 13:17:37
When I create a query in squeryl, it returns a Query[T] object. The query was not yet executed and will be, when I iterate over the Query object (Query[T] extends Iterable[T]). Around the execution of a query there has to be either a transaction{} or a inTransaction{} block. I'm just speaking of SELECT queries and transactions wouldn't be necessary, but the squeryl framework needs them. I'd like to create a query in the model of my application and pass it directly to the view where a view helper in the template iterates over it and presents the data. This is only possible when putting the

Dynamically generate case class in Scala

☆樱花仙子☆ 提交于 2019-12-02 01:00:51
I want to read a rather large csv file and process it (slice, dice, summarize etc.) interactively (data exploration). My idea is to read the file into a database (H2) and use SQL to process it: Read the file: I use Ostermiller csv parser Determine the type of each column: I select randomly 50 rows and derive the type (int, long, double, date, string) of each column I want to use Squeryl to process. To do so I need to create a case class dynamically. That's the bottleneck so far! I upload the file to H2 and use any SQL command. My questions: Is there a better general interactive way of doing

How to integrate the Scala Squeryl ORB with play 2.0 framework?

白昼怎懂夜的黑 提交于 2019-11-30 05:07:34
I am trying to use Squeryl ORB with play 2.0 framework, but when calling DB.getConnection() during initialization I get: BadPath: path parameter: Invalid path ' - could not find datasource for defaultdb': Token not allowed in path expression: '-' (you can double-quote this token if you really want it here) The database configuration looks like this (conf/application.conf): db.default.url="jdbc:postgresql://localhost/mydb?user=postgres&password=postgres" db.default.driver=org.postgresql.Driver db.default.jndiName=defaultdb And the initializing: object Global extends GlobalSettings { override

How to integrate the Scala Squeryl ORB with play 2.0 framework?

若如初见. 提交于 2019-11-29 02:52:23
问题 I am trying to use Squeryl ORB with play 2.0 framework, but when calling DB.getConnection() during initialization I get: BadPath: path parameter: Invalid path ' - could not find datasource for defaultdb': Token not allowed in path expression: '-' (you can double-quote this token if you really want it here) The database configuration looks like this (conf/application.conf): db.default.url="jdbc:postgresql://localhost/mydb?user=postgres&password=postgres" db.default.driver=org.postgresql.Driver