개간단 ㅇㅇ


(defn make-site-owner [email name password data]

  (with-db-connection

    (execute! ["INSERT INTO site_owner (email, name, pwhash, data) VALUES (?, ?, crypt(?, gen_salt('bf', 8)), ?::JSONB)"

                     email name password (json/encode data)])))


(defn find-site-owner [email password]

  (with-db-connection

    (query ["SELECT id, email, name, activep, ctime, data FROM site_owner WHERE email = ? AND pwhash = crypt(?, pwhash)"

            email password])))