Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

I have the following case classes representing entities: case class A(id: Long, name: String) case class B(id: Long, someField: String) val parser = Macro.namedParser[A] ~ Macro.namedParser[B] val ...
rvange's user avatar
  • 2,622
0 votes
1 answer
177 views

Given that there is just one simple SQL statement (example: select id from foo) that I need to execute on my Postgres 15 database, I am curious to know the performance impact of executing it using ...
Prakhar Singh's user avatar
0 votes
0 answers
16 views

I see that executeQuery returns a SqlQueryResult, which has a statementWarning() that returns Option[SQLWarning]. Is this the only place I should check to see whether my insert failed? The doc ...
A_P's user avatar
  • 366
0 votes
1 answer
276 views

I am trying to connect my spark thrift server using play framework via anorm. Play framework version - 2.8.18 Connecting to jdbc as explained here Anorm - 2.7.0 Spark thrift server version - spark 3....
Bill Goldberg's user avatar
0 votes
1 answer
63 views

I'm Using Scala(2.11) and playframework(2.3) and trying to run a query using a helper function to get results through pattern matching. The function is as follows def resultsfunc() = { val ...
Maniyan's user avatar
  • 35
1 vote
1 answer
336 views

This is a pretty basic issue but I couldn't find a solution after spending an hour on it. I'm trying to query database to get a list of values through Scala Anorm ORM. I want to convert the result to ...
Maniyan's user avatar
  • 35
1 vote
1 answer
152 views

