# Procédures

Chaque procédure se trouve dans le schéma `core` de l'application, renvoie un `VARIANT` et s'appelle avec `CALL TOMBA.core.<procedure>(...)`. Passez des objets (pas des chaînes JSON) pour les arguments `VARIANT`, par exemple `{'domain': 'WEBSITE'}`.

## Outils sur une table

| Procédure                                                                                                                                                    | Ce qu'elle fait                                                             | Rôle         |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------ |
| `find_emails(input_table STRING, domain_column STRING, first_name_column STRING, last_name_column STRING, output_table STRING, max_rows INT DEFAULT 100000)` | [Email Finder sur une table](/snowflake/tools/email-finder)               | `app_public` |
| `verify_emails(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                   | [Email Verifier sur une table](/snowflake/tools/email-verifier)           | `app_public` |
| `search_domains(input_table STRING, domain_column STRING, output_table STRING, max_rows INT DEFAULT 100000, emails_per_domain INT DEFAULT 10)`               | [Domain Search sur une table](/snowflake/tools/domain-search)             | `app_public` |
| `enrich_emails(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                   | [Email Enrichment sur une table](/snowflake/tools/email-enrichment)       | `app_public` |
| `enrich_people(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                   | [Person Enrichment sur une table](/snowflake/tools/person-enrichment)     | `app_public` |
| `enrich_companies(input_table STRING, domain_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                               | [Company Enrichment sur une table](/snowflake/tools/company-enrichment)   | `app_public` |
| `enrich_combined(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                 | [Combined Enrichment sur une table](/snowflake/tools/combined-enrichment) | `app_public` |
| `find_emails_from_linkedin(input_table STRING, url_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                         | [LinkedIn Finder sur une table](/snowflake/tools/linkedin-finder)         | `app_public` |
| `find_authors(input_table STRING, url_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                      | [Author Finder sur une table](/snowflake/tools/author-finder)             | `app_public` |
| `find_phones(input_table STRING, email_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                                     | [Phone Finder sur une table](/snowflake/tools/phone-finder)               | `app_public` |
| `validate_phones(input_table STRING, phone_column STRING, output_table STRING, max_rows INT DEFAULT 100000, country_code_column STRING DEFAULT '')`          | [Phone Validator sur une table](/snowflake/tools/phone-validator)         | `app_public` |
| `find_similar_domains(input_table STRING, domain_column STRING, output_table STRING, max_rows INT DEFAULT 100000)`                                           | [Similar Domains sur une table](/snowflake/tools/similar-domains)         | `app_public` |

## Outils sur une valeur

| Procédure                                                          | Ce qu'elle fait                                                              | Rôle         |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------- | ------------ |
| `email_finder(domain STRING, first_name STRING, last_name STRING)` | [Email Finder pour une valeur](/snowflake/tools/email-finder)               | `app_public` |
| `email_verifier(email STRING)`                                     | [Email Verifier pour une valeur](/snowflake/tools/email-verifier)           | `app_public` |
| `domain_search(domain STRING, emails_per_domain INT DEFAULT 10)`   | [Domain Search pour une valeur](/snowflake/tools/domain-search)             | `app_public` |
| `email_enrichment(email STRING)`                                   | [Email Enrichment pour une valeur](/snowflake/tools/email-enrichment)       | `app_public` |
| `person_enrichment(email STRING)`                                  | [Person Enrichment pour une valeur](/snowflake/tools/person-enrichment)     | `app_public` |
| `company_enrichment(domain STRING)`                                | [Company Enrichment pour une valeur](/snowflake/tools/company-enrichment)   | `app_public` |
| `combined_enrichment(email STRING)`                                | [Combined Enrichment pour une valeur](/snowflake/tools/combined-enrichment) | `app_public` |
| `linkedin_finder(url STRING)`                                      | [LinkedIn Finder pour une valeur](/snowflake/tools/linkedin-finder)         | `app_public` |
| `author_finder(url STRING)`                                        | [Author Finder pour une valeur](/snowflake/tools/author-finder)             | `app_public` |
| `phone_finder(email STRING)`                                       | [Phone Finder pour une valeur](/snowflake/tools/phone-finder)               | `app_public` |
| `phone_validator(phone STRING, country_code STRING DEFAULT '')`    | [Phone Validator pour une valeur](/snowflake/tools/phone-validator)         | `app_public` |
| `similar_finder(domain STRING)`                                    | [Similar Domains pour une valeur](/snowflake/tools/similar-domains)         | `app_public` |

## N'importe quel outil

| Procédure                                                                                                        | Ce qu'elle fait                                                                                                   | Rôle         |
| ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------ |
| `run_tool(tool STRING, input_table STRING, columns VARIANT, output_table STRING, max_rows INT, options VARIANT)` | [N'importe quel outil sur une table, avec un mappage de colonnes et des options](/snowflake/enrich-a-table#other-input-combinations) | `app_public` |
| `lookup(tool STRING, params VARIANT)`                                                                            | Une recherche avec n'importe quel outil et n'importe quelles entrées                                                                            | `app_public` |
| `search_companies(filters VARIANT, output_table STRING, max_results INT DEFAULT 500)`                            | [Les entreprises qui correspondent à des filtres, dans une table](/snowflake/tools/companies-search)                                  | `app_public` |

## Exécutions en arrière-plan et reprise

| Procédure                                                                                                              | Ce qu'elle fait                                                                          | Rôle         |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------ |
| `run_tool_async(tool STRING, input_table STRING, columns VARIANT, output_table STRING, max_rows INT, options VARIANT)` | [`run_tool` en arrière-plan ; renvoie l'ID d'exécution](/snowflake/background-runs)        | `app_public` |
| `search_companies_async(filters VARIANT, output_table STRING, max_results INT DEFAULT 500)`                            | [`search_companies` en arrière-plan](/snowflake/background-runs)                    | `app_public` |
| `cancel_run(run_id STRING)`                                                                                            | [Arrête une exécution en cours ou en file d'attente](/snowflake/background-runs#cancel)                     | `app_public` |
| `resume_run(run_id STRING)`                                                                                            | [Reprend une exécution arrêtée](/snowflake/resume-and-auto-resume)                           | `app_public` |
| `set_auto_resume(run_id STRING, enabled BOOLEAN)`                                                                      | [Active ou désactive la reprise automatique d'une exécution](/snowflake/resume-and-auto-resume#auto-resume) | `app_public` |
| `resume_pending()`                                                                                                     | Reprend immédiatement toutes les exécutions marquées pour la reprise automatique (l'application l'exécute chaque jour)                   | `app_public` |
| `process_jobs()`                                                                                                       | Démarre les exécutions en arrière-plan en file d'attente (l'application l'exécute automatiquement)                          | `app_public` |

## Planifications

| Procédure                                                                                                                           | Ce qu'elle fait                                                     | Rôle         |
| ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------------ |
| `create_schedule(name STRING, tool STRING, input_table STRING, columns VARIANT, output_table STRING, cron STRING, options VARIANT)` | [Garde une table enrichie selon une planification CRON](/snowflake/schedules) | `app_admin`  |
| `list_schedules()`                                                                                                                  | Les planifications et leur dernière exécution                                     | `app_public` |
| `pause_schedule(name STRING)`                                                                                                       | Met une planification en pause                                                 | `app_admin`  |
| `resume_schedule(name STRING)`                                                                                                      | Relance une planification en pause                                        | `app_admin`  |
| `run_schedule(name STRING)`                                                                                                         | Exécute une planification immédiatement                                               | `app_public` |
| `drop_schedule(name STRING)`                                                                                                        | Supprime une planification (sa table est conservée)                              | `app_admin`  |

## Utilitaires

| Procédure                                | Ce qu'elle fait                                                                              | Rôle         |
| ---------------------------------------- | ----------------------------------------------------------------------------------------- | ------------ |
| `status()`                               | Version de l'application, approbation de la connexion, essai, limite quotidienne                                      | `app_public` |
| `list_tools()`                           | Tous les outils avec leurs entrées, options, crédits et colonnes                                  | `app_public` |
| `pricing()`                              | [Prix par crédit et crédits par outil](/snowflake/pricing-and-limits)                    | `app_public` |
| `usage_summary(days INT DEFAULT 30)`     | [Exécutions, crédits et montants facturés par jour et par outil](/snowflake/results-and-history#usage-by-day) | `app_public` |
| `get_settings()`                         | [Paramètres actuels](/snowflake/reference/settings)                                         | `app_public` |
| `set_setting(name STRING, value STRING)` | [Modifie un paramètre](/snowflake/reference/settings)                                         | `app_admin`  |
| `clear_cache(tool STRING DEFAULT '')`    | [Oublie les résultats en cache d'un outil ('' pour tous)](/snowflake/cache-and-budgets)             | `app_admin`  |
| `drop_result(output_table STRING)`       | [Supprime une table de résultats](/snowflake/results-and-history)                                     | `app_public` |
| `reset_credentials()`                    | Fait se reconnecter l'application à Tomba lors de sa prochaine recherche                                        | `app_admin`  |

Vues : `TOMBA.core.runs` (toutes les exécutions) et `TOMBA.core.usage_by_day`. Voir [Résultats et historique](/snowflake/results-and-history).
