Slick: why should I save "Unit" in my database?

I am new to Scala and Slick and was surprised at something in the Slick documentation:

The following primitive types are supported out of the box for the JDBC Database in JdbcProfile

  • ...
  • Unit
  • ...

I do not understand why this list contains Unit . In my opinion, Unit is similar to Java void , which I cannot save and not receive from my database. What is his intention?

: you can find here .

+6
source share
1 answer

One way to take a look at Slick is to run the Scala code in your database as an execution engine. We are working on extending Scala code over time. An expression containing a block, for example. in the tuple is a valid Scala expression and, therefore, Slick should be launched if there is no good reason why not. Therefore, we support the unit.

0
source

Source: https://habr.com/ru/post/970125/


All Articles