Table structure - create table test (month integer, year integer, thresholds decimal(18,2) ); Static insert for simulation - insert into test(month,year,threshold) values(4,2021,100),(5,2021,98),(6,...
ForeverLearner's user avatar
0 votes
1 answer
80 views

I need to execute query in PostgreSQL using anorm. In order to handle authorization I have to set role along with query. My query is as follows. set role myuser; select country from country_list This ...
Bill Goldberg's user avatar
0 votes
0 answers
54 views

I was trying to parse some different SQL queries using one anorm parser. Some of the queries will return a,b,c as their result. Eventually, one of the query will return a,b,c,d,e. The result is ...
Sachin verma's user avatar
0 votes
0 answers
92 views

We have a use-case where we need to pivot the result set of a query to columns for insert statement. For that, we are using crosstab which takes text sql as a parameter. so the query might ...
Alex A.'s user avatar
  • 2,620
0 votes
1 answer
125 views

I am trying to create this SQL statement with Anorm in Scala. I am using a Postgres DB. insert into my_table (coords) values (ST_GeomFromText('POINT(26.9484 24.03937)',4326) I have tried this code: ...
David MacCallum's user avatar
0 votes
1 answer
79 views

Is there a way to use Anorm like a regular ORM? I'd like to have a method that just inserts an element provided. def insert[T](element: T)(implicit connection: Connection) = { element.insert(...
Dmitry  Meshkov's user avatar
1 vote
1 answer
134 views

I'm trying to link 2 tables together and return json from it, unfortunatly the documentations and online are not very clear about this, so if you know how to solve this please provide a snippet that I ...
fosowe's user avatar
  • 61
1 vote
2 answers
653 views

I'm getting a runtime exception when trying to insert a JSON string into a JSON column. The string I have looks like """{"Events": []}""", the table has a column defined as status JSONB NOT NULL. I ...
CPS's user avatar
  • 536
1 vote
1 answer
222 views

I would like to import anorm dependencies on to my scala play frame work project but it doesn't support on my current scala version. What should I do? libraryDependencies += "com.typesafe.play" %% "...
koko ka's user avatar
  • 117
3 votes
1 answer
424 views

I have been trying to execute an update query for my PostgreSQL database using Anorm with Play Framework 2.6 in Scala. The query works fine in pgAdmin so I am not sure what is going wrong here. I only ...
Jerry Hu's user avatar
  • 145
0 votes
0 answers
99 views

We have a gigantic table and we need to add a type column to it. Technically the column suppose to be not nullable, but the migration of updating everything (150M records) is a bit crazy. So we ...
Alex A.'s user avatar
  • 2,620
1 vote
1 answer
104 views

I want to write an anorm.ToStatement instance for generic enumeratum.values.ValueEnumEntry[ValueType]. But seems like ValueType is not inferred correctly. My code: import java.sql.PreparedStatement ...
user2474144's user avatar
0 votes
1 answer
88 views

I cannot parse float value in play framework, It gives me a compilation error. So from database I get value as float but it can not determine value as float and gives error of anorm of float....
priyanka patel's user avatar
1 vote
1 answer
520 views

I have 2 case classes like this : case class ClassTeacherWrapper( success: Boolean, classes: List[ClassTeacher] ) 2nd one :...
PriyalChaudhari's user avatar
0 votes
0 answers
63 views

In Scala anorm with MySQL, it seems joining more than once the same table in a query and working with aliases only returns the value of the last table included in the query. It seems the last join ...
John's user avatar
  • 5,474
0 votes
1 answer
178 views

I have a large query that seems to be a prime candidate for streaming results. I would like to make a call to a function, which returns an object which I can apply additional map transformations on,...
Jeremy Schiff's user avatar
1 vote
1 answer
177 views

In my Play (Scala) application I need to call procedures having IN and OUT params. Can't find any example anywhere !! I am using Play 2.5x (DB is Oracle).
NKM's user avatar
  • 684
0 votes
2 answers
162 views

I am using Anorm (2.5.1) in my Play+Scala application (2.5.x, 2.11.11). I keep facing the issue quite often where if the case class argument value is None, I don't want that parameter value to be ...
NKM's user avatar
  • 684
1 vote
1 answer
367 views

I would like to understand how to best handle exceptions with Anorm using Scala's Try and match features Given a query database.withConnection { implicit c => SQL("Select 1").execute() } How ...
Rob's user avatar
  • 19
1 vote
0 answers
124 views

Is there a way to convert an anorm result to an Iterator (hacky solutions are fine)? I'm fine with getting an Iterator[Row] or Iterator[MyTypeAfterDeser]. If not is there a hook to get from anorm the ...
eugen's user avatar
  • 5,916
2 votes
0 answers
86 views

I am doing as follows with anorm: val name = "john" val age = 30 val params: Seq[NamedParameter] = List(NamedParameter("name", name), NamedParameter("age", age)) SQL"insert into person (name, age) ...
David Portabella's user avatar
1 vote
1 answer
301 views

I have a simple case class Amount as below case class Amount(value: Long, currency: Currency) And an accompanying object to convert a string currency code into a Currency object object Amount { ...
Arjun Mukherjee's user avatar
8 votes
1 answer
188 views

Almost all guides/tutorials that I've seen only show how to parse values from columns that are directly available in the database. For example, the following is a very common pattern, and I ...
satnam's user avatar
  • 1,435
2 votes
1 answer
624 views

I'm currently using Scala with the Play Framework and Anorm to access my database. I've been mostly a Ruby developer and still have to get used to the new concepts like dependency injection which Play ...
Chris's user avatar
  • 1,048
2 votes
2 answers
657 views

One common problem we have in our codebase is that people forget to check if a list is empty before using it in an in clause. For example (in Scala with Anorm): def exists(element: String, list: ...
cdmckay's user avatar
  • 32.4k
0 votes
1 answer
286 views

I have implemented reading serialized object with plain JDBC, and now want to use Anorm 2.3.8. Plain JDBC Scala code is as bellow: def loadModel(rName: String, rPdbCode: String) = { //Connection ...
Laeeq's user avatar
  • 365
0 votes
0 answers
273 views

I have Java lib for SQL query builder. Builder returns: String -> sql query with param placeholders Map<String,Object> -> map of named parameters. When I use the builder in SCALA, I get ...
Bublik's user avatar
  • 930
1 vote
1 answer
290 views

I have a small Anorm query which is returning all the rows in the Service Messages table in my database. I would eventually like to turn each of these rows into JSON. However, currently all I am ...
user avatar
-1 votes
1 answer
296 views

the following code prints all rows using scala anorm: import anorm._ val query = s"select col_str, col_num from mytable" val rowParser: RowParser[~[String, Int]] = SqlParser.str(1) ~ SqlParser.int(...
David Portabella's user avatar
2 votes
1 answer
1k views

This is the query that I am executing in Postgres via JDBC using Anorm: val sql = s"select row_to_json(t) as result from tablename t;" The returned object for this query is of type PGObject, which ...
Federico's user avatar
  • 4,000
2 votes
1 answer
344 views

I am just trying to implement generated parser in scalaAnorm. My code is something like this ... def selectExample(): Unit = { case class memberInfo(member_id: BigInt, first_name: String,last_name:...
Biswajit's user avatar
  • 333
0 votes
0 answers
209 views

I'm trying to write this sql query with Anorm(Postgres): SELECT * FROM employee WHERE id = 1 AND length(ee_json #>> '{path1,paht2}') BETWEEN 0 and 1; It should be something like this: SQL( ...
lielran's user avatar
  • 199
0 votes
1 answer
216 views

I use Scala Anorm for a project and I like to write parsers for case classes. I then reuse these parsers for other queries - typically when adding a JOIN. Now sometimes, I expect an optional value (i....
John's user avatar
  • 5,474
1 vote
1 answer
679 views

I'm getting "Unresolved dependencies" when trying to install Anorm. Note: Unresolved dependencies path: [warn] com.typesafe.play:anorm_2.11:2.5.4 (C:\Users\rod\GDrive\projects\webalvin\build....
rodbs's user avatar
  • 195
0 votes
2 answers
531 views

I find myself in need of inserting a sequence of elements with a sequence of nested elements into a PostgreSQL database, preferably with a single statement, because I am returning a Future. I am using ...
MyrionSC2's user avatar
  • 1,318
1 vote
0 answers
220 views

I am new to Play Framework and created the DB connection in Play Framework and made some mistakes. I created the database in my models and its shows some error while compiling I ain't know what I have ...
arvind grey's user avatar
1 vote
2 answers
138 views

I have been reading the section Streaming results in Play docs. What I expected to find is a way to create a Scala Stream based on the results, so if I create a run that returns 10,000 rows that need ...
Bob Dem's user avatar
  • 1,031
0 votes
1 answer
822 views

i'm running play 2.3 and have no way to update ... whil i'm trying to parse jsonb column i get the error play - Cannot invoke the action, eventually got an error: java.lang.RuntimeException: ...
Nils's user avatar
  • 367
1 vote
0 answers
413 views

Is there way to log Anorm statements before execution. Currently I'm logging statements via JDBC driver trick: application.conf: db.default.driver="com.mysql.jdbc.Driver" db.default.url="jdbc:mysql:/...
Levijatanu's user avatar
2 votes
1 answer
568 views

Using scala play anorm and mysql, I try to make a sql query, filtering using a LIKE operator: import java.sql.Connection import anorm._ Class.forName("com.mysql.jdbc.Driver").newInstance() implicit ...
David Portabella's user avatar
1 vote
0 answers
334 views

i need to define anorm implicit conversion for lists of UUIDs in this code sample: case class users( name = String ) val userParser: RowParser[users]= { get[String]("name") map { ...
Nils's user avatar
  • 367
2 votes
0 answers
90 views

executing this query fails with OutOfMemoryError if the table is too big: import anorm._ Class.forName("com.mysql.jdbc.Driver").newInstance() implicit val conn = java.sql.DriverManager.getConnection(...
David Portabella's user avatar
0 votes
1 answer
811 views

I'm trying to create a dynamic query with dynamic parameters in anorm. That's why I need the parameters I'm working with, as a List. Following the doc Scala Anorm 2.5.x This is the parser that I'm ...
Gastón Schabas's user avatar
2 votes
1 answer
2k views

I have a pretty large result set (60k+ records columns) that I am pulling from a database and parsing with Anorm (though I can use play's default data access module that returns a ResultSet if needed)....
Elephantopus's user avatar

1
2 3 4 5
8