slick-codegen-example | code example shows how to setup sbt | Build Tool library
kandi X-RAY | slick-codegen-example Summary
kandi X-RAY | slick-codegen-example Summary
This code example shows how to setup sbt to use Slick's preconfigued code-generator for working with an existing database schema. build.sbt enables automatically as well as manually triggered (with sbt slick) code-generation. src/main/scala/Example.scala uses the generated code. The code is generated into file target/scala-2.11/src_managed/slick/demo/Tables.scala, which can be changed in the sbt script. It is usally wise to keep the generated Slick code under version control. Use sbt run to run the demo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of slick-codegen-example
slick-codegen-example Key Features
slick-codegen-example Examples and Code Snippets
Community Discussions
Trending Discussions on slick-codegen-example
QUESTION
I generated source code using the method described here
https://github.com/slick/slick-codegen-example/blob/master/build.sbt
This method works and now when I do compile
I can see that the auto-generated Target.scala file is being successfully compiled as Tables.class
but in my source code, If I try to import the autogenerated class file. it says cannot resolve symbol demo
ANSWER
Answered 2017-Jan-08 at 08:56This is caused by IntelliJ
can't recognize the generated code, you can try to mark target/scala-2.11/src_managed/slick/
this as Sources Root. like:
QUESTION
I am reading this sample which shows me how to generate source code using Slick-CodeGen
https://github.com/slick/slick-codegen-example/blob/master/build.sbt
And while this sample, is good, I want to modify it so that it reads the database config from application.conf using typesafe config.
Otherwise I will have to replicate the database connection configuration here and also in application.conf file.
Does anyone know, how can this sample be modified so that we can use the typesafe config to read the config values from application.conf?
Edit: Based on the suggestion below, I tried the following
I created a file called build.sbt
in the project folder
ANSWER
Answered 2017-Jan-07 at 18:57Declare a dependency on Typesafe Config in project/build.sbt
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install slick-codegen-example
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page