Apps can register SQL access to be used by the app. This is useful for apps that need to query the database for data.There are 2 types of SQL access:
Pre-defined SQL queries: These are predefined SQL SELECT queries that are declared in the app manifest. The app can then execute these queries with the API.
Tables permissions: This is a special type of SQL access that allows the app to connect directly to the database with the MySQL protocol and access specific tables with read / write permissions. This should be used with caution and only when necessary. It is recommended to use this access for apps who need to import their data (Google Ads clicks etc…).
Pre-defined SQL queries
Declaring your queries in the app manifest.json allows the app to be more secure and performant. The app can also be more easily audited for security and performance.
... "sql_access": { "predefined_queries": [ { "id": "appx_default_sql_query_1", "type": "select", "name": "SQL query 1", "description": "Example of predefined SQL query. For security reasons, use predefined queries to just fetch the data you needs", "query": "SELECT * FROM `user` WHERE external_id = ?", "test_args": ["auth-54-22"] } ... ], } ...
When the app has tables permissions, the app can connect to the database with the MySQL protocol.The SQL credentials (host, port, user, password, database) are provided by the API by calling the endpoint:GET htttps://API_ENDPOINT/api/app.get?workspace_id=acme_workspace1&id=appx_myapp
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Rimdian documentation","colors":{"primary":"#4E6CFF","light":"#4E6CFF","dark":"#4E6CFF"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/rimdian/JFZ7IIAz3hb1kgaO/logo/rimdian.svg?fit=max\u0026auto=format\u0026n=JFZ7IIAz3hb1kgaO\u0026q=85\u0026s=8ea541a473648cbcbe39a9a0c217c060","dark":"https://mintcdn.com/rimdian/JFZ7IIAz3hb1kgaO/logo/rimdian.svg?fit=max\u0026auto=format\u0026n=JFZ7IIAz3hb1kgaO\u0026q=85\u0026s=8ea541a473648cbcbe39a9a0c217c060","href":"https://www.rimdian.com"},"appearance":{"default":"light","strict":true},"navbar":{"links":[{"label":"Support","href":"mailto:support@rimdian.com"}],"primary":{"type":"button","label":"Console","href":"https://eu.rimdian.com/"}},"footer":{"socials":{"github":"https://github.com/rimdian"}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"rimdian","hasAudioNarration":false,"actualSubdomain":"rimdian","customDomains":["docs.rimdian.com"],"gitSource":{"type":"github","owner":"rimdian","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae91d34c3f4a6a9b4d30c31:success","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Documentation","count":72},{"language":"default","tag":"Data import schemas","count":16},{"language":"default","tag":"Self-hosted deployment","count":12},{"language":"default","tag":"Apps development","count":9},{"language":"default","tag":"Get Started","count":8},{"language":"default","tag":"API Reference","count":6},{"language":"default","tag":"Featured apps","count":6},{"language":"default","tag":"Data Collector API","count":3},{"language":"default","tag":"Integration","count":3},{"language":"default","tag":"Authentication","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","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":"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":"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":"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":"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":"turbopuffer-dual-write","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":"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":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"apps-development/sql-access","slug":"/apps-development/sql-access","pageMetadata":{"title":"App SQL Access","sidebarTitle":"SQL Access","description":null,"icon":"magnifying-glass","iconType":"duotone","href":"/apps-development/sql-access"},"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={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Apps can register SQL access to be used by the app. This is useful for apps that need to query the database for data.`}),`\n`,_jsx(_components.p,{children:`There are 2 types of SQL access:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Pre-defined SQL queries`}),`: These are predefined SQL `,_jsx(_components.code,{children:`SELECT`}),` queries that are declared in the app manifest. The app can then execute these queries with the API.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Tables permissions`}),`: This is a special type of SQL access that allows the app to connect directly to the database with the MySQL protocol and access specific tables with read / write permissions. This should be used with caution and only when necessary. It is recommended to use this access for apps who need to import their data (Google Ads clicks etc…).`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`pre-defined-sql-queries`,children:`Pre-defined SQL queries`}),`\n`,_jsxs(_components.p,{children:[`Declaring your queries in the app `,_jsx(_components.a,{href:`/apps-development/app-manifest-reference`,children:`manifest.json`}),` allows the app to be more secure and performant. The app can also be more easily audited for security and performance.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sql_access\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"predefined_queries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"appx_default_sql_query_1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"select\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SQL query 1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Example of predefined SQL query. For security reasons, use predefined queries to just fetch the data you needs\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:'\"SELECT * FROM `user` WHERE external_id = ?\"'}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"test_args\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"auth-54-22\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#82071E`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#F44747`,\"--shiki-dark-font-style\":`inherit`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`usage-in-the-app`,children:`Usage in the app`}),`\n`,_jsxs(_components.p,{children:[`You can `,_jsx(_components.a,{href:`/api-references/server/app-exec-query`,children:`execute a pre-defined SQL query`}),` by calling the `,_jsx(_components.code,{children:`POST /api/app.execQuery`}),` API endpoint with:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"workspace_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"acme_workspace1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"app_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"app_myapp1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"app_myapp1_get_user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"args\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user_123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`tables-permissions`,children:`Tables permissions`}),`\n`,_jsxs(_components.p,{children:[`By default, all the custom app tables declared in the app manifest.json are available with read \u0026 write permissions `,_jsx(_components.code,{children:`SELECT`}),`, `,_jsx(_components.code,{children:`INSERT`}),`, `,_jsx(_components.code,{children:`UPDATE`}),`, `,_jsx(_components.code,{children:`DELETE`}),`.`]}),`\n`,_jsxs(Tip,{children:[`Rimdian’s tables (user, session, pageview…) are only available with read (`,_jsx(_components.code,{children:`SELECT`}),`) permissions.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sql_access\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"tables_permissions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"table\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"read\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"table\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"session\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"read\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`sql-credentials`,children:`SQL credentials`}),`\n`,_jsx(_components.p,{children:`When the app has tables permissions, the app can connect to the database with the MySQL protocol.`}),`\n`,_jsx(_components.p,{children:`The SQL credentials (host, port, user, password, database) are provided by the API by calling the endpoint:`}),`\n`,_jsx(_components.p,{children:_jsx(_components.code,{children:`GET htttps://API_ENDPOINT/api/app.get?workspace_id=acme_workspace1\u0026id=appx_myapp`})})]})}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":"App SQL Access","sidebarTitle":"SQL Access","description":null,"icon":"magnifying-glass","iconType":"duotone","href":"/apps-development/sql-access"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Pre-defined SQL queries","slug":"pre-defined-sql-queries","depth":2,"children":[{"title":"Usage in the app","slug":"usage-in-the-app","depth":3,"children":[]}]},{"title":"Tables permissions","slug":"tables-permissions","depth":2,"children":[{"title":"SQL credentials","slug":"sql-credentials","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"rimdian","siteName":"Rimdian documentation","title":"App SQL Access - Rimdian documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T23:45:57.235Z","originalFileLocation":"apps-development/sql-access.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";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=\"light\"}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=\"application-name\" content=\"Rimdian documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_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/rimdian/AgdtqbpqDlwGGaqX/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"App SQL Access - Rimdian documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Rimdian documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.rimdian.com/apps-development/sql-access\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://rimdian.mintlify.site/_mintlify/api/og/v2?division=Apps+development\u0026amp;title=App+SQL+Access\u0026amp;theme=73b6ba06ad8ba00751c8ca66\u0026amp;signature=c588670b0840ea04a3769ab1b08d1bd32afb40c4057037e70725ff53624e317f\">\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=\"App SQL Access - Rimdian documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://rimdian.mintlify.site/_mintlify/api/og/v2?division=Apps+development\u0026amp;title=App+SQL+Access\u0026amp;theme=73b6ba06ad8ba00751c8ca66\u0026amp;signature=c588670b0840ea04a3769ab1b08d1bd32afb40c4057037e70725ff53624e317f\">\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/rimdian/AgdtqbpqDlwGGaqX/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Rimdian documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#4E6CFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.rimdian.com/apps-development/sql-access\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/apps-development/sql-access.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.rimdian.com/#organization\",\"name\":\"Rimdian documentation\",\"url\":\"https://docs.rimdian.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/rimdian/JFZ7IIAz3hb1kgaO/logo/rimdian.svg?fit=max\u0026auto=format\u0026n=JFZ7IIAz3hb1kgaO\u0026q=85\u0026s=8ea541a473648cbcbe39a9a0c217c060\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.rimdian.com#website\",\"name\":\"Rimdian documentation\",\"url\":\"https://docs.rimdian.com\",\"publisher\":{\"@id\":\"https://docs.rimdian.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.rimdian.com/apps-development/sql-access#webpage\",\"url\":\"https://docs.rimdian.com/apps-development/sql-access\",\"name\":\"App SQL Access\",\"dateModified\":\"2026-01-06T23:45:57.235Z\",\"isPartOf\":{\"@id\":\"https://docs.rimdian.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.rimdian.com/apps-development/sql-access#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.rimdian.com/apps-development/sql-access#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Apps development\",\"item\":\"https://docs.rimdian.com/apps-development/getting-started\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"App SQL Access\",\"item\":\"https://docs.rimdian.com/apps-development/sql-access\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.rimdian.com/apps-development/sql-access#article\",\"headline\":\"App SQL Access\",\"name\":\"App SQL Access\",\"url\":\"https://docs.rimdian.com/apps-development/sql-access\",\"mainEntityOfPage\":{\"@id\":\"https://docs.rimdian.com/apps-development/sql-access#webpage\"},\"dateModified\":\"2026-01-06T23:45:57.235Z\",\"publisher\":{\"@id\":\"https://docs.rimdian.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.rimdian.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Rimdian documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Rimdian documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/apps-development/sql-access.md","siteName":"Rimdian documentation","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Introduction","icon":"hand-wave","href":"/introduction"},{"title":"Architecture","icon":"ruler-triangle","iconType":"duotone","href":"/architecture"},{"title":"Data lifecycle","icon":"arrows-rotate","iconType":"duotone","href":"/data-lifecycle"},{"title":"User-identity resolution","iconType":"duotone","icon":"object-intersect","href":"/user-identity-resolution"},{"title":"Multi-touch attribution","iconType":"duotone","icon":"arrow-pointer","href":"/multi-touch-attribution"},{"title":"User segmentation","icon":"shapes","iconType":"duotone","href":"/user-segmentation"},{"title":"Marketing automation","iconType":"duotone","icon":"code-merge","href":"/marketing-automation"},{"title":"Apps","icon":"grid-2-plus","iconType":"duotone","href":"/apps"}]},{"group":"Featured apps","pages":[{"title":"Featured apps","sidebarTitle":"Overview","icon":"angles-right","iconType":"duotone","href":"/apps/overview"},{"title":"Google Ads","sidebarTitle":"Google Ads","icon":"google","iconType":"duotone","href":"/apps/google-ads"},{"title":"Meta Conversions API","sidebarTitle":"Meta Conversions API","icon":"meta","iconType":"duotone","href":"/apps/meta-conversions-api"},{"title":"Shopify","sidebarTitle":"Shopify","icon":"shopify","iconType":"duotone","href":"/apps/shopify"},{"title":"WooCommerce","sidebarTitle":"WooCommerce","icon":"wordpress","iconType":"duotone","href":"/apps/woocommerce"},{"title":"Affilae","sidebarTitle":"Affilae","icon":"angle-right","iconType":"duotone","href":"/apps/affilae"}]},{"group":"Integration","pages":[{"title":"Integration overview","sidebarTitle":"Overview","icon":"toggle-on","iconType":"duotone","href":"/integration/overview"},{"title":"Workspace configuration","sidebarTitle":"Configuration","icon":"sliders-simple","iconType":"duotone","href":"/integration/workspace-configuration"},{"title":"JavaScript SDK","iconType":"duotone","icon":"code","href":"/integration/javascript-sdk"}]},{"group":"Apps development","pages":[{"title":"Create your first app","sidebarTitle":"Getting started","icon":"play","iconType":"duotone","href":"/apps-development/getting-started"},{"title":"Private app installation","icon":"square-plus","iconType":"duotone","href":"/apps-development/private-app-installation"},{"title":"App tasks","sidebarTitle":"Tasks","icon":"check-double","iconType":"duotone","href":"/apps-development/tasks"},{"title":"App data hooks","sidebarTitle":"Data hooks","description":null,"icon":"webhook","iconType":"duotone","href":"/apps-development/data-hooks"},{"title":"App SQL Access","sidebarTitle":"SQL Access","icon":"magnifying-glass","iconType":"duotone","href":"/apps-development/sql-access"},{"title":"App extra columns","sidebarTitle":"Extra columns","description":null,"icon":"line-columns","iconType":"duotone","href":"/apps-development/extra-columns"},{"title":"App tables","sidebarTitle":"Extra tables","icon":"database","iconType":"duotone","href":"/apps-development/tables"},{"title":"App Cube schemas","sidebarTitle":"Cube schemas","icon":"cube","iconType":"duotone","href":"/apps-development/cube-schemas"},{"title":"Manifest.json reference","sidebarTitle":"Manifest.json","icon":"file","iconType":"duotone","href":"/apps-development/app-manifest-reference"}]}]},{"tab":"Data import schemas","pages":[{"title":"Data import schemas","href":"/data-import-schemas/introduction"}]},{"tab":"Self-hosted deployment","pages":[{"title":"Self-hosted deployment","href":"/self-hosted-deployment/overview"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-references/introduction"}]}]},{"anchor":"News","icon":"angles-right","pages":[{"title":"News","href":"/about/news"}]}]},"basePath":"","title":"App SQL Access - Rimdian documentation","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}