Skip to content

Commit

Permalink
README have been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Satendra Kumar committed Aug 16, 2015
1 parent f5a5611 commit ca4d2cd
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# slick-for-production

This is sbt project. You need to install [sbt](http://www.scala-sbt.org/) if you dont have.

Clone project

```$ git clone https://github.com/satendrakumar06/slick-for-production.git```

```$ cd slick-for-production```

```$ sbt clean compile```

Run unit test:

``` $ sbt test ```

Unit tests have used h2 database.If you want run demo app so you need to create database in MySQL.

Follow these steps:

login into mysql server then:

```mysql> create database bank_db;```

```mysql> use bank_db;```

```mysql> CREATE TABLE bank(id int PRIMARY KEY auto_increment,name varchar(200));```

```mysql>CREATE TABLE bankinfo(id int PRIMARY KEY auto_increment,owner varchar(200),bank_id int references bank(id),branches int );```

```mysql> CREATE TABLE bankproduct(id int PRIMARY KEY auto_increment,name varchar(200),bank_id int references bank(id));```

Now you can run app:

```$ sbt run ```
you will see this outut

```info] Running com.knol.db.Demo
[INFO] - [2015-08-16 18:42:25,070] - [com.zaxxer.hikari.HikariDataSource] HikariCP pool mysql is starting.
List((Bank(ICICI bank,Some(1)),Some(BankInfo(Goverment,1000,1,Some(1)))), (Bank(SBI Bank,Some(2)),None))
List((Bank(ICICI bank,Some(1)),Some(BankProduct(car loan,1,Some(1)))), (Bank(SBI Bank,Some(2)),None))```

0 comments on commit ca4d2cd

Please sign in to comment.