1"use strict";(self.webpackChunkspring_ql=self.webpackChunkspring_ql||[]).push([[7771],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return m}});var r=n(67294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=r.createContext({}),p=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,s=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=p(n),m=i,f=d["".concat(s,".").concat(m)]||d[m]||c[m]||a;return n?r.createElement(f,o(o({ref:t},u),{},{components:n})):r.createElement(f,o({ref:t},u))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,o=new Array(a);o[0]=d;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:i,o[1]=l;for(var p=2;p<a;p++)o[p]=n[p];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},42394:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return s},default:function(){return m},frontMatter:function(){return l},metadata:function(){return p},toc:function(){return c}});var r=n(83117),i=n(80102),a=(n(67294),n(3905)),o=["components"],l={sidebar_position:1},s="SQL",p={unversionedId:"reference/sql/index",id:"version-0.16/reference/sql/index",title:"SQL",description:"This section describes the SQL language supported in SpringQL, including Data Definition Language (DDL), Data Manipulation Language (DML) and Query Language.",source:"@site/versioned_docs/version-0.16/reference/sql/index.md",sourceDirName:"reference/sql",slug:"/reference/sql/",permalink:"/0.16/reference/sql/",draft:!1,editUrl:"https://github.com/SpringQL/SpringQL.github.io/blob/main/versioned_docs/version-0.16/reference/sql/index.md",tags:[],version:"0.16",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Client API",permalink:"/0.16/reference/client-api"},next:{title:"Syntax",permalink:"/0.16/reference/sql/syntax"}},u={},c=[{value:"SQL interface",id:"sql-interface",level:2},{value:"SQL execution models",id:"sql-execution-models",level:2},{value:"DDL",id:"ddl",level:3},{value:"DML and query",id:"dml-and-query",level:3},{value:"Transactions",id:"transactions",level:3}],d={toc:c};function m(e){var t=e.components,n=(0,i.Z)(e,o);return(0,a.kt)("wrapper",(0,r.Z)({},d,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"sql"},"SQL"),(0,a.kt)("p",null,"This section describes the SQL language supported in SpringQL, including Data Definition Language (DDL), Data Manipulation Language (DML) and Query Language."),(0,a.kt)("p",null,"Currently, SpringQL supports quite limited subset of SQL standard."),(0,a.kt)("h2",{id:"sql-interface"},"SQL interface"),(0,a.kt)("p",null,"You pass SQLs to SpringQL using the following APIs."),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("strong",{parentName:"li"},"Rust"),(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("a",{parentName:"li",href:"https://docs.rs/springql-core/latest/springql_core/api/struct.SpringPipeline.html#method.command"},"SpringPipeline::command()")))),(0,a.kt)("li",{parentName:"ul"},"Other languages",(0,a.kt)("ul",{parentName:"li"},(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("inlineCode",{parentName:"li"},"spring_command()"))))),(0,a.kt)("h2",{id:"sql-execution-models"},"SQL execution models"),(0,a.kt)("h3",{id:"ddl"},"DDL"),(0,a.kt)("p",null,"We currently support ",(0,a.kt)("inlineCode",{parentName:"p"},"CREATE")," statements for DDL."),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"CREATE")," statements modify the pipeline to change the dataflow.\nIt takes effect immediately after the DDL is issued via APIs."),(0,a.kt)("admonition",{type:"tip"},(0,a.kt)("p",{parentName:"admonition"},(0,a.kt)("inlineCode",{parentName:"p"},"CREATE SOURCE READER")," statements should be issued after other ",(0,a.kt)("inlineCode",{parentName:"p"},"CREATE")," statements."),(0,a.kt)("p",{parentName:"admonition"},"Some source readers may drain data inside foreign sources and the data are just diminished if the downstream pumps and sinks are defined yet.")),(0,a.kt)("h3",{id:"dml-and-query"},"DML and query"),(0,a.kt)("p",null,"We currently do not support simple DMLs (such as ",(0,a.kt)("inlineCode",{parentName:"p"},"INSERT"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"UPDATE"),", and ",(0,a.kt)("inlineCode",{parentName:"p"},"DELETE"),") and queries (such as ",(0,a.kt)("inlineCode",{parentName:"p"},"SELECT"),")."),(0,a.kt)("p",null,"However, ",(0,a.kt)("inlineCode",{parentName:"p"},"CREATE PUMP")," statements includes:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"a ",(0,a.kt)("inlineCode",{parentName:"li"}
1,"SELECT")," statement to fetch rows from upstreams and process them."),(0,a.kt)("li",{parentName:"ul"},"an ",(0,a.kt)("inlineCode",{parentName:"li"},"INSERT")," statement to push result rows to downstreams.")),(0,a.kt)("p",null,"While ",(0,a.kt)("inlineCode",{parentName:"p"},"SELECT")," queries in normal relational databases is ",(0,a.kt)("strong",{parentName:"p"},"executed once")," to tables, queries in SpringQL (and other stream processors supporting SQL) are ",(0,a.kt)("strong",{parentName:"p"},"registered to continuously run"),".\nThe registered queries applied to each input row."),(0,a.kt)("p",null,"Search ",(0,a.kt)("em",{parentName:"p"},'"CQL"')," or ",(0,a.kt)("em",{parentName:"p"},'"Continuous Query"')," if you have further interests on it."),(0,a.kt)("h3",{id:"transactions"},"Transactions"),(0,a.kt)("p",null,"We currently do not support transactions."))}m.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.