Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Renato Cavalcanti
@octonato
no, I want to make it optional
Marius B. Kotsbak
@mkotsbak
oki
Renato Cavalcanti
@octonato
JdbcProfileProvider is not being replicated
in this example, there is only one but the drive type is abstract
only when you ‘bake’ your cake you define the driver
Marius B. Kotsbak
@mkotsbak
oki
I tried a simple cake baking, but it failed:
object ScoringModelH2 extends ScoringModel {
    override type jdbcProfileProvider = H2ProfileProvider
}

trait ScoringModel {
    type jdbcProfileProvider <: JdbcProfileProvider

    object UserRepo extends EntityActions with jdbcProfileProvider {
class type required but ScoringModel.this.jdbcProfileProvider found
Ideas why that fails?
Renato Cavalcanti
@octonato
because you are trying to extends an abstract type
think about that:
```
can you write such a thing?
object Foo extends T
Where T is not a class or trait, but just type ascription
Marius B. Kotsbak
@mkotsbak
Hm no, but the cake example does archive the same just in a more complex way?
Renato Cavalcanti
@octonato
no, it’s not the same
you mixin the ConfiguredProfileProvider
not the abstract type
Marius B. Kotsbak
@mkotsbak
Ok, yes there is some magic there through the parent class
But anyway the general cake layer classes could be part of the general library for optional use if you want
So that you don't need to copy paste it into your project or add other dependencies
Renato Cavalcanti
@octonato
I may consider it, but my first feeling is that people build cakes in different ways and with or without DI frameworks like Macwire or Scaldi
but I’ll consider reintroducing it
Marius B. Kotsbak
@mkotsbak
oki
Marius B. Kotsbak
@mkotsbak
Ok, would be nice to have examples on how to use them too if they are compatible
But another issue, I have a type issue on the return type from save()
Compiler does not think its the same as the case class
Renato Cavalcanti
@octonato
you need to paste an example here and the compiler error
Marius B. Kotsbak
@mkotsbak
Sorry
I was mapping when I should have flatMapped. Probably should use for expressions for other than trivial cases :)
Marius B. Kotsbak
@mkotsbak
@rcavalcanti Is there another way to get the Query type, or should it maybe be part of ActiveSlick?: type QueryType = Query[ScoreTable, Score, Seq]
It is useful for composing queries to use it as parameter
Renato Cavalcanti
@octonato
@mkotsbak sorry, I missed that question. That sounds insteresting
do you have a working example?
Send a PR and I will have a look, thanks
Marius B. Kotsbak
@mkotsbak
Renato Cavalcanti
@octonato
I think you mean type parameters and type members
yes, it’s possible. You can always alias a type parameter so you can access it by type projections later on
This message was deleted
Marius B. Kotsbak
@mkotsbak
Japp, can't that just be included in EntityActions companion object so that you could optionally write:
object CoffeeRepo extends EntityActions.For[Coffee, Int, CoffeeTable] with H2ProfileProvider {..}
To avoid the debate about using type parameters or members
Renato Cavalcanti
@octonato
the problem here is de CoffeeTable
you can’t have it defined outside because you need the driver from the profile provider
if you define if outside you can’t swap drivers anymore
Marius B. Kotsbak
@mkotsbak
ah japp
So we could have `object CoffeeRepo extends EntityActions.For[Coffee, Int] with H2ProfileProvider {..} then
Renato Cavalcanti
@octonato
could be. Do you have a working example?
Please, send a PR. I’ll certainlly have a look
razeetg
@razeetg
Hi everyone,
Can someone help me with a query please?
Renato Cavalcanti
@octonato
@razeetg, better to ask on the Slick channel. This project is not active anymore