Created
February 2, 2018 15:21
-
-
Save chrisfauerbach/45275f1d234b935c9b3ff650ecf215ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func nameExists(name string) { | |
retval boolean := false | |
database, err = sql.Open("postgres", "postgres://chris@localhost") | |
if err != nil { | |
log.Fatal(err) | |
} | |
r, _ := database.Query("SELECT EMAIL FROM BLACKLIST WHERE EMAIL = $1", name) | |
for r.Next() { | |
var curName string | |
r.Scan(&curName) | |
retval = true | |
} | |
r.Close() | |
writeJSON(rw, 200, namesInDb) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment