UNPKG

@cocalc/server

Version:

CoCalc server functionality: functions used by either the hub and the next.js server

13 lines (11 loc) 329 B
import getPool from "@cocalc/database/pool"; export default async function isAccountAvailable( email_address: string ): Promise<boolean> { const pool = getPool("medium"); const { rows } = await pool.query( "SELECT account_id FROM accounts WHERE email_address=$1", [email_address] ); return rows.length == 0; }