# Quickstart

Five minutes from install to results. This assumes you have [installed the app](./installation) as `TOMBA`
and approved the Tomba API connection.

## 1. Look up one value

```sql
CALL TOMBA.core.email_verifier('jane.doe@acme.com');
```

The result is a `VARIANT` with `status`, the `results` (here the verification columns), the `credits` used and
the amount charged. Single lookups are the quickest way to see what a tool returns.

## 2. Create a small table

```sql
CREATE OR REPLACE TABLE my_db.public.leads (COMPANY_DOMAIN STRING, FIRST_NAME STRING, LAST_NAME STRING);
INSERT INTO my_db.public.leads VALUES
    ('acme.com', 'Jane', 'Doe'),
    ('globex.com', 'John', 'Smith');

GRANT USAGE ON DATABASE my_db TO APPLICATION TOMBA;
GRANT USAGE ON SCHEMA my_db.public TO APPLICATION TOMBA;
GRANT SELECT ON TABLE my_db.public.leads TO APPLICATION TOMBA;
```

## 3. Run a tool over the table

```sql
CALL TOMBA.core.find_emails('MY_DB.PUBLIC.LEADS', 'COMPANY_DOMAIN', 'FIRST_NAME', 'LAST_NAME',
                            'LEADS_FOUND', 100);
```

The arguments are the input table, the columns holding the domain, first and last name, the name of the
output table, and `max_rows`. The call returns a summary: rows read, found, not found, credits and the amount
charged.

## 4. Read the results

```sql
SELECT INPUT_DOMAIN, INPUT_FIRST_NAME, INPUT_LAST_NAME, EMAIL, SCORE, VERIFICATION_STATUS, POSITION
  FROM TOMBA.results.LEADS_FOUND
 WHERE lookup_status = 'found';
```

Every output table keeps your input values (`INPUT_…` columns) so you can join the results back.

## 5. Keep a copy in your database

```sql
CREATE TABLE my_db.public.leads_with_emails AS
  SELECT * FROM TOMBA.results.LEADS_FOUND;
```

## Next

- The same steps without SQL: [The Streamlit app](./streamlit-app)
- Every tool, step by step: the **Tutorials** section
- Large tables: [Background runs](./background-runs) and [Resume](./resume-and-auto-resume)
