Get the Most Out of Your Salesforce SOQL and SOSL Queries With AI
Chat with Salesforce using AI, generate schema-aware SOQL and SOSL, optimize searches with Deep Analysis and validate or explain Salesforce queries.
Supported Salesforce SOSL versions:
All versions
Combining advanced AI models with Salesforce, you can move faster and more safely while getting more value from your org's data and search.
Chat with Your Salesforce Data Using SOQL and SOSL
SQLAI uses advanced AI models to turn natural-language questions into Salesforce Object Query Language (SOQL) and Salesforce Object Search Language (SOSL). In a long-running conversation, follow-up questions can refine filters, relationship queries and search terms or explore a question in more detail without starting over. This ensures that you always get exactly what you want and helps you better understand what the generated query does.
SOQL is the right choice for precise queries against a known object and its relationships. SOSL is the right choice for full-text search across one or more objects. SQLAI keeps both languages in context so you can move between a record query and a search without losing the thread.
SQLAI does not execute generated SOQL or SOSL against your Salesforce org today. Review the query in the conversation, then run it in Developer Console, Workbench, the Salesforce CLI or your application. Result rows are never added to the conversation automatically, but you can include a sample or summary in a follow-up if you want the model to consider it.
See how Text-to-SQL turns a plain-language question into a query.
Import a Salesforce Schema
A Salesforce schema can be pasted or uploaded as object and field lists, JSON, CSV or documentation, or described to the AI parser in plain language. Direct connection is not available for Salesforce. You can also select Salesforce SOQL or Salesforce SOSL without attaching a schema. The public API engine names are soql and sosl; see all supported databases and versions.
The imported schema and optional database rules give the AI context about your objects, fields and relationships, helping it generate accurate, relevant SOQL and SOSL. Rules are a useful place to record the API version, managed-package namespaces, naming conventions, sharing and field-level-security expectations, large-data-volume objects, and which fields are searchable. SQLAI is built for large Salesforce object models: you don't have to trim your schema or paste it into every prompt, and the AI stays focused on the objects and fields that matter for your question as the org grows. Learn more about how SQLAI keeps your database context in every chat.
See importing a Salesforce schema in action.
Optimize Salesforce SOQL and SOSL Queries With Deep Analysis
The SQL optimizer reviews slow or noisy Salesforce queries and suggests rewrites intended to make them more selective, improve relevance and reduce the risk of hitting governor limits.
For SOQL, the most useful levers are filtering on indexed fields, avoiding leading wildcards and non-selective filters, using relationship queries instead of extra round trips, and limiting the number of returned rows. For SOSL, the levers are choosing the right search scope, narrowing RETURNING objects and fields, adding WHERE filters, and limiting results. Broad searches across every object are expensive and often return more than the user needs.
Optional deep analysis can compare a baseline and proposed rewrite using advanced evaluation matrices. This provides even more accurate optimization suggestions. The rewrite and its performance should still be verified against the production workload.
Salesforce's Query Plan tool shows leading operations, relative cost and cardinality for SOQL. For SOSL, the search index and org configuration determine what is actually searchable. The Developer Console and debug logs help confirm both. See deep analysis in the SQL optimizer on a sample query.
Validate Salesforce SOQL and SOSL Queries
The SQL validator performs an in-depth review of potential syntax and semantic issues, including invalid object or field names, relationship-name errors, type mismatches, malformed search terms and constructs that differ between SOQL, SOSL and standard SQL. It explains findings and can suggest corrected queries. Schema context can help with checking objects and relationships, but validation does not guarantee that a query matches the intended result.
Run the SQL validator on a query of your own.
Explain Salesforce SOQL and SOSL Queries
The SQL explainer breaks down an existing SOQL or SOSL query, including the object or search target, filters, relationship traversal or RETURNING clause, aggregate functions and returned fields. Follow-up questions can focus on a particular clause, a search-scope choice or potential edge case.
Run the SQL explainer on a query you want to understand.
Share Salesforce Schemas and Threads
An imported Salesforce schema can be shared with teammates, who can use its objects, fields and rules in their own chats. Only the owner can edit the database configuration. There is no live Salesforce connection to share today, so teammates work from the shared schema rather than a live org.
Chat threads can be shared by invitation or link as read-only transcripts. Recipients can review the conversation, but only the owner can continue it. Query result rows are not saved in the thread.
Frequently Asked Questions
Do I Need a Live Salesforce Connection to Use SQLAI?
No, and direct connections are not available for Salesforce today. Import the schema by pasting object and field lists, JSON, CSV or documentation, or let AI parse a description of your org. You can also select Salesforce SOQL or Salesforce SOSL without attaching a schema.
Does SQLAI Run Queries Against My Org Automatically?
No. SQLAI does not execute generated SOQL or SOSL against Salesforce today. Generated queries are for you to review and run in Developer Console, Workbench or your application. Result rows are not added to a chat thread automatically.
Can SQLAI Handle Large Salesforce Object Models?
Yes. SQLAI is designed for large schemas with many objects and fields. You can keep your whole object model imported, and responses stay focused on the objects and fields that matter as it grows. Learn more about how SQLAI keeps your database context in every chat.
Which Salesforce API Versions Are Supported?
There is no version picker for Salesforce, so the supported databases page lists the engines as covering all versions. SOQL and SOSL behavior and available fields depend on the org's API version, so record the API version and any managed-package namespaces in the database rules.
When Should I Use SOQL Instead of SOSL?
Use SOQL for precise queries against a known object and its relationships, and SOSL for full-text search across one or more objects. SOQL uses relationship traversal instead of joins and returns records; SOSL uses FIND ... RETURNING and returns search results. SQLAI keeps them as separate API engines so the generated syntax matches the job.
Review Before Production
AI-generated SOQL and SOSL can contain errors. Queries should be reviewed and their results, selectivity, search relevance and governor-limit impact tested in a sandbox or a low-risk org before production use. Check field-level security, sharing rules, query-plan cost, searchable fields and large-data-volume behavior.