1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: db db.tuples db.types accessors
4 furnace.auth.providers kernel continuations
6 IN: furnace.auth.providers.db
10 { "username" "USERNAME" { VARCHAR 256 } +user-assigned-id+ }
11 { "realname" "REALNAME" { VARCHAR 256 } }
12 { "password" "PASSWORD" BLOB +not-null+ }
13 { "salt" "SALT" INTEGER +not-null+ }
14 { "email" "EMAIL" { VARCHAR 256 } }
15 { "ticket" "TICKET" { VARCHAR 256 } }
16 { "capabilities" "CAPABILITIES" FACTOR-BLOB }
17 { "profile" "PROFILE" FACTOR-BLOB }
18 { "deleted" "DELETED" INTEGER +not-null+ }
21 SINGLETON: users-in-db
23 M: users-in-db get-user
24 drop <user> select-tuple ;
26 M: users-in-db new-user
30 over username>> >>username
38 M: users-in-db update-user