hesql-0.0: example/Account.hesql
module Account.DB where
-- see README for the table definitions
verifyLogin login' password' =
select1' Accountid, Login, RealName, Email from Account
where (password is null or password = md5(password')) and Lower(Login) = login'
and not Locked
login accountid' =
update Account set LoggedIn = true where AccountID = accountid'
logout acountid' =
update Account
set LoggedIn = false,
LastLogout = Now()
where AccountID = accountid'
createAccount login password email realname =
insert into Account (Login, Password, Email, RealName) values (login,md5(password),email,realname)
activeUsers =
select Login from Account
where LoggedIn and
now() - LastRequest < '00:05:00'