There is a limit to the magic that Squeryl can perform here. Your model class takes a String value for password, and you are passing it a value of type SHA1 (the value that is returned from the sha1 function). The scala compiler isn't going to allow that. There are a couple of options here:
- Hash the password before sending it to the db
- Insert your User with a null value for the password, then update it in the same transaction with the password hashed via your function
- If you are using Squeryl 0.9.6-SNAPSHOT, you might create a SHAString custom type that handles hashing the string when it is sent to the DB
To hash the password before you insert it, look at java.security.MessageDigest
and see this answer.