-
-
Notifications
You must be signed in to change notification settings - Fork 401
Add examples of mill + cask + scalasql #4924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chaitanyawaikar
wants to merge
15
commits into
com-lihaoyi:main
Choose a base branch
from
chaitanyawaikar:feature/add_examples_with_scalasql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a3db4d1
Add examples of mill + cask + scalasql
chaitanyawaikar 5d3053f
[autofix.ci] apply automated fixes
autofix-ci[bot] 6fd4641
Remove comment
chaitanyawaikar 59f3845
Add documentation for example 10-todo-webapp-cask-scalasql
chaitanyawaikar f3a7d78
Introduce example for http4s + scalasql
chaitanyawaikar 6e8c44c
[autofix.ci] apply automated fixes
autofix-ci[bot] dc6846e
Add documentation link for 11-todo-http4s-scalasql
chaitanyawaikar d39cc7d
Merge branch 'main' into feature/add_examples_with_scalasql
chaitanyawaikar cb409d3
Add tests and documentation for the module `11-todo-http-scalasql`
chaitanyawaikar 0599fb4
[autofix.ci] apply automated fixes
autofix-ci[bot] 0765a09
Merge branch 'main' into feature/add_examples_with_scalasql
chaitanyawaikar 39a33ec
Add integration tests for `10-todo-webapp-cask-scalasql` module
chaitanyawaikar 56eefc3
[autofix.ci] apply automated fixes
autofix-ci[bot] 7d4049e
Changing build.mill to get rid of the CI error
chaitanyawaikar bcb32c5
[autofix.ci] apply automated fixes
autofix-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
example/scalalib/web/10-todo-webapp-cask-scalasql/build.mill
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package build | ||
|
||
import mill._, scalalib._ | ||
|
||
object `package` extends RootModule with ScalaModule { | ||
def scalaVersion = "2.13.8" | ||
|
||
override def ivyDeps = Agg( | ||
ivy"com.lihaoyi::cask:0.9.1", | ||
ivy"com.lihaoyi::scalatags:0.13.1", | ||
ivy"com.lihaoyi::upickle:3.1.0", | ||
ivy"com.lihaoyi::scalasql:0.1.19", | ||
ivy"com.h2database:h2:2.2.224" | ||
) | ||
|
||
object test extends ScalaTests { | ||
def testFramework = "utest.runner.Framework" | ||
|
||
override def ivyDeps = Agg( | ||
ivy"com.lihaoyi::utest:0.8.5", | ||
ivy"com.lihaoyi::requests:0.6.9", | ||
ivy"com.dimafeng::testcontainers-scala-postgresql:0.43.0", | ||
ivy"com.dimafeng::testcontainers-scala-scalatest:0.43.0", | ||
ivy"org.testcontainers:postgresql:1.19.1" | ||
) | ||
} | ||
} | ||
|
||
// This example demonstrates how to set up a simple Scala webserver | ||
// implementing the popular Todo-MVC demo application. It uses the | ||
// Cask web framework to handle HTTP requests and Scalasql to interact | ||
// with an in-memory H2 database. It includes a test suite | ||
// that spins up the web server locally, creates a postgres testcontainer | ||
// and makes HTTP requests against it. | ||
|
||
/** Usage | ||
* | ||
* > ./mill test | ||
* + webapp.WebAppTests.simpleRequest... | ||
* | ||
* > ./mill runBackground | ||
* | ||
* > curl http://localhost:8080 | ||
* ...What needs to be done... | ||
* ... | ||
* | ||
* > ./mill clean runBackground | ||
* | ||
*/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have one
test
suite using H2 in memory and oneintegration
suite using PostgreSQL via testcontainers.