Connect to SQL databases for direct data access and manipulation
The SQL integration allows you to connect directly to SQL databases, enabling you to fetch data from tables or custom queries, and perform CRUD operations on your data.
Authentication
SQL connections are configured through your warehouse connections (Snowflake, BigQuery, or Redshift). No additional authentication is required.
SQL actions
Search records
Retrieve multiple records from a table with filtering and sorting.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
Filter
Define filter conditions
Sort
Sort results
Limit
Maximum records to retrieve (default: 100)
Insert record
Insert a new record into a table.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
Mappings
Map column values
Update records
Update existing records in a table.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
Matching Value
Value to match against
Matching column
Column to match on
Mappings
Map columns to update
Upsert records
Insert or update records based on a matching column.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
Matching Value
Value to match against
Matching column
Column to match on
Mappings
Map column values
Delete records
Delete records from a table.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
Matching Value
Value to match against
Matching column
Column to match on
Delete operations are permanent. Ensure you have proper filters configured.
Data models
Fetch table
Create data models directly from database tables.Configuration
Field
Description
Database
The database name
Schema
The schema name
Table
The table name
ID
Column containing unique record IDs
Title
Column containing record display titles
Fetch query
Create data models from custom SQL queries.Configuration
Field
Description
SQL
The SQL query to execute
ID
Column containing unique record IDs
Title
Column containing record display titles
Use fetch query for complex joins, aggregations, or filtered views of your
data.
Best practices
Index your columns - Ensure columns used in filters and joins are properly indexed
Limit result sets - Always use appropriate limits to avoid pulling excessive data
Use views for complex queries - Consider creating database views for frequently used complex queries
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Cargo | Go-to-Market Infrastructure for Coding Agents","description":"Build and operate your go-to-market on Cargo from your terminal: unified data models, tools, plays, AI agents, alerts, and a full GTM as Code project, driven from Claude Code, Codex, or Cursor through the Cargo agent skills over the cargo-ai CLI. A new account starts with 100 free credits for its first 30 days, and no card.","colors":{"primary":"#059669","light":"#6EE7B7","dark":"#059669"},"logo":{"light":"https://mintcdn.com/cargo/efZ_37fJlBv-Lg41/logo/light.png?fit=max\u0026auto=format\u0026n=efZ_37fJlBv-Lg41\u0026q=85\u0026s=2a7d71f348b4ddf8d7771b201239c9e6","dark":"https://mintcdn.com/cargo/efZ_37fJlBv-Lg41/logo/dark.png?fit=max\u0026auto=format\u0026n=efZ_37fJlBv-Lg41\u0026q=85\u0026s=b3a49702ceb839648891c665ee2589dd"},"favicon":{"light":"https://mintcdn.com/cargo/efZ_37fJlBv-Lg41/logo/light.png?fit=max\u0026auto=format\u0026n=efZ_37fJlBv-Lg41\u0026q=85\u0026s=2a7d71f348b4ddf8d7771b201239c9e6","dark":"https://mintcdn.com/cargo/efZ_37fJlBv-Lg41/logo/dark.png?fit=max\u0026auto=format\u0026n=efZ_37fJlBv-Lg41\u0026q=85\u0026s=b3a49702ceb839648891c665ee2589dd"},"navbar":{"links":[{"href":"mailto:engineering@getcargo.ai","label":"Support"}],"primary":{"type":"button","label":"Workspace","href":"https://app.getcargo.io"}},"footer":{"socials":{"github":"https://github.com/getcargohq","linkedin":"https://www.linkedin.com/company/cargo-hq"}},"seo":{"organization":{"name":"Cargo","url":"https://www.getcargo.ai","sameAs":["https://github.com/getcargohq","https://linkedin.com/company/cargo-hq","https://twitter.com/cargo_hq"]}},"markdown":{"instructions":["If you are an AI coding agent operating Cargo, install the agent skills first: paste `Install Cargo by following https://api.getcargo.io/INSTALL.md` into your session, or run `npx skills add getcargohq/cargo-skills`. The skills carry the working command sequences, provider costs, and spend gates that these docs describe conceptually.","The skills index at https://raw.githubusercontent.com/getcargohq/cargo-skills/main/llms.txt lists every skill, recipe, and provider playbook individually. Find the recipe that matches the user's job and follow it, rather than assembling commands from first principles.","Signing up is free: a new account starts with 100 free credits, valid for its first 30 days, and needs no card. `cargo-ai login --email you@company.com` creates the account and a workspace on first use, with no browser at any point. Tell the user this before asking them to sign up.","Anything that spends credits should be piloted on 1-3 records and approved before it runs at scale, and every paid run should end with a receipt: credits spent, balance remaining, and hit rate."]},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Youtube","icon":"youtube","href":"https://www.youtube.com/@cargohq"},{"anchor":"Community","icon":"slack","href":"https://www.getcargo.ai/community"},{"anchor":"Blog","icon":"newspaper","href":"https://www.getcargo.ai/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cargo","hasAudioNarration":false,"actualSubdomain":"cargo","customDomains":["docs.getcargo.ai"],"gitSource":{"type":"github","owner":"getcargohq","repo":"cargo","deployBranch":"master","contentDirectory":"apps/documentation","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6affcdd10d5875d90b246605","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"API Reference","count":389},{"language":"default","tag":"Integrations","count":298},{"language":"default","tag":"Documentation","count":68},{"language":"default","tag":"Resources","count":44},{"language":"default","tag":"Mailbox Management - Mailboxes","count":12},{"language":"default","tag":"Storage - Models","count":12},{"language":"default","tag":"Workspace Management - States","count":12},{"language":"default","tag":"Billing - Subscription","count":11},{"language":"default","tag":"Reference","count":10},{"language":"default","tag":"AI - Messages","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"integration/sql","slug":"/integration/sql","pageMetadata":{"title":"SQL","description":"Connect to SQL databases for direct data access and manipulation","href":"/integration/sql"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Connect to SQL databases for direct data access and manipulation\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={hr:`hr`,li:`li`,ol:`ol`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Heading,Table,Tip,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The SQL integration allows you to connect directly to SQL databases, enabling you to fetch data from tables or custom queries, and perform CRUD operations on your data.`}),`\n`,_jsx(Heading,{level:`2`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`SQL connections are configured through your warehouse connections (Snowflake, BigQuery, or Redshift). No additional authentication is required.`}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`sql-actions`,children:`SQL actions`}),`\n`,_jsx(Heading,{level:`3`,id:`search-records`,children:`Search records`}),`\n`,_jsx(_components.p,{children:`Retrieve multiple records from a table with filtering and sorting.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Filter`})}),_jsx(_components.td,{children:`Define filter conditions`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Sort`})}),_jsx(_components.td,{children:`Sort results`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Limit`})}),_jsx(_components.td,{children:`Maximum records to retrieve (default: 100)`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`insert-record`,children:`Insert record`}),`\n`,_jsx(_components.p,{children:`Insert a new record into a table.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Mappings`})}),_jsx(_components.td,{children:`Map column values`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`update-records`,children:`Update records`}),`\n`,_jsx(_components.p,{children:`Update existing records in a table.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching Value`})}),_jsx(_components.td,{children:`Value to match against`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching column`})}),_jsx(_components.td,{children:`Column to match on`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Mappings`})}),_jsx(_components.td,{children:`Map columns to update`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`upsert-records`,children:`Upsert records`}),`\n`,_jsx(_components.p,{children:`Insert or update records based on a matching column.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching Value`})}),_jsx(_components.td,{children:`Value to match against`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching column`})}),_jsx(_components.td,{children:`Column to match on`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Mappings`})}),_jsx(_components.td,{children:`Map column values`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`delete-records`,children:`Delete records`}),`\n`,_jsx(_components.p,{children:`Delete records from a table.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching Value`})}),_jsx(_components.td,{children:`Value to match against`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Matching column`})}),_jsx(_components.td,{children:`Column to match on`})]})]})]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Delete operations are permanent. Ensure you have proper filters configured.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`data-models`,children:`Data models`}),`\n`,_jsx(Heading,{level:`3`,id:`fetch-table`,children:`Fetch table`}),`\n`,_jsx(_components.p,{children:`Create data models directly from database tables.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Database`})}),_jsx(_components.td,{children:`The database name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Schema`})}),_jsx(_components.td,{children:`The schema name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Table`})}),_jsx(_components.td,{children:`The table name`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`ID`})}),_jsx(_components.td,{children:`Column containing unique record IDs`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Title`})}),_jsx(_components.td,{children:`Column containing record display titles`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`fetch-query`,children:`Fetch query`}),`\n`,_jsx(_components.p,{children:`Create data models from custom SQL queries.`}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Configuration`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`SQL`})}),_jsx(_components.td,{children:`The SQL query to execute`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`ID`})}),_jsx(_components.td,{children:`Column containing unique record IDs`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.strong,{children:`Title`})}),_jsx(_components.td,{children:`Column containing record display titles`})]})]})]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Use fetch query for complex joins, aggregations, or filtered views of your\ndata.`})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best practices`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Index your columns`}),` - Ensure columns used in filters and joins are properly indexed`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Limit result sets`}),` - Always use appropriate limits to avoid pulling excessive data`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use views for complex queries`}),` - Consider creating database views for frequently used complex queries`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"SQL","description":"Connect to SQL databases for direct data access and manipulation","href":"/integration/sql"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Authentication","slug":"authentication","depth":2,"children":[]},{"title":"SQL actions","slug":"sql-actions","depth":2,"children":[{"title":"Search records","slug":"search-records","depth":3,"children":[]},{"title":"Insert record","slug":"insert-record","depth":3,"children":[]},{"title":"Update records","slug":"update-records","depth":3,"children":[]},{"title":"Upsert records","slug":"upsert-records","depth":3,"children":[]},{"title":"Delete records","slug":"delete-records","depth":3,"children":[]}]},{"title":"Data models","slug":"data-models","depth":2,"children":[{"title":"Fetch table","slug":"fetch-table","depth":3,"children":[]},{"title":"Fetch query","slug":"fetch-query","depth":3,"children":[]}]},{"title":"Best practices","slug":"best-practices","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cargo","siteName":"Cargo | Go-to-Market Infrastructure for Coding Agents","title":"SQL - Cargo | Go-to-Market Infrastructure for Coding Agents","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-06T01:03:20.688Z","originalFileLocation":"integration/sql.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Connect to SQL databases for direct data access and manipulation\">\u003cmeta data-mint-head name=\"application-name\" content=\"Cargo | Go-to-Market Infrastructure for Coding Agents\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SQL - Cargo | Go-to-Market Infrastructure for Coding Agents\">\u003cmeta data-mint-head property=\"og:description\" content=\"Connect to SQL databases for direct data access and manipulation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Cargo | Go-to-Market Infrastructure for Coding Agents\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getcargo.ai/integration/sql\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cargo.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=SQL\u0026amp;description=Connect+to+SQL+databases+for+direct+data+access+and+manipulation\u0026amp;theme=ceb52810caf2f96ccfe78cf4\u0026amp;signature=164998734c8aadf9129b6839e955c23d2203537fed8a46b00265ab0637300b2a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SQL - Cargo | Go-to-Market Infrastructure for Coding Agents\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Connect to SQL databases for direct data access and manipulation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cargo.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=SQL\u0026amp;description=Connect+to+SQL+databases+for+direct+data+access+and+manipulation\u0026amp;theme=ceb52810caf2f96ccfe78cf4\u0026amp;signature=164998734c8aadf9129b6839e955c23d2203537fed8a46b00265ab0637300b2a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cargo/CnWLrJzUaA2MJMEk/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Cargo | Go-to-Market Infrastructure for Coding Agents\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#059669\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getcargo.ai/integration/sql\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integration/sql.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://www.getcargo.ai/#organization\",\"name\":\"Cargo\",\"url\":\"https://www.getcargo.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cargo/efZ_37fJlBv-Lg41/logo/light.png?fit=max\u0026auto=format\u0026n=efZ_37fJlBv-Lg41\u0026q=85\u0026s=2a7d71f348b4ddf8d7771b201239c9e6\"},\"sameAs\":[\"https://github.com/getcargohq\",\"https://linkedin.com/company/cargo-hq\",\"https://twitter.com/cargo_hq\"]},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getcargo.ai#website\",\"name\":\"Cargo | Go-to-Market Infrastructure for Coding Agents\",\"url\":\"https://docs.getcargo.ai\",\"publisher\":{\"@id\":\"https://www.getcargo.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getcargo.ai/integration/sql#webpage\",\"url\":\"https://docs.getcargo.ai/integration/sql\",\"name\":\"SQL\",\"description\":\"Connect to SQL databases for direct data access and manipulation\",\"dateModified\":\"2026-07-06T01:03:20.688Z\",\"isPartOf\":{\"@id\":\"https://docs.getcargo.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getcargo.ai/integration/sql#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getcargo.ai/integration/sql#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Integrations\",\"item\":\"https://docs.getcargo.ai/integration/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL\",\"item\":\"https://docs.getcargo.ai/integration/sql\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.getcargo.ai/integration/sql#article\",\"headline\":\"SQL\",\"name\":\"SQL\",\"description\":\"Connect to SQL databases for direct data access and manipulation\",\"url\":\"https://docs.getcargo.ai/integration/sql\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getcargo.ai/integration/sql#webpage\"},\"dateModified\":\"2026-07-06T01:03:20.688Z\",\"publisher\":{\"@id\":\"https://www.getcargo.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getcargo.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Cargo | Go-to-Market Infrastructure for Coding Agents\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Cargo\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integration/sql.md","siteName":"Cargo | Go-to-Market Infrastructure for Coding Agents","nav":{"global":{"anchors":[{"anchor":"Youtube","icon":"youtube","href":"https://www.youtube.com/@cargohq"},{"anchor":"Community","icon":"slack","href":"https://www.getcargo.ai/community"},{"anchor":"Blog","icon":"newspaper","href":"https://www.getcargo.ai/blog"}]},"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Integrations","groups":[{"group":"Integrations","pages":[{"title":"Overview","href":"/integration/overview"},{"title":"Custom Integration","href":"/integration/custom-integration"},{"title":"6sense","href":"/integration/6sense"},{"title":"Adyntel","href":"/integration/adyntel"},{"title":"AI Ark","href":"/integration/ai-ark"},{"title":"Airscale","href":"/integration/airscale"},{"title":"Albacross","href":"/integration/albacross"},{"title":"Amplitude","href":"/integration/amplitude"},{"title":"Amplemarket","href":"/integration/amplemarket"},{"title":"Anthropic","href":"/integration/anthropic"},{"title":"Apify","href":"/integration/apify"},{"title":"Anymail Finder","href":"/integration/anymail-finder"},{"title":"Apollo.io","href":"/integration/apolloio"},{"title":"Appfigures","href":"/integration/appfigures"},{"title":"Attio","href":"/integration/attio"},{"title":"Azure OpenAI","href":"/integration/azure-open-ai"},{"title":"BetterContact","href":"/integration/bettercontact"},{"title":"BigQuery","href":"/integration/big-query"},{"title":"BounceBan","href":"/integration/bounceban"},{"title":"Bouncer","href":"/integration/bouncer"},{"title":"Bright Data","href":"/integration/bright-data"},{"title":"Calendly","href":"/integration/calendly"},{"title":"Captain Data","href":"/integration/captain-data"},{"title":"Cargo","href":"/integration/cargo"},{"title":"Clay","href":"/integration/clay"},{"title":"Clearbit","href":"/integration/clearbit"},{"title":"ClearoutPhone","href":"/integration/clearout-phone"},{"title":"Cleon1","href":"/integration/cleon1"},{"title":"Close","href":"/integration/closecom"},{"title":"Cognism","href":"/integration/cognism"},{"title":"Company Enrich","href":"/integration/company-enrich"},{"title":"ContactOut","href":"/integration/contact-out"},{"title":"Contrast","href":"/integration/contrast"},{"title":"Coresignal","href":"/integration/coresignal"},{"title":"CSV","href":"/integration/csv"},{"title":"Customer.io","href":"/integration/customerio"},{"title":"Datachimp","href":"/integration/datachimp"},{"title":"Datagma","href":"/integration/datagma"},{"title":"dbt","href":"/integration/dbt"},{"title":"DeepSeek","href":"/integration/deep-seek"},{"title":"Devin","href":"/integration/devin"},{"title":"Dropcontact","href":"/integration/dropcontact"},{"title":"Email Bison","href":"/integration/email-bison"},{"title":"EnrichCRM","href":"/integration/enrich-crm"},{"title":"Enrichley","href":"/integration/enrichley"},{"title":"Enrow.io","href":"/integration/enrowio"},{"title":"Exa","href":"/integration/exa"},{"title":"Expandi.io","href":"/integration/expandi"},{"title":"FindyMail","href":"/integration/findy-mail"},{"title":"Firecrawl","href":"/integration/firecrawl"},{"title":"Forager","href":"/integration/forager"},{"title":"FullEnrich","href":"/integration/full-enrich"},{"title":"G2","href":"/integration/g2"},{"title":"Google Gemini","href":"/integration/gemini"},{"title":"GitHub","href":"/integration/github"},{"title":"Google Ads","href":"/integration/google-ads"},{"title":"Google Calendar","href":"/integration/google-calendar"},{"title":"Google Sheets","href":"/integration/google-sheets"},{"title":"HeyReach","href":"/integration/hey-reach"},{"title":"HTTP","href":"/integration/http"},{"group":"HubSpot","pages":[{"title":"Hubspot","href":"/integration/hubspot"},{"title":"Cargo app","href":"/integration/hubspot/app"}]},{"title":"HubSpot MCP","href":"/integration/hubspot-mcp"},{"title":"Hunter","href":"/integration/hunter"},{"title":"Icypeas","href":"/integration/icypeas"},{"title":"Implisense","href":"/integration/implisense"},{"title":"Instantly","href":"/integration/instantly"},{"title":"Instantly","href":"/integration/instantly-v2"},{"title":"Intercom","href":"/integration/intercom"},{"title":"Jira","href":"/integration/jira"},{"title":"Kaspr","href":"/integration/kaspr"},{"title":"Kitt","href":"/integration/kitt"},{"title":"LaGrowthMachine","href":"/integration/lgm"},{"title":"LeadMagic","href":"/integration/lead-magic"},{"title":"Lemlist","href":"/integration/lemlist"},{"title":"LinkedIn","href":"/integration/linkedin"},{"title":"LinkedIn Ads","href":"/integration/linkedin-ads"},{"title":"LinkedIn Matched Audiences","href":"/integration/linkedin-matched-audience"},{"title":"Linkup","href":"/integration/linkup"},{"title":"Livestorm","href":"/integration/livestorm"},{"title":"Lusha (deprecated)","href":"/integration/lusha"},{"title":"Lusha","href":"/integration/lusha-v3"},{"title":"Manus","href":"/integration/manus"},{"title":"Marketo","href":"/integration/marketo"},{"title":"Meta Ads","href":"/integration/meta-ads"},{"title":"Metabase","href":"/integration/metabase"},{"title":"Microsoft Teams","href":"/integration/microsoft-teams"},{"title":"Mixpanel","href":"/integration/mixpanel"},{"title":"Mixrank","href":"/integration/mixrank"},{"title":"Monaco","href":"/integration/monaco"},{"title":"NeverBounce","href":"/integration/never-bounce"},{"title":"NetSuite","href":"/integration/netsuite"},{"title":"Nooks","href":"/integration/nooks"},{"title":"Notion","href":"/integration/notion"},{"title":"Notion MCP","href":"/integration/notion-mcp"},{"title":"Ocean.io","href":"/integration/oceanio"},{"title":"Octave","href":"/integration/octave"},{"title":"OneSignal","href":"/integration/onesignal"},{"title":"OpenAI","href":"/integration/open-ai"},{"title":"Outreach","href":"/integration/outreach"},{"title":"Parallel","href":"/integration/parallel"},{"title":"People Data Labs","href":"/integration/people-data-labs"},{"title":"Perplexity","href":"/integration/perplexity"},{"title":"Phantombuster","href":"/integration/phantombuster"},{"title":"Pipecorn","href":"/integration/pipecorn"},{"title":"Pipedrive","href":"/integration/pipedrive"},{"title":"Piloterr","href":"/integration/piloterr"},{"title":"PostgreSQL","href":"/integration/postgresql"},{"title":"PredictLeads","href":"/integration/predict-leads"},{"title":"PromptLayer","href":"/integration/prompt-layer"},{"title":"Prospeo","href":"/integration/prospeo"},{"title":"ProxyCurl","href":"/integration/proxycurl"},{"title":"RB2B","href":"/integration/rb2b"},{"title":"Redshift","href":"/integration/redshift"},{"title":"Replicas","href":"/integration/replicas"},{"title":"Reverse Contact","href":"/integration/reverse-contact"},{"title":"Resend","href":"/integration/resend"},{"title":"Rift","href":"/integration/rift"},{"title":"RocketReach","href":"/integration/rocketreach"},{"title":"RSS Feed","href":"/integration/rss-feed"},{"title":"Sales Navigator","href":"/integration/sales-navigator"},{"title":"Salesforce","href":"/integration/salesforce"},{"title":"Salesforce MCP","href":"/integration/salesforce-mcp"},{"title":"SalesIntel","href":"/integration/sales-intel"},{"title":"Salesloft","href":"/integration/salesloft"},{"title":"Scrubby","href":"/integration/scrubby"},{"title":"SendGrid","href":"/integration/sendgrid"},{"title":"Serper","href":"/integration/serper"},{"title":"Slack","href":"/integration/slack"},{"title":"Smartlead.ai","href":"/integration/smartlead"},{"title":"Snitcher","href":"/integration/snitcher"},{"title":"Snov.io","href":"/integration/snov"},{"title":"Societe Info","href":"/integration/societe-info"},{"title":"Snowflake","description":"This page outlines how to use the Snowflake integration to create and manage your data warehouse in Cargo.","href":"/integration/snowflake"},{"title":"SQL","href":"/integration/sql"},{"title":"Store Leads","description":"Enrich e-commerce store data with Store Leads","href":"/integration/storeleads"},{"title":"Stripe","href":"/integration/stripe"},{"title":"Sumble","href":"/integration/sumble"},{"title":"Surfe","href":"/integration/surfe"},{"title":"TheirStack","href":"/integration/their-stack"},{"title":"Theneo","href":"/integration/theneo"},{"title":"The Swarm","href":"/integration/the-swarm"},{"title":"TypeSafe","href":"/integration/typesafe"},{"title":"Waterfall.io","href":"/integration/waterfall"},{"title":"Wiza","href":"/integration/wiza"},{"title":"X Ads","href":"/integration/x-ads"},{"title":"ZeroBounce","href":"/integration/zero-bounce"},{"title":"ZoomInfo","href":"/integration/zoominfo"},{"title":"ZoomInfo GTM","href":"/integration/zoominfo-gtm"}]}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"SQL - Cargo | Go-to-Market Infrastructure for Coding Agents","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}