Discuss or ask a question
Installing tales
Follow the steps over here to install tales
Once tales is installed, go to command prompt and create a new app using the following command
tales new gf
A new folder gf is create will application files on it
cd to the gf directory and type
tales run
The web server will start on port 8000
open browser and go to http://localhost:8000 you should see the welcome page.
Connecting to Db
Open fan/Settings.fan. In the main method, and add a db setting like this
using tales
class Settings : tales::Settings{
  override Void main(){
    add(DbSetting{
      hostString = "connnecton string"
      driver = "Driver class"
      username = "username"
      password = "password"
    })
  }
}
Change the driver, user name and password and host-string to match you database. Make sure you've added the driver jar to fan/lib/java/ext. For ex. if you use mysql.
  1. Copy mysql-xx driver.jar to fan/lib/java/ext/
  2. add the following setting
    add(DbSetting{
    	hostString = "jdbc:mysql://localhost:3306/db"
    	driver = "com.mysql.jdbc.Driver"
    	username = "username"
    	password = "password"
    })
That's it. Let's start creating the table and model classes