Simon
Simon

Reputation: 6452

Run a postgresql function in Play! framework

I want to create some Postgresql (9.3) functions like "upsert" for my application in Play! Scala 2.2. I have tested one of them in the console and it worked great, but when I add it to evolutions (1.sql file) I get an error :

unterminated dollar-quoted string at or near "$$.

(I can show you the function but I'm not sure that it will help since I'm sure that the function is valid.)

I tried to end my function by ";;" instead of ";" as mentioned here : a similar SO question but without result.

So I'm asking you, what is the standard way to run SQL functions in Play ?

By the way, I will have several postgresql functions and it won't be clear if I let all of them in the 1.sql file, so is there a way to write them in other files ?

Upvotes: 2

Views: 334

Answers (1)

Simon
Simon

Reputation: 6452

I finally found a solution: as mentioned in this thread, you need to replace ";" by ";;" but not only at the end of the function but for every ";".

Upvotes: 1

Related Questions