"use strict";(self.webpackChunknewoaks_help=self.webpackChunknewoaks_help||[]).push([[9283],{3952:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/report-db-1-5486ed9460f3398f7df6881bbc7fb3e2.png"},7266:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/report-db-3-2955140f14c0fd50692239538f243a4e.png"},7771:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/report-db-2-69039788b486cb89fee2d30746216bbe.png"},8175:(e,t,n)=>{n.d(t,{A:()=>r});n(6540);var s=n(4848);function r(){return(0,s.jsx)("code",{children:"EZsite"})}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>o});var s=n(6540);const r={},a=s.createContext(r);function i(e){const t=s.useContext(a);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),s.createElement(a.Provider,{value:t},e.children)}},8772:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>d,default:()=>p,frontMatter:()=>o,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"getting-started/report-db","title":"Set Up Text to report Database","description":"Enable Database","source":"@site/userGuide/getting-started/009.report-db.md","sourceDirName":"getting-started","slug":"/getting-started/report-db","permalink":"/guides/user/getting-started/report-db","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":10,"frontMatter":{"sidebar_position":10},"sidebar":"sidebar","previous":{"title":"Set Up Custom Database","permalink":"/guides/user/getting-started/set-up-custom-db"},"next":{"title":"Apply for Claude API Tier 4 Account","permalink":"/guides/user/getting-started/apply-claude"}}');var r=n(4848),a=n(8453),i=n(8175);const o={sidebar_position:10},d="Set Up Text to report Database",l={},c=[{value:"Enable Database",id:"enable-database",level:2},{value:"Configure Database Connection String",id:"configure-database-connection-string",level:2},{value:"Use Report Database",id:"use-report-database",level:2},{value:"IP Whitelist",id:"ip-whitelist",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"set-up-text-to-report-database",children:"Set Up Text to report Database"})}),"\n",(0,r.jsx)(t.h2,{id:"enable-database",children:"Enable Database"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["In the ",(0,r.jsx)(i.A,{}),", enter your project and click the ",(0,r.jsx)(t.strong,{children:"Database"})," button in the top right corner.\n",(0,r.jsx)(t.img,{alt:"set custom db",src:n(3952).A+"",width:"1511",height:"953"})]}),"\n",(0,r.jsxs)(t.li,{children:["Turn on the ",(0,r.jsx)(t.strong,{children:"Enable Database"})," switch."]}),"\n",(0,r.jsxs)(t.li,{children:["Select the ",(0,r.jsx)(t.strong,{children:"Text To Report"})," option for Database Type.\n",(0,r.jsx)(t.img,{alt:"set custom db",src:n(7771).A+"",width:"1020",height:"721"})]}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"configure-database-connection-string",children:"Configure Database Connection String"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsxs)(t.li,{children:["Click the ",(0,r.jsx)(t.strong,{children:"Add database Connection"})," button."]}),"\n",(0,r.jsx)(t.li,{children:"Complete the form information."}),"\n",(0,r.jsxs)(t.li,{children:["Click the ",(0,r.jsx)(t.strong,{children:"Save"})," button."]}),"\n",(0,r.jsxs)(t.li,{children:["Here's an PostgreSQL example:\n",(0,r.jsx)(t.img,{alt:"set custom db",src:n(7266).A+"",width:"1017",height:"721"})]}),"\n"]}),"\n",(0,r.jsx)(t.p,{children:"PS:"}),"\n",(0,r.jsxs)(t.ol,{children:["\n",(0,r.jsx)(t.li,{children:"For security reasons, your database connection string should have read-only permissions set for the database."}),"\n",(0,r.jsx)(t.li,{children:"You can add multiple database connections."}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"use-report-database",children:"Use Report Database"}),"\n",(0,r.jsx)(t.p,{children:"Here's an example:"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{children:"Use sales_order data to make a financial report to count the sales of each product each month.\n"})}),"\n",(0,r.jsx)(t.p,{children:"PS: sales_order is the table name in your database"}),"\n",(0,r.jsx)(t.h2,{id:"ip-whitelist",children:"IP Whitelist"}),"\n",(0,r.jsxs)(t.p,{children:["For the complete list of IP addresses that can access your custom database, please refer to our ",(0,r.jsx)(t.a,{href:"/developer/webhook/trigger-ip",children:"IP Whitelist documentation"}),"."]})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}}}]);