func RemoveApiKey(db *sql.DB, apiKey string) (bool, error) {
	err := checkKeyFormat(apiKey)
	if err != nil {
		return false, fmt.Errorf("api key rejected: %s", err)
	}

	// Delete the key from the database
	deleteSQL := `DELETE FROM api_keys WHERE apiKey = ?`
	statement, err := db.Prepare(deleteSQL)
	result, err := statement.Exec(apiKey)
	if err != nil {
		return false, fmt.Errorf("failed to remove api key from db: %s", err)
	}
	nRows, err := result.RowsAffected()

	return nRows == 1, err
}
// RemoveApiKey removes a given key from the keys table. Invalid keys are rejected.
RemoveApiKey removes a given key from the keys table. Invalid keys are rejected.
// RemoveApiKey removes a given key from the keys table . Invalid keys are rejected .
func RemoveApiKey(db *sql.DB, apiKey string) (bool, error) {
	err := checkKeyFormat(apiKey)
	if err != nil {
		return false, fmt.Errorf("api key rejected: %s", err)
	}
	deleteSQL := `DELETE FROM api_keys WHERE apiKey = ?`
	statement, err := db.Prepare(deleteSQL)
	result, err := statement.Exec(apiKey)
	if err != nil {
		return false, fmt.Errorf("failed to remove api key from db: %s", err)
	}
	nRows, err := result.RowsAffected()
	return nRows == 1, err
}
func RemoveApiKey ( db * sql . DB , apiKey string ) ( bool , error ) { err := checkKeyFormat ( apiKey ) if err != nil { return false , fmt . Errorf ( " " , err ) } deleteSQL := `DELETE FROM api_keys WHERE apiKey = ?` statement , err := db . Prepare ( deleteSQL ) result , err := statement . Exec ( apiKey ) if err != nil { return false , fmt . Errorf ( " " , err ) } nRows , err := result . RowsAffected ( ) return nRows == 1 , err }
RemoveApiKey removes a given key from the keys table.
RemoveApiKey removes a given key from the keys table .
// Delete the key from the database