Skip to content

Instantly share code, notes, and snippets.

@eishay
Created May 2, 2016 22:46
Show Gist options
  • Save eishay/ab254bfad52dbd7380c891821d63ebfe to your computer and use it in GitHub Desktop.
Save eishay/ab254bfad52dbd7380c891821d63ebfe to your computer and use it in GitHub Desktop.
trait DataBaseComponent {
// the actual Slick driver (e.g. H2 or MySQL)
val Driver: ExtendedDriver
// dialect specific to this driver for functions that Slick does not support
// Usage will be discussed in future blog post
val dialect: DatabaseDialect[_]
// A database instance for which connections can be created.
// Encapsulates either a DataSource or parameters for DriverManager.getConnection().
val handle: SlickDatabase
// MySQL and H2 have different preferences on casing the table and column names.
// H2 specifically prefers upper case
def entityName(name: String): String = name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment