auth

Paddy 2015-03-21 Child:8267e1c8bcd1

148:06fb735031bb Go to Latest

auth/postgres.go

Do a first, naive pass at storing profiles in Postgres. This is untested against an actual database. It's a best-guess attempt at SQL. It _should_ work. I think. Start storing things in Postgres, starting with Profiles and Logins. This necessitates the addition of a Deleted property to the Profile type, because I'm not deleting those in case of accidental deletion. Logins, though, we'll delete. This also necessitates updating the profileStore interface to no longer have a deleteProfile method, because we're tracking that through updates now. Then we need to update our profileStore tests, because they no longer clean up after themselves. Which, come to think of it, may cause some problems later.

History
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/postgres.go	Sat Mar 21 01:23:33 2015 -0400
     1.3 @@ -0,0 +1,11 @@
     1.4 +package auth
     1.5 +
     1.6 +import (
     1.7 +	"database/sql"
     1.8 +
     1.9 +	_ "github.com/lib/pq"
    1.10 +)
    1.11 +
    1.12 +type postgres struct {
    1.13 +	db *sql.DB
    1.14 +}