diff options
Diffstat (limited to '')
-rw-r--r-- | docs/sqlglot/expressions.html | 21658 |
1 files changed, 11270 insertions, 10388 deletions
diff --git a/docs/sqlglot/expressions.html b/docs/sqlglot/expressions.html index f110b40..adb9af8 100644 --- a/docs/sqlglot/expressions.html +++ b/docs/sqlglot/expressions.html @@ -3,14 +3,14 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <meta name="generator" content="pdoc 12.3.1"/> + <meta name="generator" content="pdoc 13.0.0"/> <title>sqlglot.expressions API documentation</title> <style>/*! * Bootstrap Reboot v5.0.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors * Copyright 2011-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) */*,::after,::before{box-sizing:border-box}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}hr{margin:1rem 0;color:inherit;background-color:currentColor;border:0;opacity:.25}hr:not([size]){height:1px}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem;font-weight:500;line-height:1.2}h1{font-size:calc(1.375rem + 1.5vw)}@media (min-width:1200px){h1{font-size:2.5rem}}h2{font-size:calc(1.325rem + .9vw)}@media (min-width:1200px){h2{font-size:2rem}}h3{font-size:calc(1.3rem + .6vw)}@media (min-width:1200px){h3{font-size:1.75rem}}h4{font-size:calc(1.275rem + .3vw)}@media (min-width:1200px){h4{font-size:1.5rem}}h5{font-size:1.25rem}h6{font-size:1rem}p{margin-top:0;margin-bottom:1rem}abbr[data-bs-original-title],abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul{padding-left:2rem}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:.875em}mark{padding:.2em;background-color:#fcf8e3}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#0d6efd;text-decoration:underline}a:hover{color:#0a58ca}a:not([href]):not([class]),a:not([href]):not([class]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em;direction:ltr;unicode-bidi:bidi-override}pre{display:block;margin-top:0;margin-bottom:1rem;overflow:auto;font-size:.875em}pre code{font-size:inherit;color:inherit;word-break:normal}code{font-size:.875em;color:#d63384;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:.875em;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:1em;font-weight:700}figure{margin:0 0 1rem}img,svg{vertical-align:middle}table{caption-side:bottom;border-collapse:collapse}caption{padding-top:.5rem;padding-bottom:.5rem;color:#6c757d;text-align:left}th{text-align:inherit;text-align:-webkit-match-parent}tbody,td,tfoot,th,thead,tr{border-color:inherit;border-style:solid;border-width:0}label{display:inline-block}button{border-radius:0}button:focus:not(:focus-visible){outline:0}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}select:disabled{opacity:1}[list]::-webkit-calendar-picker-indicator{display:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}::-moz-focus-inner{padding:0;border-style:none}textarea{resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{float:left;width:100%;padding:0;margin-bottom:.5rem;font-size:calc(1.275rem + .3vw);line-height:inherit}@media (min-width:1200px){legend{font-size:1.5rem}}legend+*{clear:left}::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-fields-wrapper,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-text,::-webkit-datetime-edit-year-field{padding:0}::-webkit-inner-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:textfield}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-color-swatch-wrapper{padding:0}::file-selector-button{font:inherit}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}iframe{border:0}summary{display:list-item;cursor:pointer}progress{vertical-align:baseline}[hidden]{display:none!important}</style> <style>/*! syntax-highlighting.css */pre{line-height:125%;}span.linenos{color:inherit; background-color:transparent; padding-left:5px; padding-right:20px;}.pdoc-code .hll{background-color:#ffffcc}.pdoc-code{background:#f8f8f8;}.pdoc-code .c{color:#3D7B7B; font-style:italic}.pdoc-code .err{border:1px solid #FF0000}.pdoc-code .k{color:#008000; font-weight:bold}.pdoc-code .o{color:#666666}.pdoc-code .ch{color:#3D7B7B; font-style:italic}.pdoc-code .cm{color:#3D7B7B; font-style:italic}.pdoc-code .cp{color:#9C6500}.pdoc-code .cpf{color:#3D7B7B; font-style:italic}.pdoc-code .c1{color:#3D7B7B; font-style:italic}.pdoc-code .cs{color:#3D7B7B; font-style:italic}.pdoc-code .gd{color:#A00000}.pdoc-code .ge{font-style:italic}.pdoc-code .gr{color:#E40000}.pdoc-code .gh{color:#000080; font-weight:bold}.pdoc-code .gi{color:#008400}.pdoc-code .go{color:#717171}.pdoc-code .gp{color:#000080; font-weight:bold}.pdoc-code .gs{font-weight:bold}.pdoc-code .gu{color:#800080; font-weight:bold}.pdoc-code .gt{color:#0044DD}.pdoc-code .kc{color:#008000; font-weight:bold}.pdoc-code .kd{color:#008000; font-weight:bold}.pdoc-code .kn{color:#008000; font-weight:bold}.pdoc-code .kp{color:#008000}.pdoc-code .kr{color:#008000; font-weight:bold}.pdoc-code .kt{color:#B00040}.pdoc-code .m{color:#666666}.pdoc-code .s{color:#BA2121}.pdoc-code .na{color:#687822}.pdoc-code .nb{color:#008000}.pdoc-code .nc{color:#0000FF; font-weight:bold}.pdoc-code .no{color:#880000}.pdoc-code .nd{color:#AA22FF}.pdoc-code .ni{color:#717171; font-weight:bold}.pdoc-code .ne{color:#CB3F38; font-weight:bold}.pdoc-code .nf{color:#0000FF}.pdoc-code .nl{color:#767600}.pdoc-code .nn{color:#0000FF; font-weight:bold}.pdoc-code .nt{color:#008000; font-weight:bold}.pdoc-code .nv{color:#19177C}.pdoc-code .ow{color:#AA22FF; font-weight:bold}.pdoc-code .w{color:#bbbbbb}.pdoc-code .mb{color:#666666}.pdoc-code .mf{color:#666666}.pdoc-code .mh{color:#666666}.pdoc-code .mi{color:#666666}.pdoc-code .mo{color:#666666}.pdoc-code .sa{color:#BA2121}.pdoc-code .sb{color:#BA2121}.pdoc-code .sc{color:#BA2121}.pdoc-code .dl{color:#BA2121}.pdoc-code .sd{color:#BA2121; font-style:italic}.pdoc-code .s2{color:#BA2121}.pdoc-code .se{color:#AA5D1F; font-weight:bold}.pdoc-code .sh{color:#BA2121}.pdoc-code .si{color:#A45A77; font-weight:bold}.pdoc-code .sx{color:#008000}.pdoc-code .sr{color:#A45A77}.pdoc-code .s1{color:#BA2121}.pdoc-code .ss{color:#19177C}.pdoc-code .bp{color:#008000}.pdoc-code .fm{color:#0000FF}.pdoc-code .vc{color:#19177C}.pdoc-code .vg{color:#19177C}.pdoc-code .vi{color:#19177C}.pdoc-code .vm{color:#19177C}.pdoc-code .il{color:#666666}</style> <style>/*! theme.css */:root{--pdoc-background:#fff;}.pdoc{--text:#212529;--muted:#6c757d;--link:#3660a5;--link-hover:#1659c5;--code:#f8f8f8;--active:#fff598;--accent:#eee;--accent2:#c1c1c1;--nav-hover:rgba(255, 255, 255, 0.5);--name:#0066BB;--def:#008800;--annotation:#007020;}</style> - <style>/*! layout.css */html, body{width:100%;height:100%;}html, main{scroll-behavior:smooth;}body{background-color:var(--pdoc-background);}@media (max-width:769px){#navtoggle{cursor:pointer;position:absolute;width:50px;height:40px;top:1rem;right:1rem;border-color:var(--text);color:var(--text);display:flex;opacity:0.8;}#navtoggle:hover{opacity:1;}#togglestate + div{display:none;}#togglestate:checked + div{display:inherit;}main, header{padding:2rem 3vw;}header + main{margin-top:-3rem;}.git-button{display:none !important;}nav input[type="search"]{max-width:77%;}nav input[type="search"]:first-child{margin-top:-6px;}nav input[type="search"]:valid ~ *{display:none !important;}}@media (min-width:770px){:root{--sidebar-width:clamp(12.5rem, 28vw, 22rem);}nav{position:fixed;overflow:auto;height:100vh;width:var(--sidebar-width);}main, header{padding:3rem 2rem 3rem calc(var(--sidebar-width) + 3rem);width:calc(54rem + var(--sidebar-width));max-width:100%;}header + main{margin-top:-4rem;}#navtoggle{display:none;}}#togglestate{position:absolute;height:0;opacity:0;}nav.pdoc{--pad:clamp(0.5rem, 2vw, 1.75rem);--indent:1.5rem;background-color:var(--accent);border-right:1px solid var(--accent2);box-shadow:0 0 20px rgba(50, 50, 50, .2) inset;padding:0 0 0 var(--pad);overflow-wrap:anywhere;scrollbar-width:thin; scrollbar-color:var(--accent2) transparent }nav.pdoc::-webkit-scrollbar{width:.4rem; }nav.pdoc::-webkit-scrollbar-thumb{background-color:var(--accent2); }nav.pdoc > div{padding:var(--pad) 0;}nav.pdoc .module-list-button{display:inline-flex;align-items:center;color:var(--text);border-color:var(--muted);margin-bottom:1rem;}nav.pdoc .module-list-button:hover{border-color:var(--text);}nav.pdoc input[type=search]{display:block;outline-offset:0;width:calc(100% - var(--pad));}nav.pdoc .logo{max-width:calc(100% - var(--pad));max-height:35vh;display:block;margin:0 auto 1rem;transform:translate(calc(-.5 * var(--pad)), 0);}nav.pdoc ul{list-style:none;padding-left:0;}nav.pdoc > div > ul{margin-left:calc(0px - var(--pad));}nav.pdoc li a{padding:.2rem 0 .2rem calc(var(--pad) + var(--indent));}nav.pdoc > div > ul > li > a{padding-left:var(--pad);}nav.pdoc li{transition:all 100ms;}nav.pdoc li:hover{background-color:var(--nav-hover);}nav.pdoc a, nav.pdoc a:hover{color:var(--text);}nav.pdoc a{display:block;}nav.pdoc > h2:first-of-type{margin-top:1.5rem;}nav.pdoc .class:before{content:"class ";color:var(--muted);}nav.pdoc .function:after{content:"()";color:var(--muted);}nav.pdoc footer:before{content:"";display:block;width:calc(100% - var(--pad));border-top:solid var(--accent2) 1px;margin-top:1.5rem;padding-top:.5rem;}nav.pdoc footer{font-size:small;}</style> - <style>/*! content.css */.pdoc{color:var(--text);box-sizing:border-box;line-height:1.5;background:none;}.pdoc .pdoc-button{display:inline-block;border:solid black 1px;border-radius:2px;font-size:.75rem;padding:calc(0.5em - 1px) 1em;transition:100ms all;}.pdoc .pdoc-alert{padding:1rem 1rem 1rem calc(1.5rem + 24px);border:1px solid transparent;border-radius:.25rem;background-repeat:no-repeat;background-position:1rem center;margin-bottom:1rem;}.pdoc .pdoc-alert > *:last-child{margin-bottom:0;}.pdoc .pdoc-alert-note {color:#084298;background-color:#cfe2ff;border-color:#b6d4fe;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23084298%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8%2016A8%208%200%201%200%208%200a8%208%200%200%200%200%2016zm.93-9.412-1%204.705c-.07.34.029.533.304.533.194%200%20.487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703%200-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381%202.29-.287zM8%205.5a1%201%200%201%201%200-2%201%201%200%200%201%200%202z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23664d03%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8.982%201.566a1.13%201.13%200%200%200-1.96%200L.165%2013.233c-.457.778.091%201.767.98%201.767h13.713c.889%200%201.438-.99.98-1.767L8.982%201.566zM8%205c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%205.995A.905.905%200%200%201%208%205zm.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-danger{color:#842029;background-color:#f8d7da;border-color:#f5c2c7;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23842029%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M5.52.359A.5.5%200%200%201%206%200h4a.5.5%200%200%201%20.474.658L8.694%206H12.5a.5.5%200%200%201%20.395.807l-7%209a.5.5%200%200%201-.873-.454L6.823%209.5H3.5a.5.5%200%200%201-.48-.641l2.5-8.5z%22/%3E%3C/svg%3E");}.pdoc .visually-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important;}.pdoc h1, .pdoc h2, .pdoc h3{font-weight:300;margin:.3em 0;padding:.2em 0;}.pdoc > section:not(.module-info) h1{font-size:1.5rem;font-weight:500;}.pdoc > section:not(.module-info) h2{font-size:1.4rem;font-weight:500;}.pdoc > section:not(.module-info) h3{font-size:1.3rem;font-weight:500;}.pdoc > section:not(.module-info) h4{font-size:1.2rem;}.pdoc > section:not(.module-info) h5{font-size:1.1rem;}.pdoc a{text-decoration:none;color:var(--link);}.pdoc a:hover{color:var(--link-hover);}.pdoc blockquote{margin-left:2rem;}.pdoc pre{border-top:1px solid var(--accent2);border-bottom:1px solid var(--accent2);margin-top:0;margin-bottom:1em;padding:.5rem 0 .5rem .5rem;overflow-x:auto;background-color:var(--code);}.pdoc code{color:var(--text);padding:.2em .4em;margin:0;font-size:85%;background-color:var(--code);border-radius:6px;}.pdoc a > code{color:inherit;}.pdoc pre > code{display:inline-block;font-size:inherit;background:none;border:none;padding:0;}.pdoc > section:not(.module-info){margin-bottom:1.5rem;}.pdoc .modulename{margin-top:0;font-weight:bold;}.pdoc .modulename a{color:var(--link);transition:100ms all;}.pdoc .git-button{float:right;border:solid var(--link) 1px;}.pdoc .git-button:hover{background-color:var(--link);color:var(--pdoc-background);}.view-source-toggle-state,.view-source-toggle-state ~ .pdoc-code{display:none;}.view-source-toggle-state:checked ~ .pdoc-code{display:block;}.view-source-button{display:inline-block;float:right;font-size:.75rem;line-height:1.5rem;color:var(--muted);padding:0 .4rem 0 1.3rem;cursor:pointer;text-indent:-2px;}.view-source-button > span{visibility:hidden;}.module-info .view-source-button{float:none;display:flex;justify-content:flex-end;margin:-1.2rem .4rem -.2rem 0;}.view-source-button::before{position:absolute;content:"View Source";display:list-item;list-style-type:disclosure-closed;}.view-source-toggle-state:checked ~ .attr .view-source-button::before,.view-source-toggle-state:checked ~ .view-source-button::before{list-style-type:disclosure-open;}.pdoc .docstring{margin-bottom:1.5rem;}.pdoc section:not(.module-info) .docstring{margin-left:clamp(0rem, 5vw - 2rem, 1rem);}.pdoc .docstring .pdoc-code{margin-left:1em;margin-right:1em;}.pdoc h1:target,.pdoc h2:target,.pdoc h3:target,.pdoc h4:target,.pdoc h5:target,.pdoc h6:target,.pdoc .pdoc-code > pre > span:target{background-color:var(--active);box-shadow:-1rem 0 0 0 var(--active);}.pdoc .pdoc-code > pre > span:target{display:block;}.pdoc div:target > .attr,.pdoc section:target > .attr,.pdoc dd:target > a{background-color:var(--active);}.pdoc *{scroll-margin:2rem;}.pdoc .pdoc-code .linenos{user-select:none;}.pdoc .attr:hover{filter:contrast(0.95);}.pdoc section, .pdoc .classattr{position:relative;}.pdoc .headerlink{--width:clamp(1rem, 3vw, 2rem);position:absolute;top:0;left:calc(0rem - var(--width));transition:all 100ms ease-in-out;opacity:0;}.pdoc .headerlink::before{content:"#";display:block;text-align:center;width:var(--width);height:2.3rem;line-height:2.3rem;font-size:1.5rem;}.pdoc .attr:hover ~ .headerlink,.pdoc *:target > .headerlink,.pdoc .headerlink:hover{opacity:1;}.pdoc .attr{display:block;margin:.5rem 0 .5rem;padding:.4rem .4rem .4rem 1rem;background-color:var(--accent);overflow-x:auto;}.pdoc .classattr{margin-left:2rem;}.pdoc .name{color:var(--name);font-weight:bold;}.pdoc .def{color:var(--def);font-weight:bold;}.pdoc .signature{background-color:transparent;}.pdoc .param, .pdoc .return-annotation{white-space:pre;}.pdoc .signature.multiline .param{display:block;}.pdoc .signature.condensed .param{display:inline-block;}.pdoc .annotation{color:var(--annotation);}.pdoc .inherited{margin-left:2rem;}.pdoc .inherited dt{font-weight:700;}.pdoc .inherited dt, .pdoc .inherited dd{display:inline;margin-left:0;margin-bottom:.5rem;}.pdoc .inherited dd:not(:last-child):after{content:", ";}.pdoc .inherited .class:before{content:"class ";}.pdoc .inherited .function a:after{content:"()";}.pdoc .search-result .docstring{overflow:auto;max-height:25vh;}.pdoc .search-result.focused > .attr{background-color:var(--active);}.pdoc .attribution{margin-top:2rem;display:block;opacity:0.5;transition:all 200ms;filter:grayscale(100%);}.pdoc .attribution:hover{opacity:1;filter:grayscale(0%);}.pdoc .attribution img{margin-left:5px;height:35px;vertical-align:middle;width:70px;transition:all 200ms;}.pdoc table{display:block;width:max-content;max-width:100%;overflow:auto;margin-bottom:1rem;}.pdoc table th{font-weight:600;}.pdoc table th, .pdoc table td{padding:6px 13px;border:1px solid var(--accent2);}</style> + <style>/*! layout.css */html, body{width:100%;height:100%;}html, main{scroll-behavior:smooth;}body{background-color:var(--pdoc-background);}@media (max-width:769px){#navtoggle{cursor:pointer;position:absolute;width:50px;height:40px;top:1rem;right:1rem;border-color:var(--text);color:var(--text);display:flex;opacity:0.8;z-index:999;}#navtoggle:hover{opacity:1;}#togglestate + div{display:none;}#togglestate:checked + div{display:inherit;}main, header{padding:2rem 3vw;}header + main{margin-top:-3rem;}.git-button{display:none !important;}nav input[type="search"]{max-width:77%;}nav input[type="search"]:first-child{margin-top:-6px;}nav input[type="search"]:valid ~ *{display:none !important;}}@media (min-width:770px){:root{--sidebar-width:clamp(12.5rem, 28vw, 22rem);}nav{position:fixed;overflow:auto;height:100vh;width:var(--sidebar-width);}main, header{padding:3rem 2rem 3rem calc(var(--sidebar-width) + 3rem);width:calc(54rem + var(--sidebar-width));max-width:100%;}header + main{margin-top:-4rem;}#navtoggle{display:none;}}#togglestate{position:absolute;height:0;opacity:0;}nav.pdoc{--pad:clamp(0.5rem, 2vw, 1.75rem);--indent:1.5rem;background-color:var(--accent);border-right:1px solid var(--accent2);box-shadow:0 0 20px rgba(50, 50, 50, .2) inset;padding:0 0 0 var(--pad);overflow-wrap:anywhere;scrollbar-width:thin; scrollbar-color:var(--accent2) transparent }nav.pdoc::-webkit-scrollbar{width:.4rem; }nav.pdoc::-webkit-scrollbar-thumb{background-color:var(--accent2); }nav.pdoc > div{padding:var(--pad) 0;}nav.pdoc .module-list-button{display:inline-flex;align-items:center;color:var(--text);border-color:var(--muted);margin-bottom:1rem;}nav.pdoc .module-list-button:hover{border-color:var(--text);}nav.pdoc input[type=search]{display:block;outline-offset:0;width:calc(100% - var(--pad));}nav.pdoc .logo{max-width:calc(100% - var(--pad));max-height:35vh;display:block;margin:0 auto 1rem;transform:translate(calc(-.5 * var(--pad)), 0);}nav.pdoc ul{list-style:none;padding-left:0;}nav.pdoc > div > ul{margin-left:calc(0px - var(--pad));}nav.pdoc li a{padding:.2rem 0 .2rem calc(var(--pad) + var(--indent));}nav.pdoc > div > ul > li > a{padding-left:var(--pad);}nav.pdoc li{transition:all 100ms;}nav.pdoc li:hover{background-color:var(--nav-hover);}nav.pdoc a, nav.pdoc a:hover{color:var(--text);}nav.pdoc a{display:block;}nav.pdoc > h2:first-of-type{margin-top:1.5rem;}nav.pdoc .class:before{content:"class ";color:var(--muted);}nav.pdoc .function:after{content:"()";color:var(--muted);}nav.pdoc footer:before{content:"";display:block;width:calc(100% - var(--pad));border-top:solid var(--accent2) 1px;margin-top:1.5rem;padding-top:.5rem;}nav.pdoc footer{font-size:small;}</style> + <style>/*! content.css */.pdoc{color:var(--text);box-sizing:border-box;line-height:1.5;background:none;}.pdoc .pdoc-button{cursor:pointer;display:inline-block;border:solid black 1px;border-radius:2px;font-size:.75rem;padding:calc(0.5em - 1px) 1em;transition:100ms all;}.pdoc .pdoc-alert{padding:1rem 1rem 1rem calc(1.5rem + 24px);border:1px solid transparent;border-radius:.25rem;background-repeat:no-repeat;background-position:1rem center;margin-bottom:1rem;}.pdoc .pdoc-alert > *:last-child{margin-bottom:0;}.pdoc .pdoc-alert-note {color:#084298;background-color:#cfe2ff;border-color:#b6d4fe;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23084298%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8%2016A8%208%200%201%200%208%200a8%208%200%200%200%200%2016zm.93-9.412-1%204.705c-.07.34.029.533.304.533.194%200%20.487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703%200-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381%202.29-.287zM8%205.5a1%201%200%201%201%200-2%201%201%200%200%201%200%202z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-warning{color:#664d03;background-color:#fff3cd;border-color:#ffecb5;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23664d03%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8.982%201.566a1.13%201.13%200%200%200-1.96%200L.165%2013.233c-.457.778.091%201.767.98%201.767h13.713c.889%200%201.438-.99.98-1.767L8.982%201.566zM8%205c.535%200%20.954.462.9.995l-.35%203.507a.552.552%200%200%201-1.1%200L7.1%205.995A.905.905%200%200%201%208%205zm.002%206a1%201%200%201%201%200%202%201%201%200%200%201%200-2z%22/%3E%3C/svg%3E");}.pdoc .pdoc-alert-danger{color:#842029;background-color:#f8d7da;border-color:#f5c2c7;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22%23842029%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M5.52.359A.5.5%200%200%201%206%200h4a.5.5%200%200%201%20.474.658L8.694%206H12.5a.5.5%200%200%201%20.395.807l-7%209a.5.5%200%200%201-.873-.454L6.823%209.5H3.5a.5.5%200%200%201-.48-.641l2.5-8.5z%22/%3E%3C/svg%3E");}.pdoc .visually-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;white-space:nowrap !important;border:0 !important;}.pdoc h1, .pdoc h2, .pdoc h3{font-weight:300;margin:.3em 0;padding:.2em 0;}.pdoc > section:not(.module-info) h1{font-size:1.5rem;font-weight:500;}.pdoc > section:not(.module-info) h2{font-size:1.4rem;font-weight:500;}.pdoc > section:not(.module-info) h3{font-size:1.3rem;font-weight:500;}.pdoc > section:not(.module-info) h4{font-size:1.2rem;}.pdoc > section:not(.module-info) h5{font-size:1.1rem;}.pdoc a{text-decoration:none;color:var(--link);}.pdoc a:hover{color:var(--link-hover);}.pdoc blockquote{margin-left:2rem;}.pdoc pre{border-top:1px solid var(--accent2);border-bottom:1px solid var(--accent2);margin-top:0;margin-bottom:1em;padding:.5rem 0 .5rem .5rem;overflow-x:auto;background-color:var(--code);}.pdoc code{color:var(--text);padding:.2em .4em;margin:0;font-size:85%;background-color:var(--code);border-radius:6px;}.pdoc a > code{color:inherit;}.pdoc pre > code{display:inline-block;font-size:inherit;background:none;border:none;padding:0;}.pdoc > section:not(.module-info){margin-bottom:1.5rem;}.pdoc .modulename{margin-top:0;font-weight:bold;}.pdoc .modulename a{color:var(--link);transition:100ms all;}.pdoc .git-button{float:right;border:solid var(--link) 1px;}.pdoc .git-button:hover{background-color:var(--link);color:var(--pdoc-background);}.view-source-toggle-state,.view-source-toggle-state ~ .pdoc-code{display:none;}.view-source-toggle-state:checked ~ .pdoc-code{display:block;}.view-source-button{display:inline-block;float:right;font-size:.75rem;line-height:1.5rem;color:var(--muted);padding:0 .4rem 0 1.3rem;cursor:pointer;text-indent:-2px;}.view-source-button > span{visibility:hidden;}.module-info .view-source-button{float:none;display:flex;justify-content:flex-end;margin:-1.2rem .4rem -.2rem 0;}.view-source-button::before{position:absolute;content:"View Source";display:list-item;list-style-type:disclosure-closed;}.view-source-toggle-state:checked ~ .attr .view-source-button::before,.view-source-toggle-state:checked ~ .view-source-button::before{list-style-type:disclosure-open;}.pdoc .docstring{margin-bottom:1.5rem;}.pdoc section:not(.module-info) .docstring{margin-left:clamp(0rem, 5vw - 2rem, 1rem);}.pdoc .docstring .pdoc-code{margin-left:1em;margin-right:1em;}.pdoc h1:target,.pdoc h2:target,.pdoc h3:target,.pdoc h4:target,.pdoc h5:target,.pdoc h6:target,.pdoc .pdoc-code > pre > span:target{background-color:var(--active);box-shadow:-1rem 0 0 0 var(--active);}.pdoc .pdoc-code > pre > span:target{display:block;}.pdoc div:target > .attr,.pdoc section:target > .attr,.pdoc dd:target > a{background-color:var(--active);}.pdoc *{scroll-margin:2rem;}.pdoc .pdoc-code .linenos{user-select:none;}.pdoc .attr:hover{filter:contrast(0.95);}.pdoc section, .pdoc .classattr{position:relative;}.pdoc .headerlink{--width:clamp(1rem, 3vw, 2rem);position:absolute;top:0;left:calc(0rem - var(--width));transition:all 100ms ease-in-out;opacity:0;}.pdoc .headerlink::before{content:"#";display:block;text-align:center;width:var(--width);height:2.3rem;line-height:2.3rem;font-size:1.5rem;}.pdoc .attr:hover ~ .headerlink,.pdoc *:target > .headerlink,.pdoc .headerlink:hover{opacity:1;}.pdoc .attr{display:block;margin:.5rem 0 .5rem;padding:.4rem .4rem .4rem 1rem;background-color:var(--accent);overflow-x:auto;}.pdoc .classattr{margin-left:2rem;}.pdoc .name{color:var(--name);font-weight:bold;}.pdoc .def{color:var(--def);font-weight:bold;}.pdoc .signature{background-color:transparent;}.pdoc .param, .pdoc .return-annotation{white-space:pre;}.pdoc .signature.multiline .param{display:block;}.pdoc .signature.condensed .param{display:inline-block;}.pdoc .annotation{color:var(--annotation);}.pdoc .view-value-toggle-state,.pdoc .view-value-toggle-state ~ .default_value{display:none;}.pdoc .view-value-toggle-state:checked ~ .default_value{display:inherit;}.pdoc .view-value-button{font-size:.5rem;vertical-align:middle;border-style:dashed;margin-top:-0.1rem;}.pdoc .view-value-button:hover{background:white;}.pdoc .view-value-button::before{content:"show";text-align:center;width:2.2em;display:inline-block;}.pdoc .view-value-toggle-state:checked ~ .view-value-button::before{content:"hide";}.pdoc .inherited{margin-left:2rem;}.pdoc .inherited dt{font-weight:700;}.pdoc .inherited dt, .pdoc .inherited dd{display:inline;margin-left:0;margin-bottom:.5rem;}.pdoc .inherited dd:not(:last-child):after{content:", ";}.pdoc .inherited .class:before{content:"class ";}.pdoc .inherited .function a:after{content:"()";}.pdoc .search-result .docstring{overflow:auto;max-height:25vh;}.pdoc .search-result.focused > .attr{background-color:var(--active);}.pdoc .attribution{margin-top:2rem;display:block;opacity:0.5;transition:all 200ms;filter:grayscale(100%);}.pdoc .attribution:hover{opacity:1;filter:grayscale(0%);}.pdoc .attribution img{margin-left:5px;height:35px;vertical-align:middle;width:70px;transition:all 200ms;}.pdoc table{display:block;width:max-content;max-width:100%;overflow:auto;margin-bottom:1rem;}.pdoc table th{font-weight:600;}.pdoc table th, .pdoc table td{padding:6px 13px;border:1px solid var(--accent2);}</style> <style>/*! custom.css */</style></head> <body> <nav class="pdoc"> @@ -363,6 +363,12 @@ </li> <li> + <a class="class" href="#CompressColumnConstraint">CompressColumnConstraint</a> + <ul class="memberlist"> + </ul> + + </li> + <li> <a class="class" href="#DateFormatColumnConstraint">DateFormatColumnConstraint</a> <ul class="memberlist"> </ul> @@ -387,6 +393,12 @@ </li> <li> + <a class="class" href="#InlineLengthColumnConstraint">InlineLengthColumnConstraint</a> + <ul class="memberlist"> + </ul> + + </li> + <li> <a class="class" href="#NotNullColumnConstraint">NotNullColumnConstraint</a> <ul class="memberlist"> </ul> @@ -663,49 +675,61 @@ </li> <li> + <a class="class" href="#AfterJournalProperty">AfterJournalProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> <a class="class" href="#AlgorithmProperty">AlgorithmProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#DefinerProperty">DefinerProperty</a> + <a class="class" href="#AutoIncrementProperty">AutoIncrementProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#SqlSecurityProperty">SqlSecurityProperty</a> + <a class="class" href="#BlockCompressionProperty">BlockCompressionProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#TableFormatProperty">TableFormatProperty</a> + <a class="class" href="#CharacterSetProperty">CharacterSetProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#PartitionedByProperty">PartitionedByProperty</a> + <a class="class" href="#ChecksumProperty">ChecksumProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#FileFormatProperty">FileFormatProperty</a> + <a class="class" href="#CollateProperty">CollateProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#DistKeyProperty">DistKeyProperty</a> + <a class="class" href="#DataBlocksizeProperty">DataBlocksizeProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#SortKeyProperty">SortKeyProperty</a> + <a class="class" href="#DefinerProperty">DefinerProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#DistKeyProperty">DistKeyProperty</a> <ul class="memberlist"> </ul> @@ -717,49 +741,49 @@ </li> <li> - <a class="class" href="#LikeProperty">LikeProperty</a> + <a class="class" href="#EngineProperty">EngineProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#LocationProperty">LocationProperty</a> + <a class="class" href="#ExecuteAsProperty">ExecuteAsProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#EngineProperty">EngineProperty</a> + <a class="class" href="#ExternalProperty">ExternalProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#AutoIncrementProperty">AutoIncrementProperty</a> + <a class="class" href="#FallbackProperty">FallbackProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#CharacterSetProperty">CharacterSetProperty</a> + <a class="class" href="#FileFormatProperty">FileFormatProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#CollateProperty">CollateProperty</a> + <a class="class" href="#FreespaceProperty">FreespaceProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#SchemaCommentProperty">SchemaCommentProperty</a> + <a class="class" href="#IsolatedLoadingProperty">IsolatedLoadingProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#ReturnsProperty">ReturnsProperty</a> + <a class="class" href="#JournalProperty">JournalProperty</a> <ul class="memberlist"> </ul> @@ -771,103 +795,139 @@ </li> <li> - <a class="class" href="#ExecuteAsProperty">ExecuteAsProperty</a> + <a class="class" href="#LikeProperty">LikeProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#VolatilityProperty">VolatilityProperty</a> + <a class="class" href="#LocationProperty">LocationProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#RowFormatDelimitedProperty">RowFormatDelimitedProperty</a> + <a class="class" href="#LockingProperty">LockingProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#RowFormatSerdeProperty">RowFormatSerdeProperty</a> + <a class="class" href="#LogProperty">LogProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#SerdeProperties">SerdeProperties</a> + <a class="class" href="#MaterializedProperty">MaterializedProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#FallbackProperty">FallbackProperty</a> + <a class="class" href="#MergeBlockRatioProperty">MergeBlockRatioProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#WithJournalTableProperty">WithJournalTableProperty</a> + <a class="class" href="#NoPrimaryIndexProperty">NoPrimaryIndexProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#LogProperty">LogProperty</a> + <a class="class" href="#OnCommitProperty">OnCommitProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#JournalProperty">JournalProperty</a> + <a class="class" href="#PartitionedByProperty">PartitionedByProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#AfterJournalProperty">AfterJournalProperty</a> + <a class="class" href="#ReturnsProperty">ReturnsProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#ChecksumProperty">ChecksumProperty</a> + <a class="class" href="#RowFormatDelimitedProperty">RowFormatDelimitedProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#FreespaceProperty">FreespaceProperty</a> + <a class="class" href="#RowFormatSerdeProperty">RowFormatSerdeProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#MergeBlockRatioProperty">MergeBlockRatioProperty</a> + <a class="class" href="#SchemaCommentProperty">SchemaCommentProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#DataBlocksizeProperty">DataBlocksizeProperty</a> + <a class="class" href="#SerdeProperties">SerdeProperties</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#BlockCompressionProperty">BlockCompressionProperty</a> + <a class="class" href="#SetProperty">SetProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#IsolatedLoadingProperty">IsolatedLoadingProperty</a> + <a class="class" href="#SortKeyProperty">SortKeyProperty</a> <ul class="memberlist"> </ul> </li> <li> - <a class="class" href="#LockingProperty">LockingProperty</a> + <a class="class" href="#SqlSecurityProperty">SqlSecurityProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#TableFormatProperty">TableFormatProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#TemporaryProperty">TemporaryProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#TransientProperty">TransientProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#VolatilityProperty">VolatilityProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#WithDataProperty">WithDataProperty</a> + <ul class="memberlist"> + </ul> + + </li> + <li> + <a class="class" href="#WithJournalTableProperty">WithJournalTableProperty</a> <ul class="memberlist"> </ul> @@ -894,6 +954,9 @@ <a class="variable" href="#Properties.Location.POST_ALIAS">POST_ALIAS</a> </li> <li> + <a class="variable" href="#Properties.Location.POST_EXPRESSION">POST_EXPRESSION</a> + </li> + <li> <a class="variable" href="#Properties.Location.POST_INDEX">POST_INDEX</a> </li> <li> @@ -968,6 +1031,9 @@ <li> <a class="function" href="#Union.select">select</a> </li> + <li> + <a class="variable" href="#Union.is_star">is_star</a> + </li> </ul> </li> @@ -1070,6 +1136,9 @@ <li> <a class="function" href="#Select.lock">lock</a> </li> + <li> + <a class="variable" href="#Select.is_star">is_star</a> + </li> </ul> </li> @@ -1080,6 +1149,9 @@ <a class="function" href="#Subquery.unnest">unnest</a> </li> <li> + <a class="variable" href="#Subquery.is_star">is_star</a> + </li> + <li> <a class="variable" href="#Subquery.output_name">output_name</a> </li> </ul> @@ -1314,6 +1386,9 @@ <a class="variable" href="#DataType.Type.OBJECT">OBJECT</a> </li> <li> + <a class="variable" href="#DataType.Type.INET">INET</a> + </li> + <li> <a class="variable" href="#DataType.Type.NULL">NULL</a> </li> <li> @@ -2868,7 +2943,7 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="L-82"><a href="#L-82"><span class="linenos"> 82</span></a> </span><span id="L-83"><a href="#L-83"><span class="linenos"> 83</span></a> <span class="n">key</span> <span class="o">=</span> <span class="s2">"expression"</span> </span><span id="L-84"><a href="#L-84"><span class="linenos"> 84</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="vm">__slots__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"args"</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">,</span> <span class="s2">"arg_key"</span><span class="p">,</span> <span class="s2">"comments"</span><span class="p">,</span> <span class="s2">"_type"</span><span class="p">)</span> +</span><span id="L-85"><a href="#L-85"><span class="linenos"> 85</span></a> <span class="vm">__slots__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"args"</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">,</span> <span class="s2">"arg_key"</span><span class="p">,</span> <span class="s2">"comments"</span><span class="p">,</span> <span class="s2">"_type"</span><span class="p">,</span> <span class="s2">"_meta"</span><span class="p">)</span> </span><span id="L-86"><a href="#L-86"><span class="linenos"> 86</span></a> </span><span id="L-87"><a href="#L-87"><span class="linenos"> 87</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">):</span> </span><span id="L-88"><a href="#L-88"><span class="linenos"> 88</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="n">args</span> @@ -2876,4703 +2951,4761 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="L-90"><a href="#L-90"><span class="linenos"> 90</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="L-91"><a href="#L-91"><span class="linenos"> 91</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="L-92"><a href="#L-92"><span class="linenos"> 92</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> -</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a> -</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> <span class="k">return</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_args</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> -</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a> -</span><span id="L-100"><a href="#L-100"><span class="linenos"> 100</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span> -</span><span id="L-101"><a href="#L-101"><span class="linenos"> 101</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">(</span> -</span><span id="L-102"><a href="#L-102"><span class="linenos"> 102</span></a> <span class="p">(</span> -</span><span id="L-103"><a href="#L-103"><span class="linenos"> 103</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> -</span><span id="L-104"><a href="#L-104"><span class="linenos"> 104</span></a> <span class="nb">tuple</span><span class="p">(</span> -</span><span id="L-105"><a href="#L-105"><span class="linenos"> 105</span></a> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="k">else</span> <span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="L-106"><a href="#L-106"><span class="linenos"> 106</span></a> <span class="p">),</span> -</span><span id="L-107"><a href="#L-107"><span class="linenos"> 107</span></a> <span class="p">)</span> -</span><span id="L-108"><a href="#L-108"><span class="linenos"> 108</span></a> <span class="p">)</span> -</span><span id="L-109"><a href="#L-109"><span class="linenos"> 109</span></a> -</span><span id="L-110"><a href="#L-110"><span class="linenos"> 110</span></a> <span class="nd">@property</span> -</span><span id="L-111"><a href="#L-111"><span class="linenos"> 111</span></a> <span class="k">def</span> <span class="nf">this</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-112"><a href="#L-112"><span class="linenos"> 112</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-113"><a href="#L-113"><span class="linenos"> 113</span></a><span class="sd"> Retrieves the argument with key "this".</span> -</span><span id="L-114"><a href="#L-114"><span class="linenos"> 114</span></a><span class="sd"> """</span> -</span><span id="L-115"><a href="#L-115"><span class="linenos"> 115</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-116"><a href="#L-116"><span class="linenos"> 116</span></a> -</span><span id="L-117"><a href="#L-117"><span class="linenos"> 117</span></a> <span class="nd">@property</span> -</span><span id="L-118"><a href="#L-118"><span class="linenos"> 118</span></a> <span class="k">def</span> <span class="nf">expression</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-119"><a href="#L-119"><span class="linenos"> 119</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-120"><a href="#L-120"><span class="linenos"> 120</span></a><span class="sd"> Retrieves the argument with key "expression".</span> -</span><span id="L-121"><a href="#L-121"><span class="linenos"> 121</span></a><span class="sd"> """</span> -</span><span id="L-122"><a href="#L-122"><span class="linenos"> 122</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expression"</span><span class="p">)</span> -</span><span id="L-123"><a href="#L-123"><span class="linenos"> 123</span></a> -</span><span id="L-124"><a href="#L-124"><span class="linenos"> 124</span></a> <span class="nd">@property</span> -</span><span id="L-125"><a href="#L-125"><span class="linenos"> 125</span></a> <span class="k">def</span> <span class="nf">expressions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-126"><a href="#L-126"><span class="linenos"> 126</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-127"><a href="#L-127"><span class="linenos"> 127</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> -</span><span id="L-128"><a href="#L-128"><span class="linenos"> 128</span></a><span class="sd"> """</span> -</span><span id="L-129"><a href="#L-129"><span class="linenos"> 129</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expressions"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="L-130"><a href="#L-130"><span class="linenos"> 130</span></a> -</span><span id="L-131"><a href="#L-131"><span class="linenos"> 131</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-132"><a href="#L-132"><span class="linenos"> 132</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-133"><a href="#L-133"><span class="linenos"> 133</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> -</span><span id="L-134"><a href="#L-134"><span class="linenos"> 134</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> -</span><span id="L-135"><a href="#L-135"><span class="linenos"> 135</span></a><span class="sd"> """</span> -</span><span id="L-136"><a href="#L-136"><span class="linenos"> 136</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> -</span><span id="L-137"><a href="#L-137"><span class="linenos"> 137</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-138"><a href="#L-138"><span class="linenos"> 138</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="L-139"><a href="#L-139"><span class="linenos"> 139</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> -</span><span id="L-140"><a href="#L-140"><span class="linenos"> 140</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-141"><a href="#L-141"><span class="linenos"> 141</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> -</span><span id="L-142"><a href="#L-142"><span class="linenos"> 142</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-143"><a href="#L-143"><span class="linenos"> 143</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="L-144"><a href="#L-144"><span class="linenos"> 144</span></a> -</span><span id="L-145"><a href="#L-145"><span class="linenos"> 145</span></a> <span class="nd">@property</span> -</span><span id="L-146"><a href="#L-146"><span class="linenos"> 146</span></a> <span class="k">def</span> <span class="nf">is_string</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-147"><a href="#L-147"><span class="linenos"> 147</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-148"><a href="#L-148"><span class="linenos"> 148</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> -</span><span id="L-149"><a href="#L-149"><span class="linenos"> 149</span></a><span class="sd"> """</span> -</span><span id="L-150"><a href="#L-150"><span class="linenos"> 150</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="L-151"><a href="#L-151"><span class="linenos"> 151</span></a> -</span><span id="L-152"><a href="#L-152"><span class="linenos"> 152</span></a> <span class="nd">@property</span> -</span><span id="L-153"><a href="#L-153"><span class="linenos"> 153</span></a> <span class="k">def</span> <span class="nf">is_number</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-154"><a href="#L-154"><span class="linenos"> 154</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-155"><a href="#L-155"><span class="linenos"> 155</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> -</span><span id="L-156"><a href="#L-156"><span class="linenos"> 156</span></a><span class="sd"> """</span> -</span><span id="L-157"><a href="#L-157"><span class="linenos"> 157</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="L-158"><a href="#L-158"><span class="linenos"> 158</span></a> -</span><span id="L-159"><a href="#L-159"><span class="linenos"> 159</span></a> <span class="nd">@property</span> -</span><span id="L-160"><a href="#L-160"><span class="linenos"> 160</span></a> <span class="k">def</span> <span class="nf">is_int</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-161"><a href="#L-161"><span class="linenos"> 161</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-162"><a href="#L-162"><span class="linenos"> 162</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> -</span><span id="L-163"><a href="#L-163"><span class="linenos"> 163</span></a><span class="sd"> """</span> -</span><span id="L-164"><a href="#L-164"><span class="linenos"> 164</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_number</span><span class="p">:</span> -</span><span id="L-165"><a href="#L-165"><span class="linenos"> 165</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="L-166"><a href="#L-166"><span class="linenos"> 166</span></a> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="L-167"><a href="#L-167"><span class="linenos"> 167</span></a> <span class="k">return</span> <span class="kc">True</span> -</span><span id="L-168"><a href="#L-168"><span class="linenos"> 168</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> -</span><span id="L-169"><a href="#L-169"><span class="linenos"> 169</span></a> <span class="k">pass</span> -</span><span id="L-170"><a href="#L-170"><span class="linenos"> 170</span></a> <span class="k">return</span> <span class="kc">False</span> -</span><span id="L-171"><a href="#L-171"><span class="linenos"> 171</span></a> -</span><span id="L-172"><a href="#L-172"><span class="linenos"> 172</span></a> <span class="nd">@property</span> -</span><span id="L-173"><a href="#L-173"><span class="linenos"> 173</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-174"><a href="#L-174"><span class="linenos"> 174</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> -</span><span id="L-175"><a href="#L-175"><span class="linenos"> 175</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Star</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Column</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Star</span><span class="p">))</span> -</span><span id="L-176"><a href="#L-176"><span class="linenos"> 176</span></a> -</span><span id="L-177"><a href="#L-177"><span class="linenos"> 177</span></a> <span class="nd">@property</span> -</span><span id="L-178"><a href="#L-178"><span class="linenos"> 178</span></a> <span class="k">def</span> <span class="nf">alias</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-179"><a href="#L-179"><span class="linenos"> 179</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-180"><a href="#L-180"><span class="linenos"> 180</span></a><span class="sd"> Returns the alias of the expression, or an empty string if it's not aliased.</span> -</span><span id="L-181"><a href="#L-181"><span class="linenos"> 181</span></a><span class="sd"> """</span> -</span><span id="L-182"><a href="#L-182"><span class="linenos"> 182</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">),</span> <span class="n">TableAlias</span><span class="p">):</span> -</span><span id="L-183"><a href="#L-183"><span class="linenos"> 183</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"alias"</span><span class="p">]</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-184"><a href="#L-184"><span class="linenos"> 184</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> -</span><span id="L-185"><a href="#L-185"><span class="linenos"> 185</span></a> -</span><span id="L-186"><a href="#L-186"><span class="linenos"> 186</span></a> <span class="nd">@property</span> -</span><span id="L-187"><a href="#L-187"><span class="linenos"> 187</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-188"><a href="#L-188"><span class="linenos"> 188</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> -</span><span id="L-189"><a href="#L-189"><span class="linenos"> 189</span></a> -</span><span id="L-190"><a href="#L-190"><span class="linenos"> 190</span></a> <span class="nd">@property</span> -</span><span id="L-191"><a href="#L-191"><span class="linenos"> 191</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-192"><a href="#L-192"><span class="linenos"> 192</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-193"><a href="#L-193"><span class="linenos"> 193</span></a> -</span><span id="L-194"><a href="#L-194"><span class="linenos"> 194</span></a> <span class="nd">@property</span> -</span><span id="L-195"><a href="#L-195"><span class="linenos"> 195</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-196"><a href="#L-196"><span class="linenos"> 196</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-197"><a href="#L-197"><span class="linenos"> 197</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> -</span><span id="L-198"><a href="#L-198"><span class="linenos"> 198</span></a> -</span><span id="L-199"><a href="#L-199"><span class="linenos"> 199</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> -</span><span id="L-200"><a href="#L-200"><span class="linenos"> 200</span></a> -</span><span id="L-201"><a href="#L-201"><span class="linenos"> 201</span></a><span class="sd"> Example:</span> -</span><span id="L-202"><a href="#L-202"><span class="linenos"> 202</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-203"><a href="#L-203"><span class="linenos"> 203</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> -</span><span id="L-204"><a href="#L-204"><span class="linenos"> 204</span></a><span class="sd"> 'a'</span> -</span><span id="L-205"><a href="#L-205"><span class="linenos"> 205</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> -</span><span id="L-206"><a href="#L-206"><span class="linenos"> 206</span></a><span class="sd"> 'c'</span> -</span><span id="L-207"><a href="#L-207"><span class="linenos"> 207</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> -</span><span id="L-208"><a href="#L-208"><span class="linenos"> 208</span></a><span class="sd"> ''</span> -</span><span id="L-209"><a href="#L-209"><span class="linenos"> 209</span></a><span class="sd"> """</span> -</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="L-211"><a href="#L-211"><span class="linenos"> 211</span></a> -</span><span id="L-212"><a href="#L-212"><span class="linenos"> 212</span></a> <span class="nd">@property</span> -</span><span id="L-213"><a href="#L-213"><span class="linenos"> 213</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]:</span> -</span><span id="L-214"><a href="#L-214"><span class="linenos"> 214</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> -</span><span id="L-215"><a href="#L-215"><span class="linenos"> 215</span></a> -</span><span id="L-216"><a href="#L-216"><span class="linenos"> 216</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> -</span><span id="L-217"><a href="#L-217"><span class="linenos"> 217</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span> <span class="o">|</span> <span class="nb">str</span><span class="p">])</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-218"><a href="#L-218"><span class="linenos"> 218</span></a> <span class="k">if</span> <span class="n">dtype</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> -</span><span id="L-219"><a href="#L-219"><span class="linenos"> 219</span></a> <span class="n">dtype</span> <span class="o">=</span> <span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="L-220"><a href="#L-220"><span class="linenos"> 220</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="n">dtype</span> <span class="c1"># type: ignore</span> -</span><span id="L-221"><a href="#L-221"><span class="linenos"> 221</span></a> -</span><span id="L-222"><a href="#L-222"><span class="linenos"> 222</span></a> <span class="k">def</span> <span class="nf">__deepcopy__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">memo</span><span class="p">):</span> -</span><span id="L-223"><a href="#L-223"><span class="linenos"> 223</span></a> <span class="n">copy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="o">**</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">))</span> -</span><span id="L-224"><a href="#L-224"><span class="linenos"> 224</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> -</span><span id="L-225"><a href="#L-225"><span class="linenos"> 225</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> -</span><span id="L-226"><a href="#L-226"><span class="linenos"> 226</span></a> <span class="k">return</span> <span class="n">copy</span> -</span><span id="L-227"><a href="#L-227"><span class="linenos"> 227</span></a> -</span><span id="L-228"><a href="#L-228"><span class="linenos"> 228</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-229"><a href="#L-229"><span class="linenos"> 229</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-230"><a href="#L-230"><span class="linenos"> 230</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="L-231"><a href="#L-231"><span class="linenos"> 231</span></a><span class="sd"> """</span> -</span><span id="L-232"><a href="#L-232"><span class="linenos"> 232</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="L-233"><a href="#L-233"><span class="linenos"> 233</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-234"><a href="#L-234"><span class="linenos"> 234</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> -</span><span id="L-235"><a href="#L-235"><span class="linenos"> 235</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="L-236"><a href="#L-236"><span class="linenos"> 236</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> -</span><span id="L-237"><a href="#L-237"><span class="linenos"> 237</span></a> <span class="k">return</span> <span class="n">new</span> -</span><span id="L-238"><a href="#L-238"><span class="linenos"> 238</span></a> -</span><span id="L-239"><a href="#L-239"><span class="linenos"> 239</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="L-240"><a href="#L-240"><span class="linenos"> 240</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-241"><a href="#L-241"><span class="linenos"> 241</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> -</span><span id="L-242"><a href="#L-242"><span class="linenos"> 242</span></a> -</span><span id="L-243"><a href="#L-243"><span class="linenos"> 243</span></a><span class="sd"> Args:</span> -</span><span id="L-244"><a href="#L-244"><span class="linenos"> 244</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="L-245"><a href="#L-245"><span class="linenos"> 245</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="L-246"><a href="#L-246"><span class="linenos"> 246</span></a><span class="sd"> """</span> -</span><span id="L-247"><a href="#L-247"><span class="linenos"> 247</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="L-248"><a href="#L-248"><span class="linenos"> 248</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-249"><a href="#L-249"><span class="linenos"> 249</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="L-250"><a href="#L-250"><span class="linenos"> 250</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="L-251"><a href="#L-251"><span class="linenos"> 251</span></a> -</span><span id="L-252"><a href="#L-252"><span class="linenos"> 252</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="L-253"><a href="#L-253"><span class="linenos"> 253</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-254"><a href="#L-254"><span class="linenos"> 254</span></a><span class="sd"> Sets `arg_key` to `value`.</span> -</span><span id="L-255"><a href="#L-255"><span class="linenos"> 255</span></a> -</span><span id="L-256"><a href="#L-256"><span class="linenos"> 256</span></a><span class="sd"> Args:</span> -</span><span id="L-257"><a href="#L-257"><span class="linenos"> 257</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="L-258"><a href="#L-258"><span class="linenos"> 258</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="L-259"><a href="#L-259"><span class="linenos"> 259</span></a><span class="sd"> """</span> -</span><span id="L-260"><a href="#L-260"><span class="linenos"> 260</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> -</span><span id="L-261"><a href="#L-261"><span class="linenos"> 261</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="L-262"><a href="#L-262"><span class="linenos"> 262</span></a> -</span><span id="L-263"><a href="#L-263"><span class="linenos"> 263</span></a> <span class="k">def</span> <span class="nf">_set_parent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="L-264"><a href="#L-264"><span class="linenos"> 264</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-265"><a href="#L-265"><span class="linenos"> 265</span></a> <span class="n">value</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-266"><a href="#L-266"><span class="linenos"> 266</span></a> <span class="n">value</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> -</span><span id="L-267"><a href="#L-267"><span class="linenos"> 267</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="L-268"><a href="#L-268"><span class="linenos"> 268</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">:</span> -</span><span id="L-269"><a href="#L-269"><span class="linenos"> 269</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-270"><a href="#L-270"><span class="linenos"> 270</span></a> <span class="n">v</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-271"><a href="#L-271"><span class="linenos"> 271</span></a> <span class="n">v</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> -</span><span id="L-272"><a href="#L-272"><span class="linenos"> 272</span></a> -</span><span id="L-273"><a href="#L-273"><span class="linenos"> 273</span></a> <span class="nd">@property</span> -</span><span id="L-274"><a href="#L-274"><span class="linenos"> 274</span></a> <span class="k">def</span> <span class="nf">depth</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-275"><a href="#L-275"><span class="linenos"> 275</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-276"><a href="#L-276"><span class="linenos"> 276</span></a><span class="sd"> Returns the depth of this tree.</span> -</span><span id="L-277"><a href="#L-277"><span class="linenos"> 277</span></a><span class="sd"> """</span> -</span><span id="L-278"><a href="#L-278"><span class="linenos"> 278</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="L-279"><a href="#L-279"><span class="linenos"> 279</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span> -</span><span id="L-280"><a href="#L-280"><span class="linenos"> 280</span></a> <span class="k">return</span> <span class="mi">0</span> -</span><span id="L-281"><a href="#L-281"><span class="linenos"> 281</span></a> -</span><span id="L-282"><a href="#L-282"><span class="linenos"> 282</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="L-283"><a href="#L-283"><span class="linenos"> 283</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-284"><a href="#L-284"><span class="linenos"> 284</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="L-285"><a href="#L-285"><span class="linenos"> 285</span></a><span class="sd"> the specified types.</span> +</span><span id="L-93"><a href="#L-93"><span class="linenos"> 93</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="L-94"><a href="#L-94"><span class="linenos"> 94</span></a> +</span><span id="L-95"><a href="#L-95"><span class="linenos"> 95</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-96"><a href="#L-96"><span class="linenos"> 96</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="L-97"><a href="#L-97"><span class="linenos"> 97</span></a> +</span><span id="L-98"><a href="#L-98"><span class="linenos"> 98</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-99"><a href="#L-99"><span class="linenos"> 99</span></a> <span class="k">return</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_args</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> +</span><span id="L-100"><a href="#L-100"><span class="linenos"> 100</span></a> +</span><span id="L-101"><a href="#L-101"><span class="linenos"> 101</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span> +</span><span id="L-102"><a href="#L-102"><span class="linenos"> 102</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">(</span> +</span><span id="L-103"><a href="#L-103"><span class="linenos"> 103</span></a> <span class="p">(</span> +</span><span id="L-104"><a href="#L-104"><span class="linenos"> 104</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> +</span><span id="L-105"><a href="#L-105"><span class="linenos"> 105</span></a> <span class="nb">tuple</span><span class="p">(</span> +</span><span id="L-106"><a href="#L-106"><span class="linenos"> 106</span></a> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="k">else</span> <span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="L-107"><a href="#L-107"><span class="linenos"> 107</span></a> <span class="p">),</span> +</span><span id="L-108"><a href="#L-108"><span class="linenos"> 108</span></a> <span class="p">)</span> +</span><span id="L-109"><a href="#L-109"><span class="linenos"> 109</span></a> <span class="p">)</span> +</span><span id="L-110"><a href="#L-110"><span class="linenos"> 110</span></a> +</span><span id="L-111"><a href="#L-111"><span class="linenos"> 111</span></a> <span class="nd">@property</span> +</span><span id="L-112"><a href="#L-112"><span class="linenos"> 112</span></a> <span class="k">def</span> <span class="nf">this</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-113"><a href="#L-113"><span class="linenos"> 113</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-114"><a href="#L-114"><span class="linenos"> 114</span></a><span class="sd"> Retrieves the argument with key "this".</span> +</span><span id="L-115"><a href="#L-115"><span class="linenos"> 115</span></a><span class="sd"> """</span> +</span><span id="L-116"><a href="#L-116"><span class="linenos"> 116</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-117"><a href="#L-117"><span class="linenos"> 117</span></a> +</span><span id="L-118"><a href="#L-118"><span class="linenos"> 118</span></a> <span class="nd">@property</span> +</span><span id="L-119"><a href="#L-119"><span class="linenos"> 119</span></a> <span class="k">def</span> <span class="nf">expression</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-120"><a href="#L-120"><span class="linenos"> 120</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-121"><a href="#L-121"><span class="linenos"> 121</span></a><span class="sd"> Retrieves the argument with key "expression".</span> +</span><span id="L-122"><a href="#L-122"><span class="linenos"> 122</span></a><span class="sd"> """</span> +</span><span id="L-123"><a href="#L-123"><span class="linenos"> 123</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expression"</span><span class="p">)</span> +</span><span id="L-124"><a href="#L-124"><span class="linenos"> 124</span></a> +</span><span id="L-125"><a href="#L-125"><span class="linenos"> 125</span></a> <span class="nd">@property</span> +</span><span id="L-126"><a href="#L-126"><span class="linenos"> 126</span></a> <span class="k">def</span> <span class="nf">expressions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-127"><a href="#L-127"><span class="linenos"> 127</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-128"><a href="#L-128"><span class="linenos"> 128</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> +</span><span id="L-129"><a href="#L-129"><span class="linenos"> 129</span></a><span class="sd"> """</span> +</span><span id="L-130"><a href="#L-130"><span class="linenos"> 130</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expressions"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> +</span><span id="L-131"><a href="#L-131"><span class="linenos"> 131</span></a> +</span><span id="L-132"><a href="#L-132"><span class="linenos"> 132</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-133"><a href="#L-133"><span class="linenos"> 133</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-134"><a href="#L-134"><span class="linenos"> 134</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> +</span><span id="L-135"><a href="#L-135"><span class="linenos"> 135</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> +</span><span id="L-136"><a href="#L-136"><span class="linenos"> 136</span></a><span class="sd"> """</span> +</span><span id="L-137"><a href="#L-137"><span class="linenos"> 137</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> +</span><span id="L-138"><a href="#L-138"><span class="linenos"> 138</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-139"><a href="#L-139"><span class="linenos"> 139</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="L-140"><a href="#L-140"><span class="linenos"> 140</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> +</span><span id="L-141"><a href="#L-141"><span class="linenos"> 141</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-142"><a href="#L-142"><span class="linenos"> 142</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> +</span><span id="L-143"><a href="#L-143"><span class="linenos"> 143</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-144"><a href="#L-144"><span class="linenos"> 144</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="L-145"><a href="#L-145"><span class="linenos"> 145</span></a> +</span><span id="L-146"><a href="#L-146"><span class="linenos"> 146</span></a> <span class="nd">@property</span> +</span><span id="L-147"><a href="#L-147"><span class="linenos"> 147</span></a> <span class="k">def</span> <span class="nf">is_string</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-148"><a href="#L-148"><span class="linenos"> 148</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-149"><a href="#L-149"><span class="linenos"> 149</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> +</span><span id="L-150"><a href="#L-150"><span class="linenos"> 150</span></a><span class="sd"> """</span> +</span><span id="L-151"><a href="#L-151"><span class="linenos"> 151</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="L-152"><a href="#L-152"><span class="linenos"> 152</span></a> +</span><span id="L-153"><a href="#L-153"><span class="linenos"> 153</span></a> <span class="nd">@property</span> +</span><span id="L-154"><a href="#L-154"><span class="linenos"> 154</span></a> <span class="k">def</span> <span class="nf">is_number</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-155"><a href="#L-155"><span class="linenos"> 155</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-156"><a href="#L-156"><span class="linenos"> 156</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> +</span><span id="L-157"><a href="#L-157"><span class="linenos"> 157</span></a><span class="sd"> """</span> +</span><span id="L-158"><a href="#L-158"><span class="linenos"> 158</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="L-159"><a href="#L-159"><span class="linenos"> 159</span></a> +</span><span id="L-160"><a href="#L-160"><span class="linenos"> 160</span></a> <span class="nd">@property</span> +</span><span id="L-161"><a href="#L-161"><span class="linenos"> 161</span></a> <span class="k">def</span> <span class="nf">is_int</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-162"><a href="#L-162"><span class="linenos"> 162</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-163"><a href="#L-163"><span class="linenos"> 163</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> +</span><span id="L-164"><a href="#L-164"><span class="linenos"> 164</span></a><span class="sd"> """</span> +</span><span id="L-165"><a href="#L-165"><span class="linenos"> 165</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_number</span><span class="p">:</span> +</span><span id="L-166"><a href="#L-166"><span class="linenos"> 166</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="L-167"><a href="#L-167"><span class="linenos"> 167</span></a> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-168"><a href="#L-168"><span class="linenos"> 168</span></a> <span class="k">return</span> <span class="kc">True</span> +</span><span id="L-169"><a href="#L-169"><span class="linenos"> 169</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> +</span><span id="L-170"><a href="#L-170"><span class="linenos"> 170</span></a> <span class="k">pass</span> +</span><span id="L-171"><a href="#L-171"><span class="linenos"> 171</span></a> <span class="k">return</span> <span class="kc">False</span> +</span><span id="L-172"><a href="#L-172"><span class="linenos"> 172</span></a> +</span><span id="L-173"><a href="#L-173"><span class="linenos"> 173</span></a> <span class="nd">@property</span> +</span><span id="L-174"><a href="#L-174"><span class="linenos"> 174</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-175"><a href="#L-175"><span class="linenos"> 175</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> +</span><span id="L-176"><a href="#L-176"><span class="linenos"> 176</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Star</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Column</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Star</span><span class="p">))</span> +</span><span id="L-177"><a href="#L-177"><span class="linenos"> 177</span></a> +</span><span id="L-178"><a href="#L-178"><span class="linenos"> 178</span></a> <span class="nd">@property</span> +</span><span id="L-179"><a href="#L-179"><span class="linenos"> 179</span></a> <span class="k">def</span> <span class="nf">alias</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-180"><a href="#L-180"><span class="linenos"> 180</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-181"><a href="#L-181"><span class="linenos"> 181</span></a><span class="sd"> Returns the alias of the expression, or an empty string if it's not aliased.</span> +</span><span id="L-182"><a href="#L-182"><span class="linenos"> 182</span></a><span class="sd"> """</span> +</span><span id="L-183"><a href="#L-183"><span class="linenos"> 183</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">),</span> <span class="n">TableAlias</span><span class="p">):</span> +</span><span id="L-184"><a href="#L-184"><span class="linenos"> 184</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"alias"</span><span class="p">]</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-185"><a href="#L-185"><span class="linenos"> 185</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="L-186"><a href="#L-186"><span class="linenos"> 186</span></a> +</span><span id="L-187"><a href="#L-187"><span class="linenos"> 187</span></a> <span class="nd">@property</span> +</span><span id="L-188"><a href="#L-188"><span class="linenos"> 188</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-189"><a href="#L-189"><span class="linenos"> 189</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> +</span><span id="L-190"><a href="#L-190"><span class="linenos"> 190</span></a> +</span><span id="L-191"><a href="#L-191"><span class="linenos"> 191</span></a> <span class="nd">@property</span> +</span><span id="L-192"><a href="#L-192"><span class="linenos"> 192</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-193"><a href="#L-193"><span class="linenos"> 193</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-194"><a href="#L-194"><span class="linenos"> 194</span></a> +</span><span id="L-195"><a href="#L-195"><span class="linenos"> 195</span></a> <span class="nd">@property</span> +</span><span id="L-196"><a href="#L-196"><span class="linenos"> 196</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-197"><a href="#L-197"><span class="linenos"> 197</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-198"><a href="#L-198"><span class="linenos"> 198</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> +</span><span id="L-199"><a href="#L-199"><span class="linenos"> 199</span></a> +</span><span id="L-200"><a href="#L-200"><span class="linenos"> 200</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> +</span><span id="L-201"><a href="#L-201"><span class="linenos"> 201</span></a> +</span><span id="L-202"><a href="#L-202"><span class="linenos"> 202</span></a><span class="sd"> Example:</span> +</span><span id="L-203"><a href="#L-203"><span class="linenos"> 203</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-204"><a href="#L-204"><span class="linenos"> 204</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> +</span><span id="L-205"><a href="#L-205"><span class="linenos"> 205</span></a><span class="sd"> 'a'</span> +</span><span id="L-206"><a href="#L-206"><span class="linenos"> 206</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> +</span><span id="L-207"><a href="#L-207"><span class="linenos"> 207</span></a><span class="sd"> 'c'</span> +</span><span id="L-208"><a href="#L-208"><span class="linenos"> 208</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> +</span><span id="L-209"><a href="#L-209"><span class="linenos"> 209</span></a><span class="sd"> ''</span> +</span><span id="L-210"><a href="#L-210"><span class="linenos"> 210</span></a><span class="sd"> """</span> +</span><span id="L-211"><a href="#L-211"><span class="linenos"> 211</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="L-212"><a href="#L-212"><span class="linenos"> 212</span></a> +</span><span id="L-213"><a href="#L-213"><span class="linenos"> 213</span></a> <span class="nd">@property</span> +</span><span id="L-214"><a href="#L-214"><span class="linenos"> 214</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]:</span> +</span><span id="L-215"><a href="#L-215"><span class="linenos"> 215</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> +</span><span id="L-216"><a href="#L-216"><span class="linenos"> 216</span></a> +</span><span id="L-217"><a href="#L-217"><span class="linenos"> 217</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> +</span><span id="L-218"><a href="#L-218"><span class="linenos"> 218</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span> <span class="o">|</span> <span class="nb">str</span><span class="p">])</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-219"><a href="#L-219"><span class="linenos"> 219</span></a> <span class="k">if</span> <span class="n">dtype</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> +</span><span id="L-220"><a href="#L-220"><span class="linenos"> 220</span></a> <span class="n">dtype</span> <span class="o">=</span> <span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="L-221"><a href="#L-221"><span class="linenos"> 221</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="n">dtype</span> <span class="c1"># type: ignore</span> +</span><span id="L-222"><a href="#L-222"><span class="linenos"> 222</span></a> +</span><span id="L-223"><a href="#L-223"><span class="linenos"> 223</span></a> <span class="nd">@property</span> +</span><span id="L-224"><a href="#L-224"><span class="linenos"> 224</span></a> <span class="k">def</span> <span class="nf">meta</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]:</span> +</span><span id="L-225"><a href="#L-225"><span class="linenos"> 225</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-226"><a href="#L-226"><span class="linenos"> 226</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-227"><a href="#L-227"><span class="linenos"> 227</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> +</span><span id="L-228"><a href="#L-228"><span class="linenos"> 228</span></a> +</span><span id="L-229"><a href="#L-229"><span class="linenos"> 229</span></a> <span class="k">def</span> <span class="nf">__deepcopy__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">memo</span><span class="p">):</span> +</span><span id="L-230"><a href="#L-230"><span class="linenos"> 230</span></a> <span class="n">copy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="o">**</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">))</span> +</span><span id="L-231"><a href="#L-231"><span class="linenos"> 231</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-232"><a href="#L-232"><span class="linenos"> 232</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="p">)</span> +</span><span id="L-233"><a href="#L-233"><span class="linenos"> 233</span></a> +</span><span id="L-234"><a href="#L-234"><span class="linenos"> 234</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-235"><a href="#L-235"><span class="linenos"> 235</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="L-236"><a href="#L-236"><span class="linenos"> 236</span></a> +</span><span id="L-237"><a href="#L-237"><span class="linenos"> 237</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-238"><a href="#L-238"><span class="linenos"> 238</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_meta</span><span class="p">)</span> +</span><span id="L-239"><a href="#L-239"><span class="linenos"> 239</span></a> +</span><span id="L-240"><a href="#L-240"><span class="linenos"> 240</span></a> <span class="k">return</span> <span class="n">copy</span> +</span><span id="L-241"><a href="#L-241"><span class="linenos"> 241</span></a> +</span><span id="L-242"><a href="#L-242"><span class="linenos"> 242</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-243"><a href="#L-243"><span class="linenos"> 243</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-244"><a href="#L-244"><span class="linenos"> 244</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="L-245"><a href="#L-245"><span class="linenos"> 245</span></a><span class="sd"> """</span> +</span><span id="L-246"><a href="#L-246"><span class="linenos"> 246</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="L-247"><a href="#L-247"><span class="linenos"> 247</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-248"><a href="#L-248"><span class="linenos"> 248</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> +</span><span id="L-249"><a href="#L-249"><span class="linenos"> 249</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="L-250"><a href="#L-250"><span class="linenos"> 250</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> +</span><span id="L-251"><a href="#L-251"><span class="linenos"> 251</span></a> <span class="k">return</span> <span class="n">new</span> +</span><span id="L-252"><a href="#L-252"><span class="linenos"> 252</span></a> +</span><span id="L-253"><a href="#L-253"><span class="linenos"> 253</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="L-254"><a href="#L-254"><span class="linenos"> 254</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-255"><a href="#L-255"><span class="linenos"> 255</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> +</span><span id="L-256"><a href="#L-256"><span class="linenos"> 256</span></a> +</span><span id="L-257"><a href="#L-257"><span class="linenos"> 257</span></a><span class="sd"> Args:</span> +</span><span id="L-258"><a href="#L-258"><span class="linenos"> 258</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="L-259"><a href="#L-259"><span class="linenos"> 259</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="L-260"><a href="#L-260"><span class="linenos"> 260</span></a><span class="sd"> """</span> +</span><span id="L-261"><a href="#L-261"><span class="linenos"> 261</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="L-262"><a href="#L-262"><span class="linenos"> 262</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-263"><a href="#L-263"><span class="linenos"> 263</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="L-264"><a href="#L-264"><span class="linenos"> 264</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="L-265"><a href="#L-265"><span class="linenos"> 265</span></a> +</span><span id="L-266"><a href="#L-266"><span class="linenos"> 266</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="L-267"><a href="#L-267"><span class="linenos"> 267</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-268"><a href="#L-268"><span class="linenos"> 268</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="L-269"><a href="#L-269"><span class="linenos"> 269</span></a> +</span><span id="L-270"><a href="#L-270"><span class="linenos"> 270</span></a><span class="sd"> Args:</span> +</span><span id="L-271"><a href="#L-271"><span class="linenos"> 271</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="L-272"><a href="#L-272"><span class="linenos"> 272</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="L-273"><a href="#L-273"><span class="linenos"> 273</span></a><span class="sd"> """</span> +</span><span id="L-274"><a href="#L-274"><span class="linenos"> 274</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> +</span><span id="L-275"><a href="#L-275"><span class="linenos"> 275</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="L-276"><a href="#L-276"><span class="linenos"> 276</span></a> +</span><span id="L-277"><a href="#L-277"><span class="linenos"> 277</span></a> <span class="k">def</span> <span class="nf">_set_parent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="L-278"><a href="#L-278"><span class="linenos"> 278</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-279"><a href="#L-279"><span class="linenos"> 279</span></a> <span class="n">value</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-280"><a href="#L-280"><span class="linenos"> 280</span></a> <span class="n">value</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> +</span><span id="L-281"><a href="#L-281"><span class="linenos"> 281</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="L-282"><a href="#L-282"><span class="linenos"> 282</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">:</span> +</span><span id="L-283"><a href="#L-283"><span class="linenos"> 283</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-284"><a href="#L-284"><span class="linenos"> 284</span></a> <span class="n">v</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-285"><a href="#L-285"><span class="linenos"> 285</span></a> <span class="n">v</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> </span><span id="L-286"><a href="#L-286"><span class="linenos"> 286</span></a> -</span><span id="L-287"><a href="#L-287"><span class="linenos"> 287</span></a><span class="sd"> Args:</span> -</span><span id="L-288"><a href="#L-288"><span class="linenos"> 288</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="L-289"><a href="#L-289"><span class="linenos"> 289</span></a> -</span><span id="L-290"><a href="#L-290"><span class="linenos"> 290</span></a><span class="sd"> Returns:</span> -</span><span id="L-291"><a href="#L-291"><span class="linenos"> 291</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> -</span><span id="L-292"><a href="#L-292"><span class="linenos"> 292</span></a><span class="sd"> """</span> -</span><span id="L-293"><a href="#L-293"><span class="linenos"> 293</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-294"><a href="#L-294"><span class="linenos"> 294</span></a> -</span><span id="L-295"><a href="#L-295"><span class="linenos"> 295</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="L-296"><a href="#L-296"><span class="linenos"> 296</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-297"><a href="#L-297"><span class="linenos"> 297</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> -</span><span id="L-298"><a href="#L-298"><span class="linenos"> 298</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="L-299"><a href="#L-299"><span class="linenos"> 299</span></a> -</span><span id="L-300"><a href="#L-300"><span class="linenos"> 300</span></a><span class="sd"> Args:</span> -</span><span id="L-301"><a href="#L-301"><span class="linenos"> 301</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="L-302"><a href="#L-302"><span class="linenos"> 302</span></a> -</span><span id="L-303"><a href="#L-303"><span class="linenos"> 303</span></a><span class="sd"> Returns:</span> -</span><span id="L-304"><a href="#L-304"><span class="linenos"> 304</span></a><span class="sd"> The generator object.</span> -</span><span id="L-305"><a href="#L-305"><span class="linenos"> 305</span></a><span class="sd"> """</span> -</span><span id="L-306"><a href="#L-306"><span class="linenos"> 306</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> -</span><span id="L-307"><a href="#L-307"><span class="linenos"> 307</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="L-308"><a href="#L-308"><span class="linenos"> 308</span></a> <span class="k">yield</span> <span class="n">expression</span> -</span><span id="L-309"><a href="#L-309"><span class="linenos"> 309</span></a> -</span><span id="L-310"><a href="#L-310"><span class="linenos"> 310</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> -</span><span id="L-311"><a href="#L-311"><span class="linenos"> 311</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-312"><a href="#L-312"><span class="linenos"> 312</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="L-287"><a href="#L-287"><span class="linenos"> 287</span></a> <span class="nd">@property</span> +</span><span id="L-288"><a href="#L-288"><span class="linenos"> 288</span></a> <span class="k">def</span> <span class="nf">depth</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-289"><a href="#L-289"><span class="linenos"> 289</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-290"><a href="#L-290"><span class="linenos"> 290</span></a><span class="sd"> Returns the depth of this tree.</span> +</span><span id="L-291"><a href="#L-291"><span class="linenos"> 291</span></a><span class="sd"> """</span> +</span><span id="L-292"><a href="#L-292"><span class="linenos"> 292</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="L-293"><a href="#L-293"><span class="linenos"> 293</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span> +</span><span id="L-294"><a href="#L-294"><span class="linenos"> 294</span></a> <span class="k">return</span> <span class="mi">0</span> +</span><span id="L-295"><a href="#L-295"><span class="linenos"> 295</span></a> +</span><span id="L-296"><a href="#L-296"><span class="linenos"> 296</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-297"><a href="#L-297"><span class="linenos"> 297</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-298"><a href="#L-298"><span class="linenos"> 298</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="L-299"><a href="#L-299"><span class="linenos"> 299</span></a><span class="sd"> the specified types.</span> +</span><span id="L-300"><a href="#L-300"><span class="linenos"> 300</span></a> +</span><span id="L-301"><a href="#L-301"><span class="linenos"> 301</span></a><span class="sd"> Args:</span> +</span><span id="L-302"><a href="#L-302"><span class="linenos"> 302</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="L-303"><a href="#L-303"><span class="linenos"> 303</span></a> +</span><span id="L-304"><a href="#L-304"><span class="linenos"> 304</span></a><span class="sd"> Returns:</span> +</span><span id="L-305"><a href="#L-305"><span class="linenos"> 305</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> +</span><span id="L-306"><a href="#L-306"><span class="linenos"> 306</span></a><span class="sd"> """</span> +</span><span id="L-307"><a href="#L-307"><span class="linenos"> 307</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="L-308"><a href="#L-308"><span class="linenos"> 308</span></a> +</span><span id="L-309"><a href="#L-309"><span class="linenos"> 309</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-310"><a href="#L-310"><span class="linenos"> 310</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-311"><a href="#L-311"><span class="linenos"> 311</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> +</span><span id="L-312"><a href="#L-312"><span class="linenos"> 312</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> </span><span id="L-313"><a href="#L-313"><span class="linenos"> 313</span></a> </span><span id="L-314"><a href="#L-314"><span class="linenos"> 314</span></a><span class="sd"> Args:</span> </span><span id="L-315"><a href="#L-315"><span class="linenos"> 315</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> </span><span id="L-316"><a href="#L-316"><span class="linenos"> 316</span></a> </span><span id="L-317"><a href="#L-317"><span class="linenos"> 317</span></a><span class="sd"> Returns:</span> -</span><span id="L-318"><a href="#L-318"><span class="linenos"> 318</span></a><span class="sd"> The parent node.</span> +</span><span id="L-318"><a href="#L-318"><span class="linenos"> 318</span></a><span class="sd"> The generator object.</span> </span><span id="L-319"><a href="#L-319"><span class="linenos"> 319</span></a><span class="sd"> """</span> -</span><span id="L-320"><a href="#L-320"><span class="linenos"> 320</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-321"><a href="#L-321"><span class="linenos"> 321</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="L-322"><a href="#L-322"><span class="linenos"> 322</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-323"><a href="#L-323"><span class="linenos"> 323</span></a> <span class="k">return</span> <span class="n">ancestor</span> -</span><span id="L-324"><a href="#L-324"><span class="linenos"> 324</span></a> -</span><span id="L-325"><a href="#L-325"><span class="linenos"> 325</span></a> <span class="nd">@property</span> -</span><span id="L-326"><a href="#L-326"><span class="linenos"> 326</span></a> <span class="k">def</span> <span class="nf">parent_select</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-327"><a href="#L-327"><span class="linenos"> 327</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-328"><a href="#L-328"><span class="linenos"> 328</span></a><span class="sd"> Returns the parent select statement.</span> -</span><span id="L-329"><a href="#L-329"><span class="linenos"> 329</span></a><span class="sd"> """</span> -</span><span id="L-330"><a href="#L-330"><span class="linenos"> 330</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_ancestor</span><span class="p">(</span><span class="n">Select</span><span class="p">)</span> -</span><span id="L-331"><a href="#L-331"><span class="linenos"> 331</span></a> -</span><span id="L-332"><a href="#L-332"><span class="linenos"> 332</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="L-333"><a href="#L-333"><span class="linenos"> 333</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-334"><a href="#L-334"><span class="linenos"> 334</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="L-335"><a href="#L-335"><span class="linenos"> 335</span></a> -</span><span id="L-336"><a href="#L-336"><span class="linenos"> 336</span></a><span class="sd"> Args:</span> -</span><span id="L-337"><a href="#L-337"><span class="linenos"> 337</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="L-338"><a href="#L-338"><span class="linenos"> 338</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="L-339"><a href="#L-339"><span class="linenos"> 339</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="L-340"><a href="#L-340"><span class="linenos"> 340</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> -</span><span id="L-341"><a href="#L-341"><span class="linenos"> 341</span></a> -</span><span id="L-342"><a href="#L-342"><span class="linenos"> 342</span></a><span class="sd"> Returns:</span> -</span><span id="L-343"><a href="#L-343"><span class="linenos"> 343</span></a><span class="sd"> the generator object.</span> -</span><span id="L-344"><a href="#L-344"><span class="linenos"> 344</span></a><span class="sd"> """</span> -</span><span id="L-345"><a href="#L-345"><span class="linenos"> 345</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="L-346"><a href="#L-346"><span class="linenos"> 346</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> -</span><span id="L-347"><a href="#L-347"><span class="linenos"> 347</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-348"><a href="#L-348"><span class="linenos"> 348</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="L-320"><a href="#L-320"><span class="linenos"> 320</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> +</span><span id="L-321"><a href="#L-321"><span class="linenos"> 321</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="L-322"><a href="#L-322"><span class="linenos"> 322</span></a> <span class="k">yield</span> <span class="n">expression</span> +</span><span id="L-323"><a href="#L-323"><span class="linenos"> 323</span></a> +</span><span id="L-324"><a href="#L-324"><span class="linenos"> 324</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> +</span><span id="L-325"><a href="#L-325"><span class="linenos"> 325</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-326"><a href="#L-326"><span class="linenos"> 326</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="L-327"><a href="#L-327"><span class="linenos"> 327</span></a> +</span><span id="L-328"><a href="#L-328"><span class="linenos"> 328</span></a><span class="sd"> Args:</span> +</span><span id="L-329"><a href="#L-329"><span class="linenos"> 329</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="L-330"><a href="#L-330"><span class="linenos"> 330</span></a> +</span><span id="L-331"><a href="#L-331"><span class="linenos"> 331</span></a><span class="sd"> Returns:</span> +</span><span id="L-332"><a href="#L-332"><span class="linenos"> 332</span></a><span class="sd"> The parent node.</span> +</span><span id="L-333"><a href="#L-333"><span class="linenos"> 333</span></a><span class="sd"> """</span> +</span><span id="L-334"><a href="#L-334"><span class="linenos"> 334</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-335"><a href="#L-335"><span class="linenos"> 335</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="L-336"><a href="#L-336"><span class="linenos"> 336</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-337"><a href="#L-337"><span class="linenos"> 337</span></a> <span class="k">return</span> <span class="n">ancestor</span> +</span><span id="L-338"><a href="#L-338"><span class="linenos"> 338</span></a> +</span><span id="L-339"><a href="#L-339"><span class="linenos"> 339</span></a> <span class="nd">@property</span> +</span><span id="L-340"><a href="#L-340"><span class="linenos"> 340</span></a> <span class="k">def</span> <span class="nf">parent_select</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-341"><a href="#L-341"><span class="linenos"> 341</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-342"><a href="#L-342"><span class="linenos"> 342</span></a><span class="sd"> Returns the parent select statement.</span> +</span><span id="L-343"><a href="#L-343"><span class="linenos"> 343</span></a><span class="sd"> """</span> +</span><span id="L-344"><a href="#L-344"><span class="linenos"> 344</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_ancestor</span><span class="p">(</span><span class="n">Select</span><span class="p">)</span> +</span><span id="L-345"><a href="#L-345"><span class="linenos"> 345</span></a> +</span><span id="L-346"><a href="#L-346"><span class="linenos"> 346</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="L-347"><a href="#L-347"><span class="linenos"> 347</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-348"><a href="#L-348"><span class="linenos"> 348</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> </span><span id="L-349"><a href="#L-349"><span class="linenos"> 349</span></a> -</span><span id="L-350"><a href="#L-350"><span class="linenos"> 350</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="L-351"><a href="#L-351"><span class="linenos"> 351</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-352"><a href="#L-352"><span class="linenos"> 352</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="L-353"><a href="#L-353"><span class="linenos"> 353</span></a><span class="sd"> the DFS (Depth-first) order.</span> -</span><span id="L-354"><a href="#L-354"><span class="linenos"> 354</span></a> -</span><span id="L-355"><a href="#L-355"><span class="linenos"> 355</span></a><span class="sd"> Returns:</span> -</span><span id="L-356"><a href="#L-356"><span class="linenos"> 356</span></a><span class="sd"> The generator object.</span> -</span><span id="L-357"><a href="#L-357"><span class="linenos"> 357</span></a><span class="sd"> """</span> -</span><span id="L-358"><a href="#L-358"><span class="linenos"> 358</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-359"><a href="#L-359"><span class="linenos"> 359</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="L-360"><a href="#L-360"><span class="linenos"> 360</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="L-361"><a href="#L-361"><span class="linenos"> 361</span></a> <span class="k">return</span> -</span><span id="L-362"><a href="#L-362"><span class="linenos"> 362</span></a> -</span><span id="L-363"><a href="#L-363"><span class="linenos"> 363</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-364"><a href="#L-364"><span class="linenos"> 364</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="L-365"><a href="#L-365"><span class="linenos"> 365</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-366"><a href="#L-366"><span class="linenos"> 366</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> -</span><span id="L-367"><a href="#L-367"><span class="linenos"> 367</span></a> -</span><span id="L-368"><a href="#L-368"><span class="linenos"> 368</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="L-369"><a href="#L-369"><span class="linenos"> 369</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-370"><a href="#L-370"><span class="linenos"> 370</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="L-371"><a href="#L-371"><span class="linenos"> 371</span></a><span class="sd"> the BFS (Breadth-first) order.</span> -</span><span id="L-372"><a href="#L-372"><span class="linenos"> 372</span></a> -</span><span id="L-373"><a href="#L-373"><span class="linenos"> 373</span></a><span class="sd"> Returns:</span> -</span><span id="L-374"><a href="#L-374"><span class="linenos"> 374</span></a><span class="sd"> The generator object.</span> -</span><span id="L-375"><a href="#L-375"><span class="linenos"> 375</span></a><span class="sd"> """</span> -</span><span id="L-376"><a href="#L-376"><span class="linenos"> 376</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> -</span><span id="L-377"><a href="#L-377"><span class="linenos"> 377</span></a> -</span><span id="L-378"><a href="#L-378"><span class="linenos"> 378</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="L-379"><a href="#L-379"><span class="linenos"> 379</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> -</span><span id="L-380"><a href="#L-380"><span class="linenos"> 380</span></a> -</span><span id="L-381"><a href="#L-381"><span class="linenos"> 381</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="L-382"><a href="#L-382"><span class="linenos"> 382</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="L-383"><a href="#L-383"><span class="linenos"> 383</span></a> <span class="k">continue</span> -</span><span id="L-384"><a href="#L-384"><span class="linenos"> 384</span></a> -</span><span id="L-385"><a href="#L-385"><span class="linenos"> 385</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-386"><a href="#L-386"><span class="linenos"> 386</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-387"><a href="#L-387"><span class="linenos"> 387</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="L-388"><a href="#L-388"><span class="linenos"> 388</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-389"><a href="#L-389"><span class="linenos"> 389</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> -</span><span id="L-390"><a href="#L-390"><span class="linenos"> 390</span></a> -</span><span id="L-391"><a href="#L-391"><span class="linenos"> 391</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-392"><a href="#L-392"><span class="linenos"> 392</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-393"><a href="#L-393"><span class="linenos"> 393</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="L-394"><a href="#L-394"><span class="linenos"> 394</span></a><span class="sd"> """</span> -</span><span id="L-395"><a href="#L-395"><span class="linenos"> 395</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-396"><a href="#L-396"><span class="linenos"> 396</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> -</span><span id="L-397"><a href="#L-397"><span class="linenos"> 397</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-398"><a href="#L-398"><span class="linenos"> 398</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-399"><a href="#L-399"><span class="linenos"> 399</span></a> -</span><span id="L-400"><a href="#L-400"><span class="linenos"> 400</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-401"><a href="#L-401"><span class="linenos"> 401</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-402"><a href="#L-402"><span class="linenos"> 402</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="L-403"><a href="#L-403"><span class="linenos"> 403</span></a><span class="sd"> """</span> -</span><span id="L-404"><a href="#L-404"><span class="linenos"> 404</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> -</span><span id="L-405"><a href="#L-405"><span class="linenos"> 405</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-406"><a href="#L-406"><span class="linenos"> 406</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="L-407"><a href="#L-407"><span class="linenos"> 407</span></a> -</span><span id="L-408"><a href="#L-408"><span class="linenos"> 408</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-409"><a href="#L-409"><span class="linenos"> 409</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-410"><a href="#L-410"><span class="linenos"> 410</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="L-411"><a href="#L-411"><span class="linenos"> 411</span></a><span class="sd"> """</span> -</span><span id="L-412"><a href="#L-412"><span class="linenos"> 412</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> +</span><span id="L-350"><a href="#L-350"><span class="linenos"> 350</span></a><span class="sd"> Args:</span> +</span><span id="L-351"><a href="#L-351"><span class="linenos"> 351</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="L-352"><a href="#L-352"><span class="linenos"> 352</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="L-353"><a href="#L-353"><span class="linenos"> 353</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="L-354"><a href="#L-354"><span class="linenos"> 354</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> +</span><span id="L-355"><a href="#L-355"><span class="linenos"> 355</span></a> +</span><span id="L-356"><a href="#L-356"><span class="linenos"> 356</span></a><span class="sd"> Returns:</span> +</span><span id="L-357"><a href="#L-357"><span class="linenos"> 357</span></a><span class="sd"> the generator object.</span> +</span><span id="L-358"><a href="#L-358"><span class="linenos"> 358</span></a><span class="sd"> """</span> +</span><span id="L-359"><a href="#L-359"><span class="linenos"> 359</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="L-360"><a href="#L-360"><span class="linenos"> 360</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="L-361"><a href="#L-361"><span class="linenos"> 361</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-362"><a href="#L-362"><span class="linenos"> 362</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="L-363"><a href="#L-363"><span class="linenos"> 363</span></a> +</span><span id="L-364"><a href="#L-364"><span class="linenos"> 364</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="L-365"><a href="#L-365"><span class="linenos"> 365</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-366"><a href="#L-366"><span class="linenos"> 366</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="L-367"><a href="#L-367"><span class="linenos"> 367</span></a><span class="sd"> the DFS (Depth-first) order.</span> +</span><span id="L-368"><a href="#L-368"><span class="linenos"> 368</span></a> +</span><span id="L-369"><a href="#L-369"><span class="linenos"> 369</span></a><span class="sd"> Returns:</span> +</span><span id="L-370"><a href="#L-370"><span class="linenos"> 370</span></a><span class="sd"> The generator object.</span> +</span><span id="L-371"><a href="#L-371"><span class="linenos"> 371</span></a><span class="sd"> """</span> +</span><span id="L-372"><a href="#L-372"><span class="linenos"> 372</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-373"><a href="#L-373"><span class="linenos"> 373</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="L-374"><a href="#L-374"><span class="linenos"> 374</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="L-375"><a href="#L-375"><span class="linenos"> 375</span></a> <span class="k">return</span> +</span><span id="L-376"><a href="#L-376"><span class="linenos"> 376</span></a> +</span><span id="L-377"><a href="#L-377"><span class="linenos"> 377</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-378"><a href="#L-378"><span class="linenos"> 378</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="L-379"><a href="#L-379"><span class="linenos"> 379</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-380"><a href="#L-380"><span class="linenos"> 380</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> +</span><span id="L-381"><a href="#L-381"><span class="linenos"> 381</span></a> +</span><span id="L-382"><a href="#L-382"><span class="linenos"> 382</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="L-383"><a href="#L-383"><span class="linenos"> 383</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-384"><a href="#L-384"><span class="linenos"> 384</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="L-385"><a href="#L-385"><span class="linenos"> 385</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="L-386"><a href="#L-386"><span class="linenos"> 386</span></a> +</span><span id="L-387"><a href="#L-387"><span class="linenos"> 387</span></a><span class="sd"> Returns:</span> +</span><span id="L-388"><a href="#L-388"><span class="linenos"> 388</span></a><span class="sd"> The generator object.</span> +</span><span id="L-389"><a href="#L-389"><span class="linenos"> 389</span></a><span class="sd"> """</span> +</span><span id="L-390"><a href="#L-390"><span class="linenos"> 390</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> +</span><span id="L-391"><a href="#L-391"><span class="linenos"> 391</span></a> +</span><span id="L-392"><a href="#L-392"><span class="linenos"> 392</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="L-393"><a href="#L-393"><span class="linenos"> 393</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> +</span><span id="L-394"><a href="#L-394"><span class="linenos"> 394</span></a> +</span><span id="L-395"><a href="#L-395"><span class="linenos"> 395</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="L-396"><a href="#L-396"><span class="linenos"> 396</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="L-397"><a href="#L-397"><span class="linenos"> 397</span></a> <span class="k">continue</span> +</span><span id="L-398"><a href="#L-398"><span class="linenos"> 398</span></a> +</span><span id="L-399"><a href="#L-399"><span class="linenos"> 399</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-400"><a href="#L-400"><span class="linenos"> 400</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-401"><a href="#L-401"><span class="linenos"> 401</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="L-402"><a href="#L-402"><span class="linenos"> 402</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-403"><a href="#L-403"><span class="linenos"> 403</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> +</span><span id="L-404"><a href="#L-404"><span class="linenos"> 404</span></a> +</span><span id="L-405"><a href="#L-405"><span class="linenos"> 405</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-406"><a href="#L-406"><span class="linenos"> 406</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-407"><a href="#L-407"><span class="linenos"> 407</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="L-408"><a href="#L-408"><span class="linenos"> 408</span></a><span class="sd"> """</span> +</span><span id="L-409"><a href="#L-409"><span class="linenos"> 409</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-410"><a href="#L-410"><span class="linenos"> 410</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> +</span><span id="L-411"><a href="#L-411"><span class="linenos"> 411</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-412"><a href="#L-412"><span class="linenos"> 412</span></a> <span class="k">return</span> <span class="n">expression</span> </span><span id="L-413"><a href="#L-413"><span class="linenos"> 413</span></a> -</span><span id="L-414"><a href="#L-414"><span class="linenos"> 414</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-414"><a href="#L-414"><span class="linenos"> 414</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> </span><span id="L-415"><a href="#L-415"><span class="linenos"> 415</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-416"><a href="#L-416"><span class="linenos"> 416</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> -</span><span id="L-417"><a href="#L-417"><span class="linenos"> 417</span></a> -</span><span id="L-418"><a href="#L-418"><span class="linenos"> 418</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="L-419"><a href="#L-419"><span class="linenos"> 419</span></a><span class="sd"> """</span> -</span><span id="L-420"><a href="#L-420"><span class="linenos"> 420</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> -</span><span id="L-421"><a href="#L-421"><span class="linenos"> 421</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="L-422"><a href="#L-422"><span class="linenos"> 422</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> -</span><span id="L-423"><a href="#L-423"><span class="linenos"> 423</span></a> -</span><span id="L-424"><a href="#L-424"><span class="linenos"> 424</span></a> <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-425"><a href="#L-425"><span class="linenos"> 425</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">()</span> -</span><span id="L-426"><a href="#L-426"><span class="linenos"> 426</span></a> -</span><span id="L-427"><a href="#L-427"><span class="linenos"> 427</span></a> <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-428"><a href="#L-428"><span class="linenos"> 428</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_to_s</span><span class="p">()</span> -</span><span id="L-429"><a href="#L-429"><span class="linenos"> 429</span></a> -</span><span id="L-430"><a href="#L-430"><span class="linenos"> 430</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-431"><a href="#L-431"><span class="linenos"> 431</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-432"><a href="#L-432"><span class="linenos"> 432</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="L-433"><a href="#L-433"><span class="linenos"> 433</span></a> -</span><span id="L-434"><a href="#L-434"><span class="linenos"> 434</span></a><span class="sd"> Args:</span> -</span><span id="L-435"><a href="#L-435"><span class="linenos"> 435</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="L-436"><a href="#L-436"><span class="linenos"> 436</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="L-416"><a href="#L-416"><span class="linenos"> 416</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="L-417"><a href="#L-417"><span class="linenos"> 417</span></a><span class="sd"> """</span> +</span><span id="L-418"><a href="#L-418"><span class="linenos"> 418</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> +</span><span id="L-419"><a href="#L-419"><span class="linenos"> 419</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-420"><a href="#L-420"><span class="linenos"> 420</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="L-421"><a href="#L-421"><span class="linenos"> 421</span></a> +</span><span id="L-422"><a href="#L-422"><span class="linenos"> 422</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-423"><a href="#L-423"><span class="linenos"> 423</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-424"><a href="#L-424"><span class="linenos"> 424</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="L-425"><a href="#L-425"><span class="linenos"> 425</span></a><span class="sd"> """</span> +</span><span id="L-426"><a href="#L-426"><span class="linenos"> 426</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> +</span><span id="L-427"><a href="#L-427"><span class="linenos"> 427</span></a> +</span><span id="L-428"><a href="#L-428"><span class="linenos"> 428</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-429"><a href="#L-429"><span class="linenos"> 429</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-430"><a href="#L-430"><span class="linenos"> 430</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> +</span><span id="L-431"><a href="#L-431"><span class="linenos"> 431</span></a> +</span><span id="L-432"><a href="#L-432"><span class="linenos"> 432</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="L-433"><a href="#L-433"><span class="linenos"> 433</span></a><span class="sd"> """</span> +</span><span id="L-434"><a href="#L-434"><span class="linenos"> 434</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> +</span><span id="L-435"><a href="#L-435"><span class="linenos"> 435</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="L-436"><a href="#L-436"><span class="linenos"> 436</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> </span><span id="L-437"><a href="#L-437"><span class="linenos"> 437</span></a> -</span><span id="L-438"><a href="#L-438"><span class="linenos"> 438</span></a><span class="sd"> Returns:</span> -</span><span id="L-439"><a href="#L-439"><span class="linenos"> 439</span></a><span class="sd"> The SQL string.</span> -</span><span id="L-440"><a href="#L-440"><span class="linenos"> 440</span></a><span class="sd"> """</span> -</span><span id="L-441"><a href="#L-441"><span class="linenos"> 441</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> -</span><span id="L-442"><a href="#L-442"><span class="linenos"> 442</span></a> -</span><span id="L-443"><a href="#L-443"><span class="linenos"> 443</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-444"><a href="#L-444"><span class="linenos"> 444</span></a> -</span><span id="L-445"><a href="#L-445"><span class="linenos"> 445</span></a> <span class="k">def</span> <span class="nf">_to_s</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hide_missing</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-446"><a href="#L-446"><span class="linenos"> 446</span></a> <span class="n">indent</span> <span class="o">=</span> <span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">level</span> <span class="k">else</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> -</span><span id="L-447"><a href="#L-447"><span class="linenos"> 447</span></a> <span class="n">indent</span> <span class="o">+=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span><span class="p">]</span> <span class="o">*</span> <span class="n">level</span><span class="p">)</span> -</span><span id="L-448"><a href="#L-448"><span class="linenos"> 448</span></a> <span class="n">left</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="si">}</span><span class="s2"> "</span> -</span><span id="L-449"><a href="#L-449"><span class="linenos"> 449</span></a> -</span><span id="L-450"><a href="#L-450"><span class="linenos"> 450</span></a> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-451"><a href="#L-451"><span class="linenos"> 451</span></a> <span class="n">k</span><span class="p">:</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> -</span><span id="L-452"><a href="#L-452"><span class="linenos"> 452</span></a> <span class="n">v</span><span class="o">.</span><span class="n">_to_s</span><span class="p">(</span><span class="n">hide_missing</span><span class="o">=</span><span class="n">hide_missing</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="n">level</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> -</span><span id="L-453"><a href="#L-453"><span class="linenos"> 453</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="s2">"_to_s"</span><span class="p">)</span> -</span><span id="L-454"><a href="#L-454"><span class="linenos"> 454</span></a> <span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> -</span><span id="L-455"><a href="#L-455"><span class="linenos"> 455</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> -</span><span id="L-456"><a href="#L-456"><span class="linenos"> 456</span></a> <span class="k">if</span> <span class="n">v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> -</span><span id="L-457"><a href="#L-457"><span class="linenos"> 457</span></a> <span class="p">)</span> -</span><span id="L-458"><a href="#L-458"><span class="linenos"> 458</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="L-459"><a href="#L-459"><span class="linenos"> 459</span></a> <span class="p">}</span> -</span><span id="L-460"><a href="#L-460"><span class="linenos"> 460</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"comments"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> -</span><span id="L-461"><a href="#L-461"><span class="linenos"> 461</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> -</span><span id="L-462"><a href="#L-462"><span class="linenos"> 462</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">hide_missing</span><span class="p">}</span> +</span><span id="L-438"><a href="#L-438"><span class="linenos"> 438</span></a> <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-439"><a href="#L-439"><span class="linenos"> 439</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">()</span> +</span><span id="L-440"><a href="#L-440"><span class="linenos"> 440</span></a> +</span><span id="L-441"><a href="#L-441"><span class="linenos"> 441</span></a> <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-442"><a href="#L-442"><span class="linenos"> 442</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_to_s</span><span class="p">()</span> +</span><span id="L-443"><a href="#L-443"><span class="linenos"> 443</span></a> +</span><span id="L-444"><a href="#L-444"><span class="linenos"> 444</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-445"><a href="#L-445"><span class="linenos"> 445</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-446"><a href="#L-446"><span class="linenos"> 446</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="L-447"><a href="#L-447"><span class="linenos"> 447</span></a> +</span><span id="L-448"><a href="#L-448"><span class="linenos"> 448</span></a><span class="sd"> Args:</span> +</span><span id="L-449"><a href="#L-449"><span class="linenos"> 449</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="L-450"><a href="#L-450"><span class="linenos"> 450</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="L-451"><a href="#L-451"><span class="linenos"> 451</span></a> +</span><span id="L-452"><a href="#L-452"><span class="linenos"> 452</span></a><span class="sd"> Returns:</span> +</span><span id="L-453"><a href="#L-453"><span class="linenos"> 453</span></a><span class="sd"> The SQL string.</span> +</span><span id="L-454"><a href="#L-454"><span class="linenos"> 454</span></a><span class="sd"> """</span> +</span><span id="L-455"><a href="#L-455"><span class="linenos"> 455</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> +</span><span id="L-456"><a href="#L-456"><span class="linenos"> 456</span></a> +</span><span id="L-457"><a href="#L-457"><span class="linenos"> 457</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-458"><a href="#L-458"><span class="linenos"> 458</span></a> +</span><span id="L-459"><a href="#L-459"><span class="linenos"> 459</span></a> <span class="k">def</span> <span class="nf">_to_s</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hide_missing</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-460"><a href="#L-460"><span class="linenos"> 460</span></a> <span class="n">indent</span> <span class="o">=</span> <span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">level</span> <span class="k">else</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> +</span><span id="L-461"><a href="#L-461"><span class="linenos"> 461</span></a> <span class="n">indent</span> <span class="o">+=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span><span class="p">]</span> <span class="o">*</span> <span class="n">level</span><span class="p">)</span> +</span><span id="L-462"><a href="#L-462"><span class="linenos"> 462</span></a> <span class="n">left</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="si">}</span><span class="s2"> "</span> </span><span id="L-463"><a href="#L-463"><span class="linenos"> 463</span></a> -</span><span id="L-464"><a href="#L-464"><span class="linenos"> 464</span></a> <span class="n">right</span> <span class="o">=</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s2">"</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> -</span><span id="L-465"><a href="#L-465"><span class="linenos"> 465</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> -</span><span id="L-466"><a href="#L-466"><span class="linenos"> 466</span></a> -</span><span id="L-467"><a href="#L-467"><span class="linenos"> 467</span></a> <span class="k">return</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">left</span> <span class="o">+</span> <span class="n">right</span> -</span><span id="L-468"><a href="#L-468"><span class="linenos"> 468</span></a> -</span><span id="L-469"><a href="#L-469"><span class="linenos"> 469</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="L-470"><a href="#L-470"><span class="linenos"> 470</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-471"><a href="#L-471"><span class="linenos"> 471</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="L-472"><a href="#L-472"><span class="linenos"> 472</span></a><span class="sd"> and applies the given transformation function to each node.</span> -</span><span id="L-473"><a href="#L-473"><span class="linenos"> 473</span></a> -</span><span id="L-474"><a href="#L-474"><span class="linenos"> 474</span></a><span class="sd"> Args:</span> -</span><span id="L-475"><a href="#L-475"><span class="linenos"> 475</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> -</span><span id="L-476"><a href="#L-476"><span class="linenos"> 476</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="L-477"><a href="#L-477"><span class="linenos"> 477</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="L-478"><a href="#L-478"><span class="linenos"> 478</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> -</span><span id="L-479"><a href="#L-479"><span class="linenos"> 479</span></a><span class="sd"> modified in place.</span> +</span><span id="L-464"><a href="#L-464"><span class="linenos"> 464</span></a> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-465"><a href="#L-465"><span class="linenos"> 465</span></a> <span class="n">k</span><span class="p">:</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> +</span><span id="L-466"><a href="#L-466"><span class="linenos"> 466</span></a> <span class="n">v</span><span class="o">.</span><span class="n">_to_s</span><span class="p">(</span><span class="n">hide_missing</span><span class="o">=</span><span class="n">hide_missing</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="n">level</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> +</span><span id="L-467"><a href="#L-467"><span class="linenos"> 467</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="s2">"_to_s"</span><span class="p">)</span> +</span><span id="L-468"><a href="#L-468"><span class="linenos"> 468</span></a> <span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> +</span><span id="L-469"><a href="#L-469"><span class="linenos"> 469</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> +</span><span id="L-470"><a href="#L-470"><span class="linenos"> 470</span></a> <span class="k">if</span> <span class="n">v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> +</span><span id="L-471"><a href="#L-471"><span class="linenos"> 471</span></a> <span class="p">)</span> +</span><span id="L-472"><a href="#L-472"><span class="linenos"> 472</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="L-473"><a href="#L-473"><span class="linenos"> 473</span></a> <span class="p">}</span> +</span><span id="L-474"><a href="#L-474"><span class="linenos"> 474</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"comments"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> +</span><span id="L-475"><a href="#L-475"><span class="linenos"> 475</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> +</span><span id="L-476"><a href="#L-476"><span class="linenos"> 476</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">hide_missing</span><span class="p">}</span> +</span><span id="L-477"><a href="#L-477"><span class="linenos"> 477</span></a> +</span><span id="L-478"><a href="#L-478"><span class="linenos"> 478</span></a> <span class="n">right</span> <span class="o">=</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s2">"</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> +</span><span id="L-479"><a href="#L-479"><span class="linenos"> 479</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> </span><span id="L-480"><a href="#L-480"><span class="linenos"> 480</span></a> -</span><span id="L-481"><a href="#L-481"><span class="linenos"> 481</span></a><span class="sd"> Returns:</span> -</span><span id="L-482"><a href="#L-482"><span class="linenos"> 482</span></a><span class="sd"> The transformed tree.</span> -</span><span id="L-483"><a href="#L-483"><span class="linenos"> 483</span></a><span class="sd"> """</span> -</span><span id="L-484"><a href="#L-484"><span class="linenos"> 484</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="L-485"><a href="#L-485"><span class="linenos"> 485</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="L-486"><a href="#L-486"><span class="linenos"> 486</span></a> -</span><span id="L-487"><a href="#L-487"><span class="linenos"> 487</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-488"><a href="#L-488"><span class="linenos"> 488</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="L-489"><a href="#L-489"><span class="linenos"> 489</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> -</span><span id="L-490"><a href="#L-490"><span class="linenos"> 490</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-491"><a href="#L-491"><span class="linenos"> 491</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="L-492"><a href="#L-492"><span class="linenos"> 492</span></a> -</span><span id="L-493"><a href="#L-493"><span class="linenos"> 493</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> -</span><span id="L-494"><a href="#L-494"><span class="linenos"> 494</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="L-495"><a href="#L-495"><span class="linenos"> 495</span></a> -</span><span id="L-496"><a href="#L-496"><span class="linenos"> 496</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> -</span><span id="L-497"><a href="#L-497"><span class="linenos"> 497</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-498"><a href="#L-498"><span class="linenos"> 498</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="L-499"><a href="#L-499"><span class="linenos"> 499</span></a> -</span><span id="L-500"><a href="#L-500"><span class="linenos"> 500</span></a><span class="sd"> For example::</span> -</span><span id="L-501"><a href="#L-501"><span class="linenos"> 501</span></a> -</span><span id="L-502"><a href="#L-502"><span class="linenos"> 502</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="L-503"><a href="#L-503"><span class="linenos"> 503</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="L-504"><a href="#L-504"><span class="linenos"> 504</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="L-505"><a href="#L-505"><span class="linenos"> 505</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="L-506"><a href="#L-506"><span class="linenos"> 506</span></a><span class="sd"> 'SELECT y FROM tbl'</span> -</span><span id="L-507"><a href="#L-507"><span class="linenos"> 507</span></a> -</span><span id="L-508"><a href="#L-508"><span class="linenos"> 508</span></a><span class="sd"> Args:</span> -</span><span id="L-509"><a href="#L-509"><span class="linenos"> 509</span></a><span class="sd"> expression (Expression|None): new node</span> -</span><span id="L-510"><a href="#L-510"><span class="linenos"> 510</span></a> -</span><span id="L-511"><a href="#L-511"><span class="linenos"> 511</span></a><span class="sd"> Returns:</span> -</span><span id="L-512"><a href="#L-512"><span class="linenos"> 512</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="L-513"><a href="#L-513"><span class="linenos"> 513</span></a><span class="sd"> """</span> -</span><span id="L-514"><a href="#L-514"><span class="linenos"> 514</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="L-515"><a href="#L-515"><span class="linenos"> 515</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-516"><a href="#L-516"><span class="linenos"> 516</span></a> -</span><span id="L-517"><a href="#L-517"><span class="linenos"> 517</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="L-518"><a href="#L-518"><span class="linenos"> 518</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="L-519"><a href="#L-519"><span class="linenos"> 519</span></a> -</span><span id="L-520"><a href="#L-520"><span class="linenos"> 520</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> -</span><span id="L-521"><a href="#L-521"><span class="linenos"> 521</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-522"><a href="#L-522"><span class="linenos"> 522</span></a> -</span><span id="L-523"><a href="#L-523"><span class="linenos"> 523</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-524"><a href="#L-524"><span class="linenos"> 524</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-525"><a href="#L-525"><span class="linenos"> 525</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="L-526"><a href="#L-526"><span class="linenos"> 526</span></a><span class="sd"> """</span> -</span><span id="L-527"><a href="#L-527"><span class="linenos"> 527</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> -</span><span id="L-528"><a href="#L-528"><span class="linenos"> 528</span></a> -</span><span id="L-529"><a href="#L-529"><span class="linenos"> 529</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> -</span><span id="L-530"><a href="#L-530"><span class="linenos"> 530</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-531"><a href="#L-531"><span class="linenos"> 531</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> -</span><span id="L-532"><a href="#L-532"><span class="linenos"> 532</span></a> -</span><span id="L-533"><a href="#L-533"><span class="linenos"> 533</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> -</span><span id="L-534"><a href="#L-534"><span class="linenos"> 534</span></a><span class="sd"> Otherwise, this returns this expression.</span> -</span><span id="L-535"><a href="#L-535"><span class="linenos"> 535</span></a> -</span><span id="L-536"><a href="#L-536"><span class="linenos"> 536</span></a><span class="sd"> Examples:</span> -</span><span id="L-537"><a href="#L-537"><span class="linenos"> 537</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="L-538"><a href="#L-538"><span class="linenos"> 538</span></a> -</span><span id="L-539"><a href="#L-539"><span class="linenos"> 539</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-540"><a href="#L-540"><span class="linenos"> 540</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> -</span><span id="L-541"><a href="#L-541"><span class="linenos"> 541</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="L-542"><a href="#L-542"><span class="linenos"> 542</span></a><span class="sd"> """</span> -</span><span id="L-543"><a href="#L-543"><span class="linenos"> 543</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> -</span><span id="L-544"><a href="#L-544"><span class="linenos"> 544</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="L-545"><a href="#L-545"><span class="linenos"> 545</span></a> -</span><span id="L-546"><a href="#L-546"><span class="linenos"> 546</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="L-547"><a href="#L-547"><span class="linenos"> 547</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-548"><a href="#L-548"><span class="linenos"> 548</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="L-481"><a href="#L-481"><span class="linenos"> 481</span></a> <span class="k">return</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">left</span> <span class="o">+</span> <span class="n">right</span> +</span><span id="L-482"><a href="#L-482"><span class="linenos"> 482</span></a> +</span><span id="L-483"><a href="#L-483"><span class="linenos"> 483</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="L-484"><a href="#L-484"><span class="linenos"> 484</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-485"><a href="#L-485"><span class="linenos"> 485</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="L-486"><a href="#L-486"><span class="linenos"> 486</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="L-487"><a href="#L-487"><span class="linenos"> 487</span></a> +</span><span id="L-488"><a href="#L-488"><span class="linenos"> 488</span></a><span class="sd"> Args:</span> +</span><span id="L-489"><a href="#L-489"><span class="linenos"> 489</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> +</span><span id="L-490"><a href="#L-490"><span class="linenos"> 490</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="L-491"><a href="#L-491"><span class="linenos"> 491</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="L-492"><a href="#L-492"><span class="linenos"> 492</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> +</span><span id="L-493"><a href="#L-493"><span class="linenos"> 493</span></a><span class="sd"> modified in place.</span> +</span><span id="L-494"><a href="#L-494"><span class="linenos"> 494</span></a> +</span><span id="L-495"><a href="#L-495"><span class="linenos"> 495</span></a><span class="sd"> Returns:</span> +</span><span id="L-496"><a href="#L-496"><span class="linenos"> 496</span></a><span class="sd"> The transformed tree.</span> +</span><span id="L-497"><a href="#L-497"><span class="linenos"> 497</span></a><span class="sd"> """</span> +</span><span id="L-498"><a href="#L-498"><span class="linenos"> 498</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="L-499"><a href="#L-499"><span class="linenos"> 499</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="L-500"><a href="#L-500"><span class="linenos"> 500</span></a> +</span><span id="L-501"><a href="#L-501"><span class="linenos"> 501</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-502"><a href="#L-502"><span class="linenos"> 502</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="L-503"><a href="#L-503"><span class="linenos"> 503</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> +</span><span id="L-504"><a href="#L-504"><span class="linenos"> 504</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-505"><a href="#L-505"><span class="linenos"> 505</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="L-506"><a href="#L-506"><span class="linenos"> 506</span></a> +</span><span id="L-507"><a href="#L-507"><span class="linenos"> 507</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> +</span><span id="L-508"><a href="#L-508"><span class="linenos"> 508</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="L-509"><a href="#L-509"><span class="linenos"> 509</span></a> +</span><span id="L-510"><a href="#L-510"><span class="linenos"> 510</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> +</span><span id="L-511"><a href="#L-511"><span class="linenos"> 511</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-512"><a href="#L-512"><span class="linenos"> 512</span></a><span class="sd"> Swap out this expression with a new expression.</span> +</span><span id="L-513"><a href="#L-513"><span class="linenos"> 513</span></a> +</span><span id="L-514"><a href="#L-514"><span class="linenos"> 514</span></a><span class="sd"> For example::</span> +</span><span id="L-515"><a href="#L-515"><span class="linenos"> 515</span></a> +</span><span id="L-516"><a href="#L-516"><span class="linenos"> 516</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="L-517"><a href="#L-517"><span class="linenos"> 517</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="L-518"><a href="#L-518"><span class="linenos"> 518</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="L-519"><a href="#L-519"><span class="linenos"> 519</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="L-520"><a href="#L-520"><span class="linenos"> 520</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="L-521"><a href="#L-521"><span class="linenos"> 521</span></a> +</span><span id="L-522"><a href="#L-522"><span class="linenos"> 522</span></a><span class="sd"> Args:</span> +</span><span id="L-523"><a href="#L-523"><span class="linenos"> 523</span></a><span class="sd"> expression (Expression|None): new node</span> +</span><span id="L-524"><a href="#L-524"><span class="linenos"> 524</span></a> +</span><span id="L-525"><a href="#L-525"><span class="linenos"> 525</span></a><span class="sd"> Returns:</span> +</span><span id="L-526"><a href="#L-526"><span class="linenos"> 526</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="L-527"><a href="#L-527"><span class="linenos"> 527</span></a><span class="sd"> """</span> +</span><span id="L-528"><a href="#L-528"><span class="linenos"> 528</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="L-529"><a href="#L-529"><span class="linenos"> 529</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-530"><a href="#L-530"><span class="linenos"> 530</span></a> +</span><span id="L-531"><a href="#L-531"><span class="linenos"> 531</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="L-532"><a href="#L-532"><span class="linenos"> 532</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="L-533"><a href="#L-533"><span class="linenos"> 533</span></a> +</span><span id="L-534"><a href="#L-534"><span class="linenos"> 534</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> +</span><span id="L-535"><a href="#L-535"><span class="linenos"> 535</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-536"><a href="#L-536"><span class="linenos"> 536</span></a> +</span><span id="L-537"><a href="#L-537"><span class="linenos"> 537</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-538"><a href="#L-538"><span class="linenos"> 538</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-539"><a href="#L-539"><span class="linenos"> 539</span></a><span class="sd"> Remove this expression from its AST.</span> +</span><span id="L-540"><a href="#L-540"><span class="linenos"> 540</span></a><span class="sd"> """</span> +</span><span id="L-541"><a href="#L-541"><span class="linenos"> 541</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> +</span><span id="L-542"><a href="#L-542"><span class="linenos"> 542</span></a> +</span><span id="L-543"><a href="#L-543"><span class="linenos"> 543</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> +</span><span id="L-544"><a href="#L-544"><span class="linenos"> 544</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-545"><a href="#L-545"><span class="linenos"> 545</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="L-546"><a href="#L-546"><span class="linenos"> 546</span></a> +</span><span id="L-547"><a href="#L-547"><span class="linenos"> 547</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> +</span><span id="L-548"><a href="#L-548"><span class="linenos"> 548</span></a><span class="sd"> Otherwise, this returns this expression.</span> </span><span id="L-549"><a href="#L-549"><span class="linenos"> 549</span></a> -</span><span id="L-550"><a href="#L-550"><span class="linenos"> 550</span></a><span class="sd"> Args:</span> -</span><span id="L-551"><a href="#L-551"><span class="linenos"> 551</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> -</span><span id="L-552"><a href="#L-552"><span class="linenos"> 552</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> -</span><span id="L-553"><a href="#L-553"><span class="linenos"> 553</span></a> -</span><span id="L-554"><a href="#L-554"><span class="linenos"> 554</span></a><span class="sd"> Returns:</span> -</span><span id="L-555"><a href="#L-555"><span class="linenos"> 555</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="L-550"><a href="#L-550"><span class="linenos"> 550</span></a><span class="sd"> Examples:</span> +</span><span id="L-551"><a href="#L-551"><span class="linenos"> 551</span></a><span class="sd"> This is useful for type security in chained expressions:</span> +</span><span id="L-552"><a href="#L-552"><span class="linenos"> 552</span></a> +</span><span id="L-553"><a href="#L-553"><span class="linenos"> 553</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-554"><a href="#L-554"><span class="linenos"> 554</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> +</span><span id="L-555"><a href="#L-555"><span class="linenos"> 555</span></a><span class="sd"> 'SELECT x, z FROM y'</span> </span><span id="L-556"><a href="#L-556"><span class="linenos"> 556</span></a><span class="sd"> """</span> -</span><span id="L-557"><a href="#L-557"><span class="linenos"> 557</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-558"><a href="#L-558"><span class="linenos"> 558</span></a> -</span><span id="L-559"><a href="#L-559"><span class="linenos"> 559</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> -</span><span id="L-560"><a href="#L-560"><span class="linenos"> 560</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> -</span><span id="L-561"><a href="#L-561"><span class="linenos"> 561</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-562"><a href="#L-562"><span class="linenos"> 562</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-563"><a href="#L-563"><span class="linenos"> 563</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> -</span><span id="L-564"><a href="#L-564"><span class="linenos"> 564</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> -</span><span id="L-565"><a href="#L-565"><span class="linenos"> 565</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-566"><a href="#L-566"><span class="linenos"> 566</span></a> -</span><span id="L-567"><a href="#L-567"><span class="linenos"> 567</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="L-568"><a href="#L-568"><span class="linenos"> 568</span></a> <span class="n">args</span> -</span><span id="L-569"><a href="#L-569"><span class="linenos"> 569</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> -</span><span id="L-570"><a href="#L-570"><span class="linenos"> 570</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="L-571"><a href="#L-571"><span class="linenos"> 571</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> -</span><span id="L-572"><a href="#L-572"><span class="linenos"> 572</span></a> <span class="p">):</span> -</span><span id="L-573"><a href="#L-573"><span class="linenos"> 573</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="L-574"><a href="#L-574"><span class="linenos"> 574</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> -</span><span id="L-575"><a href="#L-575"><span class="linenos"> 575</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> -</span><span id="L-576"><a href="#L-576"><span class="linenos"> 576</span></a> <span class="p">)</span> -</span><span id="L-577"><a href="#L-577"><span class="linenos"> 577</span></a> -</span><span id="L-578"><a href="#L-578"><span class="linenos"> 578</span></a> <span class="k">return</span> <span class="n">errors</span> -</span><span id="L-579"><a href="#L-579"><span class="linenos"> 579</span></a> -</span><span id="L-580"><a href="#L-580"><span class="linenos"> 580</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-581"><a href="#L-581"><span class="linenos"> 581</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-582"><a href="#L-582"><span class="linenos"> 582</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="L-583"><a href="#L-583"><span class="linenos"> 583</span></a><span class="sd"> """</span> -</span><span id="L-584"><a href="#L-584"><span class="linenos"> 584</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> -</span><span id="L-585"><a href="#L-585"><span class="linenos"> 585</span></a> -</span><span id="L-586"><a href="#L-586"><span class="linenos"> 586</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="L-587"><a href="#L-587"><span class="linenos"> 587</span></a> -</span><span id="L-588"><a href="#L-588"><span class="linenos"> 588</span></a> <span class="nd">@classmethod</span> -</span><span id="L-589"><a href="#L-589"><span class="linenos"> 589</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> -</span><span id="L-590"><a href="#L-590"><span class="linenos"> 590</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-591"><a href="#L-591"><span class="linenos"> 591</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="L-592"><a href="#L-592"><span class="linenos"> 592</span></a><span class="sd"> """</span> -</span><span id="L-593"><a href="#L-593"><span class="linenos"> 593</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> -</span><span id="L-594"><a href="#L-594"><span class="linenos"> 594</span></a> -</span><span id="L-595"><a href="#L-595"><span class="linenos"> 595</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> -</span><span id="L-596"><a href="#L-596"><span class="linenos"> 596</span></a> -</span><span id="L-597"><a href="#L-597"><span class="linenos"> 597</span></a> -</span><span id="L-598"><a href="#L-598"><span class="linenos"> 598</span></a><span class="n">IntoType</span> <span class="o">=</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span> -</span><span id="L-599"><a href="#L-599"><span class="linenos"> 599</span></a> <span class="nb">str</span><span class="p">,</span> -</span><span id="L-600"><a href="#L-600"><span class="linenos"> 600</span></a> <span class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">Expression</span><span class="p">],</span> -</span><span id="L-601"><a href="#L-601"><span class="linenos"> 601</span></a> <span class="n">t</span><span class="o">.</span><span class="n">Collection</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">Expression</span><span class="p">]]],</span> -</span><span id="L-602"><a href="#L-602"><span class="linenos"> 602</span></a><span class="p">]</span> -</span><span id="L-603"><a href="#L-603"><span class="linenos"> 603</span></a> -</span><span id="L-604"><a href="#L-604"><span class="linenos"> 604</span></a> -</span><span id="L-605"><a href="#L-605"><span class="linenos"> 605</span></a><span class="k">class</span> <span class="nc">Condition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-606"><a href="#L-606"><span class="linenos"> 606</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-607"><a href="#L-607"><span class="linenos"> 607</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-608"><a href="#L-608"><span class="linenos"> 608</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="L-609"><a href="#L-609"><span class="linenos"> 609</span></a> -</span><span id="L-610"><a href="#L-610"><span class="linenos"> 610</span></a><span class="sd"> Example:</span> -</span><span id="L-611"><a href="#L-611"><span class="linenos"> 611</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="L-612"><a href="#L-612"><span class="linenos"> 612</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="L-613"><a href="#L-613"><span class="linenos"> 613</span></a> -</span><span id="L-614"><a href="#L-614"><span class="linenos"> 614</span></a><span class="sd"> Args:</span> -</span><span id="L-615"><a href="#L-615"><span class="linenos"> 615</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-616"><a href="#L-616"><span class="linenos"> 616</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-617"><a href="#L-617"><span class="linenos"> 617</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-618"><a href="#L-618"><span class="linenos"> 618</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-619"><a href="#L-619"><span class="linenos"> 619</span></a> -</span><span id="L-620"><a href="#L-620"><span class="linenos"> 620</span></a><span class="sd"> Returns:</span> -</span><span id="L-621"><a href="#L-621"><span class="linenos"> 621</span></a><span class="sd"> And: the new condition.</span> -</span><span id="L-622"><a href="#L-622"><span class="linenos"> 622</span></a><span class="sd"> """</span> -</span><span id="L-623"><a href="#L-623"><span class="linenos"> 623</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-624"><a href="#L-624"><span class="linenos"> 624</span></a> -</span><span id="L-625"><a href="#L-625"><span class="linenos"> 625</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-626"><a href="#L-626"><span class="linenos"> 626</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-627"><a href="#L-627"><span class="linenos"> 627</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> -</span><span id="L-628"><a href="#L-628"><span class="linenos"> 628</span></a> -</span><span id="L-629"><a href="#L-629"><span class="linenos"> 629</span></a><span class="sd"> Example:</span> -</span><span id="L-630"><a href="#L-630"><span class="linenos"> 630</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="L-631"><a href="#L-631"><span class="linenos"> 631</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="L-632"><a href="#L-632"><span class="linenos"> 632</span></a> -</span><span id="L-633"><a href="#L-633"><span class="linenos"> 633</span></a><span class="sd"> Args:</span> -</span><span id="L-634"><a href="#L-634"><span class="linenos"> 634</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-635"><a href="#L-635"><span class="linenos"> 635</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-636"><a href="#L-636"><span class="linenos"> 636</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-637"><a href="#L-637"><span class="linenos"> 637</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-557"><a href="#L-557"><span class="linenos"> 557</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> +</span><span id="L-558"><a href="#L-558"><span class="linenos"> 558</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="L-559"><a href="#L-559"><span class="linenos"> 559</span></a> +</span><span id="L-560"><a href="#L-560"><span class="linenos"> 560</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="L-561"><a href="#L-561"><span class="linenos"> 561</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-562"><a href="#L-562"><span class="linenos"> 562</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="L-563"><a href="#L-563"><span class="linenos"> 563</span></a> +</span><span id="L-564"><a href="#L-564"><span class="linenos"> 564</span></a><span class="sd"> Args:</span> +</span><span id="L-565"><a href="#L-565"><span class="linenos"> 565</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> +</span><span id="L-566"><a href="#L-566"><span class="linenos"> 566</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> +</span><span id="L-567"><a href="#L-567"><span class="linenos"> 567</span></a> +</span><span id="L-568"><a href="#L-568"><span class="linenos"> 568</span></a><span class="sd"> Returns:</span> +</span><span id="L-569"><a href="#L-569"><span class="linenos"> 569</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="L-570"><a href="#L-570"><span class="linenos"> 570</span></a><span class="sd"> """</span> +</span><span id="L-571"><a href="#L-571"><span class="linenos"> 571</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-572"><a href="#L-572"><span class="linenos"> 572</span></a> +</span><span id="L-573"><a href="#L-573"><span class="linenos"> 573</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> +</span><span id="L-574"><a href="#L-574"><span class="linenos"> 574</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> +</span><span id="L-575"><a href="#L-575"><span class="linenos"> 575</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-576"><a href="#L-576"><span class="linenos"> 576</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-577"><a href="#L-577"><span class="linenos"> 577</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> +</span><span id="L-578"><a href="#L-578"><span class="linenos"> 578</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> +</span><span id="L-579"><a href="#L-579"><span class="linenos"> 579</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-580"><a href="#L-580"><span class="linenos"> 580</span></a> +</span><span id="L-581"><a href="#L-581"><span class="linenos"> 581</span></a> <span class="k">if</span> <span class="p">(</span> +</span><span id="L-582"><a href="#L-582"><span class="linenos"> 582</span></a> <span class="n">args</span> +</span><span id="L-583"><a href="#L-583"><span class="linenos"> 583</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> +</span><span id="L-584"><a href="#L-584"><span class="linenos"> 584</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="L-585"><a href="#L-585"><span class="linenos"> 585</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> +</span><span id="L-586"><a href="#L-586"><span class="linenos"> 586</span></a> <span class="p">):</span> +</span><span id="L-587"><a href="#L-587"><span class="linenos"> 587</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="L-588"><a href="#L-588"><span class="linenos"> 588</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> +</span><span id="L-589"><a href="#L-589"><span class="linenos"> 589</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="L-590"><a href="#L-590"><span class="linenos"> 590</span></a> <span class="p">)</span> +</span><span id="L-591"><a href="#L-591"><span class="linenos"> 591</span></a> +</span><span id="L-592"><a href="#L-592"><span class="linenos"> 592</span></a> <span class="k">return</span> <span class="n">errors</span> +</span><span id="L-593"><a href="#L-593"><span class="linenos"> 593</span></a> +</span><span id="L-594"><a href="#L-594"><span class="linenos"> 594</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-595"><a href="#L-595"><span class="linenos"> 595</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-596"><a href="#L-596"><span class="linenos"> 596</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="L-597"><a href="#L-597"><span class="linenos"> 597</span></a><span class="sd"> """</span> +</span><span id="L-598"><a href="#L-598"><span class="linenos"> 598</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> +</span><span id="L-599"><a href="#L-599"><span class="linenos"> 599</span></a> +</span><span id="L-600"><a href="#L-600"><span class="linenos"> 600</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="L-601"><a href="#L-601"><span class="linenos"> 601</span></a> +</span><span id="L-602"><a href="#L-602"><span class="linenos"> 602</span></a> <span class="nd">@classmethod</span> +</span><span id="L-603"><a href="#L-603"><span class="linenos"> 603</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> +</span><span id="L-604"><a href="#L-604"><span class="linenos"> 604</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-605"><a href="#L-605"><span class="linenos"> 605</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="L-606"><a href="#L-606"><span class="linenos"> 606</span></a><span class="sd"> """</span> +</span><span id="L-607"><a href="#L-607"><span class="linenos"> 607</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> +</span><span id="L-608"><a href="#L-608"><span class="linenos"> 608</span></a> +</span><span id="L-609"><a href="#L-609"><span class="linenos"> 609</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> +</span><span id="L-610"><a href="#L-610"><span class="linenos"> 610</span></a> +</span><span id="L-611"><a href="#L-611"><span class="linenos"> 611</span></a> +</span><span id="L-612"><a href="#L-612"><span class="linenos"> 612</span></a><span class="n">IntoType</span> <span class="o">=</span> <span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span> +</span><span id="L-613"><a href="#L-613"><span class="linenos"> 613</span></a> <span class="nb">str</span><span class="p">,</span> +</span><span id="L-614"><a href="#L-614"><span class="linenos"> 614</span></a> <span class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">Expression</span><span class="p">],</span> +</span><span id="L-615"><a href="#L-615"><span class="linenos"> 615</span></a> <span class="n">t</span><span class="o">.</span><span class="n">Collection</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">Expression</span><span class="p">]]],</span> +</span><span id="L-616"><a href="#L-616"><span class="linenos"> 616</span></a><span class="p">]</span> +</span><span id="L-617"><a href="#L-617"><span class="linenos"> 617</span></a> +</span><span id="L-618"><a href="#L-618"><span class="linenos"> 618</span></a> +</span><span id="L-619"><a href="#L-619"><span class="linenos"> 619</span></a><span class="k">class</span> <span class="nc">Condition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-620"><a href="#L-620"><span class="linenos"> 620</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-621"><a href="#L-621"><span class="linenos"> 621</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-622"><a href="#L-622"><span class="linenos"> 622</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="L-623"><a href="#L-623"><span class="linenos"> 623</span></a> +</span><span id="L-624"><a href="#L-624"><span class="linenos"> 624</span></a><span class="sd"> Example:</span> +</span><span id="L-625"><a href="#L-625"><span class="linenos"> 625</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="L-626"><a href="#L-626"><span class="linenos"> 626</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="L-627"><a href="#L-627"><span class="linenos"> 627</span></a> +</span><span id="L-628"><a href="#L-628"><span class="linenos"> 628</span></a><span class="sd"> Args:</span> +</span><span id="L-629"><a href="#L-629"><span class="linenos"> 629</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-630"><a href="#L-630"><span class="linenos"> 630</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-631"><a href="#L-631"><span class="linenos"> 631</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-632"><a href="#L-632"><span class="linenos"> 632</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-633"><a href="#L-633"><span class="linenos"> 633</span></a> +</span><span id="L-634"><a href="#L-634"><span class="linenos"> 634</span></a><span class="sd"> Returns:</span> +</span><span id="L-635"><a href="#L-635"><span class="linenos"> 635</span></a><span class="sd"> And: the new condition.</span> +</span><span id="L-636"><a href="#L-636"><span class="linenos"> 636</span></a><span class="sd"> """</span> +</span><span id="L-637"><a href="#L-637"><span class="linenos"> 637</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-638"><a href="#L-638"><span class="linenos"> 638</span></a> -</span><span id="L-639"><a href="#L-639"><span class="linenos"> 639</span></a><span class="sd"> Returns:</span> -</span><span id="L-640"><a href="#L-640"><span class="linenos"> 640</span></a><span class="sd"> Or: the new condition.</span> -</span><span id="L-641"><a href="#L-641"><span class="linenos"> 641</span></a><span class="sd"> """</span> -</span><span id="L-642"><a href="#L-642"><span class="linenos"> 642</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-643"><a href="#L-643"><span class="linenos"> 643</span></a> -</span><span id="L-644"><a href="#L-644"><span class="linenos"> 644</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-645"><a href="#L-645"><span class="linenos"> 645</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-646"><a href="#L-646"><span class="linenos"> 646</span></a><span class="sd"> Wrap this condition with NOT.</span> -</span><span id="L-647"><a href="#L-647"><span class="linenos"> 647</span></a> -</span><span id="L-648"><a href="#L-648"><span class="linenos"> 648</span></a><span class="sd"> Example:</span> -</span><span id="L-649"><a href="#L-649"><span class="linenos"> 649</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> -</span><span id="L-650"><a href="#L-650"><span class="linenos"> 650</span></a><span class="sd"> 'NOT x = 1'</span> -</span><span id="L-651"><a href="#L-651"><span class="linenos"> 651</span></a> -</span><span id="L-652"><a href="#L-652"><span class="linenos"> 652</span></a><span class="sd"> Returns:</span> -</span><span id="L-653"><a href="#L-653"><span class="linenos"> 653</span></a><span class="sd"> Not: the new condition.</span> -</span><span id="L-654"><a href="#L-654"><span class="linenos"> 654</span></a><span class="sd"> """</span> -</span><span id="L-655"><a href="#L-655"><span class="linenos"> 655</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="L-656"><a href="#L-656"><span class="linenos"> 656</span></a> +</span><span id="L-639"><a href="#L-639"><span class="linenos"> 639</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-640"><a href="#L-640"><span class="linenos"> 640</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-641"><a href="#L-641"><span class="linenos"> 641</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="L-642"><a href="#L-642"><span class="linenos"> 642</span></a> +</span><span id="L-643"><a href="#L-643"><span class="linenos"> 643</span></a><span class="sd"> Example:</span> +</span><span id="L-644"><a href="#L-644"><span class="linenos"> 644</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="L-645"><a href="#L-645"><span class="linenos"> 645</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="L-646"><a href="#L-646"><span class="linenos"> 646</span></a> +</span><span id="L-647"><a href="#L-647"><span class="linenos"> 647</span></a><span class="sd"> Args:</span> +</span><span id="L-648"><a href="#L-648"><span class="linenos"> 648</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-649"><a href="#L-649"><span class="linenos"> 649</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-650"><a href="#L-650"><span class="linenos"> 650</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-651"><a href="#L-651"><span class="linenos"> 651</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-652"><a href="#L-652"><span class="linenos"> 652</span></a> +</span><span id="L-653"><a href="#L-653"><span class="linenos"> 653</span></a><span class="sd"> Returns:</span> +</span><span id="L-654"><a href="#L-654"><span class="linenos"> 654</span></a><span class="sd"> Or: the new condition.</span> +</span><span id="L-655"><a href="#L-655"><span class="linenos"> 655</span></a><span class="sd"> """</span> +</span><span id="L-656"><a href="#L-656"><span class="linenos"> 656</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-657"><a href="#L-657"><span class="linenos"> 657</span></a> -</span><span id="L-658"><a href="#L-658"><span class="linenos"> 658</span></a><span class="k">class</span> <span class="nc">Predicate</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-659"><a href="#L-659"><span class="linenos"> 659</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> -</span><span id="L-660"><a href="#L-660"><span class="linenos"> 660</span></a> +</span><span id="L-658"><a href="#L-658"><span class="linenos"> 658</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-659"><a href="#L-659"><span class="linenos"> 659</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-660"><a href="#L-660"><span class="linenos"> 660</span></a><span class="sd"> Wrap this condition with NOT.</span> </span><span id="L-661"><a href="#L-661"><span class="linenos"> 661</span></a> -</span><span id="L-662"><a href="#L-662"><span class="linenos"> 662</span></a><span class="k">class</span> <span class="nc">DerivedTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-663"><a href="#L-663"><span class="linenos"> 663</span></a> <span class="nd">@property</span> -</span><span id="L-664"><a href="#L-664"><span class="linenos"> 664</span></a> <span class="k">def</span> <span class="nf">alias_column_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-665"><a href="#L-665"><span class="linenos"> 665</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> -</span><span id="L-666"><a href="#L-666"><span class="linenos"> 666</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table_alias</span><span class="p">:</span> -</span><span id="L-667"><a href="#L-667"><span class="linenos"> 667</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="L-668"><a href="#L-668"><span class="linenos"> 668</span></a> <span class="n">column_list</span> <span class="o">=</span> <span class="n">table_alias</span><span class="o">.</span><span class="n">assert_is</span><span class="p">(</span><span class="n">TableAlias</span><span class="p">)</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="L-669"><a href="#L-669"><span class="linenos"> 669</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">c</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">column_list</span><span class="p">]</span> +</span><span id="L-662"><a href="#L-662"><span class="linenos"> 662</span></a><span class="sd"> Example:</span> +</span><span id="L-663"><a href="#L-663"><span class="linenos"> 663</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="L-664"><a href="#L-664"><span class="linenos"> 664</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="L-665"><a href="#L-665"><span class="linenos"> 665</span></a> +</span><span id="L-666"><a href="#L-666"><span class="linenos"> 666</span></a><span class="sd"> Returns:</span> +</span><span id="L-667"><a href="#L-667"><span class="linenos"> 667</span></a><span class="sd"> Not: the new condition.</span> +</span><span id="L-668"><a href="#L-668"><span class="linenos"> 668</span></a><span class="sd"> """</span> +</span><span id="L-669"><a href="#L-669"><span class="linenos"> 669</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> </span><span id="L-670"><a href="#L-670"><span class="linenos"> 670</span></a> -</span><span id="L-671"><a href="#L-671"><span class="linenos"> 671</span></a> <span class="nd">@property</span> -</span><span id="L-672"><a href="#L-672"><span class="linenos"> 672</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-673"><a href="#L-673"><span class="linenos"> 673</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="L-671"><a href="#L-671"><span class="linenos"> 671</span></a> +</span><span id="L-672"><a href="#L-672"><span class="linenos"> 672</span></a><span class="k">class</span> <span class="nc">Predicate</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-673"><a href="#L-673"><span class="linenos"> 673</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> </span><span id="L-674"><a href="#L-674"><span class="linenos"> 674</span></a> -</span><span id="L-675"><a href="#L-675"><span class="linenos"> 675</span></a> <span class="k">if</span> <span class="n">alias</span><span class="p">:</span> -</span><span id="L-676"><a href="#L-676"><span class="linenos"> 676</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> -</span><span id="L-677"><a href="#L-677"><span class="linenos"> 677</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="L-678"><a href="#L-678"><span class="linenos"> 678</span></a> -</span><span id="L-679"><a href="#L-679"><span class="linenos"> 679</span></a> <span class="nd">@property</span> -</span><span id="L-680"><a href="#L-680"><span class="linenos"> 680</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-681"><a href="#L-681"><span class="linenos"> 681</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">select</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">selects</span><span class="p">]</span> -</span><span id="L-682"><a href="#L-682"><span class="linenos"> 682</span></a> -</span><span id="L-683"><a href="#L-683"><span class="linenos"> 683</span></a> -</span><span id="L-684"><a href="#L-684"><span class="linenos"> 684</span></a><span class="k">class</span> <span class="nc">Unionable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-685"><a href="#L-685"><span class="linenos"> 685</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-686"><a href="#L-686"><span class="linenos"> 686</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-687"><a href="#L-687"><span class="linenos"> 687</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="L-675"><a href="#L-675"><span class="linenos"> 675</span></a> +</span><span id="L-676"><a href="#L-676"><span class="linenos"> 676</span></a><span class="k">class</span> <span class="nc">DerivedTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-677"><a href="#L-677"><span class="linenos"> 677</span></a> <span class="nd">@property</span> +</span><span id="L-678"><a href="#L-678"><span class="linenos"> 678</span></a> <span class="k">def</span> <span class="nf">alias_column_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-679"><a href="#L-679"><span class="linenos"> 679</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="L-680"><a href="#L-680"><span class="linenos"> 680</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table_alias</span><span class="p">:</span> +</span><span id="L-681"><a href="#L-681"><span class="linenos"> 681</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="L-682"><a href="#L-682"><span class="linenos"> 682</span></a> <span class="n">column_list</span> <span class="o">=</span> <span class="n">table_alias</span><span class="o">.</span><span class="n">assert_is</span><span class="p">(</span><span class="n">TableAlias</span><span class="p">)</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> +</span><span id="L-683"><a href="#L-683"><span class="linenos"> 683</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">c</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">column_list</span><span class="p">]</span> +</span><span id="L-684"><a href="#L-684"><span class="linenos"> 684</span></a> +</span><span id="L-685"><a href="#L-685"><span class="linenos"> 685</span></a> <span class="nd">@property</span> +</span><span id="L-686"><a href="#L-686"><span class="linenos"> 686</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-687"><a href="#L-687"><span class="linenos"> 687</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> </span><span id="L-688"><a href="#L-688"><span class="linenos"> 688</span></a> -</span><span id="L-689"><a href="#L-689"><span class="linenos"> 689</span></a><span class="sd"> Example:</span> -</span><span id="L-690"><a href="#L-690"><span class="linenos"> 690</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-691"><a href="#L-691"><span class="linenos"> 691</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="L-692"><a href="#L-692"><span class="linenos"> 692</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="L-693"><a href="#L-693"><span class="linenos"> 693</span></a> -</span><span id="L-694"><a href="#L-694"><span class="linenos"> 694</span></a><span class="sd"> Args:</span> -</span><span id="L-695"><a href="#L-695"><span class="linenos"> 695</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="L-696"><a href="#L-696"><span class="linenos"> 696</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-697"><a href="#L-697"><span class="linenos"> 697</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-698"><a href="#L-698"><span class="linenos"> 698</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-699"><a href="#L-699"><span class="linenos"> 699</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-700"><a href="#L-700"><span class="linenos"> 700</span></a><span class="sd"> Returns:</span> -</span><span id="L-701"><a href="#L-701"><span class="linenos"> 701</span></a><span class="sd"> Union: the Union expression.</span> -</span><span id="L-702"><a href="#L-702"><span class="linenos"> 702</span></a><span class="sd"> """</span> -</span><span id="L-703"><a href="#L-703"><span class="linenos"> 703</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-704"><a href="#L-704"><span class="linenos"> 704</span></a> -</span><span id="L-705"><a href="#L-705"><span class="linenos"> 705</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-706"><a href="#L-706"><span class="linenos"> 706</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-707"><a href="#L-707"><span class="linenos"> 707</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="L-708"><a href="#L-708"><span class="linenos"> 708</span></a> -</span><span id="L-709"><a href="#L-709"><span class="linenos"> 709</span></a><span class="sd"> Example:</span> -</span><span id="L-710"><a href="#L-710"><span class="linenos"> 710</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-711"><a href="#L-711"><span class="linenos"> 711</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="L-712"><a href="#L-712"><span class="linenos"> 712</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="L-713"><a href="#L-713"><span class="linenos"> 713</span></a> -</span><span id="L-714"><a href="#L-714"><span class="linenos"> 714</span></a><span class="sd"> Args:</span> -</span><span id="L-715"><a href="#L-715"><span class="linenos"> 715</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="L-716"><a href="#L-716"><span class="linenos"> 716</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-717"><a href="#L-717"><span class="linenos"> 717</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-718"><a href="#L-718"><span class="linenos"> 718</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-719"><a href="#L-719"><span class="linenos"> 719</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-720"><a href="#L-720"><span class="linenos"> 720</span></a><span class="sd"> Returns:</span> -</span><span id="L-721"><a href="#L-721"><span class="linenos"> 721</span></a><span class="sd"> Intersect: the Intersect expression</span> -</span><span id="L-722"><a href="#L-722"><span class="linenos"> 722</span></a><span class="sd"> """</span> -</span><span id="L-723"><a href="#L-723"><span class="linenos"> 723</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-724"><a href="#L-724"><span class="linenos"> 724</span></a> -</span><span id="L-725"><a href="#L-725"><span class="linenos"> 725</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-726"><a href="#L-726"><span class="linenos"> 726</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-727"><a href="#L-727"><span class="linenos"> 727</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</span><span id="L-728"><a href="#L-728"><span class="linenos"> 728</span></a> -</span><span id="L-729"><a href="#L-729"><span class="linenos"> 729</span></a><span class="sd"> Example:</span> -</span><span id="L-730"><a href="#L-730"><span class="linenos"> 730</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-731"><a href="#L-731"><span class="linenos"> 731</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="L-732"><a href="#L-732"><span class="linenos"> 732</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="L-733"><a href="#L-733"><span class="linenos"> 733</span></a> -</span><span id="L-734"><a href="#L-734"><span class="linenos"> 734</span></a><span class="sd"> Args:</span> -</span><span id="L-735"><a href="#L-735"><span class="linenos"> 735</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="L-736"><a href="#L-736"><span class="linenos"> 736</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-737"><a href="#L-737"><span class="linenos"> 737</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-738"><a href="#L-738"><span class="linenos"> 738</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-739"><a href="#L-739"><span class="linenos"> 739</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-740"><a href="#L-740"><span class="linenos"> 740</span></a><span class="sd"> Returns:</span> -</span><span id="L-741"><a href="#L-741"><span class="linenos"> 741</span></a><span class="sd"> Except: the Except expression</span> -</span><span id="L-742"><a href="#L-742"><span class="linenos"> 742</span></a><span class="sd"> """</span> -</span><span id="L-743"><a href="#L-743"><span class="linenos"> 743</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-744"><a href="#L-744"><span class="linenos"> 744</span></a> -</span><span id="L-745"><a href="#L-745"><span class="linenos"> 745</span></a> -</span><span id="L-746"><a href="#L-746"><span class="linenos"> 746</span></a><span class="k">class</span> <span class="nc">UDTF</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> -</span><span id="L-747"><a href="#L-747"><span class="linenos"> 747</span></a> <span class="k">pass</span> -</span><span id="L-748"><a href="#L-748"><span class="linenos"> 748</span></a> -</span><span id="L-749"><a href="#L-749"><span class="linenos"> 749</span></a> -</span><span id="L-750"><a href="#L-750"><span class="linenos"> 750</span></a><span class="k">class</span> <span class="nc">Cache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-751"><a href="#L-751"><span class="linenos"> 751</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-752"><a href="#L-752"><span class="linenos"> 752</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-753"><a href="#L-753"><span class="linenos"> 753</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-754"><a href="#L-754"><span class="linenos"> 754</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-755"><a href="#L-755"><span class="linenos"> 755</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-756"><a href="#L-756"><span class="linenos"> 756</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-757"><a href="#L-757"><span class="linenos"> 757</span></a> <span class="p">}</span> +</span><span id="L-689"><a href="#L-689"><span class="linenos"> 689</span></a> <span class="k">if</span> <span class="n">alias</span><span class="p">:</span> +</span><span id="L-690"><a href="#L-690"><span class="linenos"> 690</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> +</span><span id="L-691"><a href="#L-691"><span class="linenos"> 691</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="L-692"><a href="#L-692"><span class="linenos"> 692</span></a> +</span><span id="L-693"><a href="#L-693"><span class="linenos"> 693</span></a> <span class="nd">@property</span> +</span><span id="L-694"><a href="#L-694"><span class="linenos"> 694</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-695"><a href="#L-695"><span class="linenos"> 695</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">select</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">selects</span><span class="p">]</span> +</span><span id="L-696"><a href="#L-696"><span class="linenos"> 696</span></a> +</span><span id="L-697"><a href="#L-697"><span class="linenos"> 697</span></a> +</span><span id="L-698"><a href="#L-698"><span class="linenos"> 698</span></a><span class="k">class</span> <span class="nc">Unionable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-699"><a href="#L-699"><span class="linenos"> 699</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-700"><a href="#L-700"><span class="linenos"> 700</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-701"><a href="#L-701"><span class="linenos"> 701</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="L-702"><a href="#L-702"><span class="linenos"> 702</span></a> +</span><span id="L-703"><a href="#L-703"><span class="linenos"> 703</span></a><span class="sd"> Example:</span> +</span><span id="L-704"><a href="#L-704"><span class="linenos"> 704</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-705"><a href="#L-705"><span class="linenos"> 705</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="L-706"><a href="#L-706"><span class="linenos"> 706</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="L-707"><a href="#L-707"><span class="linenos"> 707</span></a> +</span><span id="L-708"><a href="#L-708"><span class="linenos"> 708</span></a><span class="sd"> Args:</span> +</span><span id="L-709"><a href="#L-709"><span class="linenos"> 709</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="L-710"><a href="#L-710"><span class="linenos"> 710</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-711"><a href="#L-711"><span class="linenos"> 711</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-712"><a href="#L-712"><span class="linenos"> 712</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-713"><a href="#L-713"><span class="linenos"> 713</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-714"><a href="#L-714"><span class="linenos"> 714</span></a><span class="sd"> Returns:</span> +</span><span id="L-715"><a href="#L-715"><span class="linenos"> 715</span></a><span class="sd"> Union: the Union expression.</span> +</span><span id="L-716"><a href="#L-716"><span class="linenos"> 716</span></a><span class="sd"> """</span> +</span><span id="L-717"><a href="#L-717"><span class="linenos"> 717</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-718"><a href="#L-718"><span class="linenos"> 718</span></a> +</span><span id="L-719"><a href="#L-719"><span class="linenos"> 719</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-720"><a href="#L-720"><span class="linenos"> 720</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-721"><a href="#L-721"><span class="linenos"> 721</span></a><span class="sd"> Builds an INTERSECT expression.</span> +</span><span id="L-722"><a href="#L-722"><span class="linenos"> 722</span></a> +</span><span id="L-723"><a href="#L-723"><span class="linenos"> 723</span></a><span class="sd"> Example:</span> +</span><span id="L-724"><a href="#L-724"><span class="linenos"> 724</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-725"><a href="#L-725"><span class="linenos"> 725</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="L-726"><a href="#L-726"><span class="linenos"> 726</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="L-727"><a href="#L-727"><span class="linenos"> 727</span></a> +</span><span id="L-728"><a href="#L-728"><span class="linenos"> 728</span></a><span class="sd"> Args:</span> +</span><span id="L-729"><a href="#L-729"><span class="linenos"> 729</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="L-730"><a href="#L-730"><span class="linenos"> 730</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-731"><a href="#L-731"><span class="linenos"> 731</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-732"><a href="#L-732"><span class="linenos"> 732</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-733"><a href="#L-733"><span class="linenos"> 733</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-734"><a href="#L-734"><span class="linenos"> 734</span></a><span class="sd"> Returns:</span> +</span><span id="L-735"><a href="#L-735"><span class="linenos"> 735</span></a><span class="sd"> Intersect: the Intersect expression</span> +</span><span id="L-736"><a href="#L-736"><span class="linenos"> 736</span></a><span class="sd"> """</span> +</span><span id="L-737"><a href="#L-737"><span class="linenos"> 737</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-738"><a href="#L-738"><span class="linenos"> 738</span></a> +</span><span id="L-739"><a href="#L-739"><span class="linenos"> 739</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-740"><a href="#L-740"><span class="linenos"> 740</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-741"><a href="#L-741"><span class="linenos"> 741</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="L-742"><a href="#L-742"><span class="linenos"> 742</span></a> +</span><span id="L-743"><a href="#L-743"><span class="linenos"> 743</span></a><span class="sd"> Example:</span> +</span><span id="L-744"><a href="#L-744"><span class="linenos"> 744</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-745"><a href="#L-745"><span class="linenos"> 745</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="L-746"><a href="#L-746"><span class="linenos"> 746</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="L-747"><a href="#L-747"><span class="linenos"> 747</span></a> +</span><span id="L-748"><a href="#L-748"><span class="linenos"> 748</span></a><span class="sd"> Args:</span> +</span><span id="L-749"><a href="#L-749"><span class="linenos"> 749</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="L-750"><a href="#L-750"><span class="linenos"> 750</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-751"><a href="#L-751"><span class="linenos"> 751</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-752"><a href="#L-752"><span class="linenos"> 752</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-753"><a href="#L-753"><span class="linenos"> 753</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-754"><a href="#L-754"><span class="linenos"> 754</span></a><span class="sd"> Returns:</span> +</span><span id="L-755"><a href="#L-755"><span class="linenos"> 755</span></a><span class="sd"> Except: the Except expression</span> +</span><span id="L-756"><a href="#L-756"><span class="linenos"> 756</span></a><span class="sd"> """</span> +</span><span id="L-757"><a href="#L-757"><span class="linenos"> 757</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-758"><a href="#L-758"><span class="linenos"> 758</span></a> </span><span id="L-759"><a href="#L-759"><span class="linenos"> 759</span></a> -</span><span id="L-760"><a href="#L-760"><span class="linenos"> 760</span></a><span class="k">class</span> <span class="nc">Uncache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-761"><a href="#L-761"><span class="linenos"> 761</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-760"><a href="#L-760"><span class="linenos"> 760</span></a><span class="k">class</span> <span class="nc">UDTF</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> +</span><span id="L-761"><a href="#L-761"><span class="linenos"> 761</span></a> <span class="k">pass</span> </span><span id="L-762"><a href="#L-762"><span class="linenos"> 762</span></a> </span><span id="L-763"><a href="#L-763"><span class="linenos"> 763</span></a> -</span><span id="L-764"><a href="#L-764"><span class="linenos"> 764</span></a><span class="k">class</span> <span class="nc">Create</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-764"><a href="#L-764"><span class="linenos"> 764</span></a><span class="k">class</span> <span class="nc">Cache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> </span><span id="L-765"><a href="#L-765"><span class="linenos"> 765</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> </span><span id="L-766"><a href="#L-766"><span class="linenos"> 766</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> </span><span id="L-767"><a href="#L-767"><span class="linenos"> 767</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-768"><a href="#L-768"><span class="linenos"> 768</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-769"><a href="#L-769"><span class="linenos"> 769</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-770"><a href="#L-770"><span class="linenos"> 770</span></a> <span class="s2">"set"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-771"><a href="#L-771"><span class="linenos"> 771</span></a> <span class="s2">"multiset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-772"><a href="#L-772"><span class="linenos"> 772</span></a> <span class="s2">"global_temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-773"><a href="#L-773"><span class="linenos"> 773</span></a> <span class="s2">"volatile"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-774"><a href="#L-774"><span class="linenos"> 774</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-775"><a href="#L-775"><span class="linenos"> 775</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-776"><a href="#L-776"><span class="linenos"> 776</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-777"><a href="#L-777"><span class="linenos"> 777</span></a> <span class="s2">"transient"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-778"><a href="#L-778"><span class="linenos"> 778</span></a> <span class="s2">"external"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-779"><a href="#L-779"><span class="linenos"> 779</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-780"><a href="#L-780"><span class="linenos"> 780</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-781"><a href="#L-781"><span class="linenos"> 781</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-782"><a href="#L-782"><span class="linenos"> 782</span></a> <span class="s2">"data"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-783"><a href="#L-783"><span class="linenos"> 783</span></a> <span class="s2">"statistics"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-784"><a href="#L-784"><span class="linenos"> 784</span></a> <span class="s2">"no_primary_index"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-785"><a href="#L-785"><span class="linenos"> 785</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-786"><a href="#L-786"><span class="linenos"> 786</span></a> <span class="s2">"no_schema_binding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-787"><a href="#L-787"><span class="linenos"> 787</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-788"><a href="#L-788"><span class="linenos"> 788</span></a> <span class="p">}</span> -</span><span id="L-789"><a href="#L-789"><span class="linenos"> 789</span></a> -</span><span id="L-790"><a href="#L-790"><span class="linenos"> 790</span></a> -</span><span id="L-791"><a href="#L-791"><span class="linenos"> 791</span></a><span class="k">class</span> <span class="nc">Describe</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-792"><a href="#L-792"><span class="linenos"> 792</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-768"><a href="#L-768"><span class="linenos"> 768</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-769"><a href="#L-769"><span class="linenos"> 769</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-770"><a href="#L-770"><span class="linenos"> 770</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-771"><a href="#L-771"><span class="linenos"> 771</span></a> <span class="p">}</span> +</span><span id="L-772"><a href="#L-772"><span class="linenos"> 772</span></a> +</span><span id="L-773"><a href="#L-773"><span class="linenos"> 773</span></a> +</span><span id="L-774"><a href="#L-774"><span class="linenos"> 774</span></a><span class="k">class</span> <span class="nc">Uncache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-775"><a href="#L-775"><span class="linenos"> 775</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-776"><a href="#L-776"><span class="linenos"> 776</span></a> +</span><span id="L-777"><a href="#L-777"><span class="linenos"> 777</span></a> +</span><span id="L-778"><a href="#L-778"><span class="linenos"> 778</span></a><span class="k">class</span> <span class="nc">Create</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-779"><a href="#L-779"><span class="linenos"> 779</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-780"><a href="#L-780"><span class="linenos"> 780</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-781"><a href="#L-781"><span class="linenos"> 781</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-782"><a href="#L-782"><span class="linenos"> 782</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-783"><a href="#L-783"><span class="linenos"> 783</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-784"><a href="#L-784"><span class="linenos"> 784</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-785"><a href="#L-785"><span class="linenos"> 785</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-786"><a href="#L-786"><span class="linenos"> 786</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-787"><a href="#L-787"><span class="linenos"> 787</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-788"><a href="#L-788"><span class="linenos"> 788</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-789"><a href="#L-789"><span class="linenos"> 789</span></a> <span class="s2">"no_schema_binding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-790"><a href="#L-790"><span class="linenos"> 790</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-791"><a href="#L-791"><span class="linenos"> 791</span></a> <span class="p">}</span> +</span><span id="L-792"><a href="#L-792"><span class="linenos"> 792</span></a> </span><span id="L-793"><a href="#L-793"><span class="linenos"> 793</span></a> -</span><span id="L-794"><a href="#L-794"><span class="linenos"> 794</span></a> -</span><span id="L-795"><a href="#L-795"><span class="linenos"> 795</span></a><span class="k">class</span> <span class="nc">Set</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-796"><a href="#L-796"><span class="linenos"> 796</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-794"><a href="#L-794"><span class="linenos"> 794</span></a><span class="k">class</span> <span class="nc">Describe</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-795"><a href="#L-795"><span class="linenos"> 795</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-796"><a href="#L-796"><span class="linenos"> 796</span></a> </span><span id="L-797"><a href="#L-797"><span class="linenos"> 797</span></a> -</span><span id="L-798"><a href="#L-798"><span class="linenos"> 798</span></a> -</span><span id="L-799"><a href="#L-799"><span class="linenos"> 799</span></a><span class="k">class</span> <span class="nc">SetItem</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-800"><a href="#L-800"><span class="linenos"> 800</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-801"><a href="#L-801"><span class="linenos"> 801</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-802"><a href="#L-802"><span class="linenos"> 802</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-803"><a href="#L-803"><span class="linenos"> 803</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-804"><a href="#L-804"><span class="linenos"> 804</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># MySQL SET NAMES statement</span> -</span><span id="L-805"><a href="#L-805"><span class="linenos"> 805</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-806"><a href="#L-806"><span class="linenos"> 806</span></a> <span class="p">}</span> -</span><span id="L-807"><a href="#L-807"><span class="linenos"> 807</span></a> -</span><span id="L-808"><a href="#L-808"><span class="linenos"> 808</span></a> -</span><span id="L-809"><a href="#L-809"><span class="linenos"> 809</span></a><span class="k">class</span> <span class="nc">Show</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-810"><a href="#L-810"><span class="linenos"> 810</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-811"><a href="#L-811"><span class="linenos"> 811</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-812"><a href="#L-812"><span class="linenos"> 812</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-813"><a href="#L-813"><span class="linenos"> 813</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-814"><a href="#L-814"><span class="linenos"> 814</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-815"><a href="#L-815"><span class="linenos"> 815</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-816"><a href="#L-816"><span class="linenos"> 816</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-817"><a href="#L-817"><span class="linenos"> 817</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-818"><a href="#L-818"><span class="linenos"> 818</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-819"><a href="#L-819"><span class="linenos"> 819</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-820"><a href="#L-820"><span class="linenos"> 820</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-821"><a href="#L-821"><span class="linenos"> 821</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-822"><a href="#L-822"><span class="linenos"> 822</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-823"><a href="#L-823"><span class="linenos"> 823</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-824"><a href="#L-824"><span class="linenos"> 824</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-825"><a href="#L-825"><span class="linenos"> 825</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-826"><a href="#L-826"><span class="linenos"> 826</span></a> <span class="p">}</span> -</span><span id="L-827"><a href="#L-827"><span class="linenos"> 827</span></a> -</span><span id="L-828"><a href="#L-828"><span class="linenos"> 828</span></a> -</span><span id="L-829"><a href="#L-829"><span class="linenos"> 829</span></a><span class="k">class</span> <span class="nc">UserDefinedFunction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-830"><a href="#L-830"><span class="linenos"> 830</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-798"><a href="#L-798"><span class="linenos"> 798</span></a><span class="k">class</span> <span class="nc">Set</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-799"><a href="#L-799"><span class="linenos"> 799</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-800"><a href="#L-800"><span class="linenos"> 800</span></a> +</span><span id="L-801"><a href="#L-801"><span class="linenos"> 801</span></a> +</span><span id="L-802"><a href="#L-802"><span class="linenos"> 802</span></a><span class="k">class</span> <span class="nc">SetItem</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-803"><a href="#L-803"><span class="linenos"> 803</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-804"><a href="#L-804"><span class="linenos"> 804</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-805"><a href="#L-805"><span class="linenos"> 805</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-806"><a href="#L-806"><span class="linenos"> 806</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-807"><a href="#L-807"><span class="linenos"> 807</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># MySQL SET NAMES statement</span> +</span><span id="L-808"><a href="#L-808"><span class="linenos"> 808</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-809"><a href="#L-809"><span class="linenos"> 809</span></a> <span class="p">}</span> +</span><span id="L-810"><a href="#L-810"><span class="linenos"> 810</span></a> +</span><span id="L-811"><a href="#L-811"><span class="linenos"> 811</span></a> +</span><span id="L-812"><a href="#L-812"><span class="linenos"> 812</span></a><span class="k">class</span> <span class="nc">Show</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-813"><a href="#L-813"><span class="linenos"> 813</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-814"><a href="#L-814"><span class="linenos"> 814</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-815"><a href="#L-815"><span class="linenos"> 815</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-816"><a href="#L-816"><span class="linenos"> 816</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-817"><a href="#L-817"><span class="linenos"> 817</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-818"><a href="#L-818"><span class="linenos"> 818</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-819"><a href="#L-819"><span class="linenos"> 819</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-820"><a href="#L-820"><span class="linenos"> 820</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-821"><a href="#L-821"><span class="linenos"> 821</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-822"><a href="#L-822"><span class="linenos"> 822</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-823"><a href="#L-823"><span class="linenos"> 823</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-824"><a href="#L-824"><span class="linenos"> 824</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-825"><a href="#L-825"><span class="linenos"> 825</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-826"><a href="#L-826"><span class="linenos"> 826</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-827"><a href="#L-827"><span class="linenos"> 827</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-828"><a href="#L-828"><span class="linenos"> 828</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-829"><a href="#L-829"><span class="linenos"> 829</span></a> <span class="p">}</span> +</span><span id="L-830"><a href="#L-830"><span class="linenos"> 830</span></a> </span><span id="L-831"><a href="#L-831"><span class="linenos"> 831</span></a> -</span><span id="L-832"><a href="#L-832"><span class="linenos"> 832</span></a> -</span><span id="L-833"><a href="#L-833"><span class="linenos"> 833</span></a><span class="k">class</span> <span class="nc">CharacterSet</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-834"><a href="#L-834"><span class="linenos"> 834</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-832"><a href="#L-832"><span class="linenos"> 832</span></a><span class="k">class</span> <span class="nc">UserDefinedFunction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-833"><a href="#L-833"><span class="linenos"> 833</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-834"><a href="#L-834"><span class="linenos"> 834</span></a> </span><span id="L-835"><a href="#L-835"><span class="linenos"> 835</span></a> -</span><span id="L-836"><a href="#L-836"><span class="linenos"> 836</span></a> -</span><span id="L-837"><a href="#L-837"><span class="linenos"> 837</span></a><span class="k">class</span> <span class="nc">With</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-838"><a href="#L-838"><span class="linenos"> 838</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"recursive"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-836"><a href="#L-836"><span class="linenos"> 836</span></a><span class="k">class</span> <span class="nc">CharacterSet</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-837"><a href="#L-837"><span class="linenos"> 837</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-838"><a href="#L-838"><span class="linenos"> 838</span></a> </span><span id="L-839"><a href="#L-839"><span class="linenos"> 839</span></a> -</span><span id="L-840"><a href="#L-840"><span class="linenos"> 840</span></a> <span class="nd">@property</span> -</span><span id="L-841"><a href="#L-841"><span class="linenos"> 841</span></a> <span class="k">def</span> <span class="nf">recursive</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-842"><a href="#L-842"><span class="linenos"> 842</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"recursive"</span><span class="p">))</span> -</span><span id="L-843"><a href="#L-843"><span class="linenos"> 843</span></a> -</span><span id="L-844"><a href="#L-844"><span class="linenos"> 844</span></a> -</span><span id="L-845"><a href="#L-845"><span class="linenos"> 845</span></a><span class="k">class</span> <span class="nc">WithinGroup</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-846"><a href="#L-846"><span class="linenos"> 846</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-840"><a href="#L-840"><span class="linenos"> 840</span></a><span class="k">class</span> <span class="nc">With</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-841"><a href="#L-841"><span class="linenos"> 841</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"recursive"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-842"><a href="#L-842"><span class="linenos"> 842</span></a> +</span><span id="L-843"><a href="#L-843"><span class="linenos"> 843</span></a> <span class="nd">@property</span> +</span><span id="L-844"><a href="#L-844"><span class="linenos"> 844</span></a> <span class="k">def</span> <span class="nf">recursive</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-845"><a href="#L-845"><span class="linenos"> 845</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"recursive"</span><span class="p">))</span> +</span><span id="L-846"><a href="#L-846"><span class="linenos"> 846</span></a> </span><span id="L-847"><a href="#L-847"><span class="linenos"> 847</span></a> -</span><span id="L-848"><a href="#L-848"><span class="linenos"> 848</span></a> -</span><span id="L-849"><a href="#L-849"><span class="linenos"> 849</span></a><span class="k">class</span> <span class="nc">CTE</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">):</span> -</span><span id="L-850"><a href="#L-850"><span class="linenos"> 850</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-848"><a href="#L-848"><span class="linenos"> 848</span></a><span class="k">class</span> <span class="nc">WithinGroup</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-849"><a href="#L-849"><span class="linenos"> 849</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-850"><a href="#L-850"><span class="linenos"> 850</span></a> </span><span id="L-851"><a href="#L-851"><span class="linenos"> 851</span></a> -</span><span id="L-852"><a href="#L-852"><span class="linenos"> 852</span></a> -</span><span id="L-853"><a href="#L-853"><span class="linenos"> 853</span></a><span class="k">class</span> <span class="nc">TableAlias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-854"><a href="#L-854"><span class="linenos"> 854</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-852"><a href="#L-852"><span class="linenos"> 852</span></a><span class="k">class</span> <span class="nc">CTE</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">):</span> +</span><span id="L-853"><a href="#L-853"><span class="linenos"> 853</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-854"><a href="#L-854"><span class="linenos"> 854</span></a> </span><span id="L-855"><a href="#L-855"><span class="linenos"> 855</span></a> -</span><span id="L-856"><a href="#L-856"><span class="linenos"> 856</span></a> <span class="nd">@property</span> -</span><span id="L-857"><a href="#L-857"><span class="linenos"> 857</span></a> <span class="k">def</span> <span class="nf">columns</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-858"><a href="#L-858"><span class="linenos"> 858</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="L-859"><a href="#L-859"><span class="linenos"> 859</span></a> -</span><span id="L-860"><a href="#L-860"><span class="linenos"> 860</span></a> -</span><span id="L-861"><a href="#L-861"><span class="linenos"> 861</span></a><span class="k">class</span> <span class="nc">BitString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-862"><a href="#L-862"><span class="linenos"> 862</span></a> <span class="k">pass</span> +</span><span id="L-856"><a href="#L-856"><span class="linenos"> 856</span></a><span class="k">class</span> <span class="nc">TableAlias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-857"><a href="#L-857"><span class="linenos"> 857</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-858"><a href="#L-858"><span class="linenos"> 858</span></a> +</span><span id="L-859"><a href="#L-859"><span class="linenos"> 859</span></a> <span class="nd">@property</span> +</span><span id="L-860"><a href="#L-860"><span class="linenos"> 860</span></a> <span class="k">def</span> <span class="nf">columns</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-861"><a href="#L-861"><span class="linenos"> 861</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> +</span><span id="L-862"><a href="#L-862"><span class="linenos"> 862</span></a> </span><span id="L-863"><a href="#L-863"><span class="linenos"> 863</span></a> -</span><span id="L-864"><a href="#L-864"><span class="linenos"> 864</span></a> -</span><span id="L-865"><a href="#L-865"><span class="linenos"> 865</span></a><span class="k">class</span> <span class="nc">HexString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-866"><a href="#L-866"><span class="linenos"> 866</span></a> <span class="k">pass</span> +</span><span id="L-864"><a href="#L-864"><span class="linenos"> 864</span></a><span class="k">class</span> <span class="nc">BitString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-865"><a href="#L-865"><span class="linenos"> 865</span></a> <span class="k">pass</span> +</span><span id="L-866"><a href="#L-866"><span class="linenos"> 866</span></a> </span><span id="L-867"><a href="#L-867"><span class="linenos"> 867</span></a> -</span><span id="L-868"><a href="#L-868"><span class="linenos"> 868</span></a> -</span><span id="L-869"><a href="#L-869"><span class="linenos"> 869</span></a><span class="k">class</span> <span class="nc">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-870"><a href="#L-870"><span class="linenos"> 870</span></a> <span class="k">pass</span> +</span><span id="L-868"><a href="#L-868"><span class="linenos"> 868</span></a><span class="k">class</span> <span class="nc">HexString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-869"><a href="#L-869"><span class="linenos"> 869</span></a> <span class="k">pass</span> +</span><span id="L-870"><a href="#L-870"><span class="linenos"> 870</span></a> </span><span id="L-871"><a href="#L-871"><span class="linenos"> 871</span></a> -</span><span id="L-872"><a href="#L-872"><span class="linenos"> 872</span></a> -</span><span id="L-873"><a href="#L-873"><span class="linenos"> 873</span></a><span class="k">class</span> <span class="nc">Column</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-874"><a href="#L-874"><span class="linenos"> 874</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-872"><a href="#L-872"><span class="linenos"> 872</span></a><span class="k">class</span> <span class="nc">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-873"><a href="#L-873"><span class="linenos"> 873</span></a> <span class="k">pass</span> +</span><span id="L-874"><a href="#L-874"><span class="linenos"> 874</span></a> </span><span id="L-875"><a href="#L-875"><span class="linenos"> 875</span></a> -</span><span id="L-876"><a href="#L-876"><span class="linenos"> 876</span></a> <span class="nd">@property</span> -</span><span id="L-877"><a href="#L-877"><span class="linenos"> 877</span></a> <span class="k">def</span> <span class="nf">table</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-878"><a href="#L-878"><span class="linenos"> 878</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"table"</span><span class="p">)</span> -</span><span id="L-879"><a href="#L-879"><span class="linenos"> 879</span></a> -</span><span id="L-880"><a href="#L-880"><span class="linenos"> 880</span></a> <span class="nd">@property</span> -</span><span id="L-881"><a href="#L-881"><span class="linenos"> 881</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-882"><a href="#L-882"><span class="linenos"> 882</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> -</span><span id="L-883"><a href="#L-883"><span class="linenos"> 883</span></a> -</span><span id="L-884"><a href="#L-884"><span class="linenos"> 884</span></a> <span class="nd">@property</span> -</span><span id="L-885"><a href="#L-885"><span class="linenos"> 885</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-886"><a href="#L-886"><span class="linenos"> 886</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> -</span><span id="L-887"><a href="#L-887"><span class="linenos"> 887</span></a> -</span><span id="L-888"><a href="#L-888"><span class="linenos"> 888</span></a> <span class="nd">@property</span> -</span><span id="L-889"><a href="#L-889"><span class="linenos"> 889</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-890"><a href="#L-890"><span class="linenos"> 890</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-891"><a href="#L-891"><span class="linenos"> 891</span></a> -</span><span id="L-892"><a href="#L-892"><span class="linenos"> 892</span></a> -</span><span id="L-893"><a href="#L-893"><span class="linenos"> 893</span></a><span class="k">class</span> <span class="nc">ColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-894"><a href="#L-894"><span class="linenos"> 894</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-895"><a href="#L-895"><span class="linenos"> 895</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-896"><a href="#L-896"><span class="linenos"> 896</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-897"><a href="#L-897"><span class="linenos"> 897</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-898"><a href="#L-898"><span class="linenos"> 898</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-899"><a href="#L-899"><span class="linenos"> 899</span></a> <span class="p">}</span> -</span><span id="L-900"><a href="#L-900"><span class="linenos"> 900</span></a> -</span><span id="L-901"><a href="#L-901"><span class="linenos"> 901</span></a> -</span><span id="L-902"><a href="#L-902"><span class="linenos"> 902</span></a><span class="k">class</span> <span class="nc">AlterColumn</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-903"><a href="#L-903"><span class="linenos"> 903</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-904"><a href="#L-904"><span class="linenos"> 904</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-905"><a href="#L-905"><span class="linenos"> 905</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-906"><a href="#L-906"><span class="linenos"> 906</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-907"><a href="#L-907"><span class="linenos"> 907</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-908"><a href="#L-908"><span class="linenos"> 908</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-909"><a href="#L-909"><span class="linenos"> 909</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-910"><a href="#L-910"><span class="linenos"> 910</span></a> <span class="p">}</span> -</span><span id="L-911"><a href="#L-911"><span class="linenos"> 911</span></a> -</span><span id="L-912"><a href="#L-912"><span class="linenos"> 912</span></a> -</span><span id="L-913"><a href="#L-913"><span class="linenos"> 913</span></a><span class="k">class</span> <span class="nc">RenameTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-914"><a href="#L-914"><span class="linenos"> 914</span></a> <span class="k">pass</span> +</span><span id="L-876"><a href="#L-876"><span class="linenos"> 876</span></a><span class="k">class</span> <span class="nc">Column</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-877"><a href="#L-877"><span class="linenos"> 877</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-878"><a href="#L-878"><span class="linenos"> 878</span></a> +</span><span id="L-879"><a href="#L-879"><span class="linenos"> 879</span></a> <span class="nd">@property</span> +</span><span id="L-880"><a href="#L-880"><span class="linenos"> 880</span></a> <span class="k">def</span> <span class="nf">table</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-881"><a href="#L-881"><span class="linenos"> 881</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"table"</span><span class="p">)</span> +</span><span id="L-882"><a href="#L-882"><span class="linenos"> 882</span></a> +</span><span id="L-883"><a href="#L-883"><span class="linenos"> 883</span></a> <span class="nd">@property</span> +</span><span id="L-884"><a href="#L-884"><span class="linenos"> 884</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-885"><a href="#L-885"><span class="linenos"> 885</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> +</span><span id="L-886"><a href="#L-886"><span class="linenos"> 886</span></a> +</span><span id="L-887"><a href="#L-887"><span class="linenos"> 887</span></a> <span class="nd">@property</span> +</span><span id="L-888"><a href="#L-888"><span class="linenos"> 888</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-889"><a href="#L-889"><span class="linenos"> 889</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> +</span><span id="L-890"><a href="#L-890"><span class="linenos"> 890</span></a> +</span><span id="L-891"><a href="#L-891"><span class="linenos"> 891</span></a> <span class="nd">@property</span> +</span><span id="L-892"><a href="#L-892"><span class="linenos"> 892</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-893"><a href="#L-893"><span class="linenos"> 893</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-894"><a href="#L-894"><span class="linenos"> 894</span></a> +</span><span id="L-895"><a href="#L-895"><span class="linenos"> 895</span></a> +</span><span id="L-896"><a href="#L-896"><span class="linenos"> 896</span></a><span class="k">class</span> <span class="nc">ColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-897"><a href="#L-897"><span class="linenos"> 897</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-898"><a href="#L-898"><span class="linenos"> 898</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-899"><a href="#L-899"><span class="linenos"> 899</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-900"><a href="#L-900"><span class="linenos"> 900</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-901"><a href="#L-901"><span class="linenos"> 901</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-902"><a href="#L-902"><span class="linenos"> 902</span></a> <span class="p">}</span> +</span><span id="L-903"><a href="#L-903"><span class="linenos"> 903</span></a> +</span><span id="L-904"><a href="#L-904"><span class="linenos"> 904</span></a> +</span><span id="L-905"><a href="#L-905"><span class="linenos"> 905</span></a><span class="k">class</span> <span class="nc">AlterColumn</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-906"><a href="#L-906"><span class="linenos"> 906</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-907"><a href="#L-907"><span class="linenos"> 907</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-908"><a href="#L-908"><span class="linenos"> 908</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-909"><a href="#L-909"><span class="linenos"> 909</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-910"><a href="#L-910"><span class="linenos"> 910</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-911"><a href="#L-911"><span class="linenos"> 911</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-912"><a href="#L-912"><span class="linenos"> 912</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-913"><a href="#L-913"><span class="linenos"> 913</span></a> <span class="p">}</span> +</span><span id="L-914"><a href="#L-914"><span class="linenos"> 914</span></a> </span><span id="L-915"><a href="#L-915"><span class="linenos"> 915</span></a> -</span><span id="L-916"><a href="#L-916"><span class="linenos"> 916</span></a> -</span><span id="L-917"><a href="#L-917"><span class="linenos"> 917</span></a><span class="k">class</span> <span class="nc">ColumnConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-918"><a href="#L-918"><span class="linenos"> 918</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-916"><a href="#L-916"><span class="linenos"> 916</span></a><span class="k">class</span> <span class="nc">RenameTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-917"><a href="#L-917"><span class="linenos"> 917</span></a> <span class="k">pass</span> +</span><span id="L-918"><a href="#L-918"><span class="linenos"> 918</span></a> </span><span id="L-919"><a href="#L-919"><span class="linenos"> 919</span></a> -</span><span id="L-920"><a href="#L-920"><span class="linenos"> 920</span></a> -</span><span id="L-921"><a href="#L-921"><span class="linenos"> 921</span></a><span class="k">class</span> <span class="nc">ColumnConstraintKind</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-922"><a href="#L-922"><span class="linenos"> 922</span></a> <span class="k">pass</span> +</span><span id="L-920"><a href="#L-920"><span class="linenos"> 920</span></a><span class="k">class</span> <span class="nc">ColumnConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-921"><a href="#L-921"><span class="linenos"> 921</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-922"><a href="#L-922"><span class="linenos"> 922</span></a> </span><span id="L-923"><a href="#L-923"><span class="linenos"> 923</span></a> -</span><span id="L-924"><a href="#L-924"><span class="linenos"> 924</span></a> -</span><span id="L-925"><a href="#L-925"><span class="linenos"> 925</span></a><span class="k">class</span> <span class="nc">AutoIncrementColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-926"><a href="#L-926"><span class="linenos"> 926</span></a> <span class="k">pass</span> +</span><span id="L-924"><a href="#L-924"><span class="linenos"> 924</span></a><span class="k">class</span> <span class="nc">ColumnConstraintKind</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-925"><a href="#L-925"><span class="linenos"> 925</span></a> <span class="k">pass</span> +</span><span id="L-926"><a href="#L-926"><span class="linenos"> 926</span></a> </span><span id="L-927"><a href="#L-927"><span class="linenos"> 927</span></a> -</span><span id="L-928"><a href="#L-928"><span class="linenos"> 928</span></a> -</span><span id="L-929"><a href="#L-929"><span class="linenos"> 929</span></a><span class="k">class</span> <span class="nc">CaseSpecificColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-930"><a href="#L-930"><span class="linenos"> 930</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"not_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-928"><a href="#L-928"><span class="linenos"> 928</span></a><span class="k">class</span> <span class="nc">AutoIncrementColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-929"><a href="#L-929"><span class="linenos"> 929</span></a> <span class="k">pass</span> +</span><span id="L-930"><a href="#L-930"><span class="linenos"> 930</span></a> </span><span id="L-931"><a href="#L-931"><span class="linenos"> 931</span></a> -</span><span id="L-932"><a href="#L-932"><span class="linenos"> 932</span></a> -</span><span id="L-933"><a href="#L-933"><span class="linenos"> 933</span></a><span class="k">class</span> <span class="nc">CharacterSetColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-934"><a href="#L-934"><span class="linenos"> 934</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-932"><a href="#L-932"><span class="linenos"> 932</span></a><span class="k">class</span> <span class="nc">CaseSpecificColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-933"><a href="#L-933"><span class="linenos"> 933</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"not_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-934"><a href="#L-934"><span class="linenos"> 934</span></a> </span><span id="L-935"><a href="#L-935"><span class="linenos"> 935</span></a> -</span><span id="L-936"><a href="#L-936"><span class="linenos"> 936</span></a> -</span><span id="L-937"><a href="#L-937"><span class="linenos"> 937</span></a><span class="k">class</span> <span class="nc">CheckColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-938"><a href="#L-938"><span class="linenos"> 938</span></a> <span class="k">pass</span> +</span><span id="L-936"><a href="#L-936"><span class="linenos"> 936</span></a><span class="k">class</span> <span class="nc">CharacterSetColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-937"><a href="#L-937"><span class="linenos"> 937</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-938"><a href="#L-938"><span class="linenos"> 938</span></a> </span><span id="L-939"><a href="#L-939"><span class="linenos"> 939</span></a> -</span><span id="L-940"><a href="#L-940"><span class="linenos"> 940</span></a> -</span><span id="L-941"><a href="#L-941"><span class="linenos"> 941</span></a><span class="k">class</span> <span class="nc">CollateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-942"><a href="#L-942"><span class="linenos"> 942</span></a> <span class="k">pass</span> +</span><span id="L-940"><a href="#L-940"><span class="linenos"> 940</span></a><span class="k">class</span> <span class="nc">CheckColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-941"><a href="#L-941"><span class="linenos"> 941</span></a> <span class="k">pass</span> +</span><span id="L-942"><a href="#L-942"><span class="linenos"> 942</span></a> </span><span id="L-943"><a href="#L-943"><span class="linenos"> 943</span></a> -</span><span id="L-944"><a href="#L-944"><span class="linenos"> 944</span></a> -</span><span id="L-945"><a href="#L-945"><span class="linenos"> 945</span></a><span class="k">class</span> <span class="nc">CommentColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-946"><a href="#L-946"><span class="linenos"> 946</span></a> <span class="k">pass</span> +</span><span id="L-944"><a href="#L-944"><span class="linenos"> 944</span></a><span class="k">class</span> <span class="nc">CollateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-945"><a href="#L-945"><span class="linenos"> 945</span></a> <span class="k">pass</span> +</span><span id="L-946"><a href="#L-946"><span class="linenos"> 946</span></a> </span><span id="L-947"><a href="#L-947"><span class="linenos"> 947</span></a> -</span><span id="L-948"><a href="#L-948"><span class="linenos"> 948</span></a> -</span><span id="L-949"><a href="#L-949"><span class="linenos"> 949</span></a><span class="k">class</span> <span class="nc">DateFormatColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-950"><a href="#L-950"><span class="linenos"> 950</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-948"><a href="#L-948"><span class="linenos"> 948</span></a><span class="k">class</span> <span class="nc">CommentColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-949"><a href="#L-949"><span class="linenos"> 949</span></a> <span class="k">pass</span> +</span><span id="L-950"><a href="#L-950"><span class="linenos"> 950</span></a> </span><span id="L-951"><a href="#L-951"><span class="linenos"> 951</span></a> -</span><span id="L-952"><a href="#L-952"><span class="linenos"> 952</span></a> -</span><span id="L-953"><a href="#L-953"><span class="linenos"> 953</span></a><span class="k">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-954"><a href="#L-954"><span class="linenos"> 954</span></a> <span class="k">pass</span> +</span><span id="L-952"><a href="#L-952"><span class="linenos"> 952</span></a><span class="k">class</span> <span class="nc">CompressColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-953"><a href="#L-953"><span class="linenos"> 953</span></a> <span class="k">pass</span> +</span><span id="L-954"><a href="#L-954"><span class="linenos"> 954</span></a> </span><span id="L-955"><a href="#L-955"><span class="linenos"> 955</span></a> -</span><span id="L-956"><a href="#L-956"><span class="linenos"> 956</span></a> -</span><span id="L-957"><a href="#L-957"><span class="linenos"> 957</span></a><span class="k">class</span> <span class="nc">EncodeColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-958"><a href="#L-958"><span class="linenos"> 958</span></a> <span class="k">pass</span> +</span><span id="L-956"><a href="#L-956"><span class="linenos"> 956</span></a><span class="k">class</span> <span class="nc">DateFormatColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-957"><a href="#L-957"><span class="linenos"> 957</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-958"><a href="#L-958"><span class="linenos"> 958</span></a> </span><span id="L-959"><a href="#L-959"><span class="linenos"> 959</span></a> -</span><span id="L-960"><a href="#L-960"><span class="linenos"> 960</span></a> -</span><span id="L-961"><a href="#L-961"><span class="linenos"> 961</span></a><span class="k">class</span> <span class="nc">GeneratedAsIdentityColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-962"><a href="#L-962"><span class="linenos"> 962</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> -</span><span id="L-963"><a href="#L-963"><span class="linenos"> 963</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-964"><a href="#L-964"><span class="linenos"> 964</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-965"><a href="#L-965"><span class="linenos"> 965</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-966"><a href="#L-966"><span class="linenos"> 966</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-967"><a href="#L-967"><span class="linenos"> 967</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-968"><a href="#L-968"><span class="linenos"> 968</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-969"><a href="#L-969"><span class="linenos"> 969</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-970"><a href="#L-970"><span class="linenos"> 970</span></a> <span class="p">}</span> -</span><span id="L-971"><a href="#L-971"><span class="linenos"> 971</span></a> -</span><span id="L-972"><a href="#L-972"><span class="linenos"> 972</span></a> -</span><span id="L-973"><a href="#L-973"><span class="linenos"> 973</span></a><span class="k">class</span> <span class="nc">NotNullColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-974"><a href="#L-974"><span class="linenos"> 974</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"allow_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-975"><a href="#L-975"><span class="linenos"> 975</span></a> -</span><span id="L-976"><a href="#L-976"><span class="linenos"> 976</span></a> -</span><span id="L-977"><a href="#L-977"><span class="linenos"> 977</span></a><span class="k">class</span> <span class="nc">PrimaryKeyColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-978"><a href="#L-978"><span class="linenos"> 978</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"desc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-960"><a href="#L-960"><span class="linenos"> 960</span></a><span class="k">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-961"><a href="#L-961"><span class="linenos"> 961</span></a> <span class="k">pass</span> +</span><span id="L-962"><a href="#L-962"><span class="linenos"> 962</span></a> +</span><span id="L-963"><a href="#L-963"><span class="linenos"> 963</span></a> +</span><span id="L-964"><a href="#L-964"><span class="linenos"> 964</span></a><span class="k">class</span> <span class="nc">EncodeColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-965"><a href="#L-965"><span class="linenos"> 965</span></a> <span class="k">pass</span> +</span><span id="L-966"><a href="#L-966"><span class="linenos"> 966</span></a> +</span><span id="L-967"><a href="#L-967"><span class="linenos"> 967</span></a> +</span><span id="L-968"><a href="#L-968"><span class="linenos"> 968</span></a><span class="k">class</span> <span class="nc">GeneratedAsIdentityColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-969"><a href="#L-969"><span class="linenos"> 969</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> +</span><span id="L-970"><a href="#L-970"><span class="linenos"> 970</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-971"><a href="#L-971"><span class="linenos"> 971</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-972"><a href="#L-972"><span class="linenos"> 972</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-973"><a href="#L-973"><span class="linenos"> 973</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-974"><a href="#L-974"><span class="linenos"> 974</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-975"><a href="#L-975"><span class="linenos"> 975</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-976"><a href="#L-976"><span class="linenos"> 976</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-977"><a href="#L-977"><span class="linenos"> 977</span></a> <span class="p">}</span> +</span><span id="L-978"><a href="#L-978"><span class="linenos"> 978</span></a> </span><span id="L-979"><a href="#L-979"><span class="linenos"> 979</span></a> -</span><span id="L-980"><a href="#L-980"><span class="linenos"> 980</span></a> -</span><span id="L-981"><a href="#L-981"><span class="linenos"> 981</span></a><span class="k">class</span> <span class="nc">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-982"><a href="#L-982"><span class="linenos"> 982</span></a> <span class="k">pass</span> +</span><span id="L-980"><a href="#L-980"><span class="linenos"> 980</span></a><span class="k">class</span> <span class="nc">InlineLengthColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-981"><a href="#L-981"><span class="linenos"> 981</span></a> <span class="k">pass</span> +</span><span id="L-982"><a href="#L-982"><span class="linenos"> 982</span></a> </span><span id="L-983"><a href="#L-983"><span class="linenos"> 983</span></a> -</span><span id="L-984"><a href="#L-984"><span class="linenos"> 984</span></a> -</span><span id="L-985"><a href="#L-985"><span class="linenos"> 985</span></a><span class="k">class</span> <span class="nc">UniqueColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-986"><a href="#L-986"><span class="linenos"> 986</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-984"><a href="#L-984"><span class="linenos"> 984</span></a><span class="k">class</span> <span class="nc">NotNullColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-985"><a href="#L-985"><span class="linenos"> 985</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"allow_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-986"><a href="#L-986"><span class="linenos"> 986</span></a> </span><span id="L-987"><a href="#L-987"><span class="linenos"> 987</span></a> -</span><span id="L-988"><a href="#L-988"><span class="linenos"> 988</span></a> -</span><span id="L-989"><a href="#L-989"><span class="linenos"> 989</span></a><span class="k">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-990"><a href="#L-990"><span class="linenos"> 990</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-988"><a href="#L-988"><span class="linenos"> 988</span></a><span class="k">class</span> <span class="nc">PrimaryKeyColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-989"><a href="#L-989"><span class="linenos"> 989</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"desc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-990"><a href="#L-990"><span class="linenos"> 990</span></a> </span><span id="L-991"><a href="#L-991"><span class="linenos"> 991</span></a> -</span><span id="L-992"><a href="#L-992"><span class="linenos"> 992</span></a> -</span><span id="L-993"><a href="#L-993"><span class="linenos"> 993</span></a><span class="k">class</span> <span class="nc">PathColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="L-994"><a href="#L-994"><span class="linenos"> 994</span></a> <span class="k">pass</span> +</span><span id="L-992"><a href="#L-992"><span class="linenos"> 992</span></a><span class="k">class</span> <span class="nc">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-993"><a href="#L-993"><span class="linenos"> 993</span></a> <span class="k">pass</span> +</span><span id="L-994"><a href="#L-994"><span class="linenos"> 994</span></a> </span><span id="L-995"><a href="#L-995"><span class="linenos"> 995</span></a> -</span><span id="L-996"><a href="#L-996"><span class="linenos"> 996</span></a> -</span><span id="L-997"><a href="#L-997"><span class="linenos"> 997</span></a><span class="k">class</span> <span class="nc">Constraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-998"><a href="#L-998"><span class="linenos"> 998</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-996"><a href="#L-996"><span class="linenos"> 996</span></a><span class="k">class</span> <span class="nc">UniqueColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-997"><a href="#L-997"><span class="linenos"> 997</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-998"><a href="#L-998"><span class="linenos"> 998</span></a> </span><span id="L-999"><a href="#L-999"><span class="linenos"> 999</span></a> -</span><span id="L-1000"><a href="#L-1000"><span class="linenos">1000</span></a> -</span><span id="L-1001"><a href="#L-1001"><span class="linenos">1001</span></a><span class="k">class</span> <span class="nc">Delete</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1002"><a href="#L-1002"><span class="linenos">1002</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1000"><a href="#L-1000"><span class="linenos">1000</span></a><span class="k">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1001"><a href="#L-1001"><span class="linenos">1001</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-1002"><a href="#L-1002"><span class="linenos">1002</span></a> </span><span id="L-1003"><a href="#L-1003"><span class="linenos">1003</span></a> -</span><span id="L-1004"><a href="#L-1004"><span class="linenos">1004</span></a> -</span><span id="L-1005"><a href="#L-1005"><span class="linenos">1005</span></a><span class="k">class</span> <span class="nc">Drop</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1006"><a href="#L-1006"><span class="linenos">1006</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1007"><a href="#L-1007"><span class="linenos">1007</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1008"><a href="#L-1008"><span class="linenos">1008</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1009"><a href="#L-1009"><span class="linenos">1009</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1010"><a href="#L-1010"><span class="linenos">1010</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1011"><a href="#L-1011"><span class="linenos">1011</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1012"><a href="#L-1012"><span class="linenos">1012</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1013"><a href="#L-1013"><span class="linenos">1013</span></a> <span class="p">}</span> +</span><span id="L-1004"><a href="#L-1004"><span class="linenos">1004</span></a><span class="k">class</span> <span class="nc">PathColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="L-1005"><a href="#L-1005"><span class="linenos">1005</span></a> <span class="k">pass</span> +</span><span id="L-1006"><a href="#L-1006"><span class="linenos">1006</span></a> +</span><span id="L-1007"><a href="#L-1007"><span class="linenos">1007</span></a> +</span><span id="L-1008"><a href="#L-1008"><span class="linenos">1008</span></a><span class="k">class</span> <span class="nc">Constraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1009"><a href="#L-1009"><span class="linenos">1009</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1010"><a href="#L-1010"><span class="linenos">1010</span></a> +</span><span id="L-1011"><a href="#L-1011"><span class="linenos">1011</span></a> +</span><span id="L-1012"><a href="#L-1012"><span class="linenos">1012</span></a><span class="k">class</span> <span class="nc">Delete</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1013"><a href="#L-1013"><span class="linenos">1013</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-1014"><a href="#L-1014"><span class="linenos">1014</span></a> </span><span id="L-1015"><a href="#L-1015"><span class="linenos">1015</span></a> -</span><span id="L-1016"><a href="#L-1016"><span class="linenos">1016</span></a><span class="k">class</span> <span class="nc">Filter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1017"><a href="#L-1017"><span class="linenos">1017</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1018"><a href="#L-1018"><span class="linenos">1018</span></a> -</span><span id="L-1019"><a href="#L-1019"><span class="linenos">1019</span></a> -</span><span id="L-1020"><a href="#L-1020"><span class="linenos">1020</span></a><span class="k">class</span> <span class="nc">Check</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1021"><a href="#L-1021"><span class="linenos">1021</span></a> <span class="k">pass</span> -</span><span id="L-1022"><a href="#L-1022"><span class="linenos">1022</span></a> -</span><span id="L-1023"><a href="#L-1023"><span class="linenos">1023</span></a> -</span><span id="L-1024"><a href="#L-1024"><span class="linenos">1024</span></a><span class="k">class</span> <span class="nc">Directory</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1025"><a href="#L-1025"><span class="linenos">1025</span></a> <span class="c1"># https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html</span> -</span><span id="L-1026"><a href="#L-1026"><span class="linenos">1026</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"row_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1027"><a href="#L-1027"><span class="linenos">1027</span></a> -</span><span id="L-1028"><a href="#L-1028"><span class="linenos">1028</span></a> -</span><span id="L-1029"><a href="#L-1029"><span class="linenos">1029</span></a><span class="k">class</span> <span class="nc">ForeignKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1030"><a href="#L-1030"><span class="linenos">1030</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1031"><a href="#L-1031"><span class="linenos">1031</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1032"><a href="#L-1032"><span class="linenos">1032</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1033"><a href="#L-1033"><span class="linenos">1033</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1034"><a href="#L-1034"><span class="linenos">1034</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1035"><a href="#L-1035"><span class="linenos">1035</span></a> <span class="p">}</span> -</span><span id="L-1036"><a href="#L-1036"><span class="linenos">1036</span></a> -</span><span id="L-1037"><a href="#L-1037"><span class="linenos">1037</span></a> -</span><span id="L-1038"><a href="#L-1038"><span class="linenos">1038</span></a><span class="k">class</span> <span class="nc">PrimaryKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1039"><a href="#L-1039"><span class="linenos">1039</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1040"><a href="#L-1040"><span class="linenos">1040</span></a> -</span><span id="L-1041"><a href="#L-1041"><span class="linenos">1041</span></a> -</span><span id="L-1042"><a href="#L-1042"><span class="linenos">1042</span></a><span class="k">class</span> <span class="nc">Unique</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1043"><a href="#L-1043"><span class="linenos">1043</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1044"><a href="#L-1044"><span class="linenos">1044</span></a> -</span><span id="L-1045"><a href="#L-1045"><span class="linenos">1045</span></a> -</span><span id="L-1046"><a href="#L-1046"><span class="linenos">1046</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/sql-selectinto.html</span> -</span><span id="L-1047"><a href="#L-1047"><span class="linenos">1047</span></a><span class="c1"># https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_INTO.html#r_SELECT_INTO-examples</span> -</span><span id="L-1048"><a href="#L-1048"><span class="linenos">1048</span></a><span class="k">class</span> <span class="nc">Into</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1049"><a href="#L-1049"><span class="linenos">1049</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unlogged"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1050"><a href="#L-1050"><span class="linenos">1050</span></a> +</span><span id="L-1016"><a href="#L-1016"><span class="linenos">1016</span></a><span class="k">class</span> <span class="nc">Drop</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1017"><a href="#L-1017"><span class="linenos">1017</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1018"><a href="#L-1018"><span class="linenos">1018</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1019"><a href="#L-1019"><span class="linenos">1019</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1020"><a href="#L-1020"><span class="linenos">1020</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1021"><a href="#L-1021"><span class="linenos">1021</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1022"><a href="#L-1022"><span class="linenos">1022</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1023"><a href="#L-1023"><span class="linenos">1023</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1024"><a href="#L-1024"><span class="linenos">1024</span></a> <span class="p">}</span> +</span><span id="L-1025"><a href="#L-1025"><span class="linenos">1025</span></a> +</span><span id="L-1026"><a href="#L-1026"><span class="linenos">1026</span></a> +</span><span id="L-1027"><a href="#L-1027"><span class="linenos">1027</span></a><span class="k">class</span> <span class="nc">Filter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1028"><a href="#L-1028"><span class="linenos">1028</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1029"><a href="#L-1029"><span class="linenos">1029</span></a> +</span><span id="L-1030"><a href="#L-1030"><span class="linenos">1030</span></a> +</span><span id="L-1031"><a href="#L-1031"><span class="linenos">1031</span></a><span class="k">class</span> <span class="nc">Check</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1032"><a href="#L-1032"><span class="linenos">1032</span></a> <span class="k">pass</span> +</span><span id="L-1033"><a href="#L-1033"><span class="linenos">1033</span></a> +</span><span id="L-1034"><a href="#L-1034"><span class="linenos">1034</span></a> +</span><span id="L-1035"><a href="#L-1035"><span class="linenos">1035</span></a><span class="k">class</span> <span class="nc">Directory</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1036"><a href="#L-1036"><span class="linenos">1036</span></a> <span class="c1"># https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html</span> +</span><span id="L-1037"><a href="#L-1037"><span class="linenos">1037</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"row_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1038"><a href="#L-1038"><span class="linenos">1038</span></a> +</span><span id="L-1039"><a href="#L-1039"><span class="linenos">1039</span></a> +</span><span id="L-1040"><a href="#L-1040"><span class="linenos">1040</span></a><span class="k">class</span> <span class="nc">ForeignKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1041"><a href="#L-1041"><span class="linenos">1041</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1042"><a href="#L-1042"><span class="linenos">1042</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1043"><a href="#L-1043"><span class="linenos">1043</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1044"><a href="#L-1044"><span class="linenos">1044</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1045"><a href="#L-1045"><span class="linenos">1045</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1046"><a href="#L-1046"><span class="linenos">1046</span></a> <span class="p">}</span> +</span><span id="L-1047"><a href="#L-1047"><span class="linenos">1047</span></a> +</span><span id="L-1048"><a href="#L-1048"><span class="linenos">1048</span></a> +</span><span id="L-1049"><a href="#L-1049"><span class="linenos">1049</span></a><span class="k">class</span> <span class="nc">PrimaryKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1050"><a href="#L-1050"><span class="linenos">1050</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-1051"><a href="#L-1051"><span class="linenos">1051</span></a> -</span><span id="L-1052"><a href="#L-1052"><span class="linenos">1052</span></a><span class="k">class</span> <span class="nc">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1053"><a href="#L-1053"><span class="linenos">1053</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1054"><a href="#L-1054"><span class="linenos">1054</span></a> +</span><span id="L-1052"><a href="#L-1052"><span class="linenos">1052</span></a> +</span><span id="L-1053"><a href="#L-1053"><span class="linenos">1053</span></a><span class="k">class</span> <span class="nc">Unique</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1054"><a href="#L-1054"><span class="linenos">1054</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1055"><a href="#L-1055"><span class="linenos">1055</span></a> -</span><span id="L-1056"><a href="#L-1056"><span class="linenos">1056</span></a><span class="k">class</span> <span class="nc">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1057"><a href="#L-1057"><span class="linenos">1057</span></a> <span class="k">pass</span> -</span><span id="L-1058"><a href="#L-1058"><span class="linenos">1058</span></a> -</span><span id="L-1059"><a href="#L-1059"><span class="linenos">1059</span></a> -</span><span id="L-1060"><a href="#L-1060"><span class="linenos">1060</span></a><span class="k">class</span> <span class="nc">Hint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1061"><a href="#L-1061"><span class="linenos">1061</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1056"><a href="#L-1056"><span class="linenos">1056</span></a> +</span><span id="L-1057"><a href="#L-1057"><span class="linenos">1057</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/sql-selectinto.html</span> +</span><span id="L-1058"><a href="#L-1058"><span class="linenos">1058</span></a><span class="c1"># https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_INTO.html#r_SELECT_INTO-examples</span> +</span><span id="L-1059"><a href="#L-1059"><span class="linenos">1059</span></a><span class="k">class</span> <span class="nc">Into</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1060"><a href="#L-1060"><span class="linenos">1060</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unlogged"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1061"><a href="#L-1061"><span class="linenos">1061</span></a> </span><span id="L-1062"><a href="#L-1062"><span class="linenos">1062</span></a> -</span><span id="L-1063"><a href="#L-1063"><span class="linenos">1063</span></a> -</span><span id="L-1064"><a href="#L-1064"><span class="linenos">1064</span></a><span class="k">class</span> <span class="nc">JoinHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1065"><a href="#L-1065"><span class="linenos">1065</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1063"><a href="#L-1063"><span class="linenos">1063</span></a><span class="k">class</span> <span class="nc">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1064"><a href="#L-1064"><span class="linenos">1064</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1065"><a href="#L-1065"><span class="linenos">1065</span></a> </span><span id="L-1066"><a href="#L-1066"><span class="linenos">1066</span></a> -</span><span id="L-1067"><a href="#L-1067"><span class="linenos">1067</span></a> -</span><span id="L-1068"><a href="#L-1068"><span class="linenos">1068</span></a><span class="k">class</span> <span class="nc">Identifier</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1069"><a href="#L-1069"><span class="linenos">1069</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quoted"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1067"><a href="#L-1067"><span class="linenos">1067</span></a><span class="k">class</span> <span class="nc">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1068"><a href="#L-1068"><span class="linenos">1068</span></a> <span class="k">pass</span> +</span><span id="L-1069"><a href="#L-1069"><span class="linenos">1069</span></a> </span><span id="L-1070"><a href="#L-1070"><span class="linenos">1070</span></a> -</span><span id="L-1071"><a href="#L-1071"><span class="linenos">1071</span></a> <span class="nd">@property</span> -</span><span id="L-1072"><a href="#L-1072"><span class="linenos">1072</span></a> <span class="k">def</span> <span class="nf">quoted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1073"><a href="#L-1073"><span class="linenos">1073</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"quoted"</span><span class="p">))</span> +</span><span id="L-1071"><a href="#L-1071"><span class="linenos">1071</span></a><span class="k">class</span> <span class="nc">Hint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1072"><a href="#L-1072"><span class="linenos">1072</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1073"><a href="#L-1073"><span class="linenos">1073</span></a> </span><span id="L-1074"><a href="#L-1074"><span class="linenos">1074</span></a> -</span><span id="L-1075"><a href="#L-1075"><span class="linenos">1075</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> -</span><span id="L-1076"><a href="#L-1076"><span class="linenos">1076</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="L-1075"><a href="#L-1075"><span class="linenos">1075</span></a><span class="k">class</span> <span class="nc">JoinHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1076"><a href="#L-1076"><span class="linenos">1076</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1077"><a href="#L-1077"><span class="linenos">1077</span></a> -</span><span id="L-1078"><a href="#L-1078"><span class="linenos">1078</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1079"><a href="#L-1079"><span class="linenos">1079</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">lower</span><span class="p">()))</span> -</span><span id="L-1080"><a href="#L-1080"><span class="linenos">1080</span></a> -</span><span id="L-1081"><a href="#L-1081"><span class="linenos">1081</span></a> <span class="nd">@property</span> -</span><span id="L-1082"><a href="#L-1082"><span class="linenos">1082</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1083"><a href="#L-1083"><span class="linenos">1083</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-1084"><a href="#L-1084"><span class="linenos">1084</span></a> +</span><span id="L-1078"><a href="#L-1078"><span class="linenos">1078</span></a> +</span><span id="L-1079"><a href="#L-1079"><span class="linenos">1079</span></a><span class="k">class</span> <span class="nc">Identifier</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1080"><a href="#L-1080"><span class="linenos">1080</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quoted"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1081"><a href="#L-1081"><span class="linenos">1081</span></a> +</span><span id="L-1082"><a href="#L-1082"><span class="linenos">1082</span></a> <span class="nd">@property</span> +</span><span id="L-1083"><a href="#L-1083"><span class="linenos">1083</span></a> <span class="k">def</span> <span class="nf">quoted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1084"><a href="#L-1084"><span class="linenos">1084</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"quoted"</span><span class="p">))</span> </span><span id="L-1085"><a href="#L-1085"><span class="linenos">1085</span></a> -</span><span id="L-1086"><a href="#L-1086"><span class="linenos">1086</span></a><span class="k">class</span> <span class="nc">Index</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1087"><a href="#L-1087"><span class="linenos">1087</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1088"><a href="#L-1088"><span class="linenos">1088</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1089"><a href="#L-1089"><span class="linenos">1089</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1090"><a href="#L-1090"><span class="linenos">1090</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1091"><a href="#L-1091"><span class="linenos">1091</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1092"><a href="#L-1092"><span class="linenos">1092</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1093"><a href="#L-1093"><span class="linenos">1093</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1094"><a href="#L-1094"><span class="linenos">1094</span></a> <span class="s2">"amp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> -</span><span id="L-1095"><a href="#L-1095"><span class="linenos">1095</span></a> <span class="p">}</span> +</span><span id="L-1086"><a href="#L-1086"><span class="linenos">1086</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> +</span><span id="L-1087"><a href="#L-1087"><span class="linenos">1087</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="L-1088"><a href="#L-1088"><span class="linenos">1088</span></a> +</span><span id="L-1089"><a href="#L-1089"><span class="linenos">1089</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1090"><a href="#L-1090"><span class="linenos">1090</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">lower</span><span class="p">()))</span> +</span><span id="L-1091"><a href="#L-1091"><span class="linenos">1091</span></a> +</span><span id="L-1092"><a href="#L-1092"><span class="linenos">1092</span></a> <span class="nd">@property</span> +</span><span id="L-1093"><a href="#L-1093"><span class="linenos">1093</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1094"><a href="#L-1094"><span class="linenos">1094</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-1095"><a href="#L-1095"><span class="linenos">1095</span></a> </span><span id="L-1096"><a href="#L-1096"><span class="linenos">1096</span></a> -</span><span id="L-1097"><a href="#L-1097"><span class="linenos">1097</span></a> -</span><span id="L-1098"><a href="#L-1098"><span class="linenos">1098</span></a><span class="k">class</span> <span class="nc">Insert</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1099"><a href="#L-1099"><span class="linenos">1099</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1100"><a href="#L-1100"><span class="linenos">1100</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1101"><a href="#L-1101"><span class="linenos">1101</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1102"><a href="#L-1102"><span class="linenos">1102</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1103"><a href="#L-1103"><span class="linenos">1103</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1104"><a href="#L-1104"><span class="linenos">1104</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1105"><a href="#L-1105"><span class="linenos">1105</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1106"><a href="#L-1106"><span class="linenos">1106</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1107"><a href="#L-1107"><span class="linenos">1107</span></a> <span class="p">}</span> +</span><span id="L-1097"><a href="#L-1097"><span class="linenos">1097</span></a><span class="k">class</span> <span class="nc">Index</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1098"><a href="#L-1098"><span class="linenos">1098</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1099"><a href="#L-1099"><span class="linenos">1099</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1100"><a href="#L-1100"><span class="linenos">1100</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1101"><a href="#L-1101"><span class="linenos">1101</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1102"><a href="#L-1102"><span class="linenos">1102</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1103"><a href="#L-1103"><span class="linenos">1103</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1104"><a href="#L-1104"><span class="linenos">1104</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1105"><a href="#L-1105"><span class="linenos">1105</span></a> <span class="s2">"amp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> +</span><span id="L-1106"><a href="#L-1106"><span class="linenos">1106</span></a> <span class="p">}</span> +</span><span id="L-1107"><a href="#L-1107"><span class="linenos">1107</span></a> </span><span id="L-1108"><a href="#L-1108"><span class="linenos">1108</span></a> -</span><span id="L-1109"><a href="#L-1109"><span class="linenos">1109</span></a> -</span><span id="L-1110"><a href="#L-1110"><span class="linenos">1110</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html</span> -</span><span id="L-1111"><a href="#L-1111"><span class="linenos">1111</span></a><span class="k">class</span> <span class="nc">Introducer</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1112"><a href="#L-1112"><span class="linenos">1112</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1113"><a href="#L-1113"><span class="linenos">1113</span></a> -</span><span id="L-1114"><a href="#L-1114"><span class="linenos">1114</span></a> -</span><span id="L-1115"><a href="#L-1115"><span class="linenos">1115</span></a><span class="c1"># national char, like n'utf8'</span> -</span><span id="L-1116"><a href="#L-1116"><span class="linenos">1116</span></a><span class="k">class</span> <span class="nc">National</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1117"><a href="#L-1117"><span class="linenos">1117</span></a> <span class="k">pass</span> -</span><span id="L-1118"><a href="#L-1118"><span class="linenos">1118</span></a> +</span><span id="L-1109"><a href="#L-1109"><span class="linenos">1109</span></a><span class="k">class</span> <span class="nc">Insert</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1110"><a href="#L-1110"><span class="linenos">1110</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1111"><a href="#L-1111"><span class="linenos">1111</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1112"><a href="#L-1112"><span class="linenos">1112</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1113"><a href="#L-1113"><span class="linenos">1113</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1114"><a href="#L-1114"><span class="linenos">1114</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1115"><a href="#L-1115"><span class="linenos">1115</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1116"><a href="#L-1116"><span class="linenos">1116</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1117"><a href="#L-1117"><span class="linenos">1117</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1118"><a href="#L-1118"><span class="linenos">1118</span></a> <span class="p">}</span> </span><span id="L-1119"><a href="#L-1119"><span class="linenos">1119</span></a> -</span><span id="L-1120"><a href="#L-1120"><span class="linenos">1120</span></a><span class="k">class</span> <span class="nc">LoadData</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1121"><a href="#L-1121"><span class="linenos">1121</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1122"><a href="#L-1122"><span class="linenos">1122</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1123"><a href="#L-1123"><span class="linenos">1123</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1124"><a href="#L-1124"><span class="linenos">1124</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1125"><a href="#L-1125"><span class="linenos">1125</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1126"><a href="#L-1126"><span class="linenos">1126</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1127"><a href="#L-1127"><span class="linenos">1127</span></a> <span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1128"><a href="#L-1128"><span class="linenos">1128</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1129"><a href="#L-1129"><span class="linenos">1129</span></a> <span class="p">}</span> +</span><span id="L-1120"><a href="#L-1120"><span class="linenos">1120</span></a> +</span><span id="L-1121"><a href="#L-1121"><span class="linenos">1121</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html</span> +</span><span id="L-1122"><a href="#L-1122"><span class="linenos">1122</span></a><span class="k">class</span> <span class="nc">Introducer</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1123"><a href="#L-1123"><span class="linenos">1123</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1124"><a href="#L-1124"><span class="linenos">1124</span></a> +</span><span id="L-1125"><a href="#L-1125"><span class="linenos">1125</span></a> +</span><span id="L-1126"><a href="#L-1126"><span class="linenos">1126</span></a><span class="c1"># national char, like n'utf8'</span> +</span><span id="L-1127"><a href="#L-1127"><span class="linenos">1127</span></a><span class="k">class</span> <span class="nc">National</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1128"><a href="#L-1128"><span class="linenos">1128</span></a> <span class="k">pass</span> +</span><span id="L-1129"><a href="#L-1129"><span class="linenos">1129</span></a> </span><span id="L-1130"><a href="#L-1130"><span class="linenos">1130</span></a> -</span><span id="L-1131"><a href="#L-1131"><span class="linenos">1131</span></a> -</span><span id="L-1132"><a href="#L-1132"><span class="linenos">1132</span></a><span class="k">class</span> <span class="nc">Partition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1133"><a href="#L-1133"><span class="linenos">1133</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1134"><a href="#L-1134"><span class="linenos">1134</span></a> -</span><span id="L-1135"><a href="#L-1135"><span class="linenos">1135</span></a> -</span><span id="L-1136"><a href="#L-1136"><span class="linenos">1136</span></a><span class="k">class</span> <span class="nc">Fetch</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1137"><a href="#L-1137"><span class="linenos">1137</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1138"><a href="#L-1138"><span class="linenos">1138</span></a> -</span><span id="L-1139"><a href="#L-1139"><span class="linenos">1139</span></a> -</span><span id="L-1140"><a href="#L-1140"><span class="linenos">1140</span></a><span class="k">class</span> <span class="nc">Group</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1141"><a href="#L-1141"><span class="linenos">1141</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1142"><a href="#L-1142"><span class="linenos">1142</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1143"><a href="#L-1143"><span class="linenos">1143</span></a> <span class="s2">"grouping_sets"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1144"><a href="#L-1144"><span class="linenos">1144</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1145"><a href="#L-1145"><span class="linenos">1145</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1146"><a href="#L-1146"><span class="linenos">1146</span></a> <span class="p">}</span> -</span><span id="L-1147"><a href="#L-1147"><span class="linenos">1147</span></a> -</span><span id="L-1148"><a href="#L-1148"><span class="linenos">1148</span></a> -</span><span id="L-1149"><a href="#L-1149"><span class="linenos">1149</span></a><span class="k">class</span> <span class="nc">Lambda</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1150"><a href="#L-1150"><span class="linenos">1150</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1151"><a href="#L-1151"><span class="linenos">1151</span></a> -</span><span id="L-1152"><a href="#L-1152"><span class="linenos">1152</span></a> -</span><span id="L-1153"><a href="#L-1153"><span class="linenos">1153</span></a><span class="k">class</span> <span class="nc">Limit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1154"><a href="#L-1154"><span class="linenos">1154</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1155"><a href="#L-1155"><span class="linenos">1155</span></a> -</span><span id="L-1156"><a href="#L-1156"><span class="linenos">1156</span></a> -</span><span id="L-1157"><a href="#L-1157"><span class="linenos">1157</span></a><span class="k">class</span> <span class="nc">Literal</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-1158"><a href="#L-1158"><span class="linenos">1158</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_string"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1131"><a href="#L-1131"><span class="linenos">1131</span></a><span class="k">class</span> <span class="nc">LoadData</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1132"><a href="#L-1132"><span class="linenos">1132</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1133"><a href="#L-1133"><span class="linenos">1133</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1134"><a href="#L-1134"><span class="linenos">1134</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1135"><a href="#L-1135"><span class="linenos">1135</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1136"><a href="#L-1136"><span class="linenos">1136</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1137"><a href="#L-1137"><span class="linenos">1137</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1138"><a href="#L-1138"><span class="linenos">1138</span></a> <span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1139"><a href="#L-1139"><span class="linenos">1139</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1140"><a href="#L-1140"><span class="linenos">1140</span></a> <span class="p">}</span> +</span><span id="L-1141"><a href="#L-1141"><span class="linenos">1141</span></a> +</span><span id="L-1142"><a href="#L-1142"><span class="linenos">1142</span></a> +</span><span id="L-1143"><a href="#L-1143"><span class="linenos">1143</span></a><span class="k">class</span> <span class="nc">Partition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1144"><a href="#L-1144"><span class="linenos">1144</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1145"><a href="#L-1145"><span class="linenos">1145</span></a> +</span><span id="L-1146"><a href="#L-1146"><span class="linenos">1146</span></a> +</span><span id="L-1147"><a href="#L-1147"><span class="linenos">1147</span></a><span class="k">class</span> <span class="nc">Fetch</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1148"><a href="#L-1148"><span class="linenos">1148</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1149"><a href="#L-1149"><span class="linenos">1149</span></a> +</span><span id="L-1150"><a href="#L-1150"><span class="linenos">1150</span></a> +</span><span id="L-1151"><a href="#L-1151"><span class="linenos">1151</span></a><span class="k">class</span> <span class="nc">Group</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1152"><a href="#L-1152"><span class="linenos">1152</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1153"><a href="#L-1153"><span class="linenos">1153</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1154"><a href="#L-1154"><span class="linenos">1154</span></a> <span class="s2">"grouping_sets"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1155"><a href="#L-1155"><span class="linenos">1155</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1156"><a href="#L-1156"><span class="linenos">1156</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1157"><a href="#L-1157"><span class="linenos">1157</span></a> <span class="p">}</span> +</span><span id="L-1158"><a href="#L-1158"><span class="linenos">1158</span></a> </span><span id="L-1159"><a href="#L-1159"><span class="linenos">1159</span></a> -</span><span id="L-1160"><a href="#L-1160"><span class="linenos">1160</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> -</span><span id="L-1161"><a href="#L-1161"><span class="linenos">1161</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="L-1162"><a href="#L-1162"><span class="linenos">1162</span></a> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> -</span><span id="L-1163"><a href="#L-1163"><span class="linenos">1163</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-1164"><a href="#L-1164"><span class="linenos">1164</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="L-1165"><a href="#L-1165"><span class="linenos">1165</span></a> <span class="p">)</span> +</span><span id="L-1160"><a href="#L-1160"><span class="linenos">1160</span></a><span class="k">class</span> <span class="nc">Lambda</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1161"><a href="#L-1161"><span class="linenos">1161</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1162"><a href="#L-1162"><span class="linenos">1162</span></a> +</span><span id="L-1163"><a href="#L-1163"><span class="linenos">1163</span></a> +</span><span id="L-1164"><a href="#L-1164"><span class="linenos">1164</span></a><span class="k">class</span> <span class="nc">Limit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1165"><a href="#L-1165"><span class="linenos">1165</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1166"><a href="#L-1166"><span class="linenos">1166</span></a> -</span><span id="L-1167"><a href="#L-1167"><span class="linenos">1167</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1168"><a href="#L-1168"><span class="linenos">1168</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]))</span> -</span><span id="L-1169"><a href="#L-1169"><span class="linenos">1169</span></a> -</span><span id="L-1170"><a href="#L-1170"><span class="linenos">1170</span></a> <span class="nd">@classmethod</span> -</span><span id="L-1171"><a href="#L-1171"><span class="linenos">1171</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="L-1172"><a href="#L-1172"><span class="linenos">1172</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="L-1173"><a href="#L-1173"><span class="linenos">1173</span></a> -</span><span id="L-1174"><a href="#L-1174"><span class="linenos">1174</span></a> <span class="nd">@classmethod</span> -</span><span id="L-1175"><a href="#L-1175"><span class="linenos">1175</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="L-1176"><a href="#L-1176"><span class="linenos">1176</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-1167"><a href="#L-1167"><span class="linenos">1167</span></a> +</span><span id="L-1168"><a href="#L-1168"><span class="linenos">1168</span></a><span class="k">class</span> <span class="nc">Literal</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-1169"><a href="#L-1169"><span class="linenos">1169</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_string"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1170"><a href="#L-1170"><span class="linenos">1170</span></a> +</span><span id="L-1171"><a href="#L-1171"><span class="linenos">1171</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> +</span><span id="L-1172"><a href="#L-1172"><span class="linenos">1172</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="L-1173"><a href="#L-1173"><span class="linenos">1173</span></a> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> +</span><span id="L-1174"><a href="#L-1174"><span class="linenos">1174</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-1175"><a href="#L-1175"><span class="linenos">1175</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="L-1176"><a href="#L-1176"><span class="linenos">1176</span></a> <span class="p">)</span> </span><span id="L-1177"><a href="#L-1177"><span class="linenos">1177</span></a> -</span><span id="L-1178"><a href="#L-1178"><span class="linenos">1178</span></a> <span class="nd">@property</span> -</span><span id="L-1179"><a href="#L-1179"><span class="linenos">1179</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1180"><a href="#L-1180"><span class="linenos">1180</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-1181"><a href="#L-1181"><span class="linenos">1181</span></a> -</span><span id="L-1182"><a href="#L-1182"><span class="linenos">1182</span></a> -</span><span id="L-1183"><a href="#L-1183"><span class="linenos">1183</span></a><span class="k">class</span> <span class="nc">Join</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1184"><a href="#L-1184"><span class="linenos">1184</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1185"><a href="#L-1185"><span class="linenos">1185</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1186"><a href="#L-1186"><span class="linenos">1186</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1187"><a href="#L-1187"><span class="linenos">1187</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1188"><a href="#L-1188"><span class="linenos">1188</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1189"><a href="#L-1189"><span class="linenos">1189</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1190"><a href="#L-1190"><span class="linenos">1190</span></a> <span class="s2">"natural"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1191"><a href="#L-1191"><span class="linenos">1191</span></a> <span class="p">}</span> +</span><span id="L-1178"><a href="#L-1178"><span class="linenos">1178</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1179"><a href="#L-1179"><span class="linenos">1179</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]))</span> +</span><span id="L-1180"><a href="#L-1180"><span class="linenos">1180</span></a> +</span><span id="L-1181"><a href="#L-1181"><span class="linenos">1181</span></a> <span class="nd">@classmethod</span> +</span><span id="L-1182"><a href="#L-1182"><span class="linenos">1182</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="L-1183"><a href="#L-1183"><span class="linenos">1183</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="L-1184"><a href="#L-1184"><span class="linenos">1184</span></a> +</span><span id="L-1185"><a href="#L-1185"><span class="linenos">1185</span></a> <span class="nd">@classmethod</span> +</span><span id="L-1186"><a href="#L-1186"><span class="linenos">1186</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="L-1187"><a href="#L-1187"><span class="linenos">1187</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-1188"><a href="#L-1188"><span class="linenos">1188</span></a> +</span><span id="L-1189"><a href="#L-1189"><span class="linenos">1189</span></a> <span class="nd">@property</span> +</span><span id="L-1190"><a href="#L-1190"><span class="linenos">1190</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1191"><a href="#L-1191"><span class="linenos">1191</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span><span id="L-1192"><a href="#L-1192"><span class="linenos">1192</span></a> -</span><span id="L-1193"><a href="#L-1193"><span class="linenos">1193</span></a> <span class="nd">@property</span> -</span><span id="L-1194"><a href="#L-1194"><span class="linenos">1194</span></a> <span class="k">def</span> <span class="nf">kind</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1195"><a href="#L-1195"><span class="linenos">1195</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-1196"><a href="#L-1196"><span class="linenos">1196</span></a> -</span><span id="L-1197"><a href="#L-1197"><span class="linenos">1197</span></a> <span class="nd">@property</span> -</span><span id="L-1198"><a href="#L-1198"><span class="linenos">1198</span></a> <span class="k">def</span> <span class="nf">side</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1199"><a href="#L-1199"><span class="linenos">1199</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"side"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="L-1200"><a href="#L-1200"><span class="linenos">1200</span></a> -</span><span id="L-1201"><a href="#L-1201"><span class="linenos">1201</span></a> <span class="nd">@property</span> -</span><span id="L-1202"><a href="#L-1202"><span class="linenos">1202</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1203"><a href="#L-1203"><span class="linenos">1203</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">alias_or_name</span> -</span><span id="L-1204"><a href="#L-1204"><span class="linenos">1204</span></a> -</span><span id="L-1205"><a href="#L-1205"><span class="linenos">1205</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-1206"><a href="#L-1206"><span class="linenos">1206</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1207"><a href="#L-1207"><span class="linenos">1207</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="L-1208"><a href="#L-1208"><span class="linenos">1208</span></a> -</span><span id="L-1209"><a href="#L-1209"><span class="linenos">1209</span></a><span class="sd"> Example:</span> -</span><span id="L-1210"><a href="#L-1210"><span class="linenos">1210</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-1211"><a href="#L-1211"><span class="linenos">1211</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="L-1212"><a href="#L-1212"><span class="linenos">1212</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="L-1213"><a href="#L-1213"><span class="linenos">1213</span></a> -</span><span id="L-1214"><a href="#L-1214"><span class="linenos">1214</span></a><span class="sd"> Args:</span> -</span><span id="L-1215"><a href="#L-1215"><span class="linenos">1215</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1216"><a href="#L-1216"><span class="linenos">1216</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1217"><a href="#L-1217"><span class="linenos">1217</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-1218"><a href="#L-1218"><span class="linenos">1218</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-1219"><a href="#L-1219"><span class="linenos">1219</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-1220"><a href="#L-1220"><span class="linenos">1220</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-1221"><a href="#L-1221"><span class="linenos">1221</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1222"><a href="#L-1222"><span class="linenos">1222</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-1223"><a href="#L-1223"><span class="linenos">1223</span></a> -</span><span id="L-1224"><a href="#L-1224"><span class="linenos">1224</span></a><span class="sd"> Returns:</span> -</span><span id="L-1225"><a href="#L-1225"><span class="linenos">1225</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="L-1226"><a href="#L-1226"><span class="linenos">1226</span></a><span class="sd"> """</span> -</span><span id="L-1227"><a href="#L-1227"><span class="linenos">1227</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-1228"><a href="#L-1228"><span class="linenos">1228</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1229"><a href="#L-1229"><span class="linenos">1229</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1230"><a href="#L-1230"><span class="linenos">1230</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> -</span><span id="L-1231"><a href="#L-1231"><span class="linenos">1231</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1232"><a href="#L-1232"><span class="linenos">1232</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1233"><a href="#L-1233"><span class="linenos">1233</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1234"><a href="#L-1234"><span class="linenos">1234</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1235"><a href="#L-1235"><span class="linenos">1235</span></a> <span class="p">)</span> -</span><span id="L-1236"><a href="#L-1236"><span class="linenos">1236</span></a> -</span><span id="L-1237"><a href="#L-1237"><span class="linenos">1237</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="L-1238"><a href="#L-1238"><span class="linenos">1238</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-1239"><a href="#L-1239"><span class="linenos">1239</span></a> -</span><span id="L-1240"><a href="#L-1240"><span class="linenos">1240</span></a> <span class="k">return</span> <span class="n">join</span> -</span><span id="L-1241"><a href="#L-1241"><span class="linenos">1241</span></a> -</span><span id="L-1242"><a href="#L-1242"><span class="linenos">1242</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-1243"><a href="#L-1243"><span class="linenos">1243</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1244"><a href="#L-1244"><span class="linenos">1244</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="L-1245"><a href="#L-1245"><span class="linenos">1245</span></a> -</span><span id="L-1246"><a href="#L-1246"><span class="linenos">1246</span></a><span class="sd"> Example:</span> -</span><span id="L-1247"><a href="#L-1247"><span class="linenos">1247</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-1248"><a href="#L-1248"><span class="linenos">1248</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="L-1249"><a href="#L-1249"><span class="linenos">1249</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="L-1193"><a href="#L-1193"><span class="linenos">1193</span></a> +</span><span id="L-1194"><a href="#L-1194"><span class="linenos">1194</span></a><span class="k">class</span> <span class="nc">Join</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1195"><a href="#L-1195"><span class="linenos">1195</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1196"><a href="#L-1196"><span class="linenos">1196</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1197"><a href="#L-1197"><span class="linenos">1197</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1198"><a href="#L-1198"><span class="linenos">1198</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1199"><a href="#L-1199"><span class="linenos">1199</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1200"><a href="#L-1200"><span class="linenos">1200</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1201"><a href="#L-1201"><span class="linenos">1201</span></a> <span class="s2">"natural"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1202"><a href="#L-1202"><span class="linenos">1202</span></a> <span class="p">}</span> +</span><span id="L-1203"><a href="#L-1203"><span class="linenos">1203</span></a> +</span><span id="L-1204"><a href="#L-1204"><span class="linenos">1204</span></a> <span class="nd">@property</span> +</span><span id="L-1205"><a href="#L-1205"><span class="linenos">1205</span></a> <span class="k">def</span> <span class="nf">kind</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1206"><a href="#L-1206"><span class="linenos">1206</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="L-1207"><a href="#L-1207"><span class="linenos">1207</span></a> +</span><span id="L-1208"><a href="#L-1208"><span class="linenos">1208</span></a> <span class="nd">@property</span> +</span><span id="L-1209"><a href="#L-1209"><span class="linenos">1209</span></a> <span class="k">def</span> <span class="nf">side</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1210"><a href="#L-1210"><span class="linenos">1210</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"side"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="L-1211"><a href="#L-1211"><span class="linenos">1211</span></a> +</span><span id="L-1212"><a href="#L-1212"><span class="linenos">1212</span></a> <span class="nd">@property</span> +</span><span id="L-1213"><a href="#L-1213"><span class="linenos">1213</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1214"><a href="#L-1214"><span class="linenos">1214</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">alias_or_name</span> +</span><span id="L-1215"><a href="#L-1215"><span class="linenos">1215</span></a> +</span><span id="L-1216"><a href="#L-1216"><span class="linenos">1216</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-1217"><a href="#L-1217"><span class="linenos">1217</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1218"><a href="#L-1218"><span class="linenos">1218</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="L-1219"><a href="#L-1219"><span class="linenos">1219</span></a> +</span><span id="L-1220"><a href="#L-1220"><span class="linenos">1220</span></a><span class="sd"> Example:</span> +</span><span id="L-1221"><a href="#L-1221"><span class="linenos">1221</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-1222"><a href="#L-1222"><span class="linenos">1222</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="L-1223"><a href="#L-1223"><span class="linenos">1223</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="L-1224"><a href="#L-1224"><span class="linenos">1224</span></a> +</span><span id="L-1225"><a href="#L-1225"><span class="linenos">1225</span></a><span class="sd"> Args:</span> +</span><span id="L-1226"><a href="#L-1226"><span class="linenos">1226</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-1227"><a href="#L-1227"><span class="linenos">1227</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1228"><a href="#L-1228"><span class="linenos">1228</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-1229"><a href="#L-1229"><span class="linenos">1229</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-1230"><a href="#L-1230"><span class="linenos">1230</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-1231"><a href="#L-1231"><span class="linenos">1231</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-1232"><a href="#L-1232"><span class="linenos">1232</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1233"><a href="#L-1233"><span class="linenos">1233</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1234"><a href="#L-1234"><span class="linenos">1234</span></a> +</span><span id="L-1235"><a href="#L-1235"><span class="linenos">1235</span></a><span class="sd"> Returns:</span> +</span><span id="L-1236"><a href="#L-1236"><span class="linenos">1236</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="L-1237"><a href="#L-1237"><span class="linenos">1237</span></a><span class="sd"> """</span> +</span><span id="L-1238"><a href="#L-1238"><span class="linenos">1238</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-1239"><a href="#L-1239"><span class="linenos">1239</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1240"><a href="#L-1240"><span class="linenos">1240</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1241"><a href="#L-1241"><span class="linenos">1241</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> +</span><span id="L-1242"><a href="#L-1242"><span class="linenos">1242</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1243"><a href="#L-1243"><span class="linenos">1243</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1244"><a href="#L-1244"><span class="linenos">1244</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1245"><a href="#L-1245"><span class="linenos">1245</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1246"><a href="#L-1246"><span class="linenos">1246</span></a> <span class="p">)</span> +</span><span id="L-1247"><a href="#L-1247"><span class="linenos">1247</span></a> +</span><span id="L-1248"><a href="#L-1248"><span class="linenos">1248</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="L-1249"><a href="#L-1249"><span class="linenos">1249</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> </span><span id="L-1250"><a href="#L-1250"><span class="linenos">1250</span></a> -</span><span id="L-1251"><a href="#L-1251"><span class="linenos">1251</span></a><span class="sd"> Args:</span> -</span><span id="L-1252"><a href="#L-1252"><span class="linenos">1252</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1253"><a href="#L-1253"><span class="linenos">1253</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1254"><a href="#L-1254"><span class="linenos">1254</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="L-1255"><a href="#L-1255"><span class="linenos">1255</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-1256"><a href="#L-1256"><span class="linenos">1256</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-1257"><a href="#L-1257"><span class="linenos">1257</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1258"><a href="#L-1258"><span class="linenos">1258</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-1259"><a href="#L-1259"><span class="linenos">1259</span></a> -</span><span id="L-1260"><a href="#L-1260"><span class="linenos">1260</span></a><span class="sd"> Returns:</span> -</span><span id="L-1261"><a href="#L-1261"><span class="linenos">1261</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="L-1262"><a href="#L-1262"><span class="linenos">1262</span></a><span class="sd"> """</span> -</span><span id="L-1263"><a href="#L-1263"><span class="linenos">1263</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-1264"><a href="#L-1264"><span class="linenos">1264</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1265"><a href="#L-1265"><span class="linenos">1265</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1266"><a href="#L-1266"><span class="linenos">1266</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="L-1267"><a href="#L-1267"><span class="linenos">1267</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1268"><a href="#L-1268"><span class="linenos">1268</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1269"><a href="#L-1269"><span class="linenos">1269</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1270"><a href="#L-1270"><span class="linenos">1270</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1271"><a href="#L-1271"><span class="linenos">1271</span></a> <span class="p">)</span> -</span><span id="L-1272"><a href="#L-1272"><span class="linenos">1272</span></a> -</span><span id="L-1273"><a href="#L-1273"><span class="linenos">1273</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="L-1274"><a href="#L-1274"><span class="linenos">1274</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-1275"><a href="#L-1275"><span class="linenos">1275</span></a> -</span><span id="L-1276"><a href="#L-1276"><span class="linenos">1276</span></a> <span class="k">return</span> <span class="n">join</span> -</span><span id="L-1277"><a href="#L-1277"><span class="linenos">1277</span></a> -</span><span id="L-1278"><a href="#L-1278"><span class="linenos">1278</span></a> -</span><span id="L-1279"><a href="#L-1279"><span class="linenos">1279</span></a><span class="k">class</span> <span class="nc">Lateral</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="L-1280"><a href="#L-1280"><span class="linenos">1280</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"view"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"outer"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1281"><a href="#L-1281"><span class="linenos">1281</span></a> -</span><span id="L-1282"><a href="#L-1282"><span class="linenos">1282</span></a> -</span><span id="L-1283"><a href="#L-1283"><span class="linenos">1283</span></a><span class="k">class</span> <span class="nc">MatchRecognize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1284"><a href="#L-1284"><span class="linenos">1284</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1285"><a href="#L-1285"><span class="linenos">1285</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1286"><a href="#L-1286"><span class="linenos">1286</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1287"><a href="#L-1287"><span class="linenos">1287</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1288"><a href="#L-1288"><span class="linenos">1288</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1289"><a href="#L-1289"><span class="linenos">1289</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1290"><a href="#L-1290"><span class="linenos">1290</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1291"><a href="#L-1291"><span class="linenos">1291</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1292"><a href="#L-1292"><span class="linenos">1292</span></a> <span class="p">}</span> +</span><span id="L-1251"><a href="#L-1251"><span class="linenos">1251</span></a> <span class="k">return</span> <span class="n">join</span> +</span><span id="L-1252"><a href="#L-1252"><span class="linenos">1252</span></a> +</span><span id="L-1253"><a href="#L-1253"><span class="linenos">1253</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-1254"><a href="#L-1254"><span class="linenos">1254</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1255"><a href="#L-1255"><span class="linenos">1255</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="L-1256"><a href="#L-1256"><span class="linenos">1256</span></a> +</span><span id="L-1257"><a href="#L-1257"><span class="linenos">1257</span></a><span class="sd"> Example:</span> +</span><span id="L-1258"><a href="#L-1258"><span class="linenos">1258</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-1259"><a href="#L-1259"><span class="linenos">1259</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="L-1260"><a href="#L-1260"><span class="linenos">1260</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="L-1261"><a href="#L-1261"><span class="linenos">1261</span></a> +</span><span id="L-1262"><a href="#L-1262"><span class="linenos">1262</span></a><span class="sd"> Args:</span> +</span><span id="L-1263"><a href="#L-1263"><span class="linenos">1263</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-1264"><a href="#L-1264"><span class="linenos">1264</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1265"><a href="#L-1265"><span class="linenos">1265</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="L-1266"><a href="#L-1266"><span class="linenos">1266</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-1267"><a href="#L-1267"><span class="linenos">1267</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-1268"><a href="#L-1268"><span class="linenos">1268</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1269"><a href="#L-1269"><span class="linenos">1269</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1270"><a href="#L-1270"><span class="linenos">1270</span></a> +</span><span id="L-1271"><a href="#L-1271"><span class="linenos">1271</span></a><span class="sd"> Returns:</span> +</span><span id="L-1272"><a href="#L-1272"><span class="linenos">1272</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="L-1273"><a href="#L-1273"><span class="linenos">1273</span></a><span class="sd"> """</span> +</span><span id="L-1274"><a href="#L-1274"><span class="linenos">1274</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-1275"><a href="#L-1275"><span class="linenos">1275</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1276"><a href="#L-1276"><span class="linenos">1276</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1277"><a href="#L-1277"><span class="linenos">1277</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="L-1278"><a href="#L-1278"><span class="linenos">1278</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1279"><a href="#L-1279"><span class="linenos">1279</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1280"><a href="#L-1280"><span class="linenos">1280</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1281"><a href="#L-1281"><span class="linenos">1281</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1282"><a href="#L-1282"><span class="linenos">1282</span></a> <span class="p">)</span> +</span><span id="L-1283"><a href="#L-1283"><span class="linenos">1283</span></a> +</span><span id="L-1284"><a href="#L-1284"><span class="linenos">1284</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="L-1285"><a href="#L-1285"><span class="linenos">1285</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="L-1286"><a href="#L-1286"><span class="linenos">1286</span></a> +</span><span id="L-1287"><a href="#L-1287"><span class="linenos">1287</span></a> <span class="k">return</span> <span class="n">join</span> +</span><span id="L-1288"><a href="#L-1288"><span class="linenos">1288</span></a> +</span><span id="L-1289"><a href="#L-1289"><span class="linenos">1289</span></a> +</span><span id="L-1290"><a href="#L-1290"><span class="linenos">1290</span></a><span class="k">class</span> <span class="nc">Lateral</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="L-1291"><a href="#L-1291"><span class="linenos">1291</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"view"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"outer"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1292"><a href="#L-1292"><span class="linenos">1292</span></a> </span><span id="L-1293"><a href="#L-1293"><span class="linenos">1293</span></a> -</span><span id="L-1294"><a href="#L-1294"><span class="linenos">1294</span></a> -</span><span id="L-1295"><a href="#L-1295"><span class="linenos">1295</span></a><span class="c1"># Clickhouse FROM FINAL modifier</span> -</span><span id="L-1296"><a href="#L-1296"><span class="linenos">1296</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/statements/select/from/#final-modifier</span> -</span><span id="L-1297"><a href="#L-1297"><span class="linenos">1297</span></a><span class="k">class</span> <span class="nc">Final</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1298"><a href="#L-1298"><span class="linenos">1298</span></a> <span class="k">pass</span> -</span><span id="L-1299"><a href="#L-1299"><span class="linenos">1299</span></a> -</span><span id="L-1300"><a href="#L-1300"><span class="linenos">1300</span></a> -</span><span id="L-1301"><a href="#L-1301"><span class="linenos">1301</span></a><span class="k">class</span> <span class="nc">Offset</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1302"><a href="#L-1302"><span class="linenos">1302</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1303"><a href="#L-1303"><span class="linenos">1303</span></a> +</span><span id="L-1294"><a href="#L-1294"><span class="linenos">1294</span></a><span class="k">class</span> <span class="nc">MatchRecognize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1295"><a href="#L-1295"><span class="linenos">1295</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1296"><a href="#L-1296"><span class="linenos">1296</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1297"><a href="#L-1297"><span class="linenos">1297</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1298"><a href="#L-1298"><span class="linenos">1298</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1299"><a href="#L-1299"><span class="linenos">1299</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1300"><a href="#L-1300"><span class="linenos">1300</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1301"><a href="#L-1301"><span class="linenos">1301</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1302"><a href="#L-1302"><span class="linenos">1302</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1303"><a href="#L-1303"><span class="linenos">1303</span></a> <span class="p">}</span> </span><span id="L-1304"><a href="#L-1304"><span class="linenos">1304</span></a> -</span><span id="L-1305"><a href="#L-1305"><span class="linenos">1305</span></a><span class="k">class</span> <span class="nc">Order</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1306"><a href="#L-1306"><span class="linenos">1306</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1307"><a href="#L-1307"><span class="linenos">1307</span></a> -</span><span id="L-1308"><a href="#L-1308"><span class="linenos">1308</span></a> -</span><span id="L-1309"><a href="#L-1309"><span class="linenos">1309</span></a><span class="c1"># hive specific sorts</span> -</span><span id="L-1310"><a href="#L-1310"><span class="linenos">1310</span></a><span class="c1"># https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy</span> -</span><span id="L-1311"><a href="#L-1311"><span class="linenos">1311</span></a><span class="k">class</span> <span class="nc">Cluster</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="L-1312"><a href="#L-1312"><span class="linenos">1312</span></a> <span class="k">pass</span> -</span><span id="L-1313"><a href="#L-1313"><span class="linenos">1313</span></a> +</span><span id="L-1305"><a href="#L-1305"><span class="linenos">1305</span></a> +</span><span id="L-1306"><a href="#L-1306"><span class="linenos">1306</span></a><span class="c1"># Clickhouse FROM FINAL modifier</span> +</span><span id="L-1307"><a href="#L-1307"><span class="linenos">1307</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/statements/select/from/#final-modifier</span> +</span><span id="L-1308"><a href="#L-1308"><span class="linenos">1308</span></a><span class="k">class</span> <span class="nc">Final</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1309"><a href="#L-1309"><span class="linenos">1309</span></a> <span class="k">pass</span> +</span><span id="L-1310"><a href="#L-1310"><span class="linenos">1310</span></a> +</span><span id="L-1311"><a href="#L-1311"><span class="linenos">1311</span></a> +</span><span id="L-1312"><a href="#L-1312"><span class="linenos">1312</span></a><span class="k">class</span> <span class="nc">Offset</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1313"><a href="#L-1313"><span class="linenos">1313</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1314"><a href="#L-1314"><span class="linenos">1314</span></a> -</span><span id="L-1315"><a href="#L-1315"><span class="linenos">1315</span></a><span class="k">class</span> <span class="nc">Distribute</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="L-1316"><a href="#L-1316"><span class="linenos">1316</span></a> <span class="k">pass</span> -</span><span id="L-1317"><a href="#L-1317"><span class="linenos">1317</span></a> +</span><span id="L-1315"><a href="#L-1315"><span class="linenos">1315</span></a> +</span><span id="L-1316"><a href="#L-1316"><span class="linenos">1316</span></a><span class="k">class</span> <span class="nc">Order</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1317"><a href="#L-1317"><span class="linenos">1317</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1318"><a href="#L-1318"><span class="linenos">1318</span></a> -</span><span id="L-1319"><a href="#L-1319"><span class="linenos">1319</span></a><span class="k">class</span> <span class="nc">Sort</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="L-1320"><a href="#L-1320"><span class="linenos">1320</span></a> <span class="k">pass</span> -</span><span id="L-1321"><a href="#L-1321"><span class="linenos">1321</span></a> -</span><span id="L-1322"><a href="#L-1322"><span class="linenos">1322</span></a> -</span><span id="L-1323"><a href="#L-1323"><span class="linenos">1323</span></a><span class="k">class</span> <span class="nc">Ordered</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1324"><a href="#L-1324"><span class="linenos">1324</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"desc"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"nulls_first"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1319"><a href="#L-1319"><span class="linenos">1319</span></a> +</span><span id="L-1320"><a href="#L-1320"><span class="linenos">1320</span></a><span class="c1"># hive specific sorts</span> +</span><span id="L-1321"><a href="#L-1321"><span class="linenos">1321</span></a><span class="c1"># https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy</span> +</span><span id="L-1322"><a href="#L-1322"><span class="linenos">1322</span></a><span class="k">class</span> <span class="nc">Cluster</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="L-1323"><a href="#L-1323"><span class="linenos">1323</span></a> <span class="k">pass</span> +</span><span id="L-1324"><a href="#L-1324"><span class="linenos">1324</span></a> </span><span id="L-1325"><a href="#L-1325"><span class="linenos">1325</span></a> -</span><span id="L-1326"><a href="#L-1326"><span class="linenos">1326</span></a> -</span><span id="L-1327"><a href="#L-1327"><span class="linenos">1327</span></a><span class="k">class</span> <span class="nc">Property</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1328"><a href="#L-1328"><span class="linenos">1328</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1326"><a href="#L-1326"><span class="linenos">1326</span></a><span class="k">class</span> <span class="nc">Distribute</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="L-1327"><a href="#L-1327"><span class="linenos">1327</span></a> <span class="k">pass</span> +</span><span id="L-1328"><a href="#L-1328"><span class="linenos">1328</span></a> </span><span id="L-1329"><a href="#L-1329"><span class="linenos">1329</span></a> -</span><span id="L-1330"><a href="#L-1330"><span class="linenos">1330</span></a> -</span><span id="L-1331"><a href="#L-1331"><span class="linenos">1331</span></a><span class="k">class</span> <span class="nc">AlgorithmProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1332"><a href="#L-1332"><span class="linenos">1332</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1330"><a href="#L-1330"><span class="linenos">1330</span></a><span class="k">class</span> <span class="nc">Sort</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="L-1331"><a href="#L-1331"><span class="linenos">1331</span></a> <span class="k">pass</span> +</span><span id="L-1332"><a href="#L-1332"><span class="linenos">1332</span></a> </span><span id="L-1333"><a href="#L-1333"><span class="linenos">1333</span></a> -</span><span id="L-1334"><a href="#L-1334"><span class="linenos">1334</span></a> -</span><span id="L-1335"><a href="#L-1335"><span class="linenos">1335</span></a><span class="k">class</span> <span class="nc">DefinerProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1336"><a href="#L-1336"><span class="linenos">1336</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1334"><a href="#L-1334"><span class="linenos">1334</span></a><span class="k">class</span> <span class="nc">Ordered</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1335"><a href="#L-1335"><span class="linenos">1335</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"desc"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"nulls_first"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1336"><a href="#L-1336"><span class="linenos">1336</span></a> </span><span id="L-1337"><a href="#L-1337"><span class="linenos">1337</span></a> -</span><span id="L-1338"><a href="#L-1338"><span class="linenos">1338</span></a> -</span><span id="L-1339"><a href="#L-1339"><span class="linenos">1339</span></a><span class="k">class</span> <span class="nc">SqlSecurityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1340"><a href="#L-1340"><span class="linenos">1340</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"definer"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1338"><a href="#L-1338"><span class="linenos">1338</span></a><span class="k">class</span> <span class="nc">Property</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1339"><a href="#L-1339"><span class="linenos">1339</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1340"><a href="#L-1340"><span class="linenos">1340</span></a> </span><span id="L-1341"><a href="#L-1341"><span class="linenos">1341</span></a> -</span><span id="L-1342"><a href="#L-1342"><span class="linenos">1342</span></a> -</span><span id="L-1343"><a href="#L-1343"><span class="linenos">1343</span></a><span class="k">class</span> <span class="nc">TableFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1344"><a href="#L-1344"><span class="linenos">1344</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1342"><a href="#L-1342"><span class="linenos">1342</span></a><span class="k">class</span> <span class="nc">AfterJournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1343"><a href="#L-1343"><span class="linenos">1343</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1344"><a href="#L-1344"><span class="linenos">1344</span></a> </span><span id="L-1345"><a href="#L-1345"><span class="linenos">1345</span></a> -</span><span id="L-1346"><a href="#L-1346"><span class="linenos">1346</span></a> -</span><span id="L-1347"><a href="#L-1347"><span class="linenos">1347</span></a><span class="k">class</span> <span class="nc">PartitionedByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1348"><a href="#L-1348"><span class="linenos">1348</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1346"><a href="#L-1346"><span class="linenos">1346</span></a><span class="k">class</span> <span class="nc">AlgorithmProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1347"><a href="#L-1347"><span class="linenos">1347</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1348"><a href="#L-1348"><span class="linenos">1348</span></a> </span><span id="L-1349"><a href="#L-1349"><span class="linenos">1349</span></a> -</span><span id="L-1350"><a href="#L-1350"><span class="linenos">1350</span></a> -</span><span id="L-1351"><a href="#L-1351"><span class="linenos">1351</span></a><span class="k">class</span> <span class="nc">FileFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1352"><a href="#L-1352"><span class="linenos">1352</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1350"><a href="#L-1350"><span class="linenos">1350</span></a><span class="k">class</span> <span class="nc">AutoIncrementProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1351"><a href="#L-1351"><span class="linenos">1351</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1352"><a href="#L-1352"><span class="linenos">1352</span></a> </span><span id="L-1353"><a href="#L-1353"><span class="linenos">1353</span></a> -</span><span id="L-1354"><a href="#L-1354"><span class="linenos">1354</span></a> -</span><span id="L-1355"><a href="#L-1355"><span class="linenos">1355</span></a><span class="k">class</span> <span class="nc">DistKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1356"><a href="#L-1356"><span class="linenos">1356</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1354"><a href="#L-1354"><span class="linenos">1354</span></a><span class="k">class</span> <span class="nc">BlockCompressionProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1355"><a href="#L-1355"><span class="linenos">1355</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"autotemp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"always"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"manual"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"never"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1356"><a href="#L-1356"><span class="linenos">1356</span></a> </span><span id="L-1357"><a href="#L-1357"><span class="linenos">1357</span></a> -</span><span id="L-1358"><a href="#L-1358"><span class="linenos">1358</span></a> -</span><span id="L-1359"><a href="#L-1359"><span class="linenos">1359</span></a><span class="k">class</span> <span class="nc">SortKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1360"><a href="#L-1360"><span class="linenos">1360</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"compound"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1358"><a href="#L-1358"><span class="linenos">1358</span></a><span class="k">class</span> <span class="nc">CharacterSetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1359"><a href="#L-1359"><span class="linenos">1359</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1360"><a href="#L-1360"><span class="linenos">1360</span></a> </span><span id="L-1361"><a href="#L-1361"><span class="linenos">1361</span></a> -</span><span id="L-1362"><a href="#L-1362"><span class="linenos">1362</span></a> -</span><span id="L-1363"><a href="#L-1363"><span class="linenos">1363</span></a><span class="k">class</span> <span class="nc">DistStyleProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1364"><a href="#L-1364"><span class="linenos">1364</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1362"><a href="#L-1362"><span class="linenos">1362</span></a><span class="k">class</span> <span class="nc">ChecksumProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1363"><a href="#L-1363"><span class="linenos">1363</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1364"><a href="#L-1364"><span class="linenos">1364</span></a> </span><span id="L-1365"><a href="#L-1365"><span class="linenos">1365</span></a> -</span><span id="L-1366"><a href="#L-1366"><span class="linenos">1366</span></a> -</span><span id="L-1367"><a href="#L-1367"><span class="linenos">1367</span></a><span class="k">class</span> <span class="nc">LikeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1368"><a href="#L-1368"><span class="linenos">1368</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1366"><a href="#L-1366"><span class="linenos">1366</span></a><span class="k">class</span> <span class="nc">CollateProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1367"><a href="#L-1367"><span class="linenos">1367</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1368"><a href="#L-1368"><span class="linenos">1368</span></a> </span><span id="L-1369"><a href="#L-1369"><span class="linenos">1369</span></a> -</span><span id="L-1370"><a href="#L-1370"><span class="linenos">1370</span></a> -</span><span id="L-1371"><a href="#L-1371"><span class="linenos">1371</span></a><span class="k">class</span> <span class="nc">LocationProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1372"><a href="#L-1372"><span class="linenos">1372</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1370"><a href="#L-1370"><span class="linenos">1370</span></a><span class="k">class</span> <span class="nc">DataBlocksizeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1371"><a href="#L-1371"><span class="linenos">1371</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1372"><a href="#L-1372"><span class="linenos">1372</span></a> </span><span id="L-1373"><a href="#L-1373"><span class="linenos">1373</span></a> -</span><span id="L-1374"><a href="#L-1374"><span class="linenos">1374</span></a> -</span><span id="L-1375"><a href="#L-1375"><span class="linenos">1375</span></a><span class="k">class</span> <span class="nc">EngineProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1376"><a href="#L-1376"><span class="linenos">1376</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1374"><a href="#L-1374"><span class="linenos">1374</span></a><span class="k">class</span> <span class="nc">DefinerProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1375"><a href="#L-1375"><span class="linenos">1375</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1376"><a href="#L-1376"><span class="linenos">1376</span></a> </span><span id="L-1377"><a href="#L-1377"><span class="linenos">1377</span></a> -</span><span id="L-1378"><a href="#L-1378"><span class="linenos">1378</span></a> -</span><span id="L-1379"><a href="#L-1379"><span class="linenos">1379</span></a><span class="k">class</span> <span class="nc">AutoIncrementProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1380"><a href="#L-1380"><span class="linenos">1380</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1378"><a href="#L-1378"><span class="linenos">1378</span></a><span class="k">class</span> <span class="nc">DistKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1379"><a href="#L-1379"><span class="linenos">1379</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1380"><a href="#L-1380"><span class="linenos">1380</span></a> </span><span id="L-1381"><a href="#L-1381"><span class="linenos">1381</span></a> -</span><span id="L-1382"><a href="#L-1382"><span class="linenos">1382</span></a> -</span><span id="L-1383"><a href="#L-1383"><span class="linenos">1383</span></a><span class="k">class</span> <span class="nc">CharacterSetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1384"><a href="#L-1384"><span class="linenos">1384</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1382"><a href="#L-1382"><span class="linenos">1382</span></a><span class="k">class</span> <span class="nc">DistStyleProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1383"><a href="#L-1383"><span class="linenos">1383</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1384"><a href="#L-1384"><span class="linenos">1384</span></a> </span><span id="L-1385"><a href="#L-1385"><span class="linenos">1385</span></a> -</span><span id="L-1386"><a href="#L-1386"><span class="linenos">1386</span></a> -</span><span id="L-1387"><a href="#L-1387"><span class="linenos">1387</span></a><span class="k">class</span> <span class="nc">CollateProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1388"><a href="#L-1388"><span class="linenos">1388</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1386"><a href="#L-1386"><span class="linenos">1386</span></a><span class="k">class</span> <span class="nc">EngineProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1387"><a href="#L-1387"><span class="linenos">1387</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1388"><a href="#L-1388"><span class="linenos">1388</span></a> </span><span id="L-1389"><a href="#L-1389"><span class="linenos">1389</span></a> -</span><span id="L-1390"><a href="#L-1390"><span class="linenos">1390</span></a> -</span><span id="L-1391"><a href="#L-1391"><span class="linenos">1391</span></a><span class="k">class</span> <span class="nc">SchemaCommentProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1392"><a href="#L-1392"><span class="linenos">1392</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1390"><a href="#L-1390"><span class="linenos">1390</span></a><span class="k">class</span> <span class="nc">ExecuteAsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1391"><a href="#L-1391"><span class="linenos">1391</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1392"><a href="#L-1392"><span class="linenos">1392</span></a> </span><span id="L-1393"><a href="#L-1393"><span class="linenos">1393</span></a> -</span><span id="L-1394"><a href="#L-1394"><span class="linenos">1394</span></a> -</span><span id="L-1395"><a href="#L-1395"><span class="linenos">1395</span></a><span class="k">class</span> <span class="nc">ReturnsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1396"><a href="#L-1396"><span class="linenos">1396</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1394"><a href="#L-1394"><span class="linenos">1394</span></a><span class="k">class</span> <span class="nc">ExternalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1395"><a href="#L-1395"><span class="linenos">1395</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1396"><a href="#L-1396"><span class="linenos">1396</span></a> </span><span id="L-1397"><a href="#L-1397"><span class="linenos">1397</span></a> -</span><span id="L-1398"><a href="#L-1398"><span class="linenos">1398</span></a> -</span><span id="L-1399"><a href="#L-1399"><span class="linenos">1399</span></a><span class="k">class</span> <span class="nc">LanguageProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1400"><a href="#L-1400"><span class="linenos">1400</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1398"><a href="#L-1398"><span class="linenos">1398</span></a><span class="k">class</span> <span class="nc">FallbackProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1399"><a href="#L-1399"><span class="linenos">1399</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"protection"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1400"><a href="#L-1400"><span class="linenos">1400</span></a> </span><span id="L-1401"><a href="#L-1401"><span class="linenos">1401</span></a> -</span><span id="L-1402"><a href="#L-1402"><span class="linenos">1402</span></a> -</span><span id="L-1403"><a href="#L-1403"><span class="linenos">1403</span></a><span class="k">class</span> <span class="nc">ExecuteAsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1404"><a href="#L-1404"><span class="linenos">1404</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1402"><a href="#L-1402"><span class="linenos">1402</span></a><span class="k">class</span> <span class="nc">FileFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1403"><a href="#L-1403"><span class="linenos">1403</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1404"><a href="#L-1404"><span class="linenos">1404</span></a> </span><span id="L-1405"><a href="#L-1405"><span class="linenos">1405</span></a> -</span><span id="L-1406"><a href="#L-1406"><span class="linenos">1406</span></a> -</span><span id="L-1407"><a href="#L-1407"><span class="linenos">1407</span></a><span class="k">class</span> <span class="nc">VolatilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1408"><a href="#L-1408"><span class="linenos">1408</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1406"><a href="#L-1406"><span class="linenos">1406</span></a><span class="k">class</span> <span class="nc">FreespaceProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1407"><a href="#L-1407"><span class="linenos">1407</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1408"><a href="#L-1408"><span class="linenos">1408</span></a> </span><span id="L-1409"><a href="#L-1409"><span class="linenos">1409</span></a> -</span><span id="L-1410"><a href="#L-1410"><span class="linenos">1410</span></a> -</span><span id="L-1411"><a href="#L-1411"><span class="linenos">1411</span></a><span class="k">class</span> <span class="nc">RowFormatDelimitedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1412"><a href="#L-1412"><span class="linenos">1412</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> -</span><span id="L-1413"><a href="#L-1413"><span class="linenos">1413</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1414"><a href="#L-1414"><span class="linenos">1414</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1415"><a href="#L-1415"><span class="linenos">1415</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1416"><a href="#L-1416"><span class="linenos">1416</span></a> <span class="s2">"collection_items"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1417"><a href="#L-1417"><span class="linenos">1417</span></a> <span class="s2">"map_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1418"><a href="#L-1418"><span class="linenos">1418</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1419"><a href="#L-1419"><span class="linenos">1419</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1420"><a href="#L-1420"><span class="linenos">1420</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1421"><a href="#L-1421"><span class="linenos">1421</span></a> <span class="p">}</span> +</span><span id="L-1410"><a href="#L-1410"><span class="linenos">1410</span></a><span class="k">class</span> <span class="nc">IsolatedLoadingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1411"><a href="#L-1411"><span class="linenos">1411</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1412"><a href="#L-1412"><span class="linenos">1412</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1413"><a href="#L-1413"><span class="linenos">1413</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1414"><a href="#L-1414"><span class="linenos">1414</span></a> <span class="s2">"for_all"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1415"><a href="#L-1415"><span class="linenos">1415</span></a> <span class="s2">"for_insert"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1416"><a href="#L-1416"><span class="linenos">1416</span></a> <span class="s2">"for_none"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1417"><a href="#L-1417"><span class="linenos">1417</span></a> <span class="p">}</span> +</span><span id="L-1418"><a href="#L-1418"><span class="linenos">1418</span></a> +</span><span id="L-1419"><a href="#L-1419"><span class="linenos">1419</span></a> +</span><span id="L-1420"><a href="#L-1420"><span class="linenos">1420</span></a><span class="k">class</span> <span class="nc">JournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1421"><a href="#L-1421"><span class="linenos">1421</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-1422"><a href="#L-1422"><span class="linenos">1422</span></a> </span><span id="L-1423"><a href="#L-1423"><span class="linenos">1423</span></a> -</span><span id="L-1424"><a href="#L-1424"><span class="linenos">1424</span></a><span class="k">class</span> <span class="nc">RowFormatSerdeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1424"><a href="#L-1424"><span class="linenos">1424</span></a><span class="k">class</span> <span class="nc">LanguageProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> </span><span id="L-1425"><a href="#L-1425"><span class="linenos">1425</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1426"><a href="#L-1426"><span class="linenos">1426</span></a> </span><span id="L-1427"><a href="#L-1427"><span class="linenos">1427</span></a> -</span><span id="L-1428"><a href="#L-1428"><span class="linenos">1428</span></a><span class="k">class</span> <span class="nc">SerdeProperties</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1429"><a href="#L-1429"><span class="linenos">1429</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1428"><a href="#L-1428"><span class="linenos">1428</span></a><span class="k">class</span> <span class="nc">LikeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1429"><a href="#L-1429"><span class="linenos">1429</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-1430"><a href="#L-1430"><span class="linenos">1430</span></a> </span><span id="L-1431"><a href="#L-1431"><span class="linenos">1431</span></a> -</span><span id="L-1432"><a href="#L-1432"><span class="linenos">1432</span></a><span class="k">class</span> <span class="nc">FallbackProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1433"><a href="#L-1433"><span class="linenos">1433</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"protection"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1432"><a href="#L-1432"><span class="linenos">1432</span></a><span class="k">class</span> <span class="nc">LocationProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1433"><a href="#L-1433"><span class="linenos">1433</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-1434"><a href="#L-1434"><span class="linenos">1434</span></a> </span><span id="L-1435"><a href="#L-1435"><span class="linenos">1435</span></a> -</span><span id="L-1436"><a href="#L-1436"><span class="linenos">1436</span></a><span class="k">class</span> <span class="nc">WithJournalTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1437"><a href="#L-1437"><span class="linenos">1437</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1438"><a href="#L-1438"><span class="linenos">1438</span></a> -</span><span id="L-1439"><a href="#L-1439"><span class="linenos">1439</span></a> -</span><span id="L-1440"><a href="#L-1440"><span class="linenos">1440</span></a><span class="k">class</span> <span class="nc">LogProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1441"><a href="#L-1441"><span class="linenos">1441</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1442"><a href="#L-1442"><span class="linenos">1442</span></a> -</span><span id="L-1443"><a href="#L-1443"><span class="linenos">1443</span></a> -</span><span id="L-1444"><a href="#L-1444"><span class="linenos">1444</span></a><span class="k">class</span> <span class="nc">JournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1445"><a href="#L-1445"><span class="linenos">1445</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1446"><a href="#L-1446"><span class="linenos">1446</span></a> -</span><span id="L-1447"><a href="#L-1447"><span class="linenos">1447</span></a> -</span><span id="L-1448"><a href="#L-1448"><span class="linenos">1448</span></a><span class="k">class</span> <span class="nc">AfterJournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1449"><a href="#L-1449"><span class="linenos">1449</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1450"><a href="#L-1450"><span class="linenos">1450</span></a> -</span><span id="L-1451"><a href="#L-1451"><span class="linenos">1451</span></a> -</span><span id="L-1452"><a href="#L-1452"><span class="linenos">1452</span></a><span class="k">class</span> <span class="nc">ChecksumProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1453"><a href="#L-1453"><span class="linenos">1453</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1454"><a href="#L-1454"><span class="linenos">1454</span></a> -</span><span id="L-1455"><a href="#L-1455"><span class="linenos">1455</span></a> -</span><span id="L-1456"><a href="#L-1456"><span class="linenos">1456</span></a><span class="k">class</span> <span class="nc">FreespaceProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1457"><a href="#L-1457"><span class="linenos">1457</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1458"><a href="#L-1458"><span class="linenos">1458</span></a> -</span><span id="L-1459"><a href="#L-1459"><span class="linenos">1459</span></a> -</span><span id="L-1460"><a href="#L-1460"><span class="linenos">1460</span></a><span class="k">class</span> <span class="nc">MergeBlockRatioProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1461"><a href="#L-1461"><span class="linenos">1461</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1462"><a href="#L-1462"><span class="linenos">1462</span></a> -</span><span id="L-1463"><a href="#L-1463"><span class="linenos">1463</span></a> -</span><span id="L-1464"><a href="#L-1464"><span class="linenos">1464</span></a><span class="k">class</span> <span class="nc">DataBlocksizeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1465"><a href="#L-1465"><span class="linenos">1465</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1466"><a href="#L-1466"><span class="linenos">1466</span></a> -</span><span id="L-1467"><a href="#L-1467"><span class="linenos">1467</span></a> -</span><span id="L-1468"><a href="#L-1468"><span class="linenos">1468</span></a><span class="k">class</span> <span class="nc">BlockCompressionProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1469"><a href="#L-1469"><span class="linenos">1469</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"autotemp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"always"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"manual"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"never"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-1470"><a href="#L-1470"><span class="linenos">1470</span></a> -</span><span id="L-1471"><a href="#L-1471"><span class="linenos">1471</span></a> -</span><span id="L-1472"><a href="#L-1472"><span class="linenos">1472</span></a><span class="k">class</span> <span class="nc">IsolatedLoadingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1473"><a href="#L-1473"><span class="linenos">1473</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1474"><a href="#L-1474"><span class="linenos">1474</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1475"><a href="#L-1475"><span class="linenos">1475</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1476"><a href="#L-1476"><span class="linenos">1476</span></a> <span class="s2">"for_all"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1477"><a href="#L-1477"><span class="linenos">1477</span></a> <span class="s2">"for_insert"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1478"><a href="#L-1478"><span class="linenos">1478</span></a> <span class="s2">"for_none"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1479"><a href="#L-1479"><span class="linenos">1479</span></a> <span class="p">}</span> -</span><span id="L-1480"><a href="#L-1480"><span class="linenos">1480</span></a> -</span><span id="L-1481"><a href="#L-1481"><span class="linenos">1481</span></a> -</span><span id="L-1482"><a href="#L-1482"><span class="linenos">1482</span></a><span class="k">class</span> <span class="nc">LockingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="L-1483"><a href="#L-1483"><span class="linenos">1483</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1484"><a href="#L-1484"><span class="linenos">1484</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1485"><a href="#L-1485"><span class="linenos">1485</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1486"><a href="#L-1486"><span class="linenos">1486</span></a> <span class="s2">"for_or_in"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1487"><a href="#L-1487"><span class="linenos">1487</span></a> <span class="s2">"lock_type"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1488"><a href="#L-1488"><span class="linenos">1488</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1489"><a href="#L-1489"><span class="linenos">1489</span></a> <span class="p">}</span> +</span><span id="L-1436"><a href="#L-1436"><span class="linenos">1436</span></a><span class="k">class</span> <span class="nc">LockingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1437"><a href="#L-1437"><span class="linenos">1437</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1438"><a href="#L-1438"><span class="linenos">1438</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1439"><a href="#L-1439"><span class="linenos">1439</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1440"><a href="#L-1440"><span class="linenos">1440</span></a> <span class="s2">"for_or_in"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1441"><a href="#L-1441"><span class="linenos">1441</span></a> <span class="s2">"lock_type"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1442"><a href="#L-1442"><span class="linenos">1442</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1443"><a href="#L-1443"><span class="linenos">1443</span></a> <span class="p">}</span> +</span><span id="L-1444"><a href="#L-1444"><span class="linenos">1444</span></a> +</span><span id="L-1445"><a href="#L-1445"><span class="linenos">1445</span></a> +</span><span id="L-1446"><a href="#L-1446"><span class="linenos">1446</span></a><span class="k">class</span> <span class="nc">LogProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1447"><a href="#L-1447"><span class="linenos">1447</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1448"><a href="#L-1448"><span class="linenos">1448</span></a> +</span><span id="L-1449"><a href="#L-1449"><span class="linenos">1449</span></a> +</span><span id="L-1450"><a href="#L-1450"><span class="linenos">1450</span></a><span class="k">class</span> <span class="nc">MaterializedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1451"><a href="#L-1451"><span class="linenos">1451</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1452"><a href="#L-1452"><span class="linenos">1452</span></a> +</span><span id="L-1453"><a href="#L-1453"><span class="linenos">1453</span></a> +</span><span id="L-1454"><a href="#L-1454"><span class="linenos">1454</span></a><span class="k">class</span> <span class="nc">MergeBlockRatioProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1455"><a href="#L-1455"><span class="linenos">1455</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1456"><a href="#L-1456"><span class="linenos">1456</span></a> +</span><span id="L-1457"><a href="#L-1457"><span class="linenos">1457</span></a> +</span><span id="L-1458"><a href="#L-1458"><span class="linenos">1458</span></a><span class="k">class</span> <span class="nc">NoPrimaryIndexProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1459"><a href="#L-1459"><span class="linenos">1459</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1460"><a href="#L-1460"><span class="linenos">1460</span></a> +</span><span id="L-1461"><a href="#L-1461"><span class="linenos">1461</span></a> +</span><span id="L-1462"><a href="#L-1462"><span class="linenos">1462</span></a><span class="k">class</span> <span class="nc">OnCommitProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1463"><a href="#L-1463"><span class="linenos">1463</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1464"><a href="#L-1464"><span class="linenos">1464</span></a> +</span><span id="L-1465"><a href="#L-1465"><span class="linenos">1465</span></a> +</span><span id="L-1466"><a href="#L-1466"><span class="linenos">1466</span></a><span class="k">class</span> <span class="nc">PartitionedByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1467"><a href="#L-1467"><span class="linenos">1467</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1468"><a href="#L-1468"><span class="linenos">1468</span></a> +</span><span id="L-1469"><a href="#L-1469"><span class="linenos">1469</span></a> +</span><span id="L-1470"><a href="#L-1470"><span class="linenos">1470</span></a><span class="k">class</span> <span class="nc">ReturnsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1471"><a href="#L-1471"><span class="linenos">1471</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1472"><a href="#L-1472"><span class="linenos">1472</span></a> +</span><span id="L-1473"><a href="#L-1473"><span class="linenos">1473</span></a> +</span><span id="L-1474"><a href="#L-1474"><span class="linenos">1474</span></a><span class="k">class</span> <span class="nc">RowFormatDelimitedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1475"><a href="#L-1475"><span class="linenos">1475</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> +</span><span id="L-1476"><a href="#L-1476"><span class="linenos">1476</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1477"><a href="#L-1477"><span class="linenos">1477</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1478"><a href="#L-1478"><span class="linenos">1478</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1479"><a href="#L-1479"><span class="linenos">1479</span></a> <span class="s2">"collection_items"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1480"><a href="#L-1480"><span class="linenos">1480</span></a> <span class="s2">"map_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1481"><a href="#L-1481"><span class="linenos">1481</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1482"><a href="#L-1482"><span class="linenos">1482</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1483"><a href="#L-1483"><span class="linenos">1483</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1484"><a href="#L-1484"><span class="linenos">1484</span></a> <span class="p">}</span> +</span><span id="L-1485"><a href="#L-1485"><span class="linenos">1485</span></a> +</span><span id="L-1486"><a href="#L-1486"><span class="linenos">1486</span></a> +</span><span id="L-1487"><a href="#L-1487"><span class="linenos">1487</span></a><span class="k">class</span> <span class="nc">RowFormatSerdeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1488"><a href="#L-1488"><span class="linenos">1488</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1489"><a href="#L-1489"><span class="linenos">1489</span></a> </span><span id="L-1490"><a href="#L-1490"><span class="linenos">1490</span></a> -</span><span id="L-1491"><a href="#L-1491"><span class="linenos">1491</span></a> -</span><span id="L-1492"><a href="#L-1492"><span class="linenos">1492</span></a><span class="k">class</span> <span class="nc">Properties</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1493"><a href="#L-1493"><span class="linenos">1493</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1491"><a href="#L-1491"><span class="linenos">1491</span></a><span class="k">class</span> <span class="nc">SchemaCommentProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1492"><a href="#L-1492"><span class="linenos">1492</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1493"><a href="#L-1493"><span class="linenos">1493</span></a> </span><span id="L-1494"><a href="#L-1494"><span class="linenos">1494</span></a> -</span><span id="L-1495"><a href="#L-1495"><span class="linenos">1495</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1496"><a href="#L-1496"><span class="linenos">1496</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> -</span><span id="L-1497"><a href="#L-1497"><span class="linenos">1497</span></a> <span class="s2">"AUTO_INCREMENT"</span><span class="p">:</span> <span class="n">AutoIncrementProperty</span><span class="p">,</span> -</span><span id="L-1498"><a href="#L-1498"><span class="linenos">1498</span></a> <span class="s2">"CHARACTER SET"</span><span class="p">:</span> <span class="n">CharacterSetProperty</span><span class="p">,</span> -</span><span id="L-1499"><a href="#L-1499"><span class="linenos">1499</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> -</span><span id="L-1500"><a href="#L-1500"><span class="linenos">1500</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> -</span><span id="L-1501"><a href="#L-1501"><span class="linenos">1501</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> -</span><span id="L-1502"><a href="#L-1502"><span class="linenos">1502</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> -</span><span id="L-1503"><a href="#L-1503"><span class="linenos">1503</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> -</span><span id="L-1504"><a href="#L-1504"><span class="linenos">1504</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> -</span><span id="L-1505"><a href="#L-1505"><span class="linenos">1505</span></a> <span class="s2">"EXECUTE AS"</span><span class="p">:</span> <span class="n">ExecuteAsProperty</span><span class="p">,</span> -</span><span id="L-1506"><a href="#L-1506"><span class="linenos">1506</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> -</span><span id="L-1507"><a href="#L-1507"><span class="linenos">1507</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> -</span><span id="L-1508"><a href="#L-1508"><span class="linenos">1508</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> -</span><span id="L-1509"><a href="#L-1509"><span class="linenos">1509</span></a> <span class="s2">"PARTITIONED_BY"</span><span class="p">:</span> <span class="n">PartitionedByProperty</span><span class="p">,</span> -</span><span id="L-1510"><a href="#L-1510"><span class="linenos">1510</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> -</span><span id="L-1511"><a href="#L-1511"><span class="linenos">1511</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> -</span><span id="L-1512"><a href="#L-1512"><span class="linenos">1512</span></a> <span class="s2">"TABLE_FORMAT"</span><span class="p">:</span> <span class="n">TableFormatProperty</span><span class="p">,</span> -</span><span id="L-1513"><a href="#L-1513"><span class="linenos">1513</span></a> <span class="p">}</span> +</span><span id="L-1495"><a href="#L-1495"><span class="linenos">1495</span></a><span class="k">class</span> <span class="nc">SerdeProperties</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1496"><a href="#L-1496"><span class="linenos">1496</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1497"><a href="#L-1497"><span class="linenos">1497</span></a> +</span><span id="L-1498"><a href="#L-1498"><span class="linenos">1498</span></a> +</span><span id="L-1499"><a href="#L-1499"><span class="linenos">1499</span></a><span class="k">class</span> <span class="nc">SetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1500"><a href="#L-1500"><span class="linenos">1500</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"multi"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1501"><a href="#L-1501"><span class="linenos">1501</span></a> +</span><span id="L-1502"><a href="#L-1502"><span class="linenos">1502</span></a> +</span><span id="L-1503"><a href="#L-1503"><span class="linenos">1503</span></a><span class="k">class</span> <span class="nc">SortKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1504"><a href="#L-1504"><span class="linenos">1504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"compound"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1505"><a href="#L-1505"><span class="linenos">1505</span></a> +</span><span id="L-1506"><a href="#L-1506"><span class="linenos">1506</span></a> +</span><span id="L-1507"><a href="#L-1507"><span class="linenos">1507</span></a><span class="k">class</span> <span class="nc">SqlSecurityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1508"><a href="#L-1508"><span class="linenos">1508</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"definer"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1509"><a href="#L-1509"><span class="linenos">1509</span></a> +</span><span id="L-1510"><a href="#L-1510"><span class="linenos">1510</span></a> +</span><span id="L-1511"><a href="#L-1511"><span class="linenos">1511</span></a><span class="k">class</span> <span class="nc">TableFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1512"><a href="#L-1512"><span class="linenos">1512</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1513"><a href="#L-1513"><span class="linenos">1513</span></a> </span><span id="L-1514"><a href="#L-1514"><span class="linenos">1514</span></a> -</span><span id="L-1515"><a href="#L-1515"><span class="linenos">1515</span></a> <span class="n">PROPERTY_TO_NAME</span> <span class="o">=</span> <span class="p">{</span><span class="n">v</span><span class="p">:</span> <span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> -</span><span id="L-1516"><a href="#L-1516"><span class="linenos">1516</span></a> -</span><span id="L-1517"><a href="#L-1517"><span class="linenos">1517</span></a> <span class="c1"># CREATE property locations</span> -</span><span id="L-1518"><a href="#L-1518"><span class="linenos">1518</span></a> <span class="c1"># Form: schema specified</span> -</span><span id="L-1519"><a href="#L-1519"><span class="linenos">1519</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="L-1520"><a href="#L-1520"><span class="linenos">1520</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="L-1521"><a href="#L-1521"><span class="linenos">1521</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> -</span><span id="L-1522"><a href="#L-1522"><span class="linenos">1522</span></a> <span class="c1"># with ([POST_WITH])</span> -</span><span id="L-1523"><a href="#L-1523"><span class="linenos">1523</span></a> <span class="c1"># index (b) [POST_INDEX]</span> -</span><span id="L-1524"><a href="#L-1524"><span class="linenos">1524</span></a> <span class="c1">#</span> -</span><span id="L-1525"><a href="#L-1525"><span class="linenos">1525</span></a> <span class="c1"># Form: alias selection</span> -</span><span id="L-1526"><a href="#L-1526"><span class="linenos">1526</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="L-1527"><a href="#L-1527"><span class="linenos">1527</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="L-1528"><a href="#L-1528"><span class="linenos">1528</span></a> <span class="c1"># as [POST_ALIAS] (select * from b)</span> -</span><span id="L-1529"><a href="#L-1529"><span class="linenos">1529</span></a> <span class="c1"># index (c) [POST_INDEX]</span> -</span><span id="L-1530"><a href="#L-1530"><span class="linenos">1530</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="L-1531"><a href="#L-1531"><span class="linenos">1531</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1532"><a href="#L-1532"><span class="linenos">1532</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1533"><a href="#L-1533"><span class="linenos">1533</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1534"><a href="#L-1534"><span class="linenos">1534</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1535"><a href="#L-1535"><span class="linenos">1535</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1536"><a href="#L-1536"><span class="linenos">1536</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1537"><a href="#L-1537"><span class="linenos">1537</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-1538"><a href="#L-1538"><span class="linenos">1538</span></a> -</span><span id="L-1539"><a href="#L-1539"><span class="linenos">1539</span></a> <span class="nd">@classmethod</span> -</span><span id="L-1540"><a href="#L-1540"><span class="linenos">1540</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> -</span><span id="L-1541"><a href="#L-1541"><span class="linenos">1541</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-1542"><a href="#L-1542"><span class="linenos">1542</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-1543"><a href="#L-1543"><span class="linenos">1543</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> -</span><span id="L-1544"><a href="#L-1544"><span class="linenos">1544</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="L-1545"><a href="#L-1545"><span class="linenos">1545</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="L-1546"><a href="#L-1546"><span class="linenos">1546</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-1547"><a href="#L-1547"><span class="linenos">1547</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="L-1548"><a href="#L-1548"><span class="linenos">1548</span></a> -</span><span id="L-1549"><a href="#L-1549"><span class="linenos">1549</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> -</span><span id="L-1550"><a href="#L-1550"><span class="linenos">1550</span></a> -</span><span id="L-1551"><a href="#L-1551"><span class="linenos">1551</span></a> -</span><span id="L-1552"><a href="#L-1552"><span class="linenos">1552</span></a><span class="k">class</span> <span class="nc">Qualify</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1553"><a href="#L-1553"><span class="linenos">1553</span></a> <span class="k">pass</span> -</span><span id="L-1554"><a href="#L-1554"><span class="linenos">1554</span></a> -</span><span id="L-1555"><a href="#L-1555"><span class="linenos">1555</span></a> -</span><span id="L-1556"><a href="#L-1556"><span class="linenos">1556</span></a><span class="c1"># https://www.ibm.com/docs/en/ias?topic=procedures-return-statement-in-sql</span> -</span><span id="L-1557"><a href="#L-1557"><span class="linenos">1557</span></a><span class="k">class</span> <span class="nc">Return</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1558"><a href="#L-1558"><span class="linenos">1558</span></a> <span class="k">pass</span> +</span><span id="L-1515"><a href="#L-1515"><span class="linenos">1515</span></a><span class="k">class</span> <span class="nc">TemporaryProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1516"><a href="#L-1516"><span class="linenos">1516</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"global_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1517"><a href="#L-1517"><span class="linenos">1517</span></a> +</span><span id="L-1518"><a href="#L-1518"><span class="linenos">1518</span></a> +</span><span id="L-1519"><a href="#L-1519"><span class="linenos">1519</span></a><span class="k">class</span> <span class="nc">TransientProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1520"><a href="#L-1520"><span class="linenos">1520</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1521"><a href="#L-1521"><span class="linenos">1521</span></a> +</span><span id="L-1522"><a href="#L-1522"><span class="linenos">1522</span></a> +</span><span id="L-1523"><a href="#L-1523"><span class="linenos">1523</span></a><span class="k">class</span> <span class="nc">VolatilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1524"><a href="#L-1524"><span class="linenos">1524</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1525"><a href="#L-1525"><span class="linenos">1525</span></a> +</span><span id="L-1526"><a href="#L-1526"><span class="linenos">1526</span></a> +</span><span id="L-1527"><a href="#L-1527"><span class="linenos">1527</span></a><span class="k">class</span> <span class="nc">WithDataProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1528"><a href="#L-1528"><span class="linenos">1528</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"statistics"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1529"><a href="#L-1529"><span class="linenos">1529</span></a> +</span><span id="L-1530"><a href="#L-1530"><span class="linenos">1530</span></a> +</span><span id="L-1531"><a href="#L-1531"><span class="linenos">1531</span></a><span class="k">class</span> <span class="nc">WithJournalTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="L-1532"><a href="#L-1532"><span class="linenos">1532</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1533"><a href="#L-1533"><span class="linenos">1533</span></a> +</span><span id="L-1534"><a href="#L-1534"><span class="linenos">1534</span></a> +</span><span id="L-1535"><a href="#L-1535"><span class="linenos">1535</span></a><span class="k">class</span> <span class="nc">Properties</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1536"><a href="#L-1536"><span class="linenos">1536</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1537"><a href="#L-1537"><span class="linenos">1537</span></a> +</span><span id="L-1538"><a href="#L-1538"><span class="linenos">1538</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1539"><a href="#L-1539"><span class="linenos">1539</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> +</span><span id="L-1540"><a href="#L-1540"><span class="linenos">1540</span></a> <span class="s2">"AUTO_INCREMENT"</span><span class="p">:</span> <span class="n">AutoIncrementProperty</span><span class="p">,</span> +</span><span id="L-1541"><a href="#L-1541"><span class="linenos">1541</span></a> <span class="s2">"CHARACTER SET"</span><span class="p">:</span> <span class="n">CharacterSetProperty</span><span class="p">,</span> +</span><span id="L-1542"><a href="#L-1542"><span class="linenos">1542</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> +</span><span id="L-1543"><a href="#L-1543"><span class="linenos">1543</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> +</span><span id="L-1544"><a href="#L-1544"><span class="linenos">1544</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> +</span><span id="L-1545"><a href="#L-1545"><span class="linenos">1545</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> +</span><span id="L-1546"><a href="#L-1546"><span class="linenos">1546</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> +</span><span id="L-1547"><a href="#L-1547"><span class="linenos">1547</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> +</span><span id="L-1548"><a href="#L-1548"><span class="linenos">1548</span></a> <span class="s2">"EXECUTE AS"</span><span class="p">:</span> <span class="n">ExecuteAsProperty</span><span class="p">,</span> +</span><span id="L-1549"><a href="#L-1549"><span class="linenos">1549</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> +</span><span id="L-1550"><a href="#L-1550"><span class="linenos">1550</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> +</span><span id="L-1551"><a href="#L-1551"><span class="linenos">1551</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> +</span><span id="L-1552"><a href="#L-1552"><span class="linenos">1552</span></a> <span class="s2">"PARTITIONED_BY"</span><span class="p">:</span> <span class="n">PartitionedByProperty</span><span class="p">,</span> +</span><span id="L-1553"><a href="#L-1553"><span class="linenos">1553</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> +</span><span id="L-1554"><a href="#L-1554"><span class="linenos">1554</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> +</span><span id="L-1555"><a href="#L-1555"><span class="linenos">1555</span></a> <span class="s2">"TABLE_FORMAT"</span><span class="p">:</span> <span class="n">TableFormatProperty</span><span class="p">,</span> +</span><span id="L-1556"><a href="#L-1556"><span class="linenos">1556</span></a> <span class="p">}</span> +</span><span id="L-1557"><a href="#L-1557"><span class="linenos">1557</span></a> +</span><span id="L-1558"><a href="#L-1558"><span class="linenos">1558</span></a> <span class="n">PROPERTY_TO_NAME</span> <span class="o">=</span> <span class="p">{</span><span class="n">v</span><span class="p">:</span> <span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> </span><span id="L-1559"><a href="#L-1559"><span class="linenos">1559</span></a> -</span><span id="L-1560"><a href="#L-1560"><span class="linenos">1560</span></a> -</span><span id="L-1561"><a href="#L-1561"><span class="linenos">1561</span></a><span class="k">class</span> <span class="nc">Reference</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1562"><a href="#L-1562"><span class="linenos">1562</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1563"><a href="#L-1563"><span class="linenos">1563</span></a> -</span><span id="L-1564"><a href="#L-1564"><span class="linenos">1564</span></a> -</span><span id="L-1565"><a href="#L-1565"><span class="linenos">1565</span></a><span class="k">class</span> <span class="nc">Tuple</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1566"><a href="#L-1566"><span class="linenos">1566</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1567"><a href="#L-1567"><span class="linenos">1567</span></a> -</span><span id="L-1568"><a href="#L-1568"><span class="linenos">1568</span></a> -</span><span id="L-1569"><a href="#L-1569"><span class="linenos">1569</span></a><span class="k">class</span> <span class="nc">Subqueryable</span><span class="p">(</span><span class="n">Unionable</span><span class="p">):</span> -</span><span id="L-1570"><a href="#L-1570"><span class="linenos">1570</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> -</span><span id="L-1571"><a href="#L-1571"><span class="linenos">1571</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1572"><a href="#L-1572"><span class="linenos">1572</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> -</span><span id="L-1573"><a href="#L-1573"><span class="linenos">1573</span></a> -</span><span id="L-1574"><a href="#L-1574"><span class="linenos">1574</span></a><span class="sd"> Example:</span> -</span><span id="L-1575"><a href="#L-1575"><span class="linenos">1575</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="L-1576"><a href="#L-1576"><span class="linenos">1576</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="L-1577"><a href="#L-1577"><span class="linenos">1577</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="L-1578"><a href="#L-1578"><span class="linenos">1578</span></a> -</span><span id="L-1579"><a href="#L-1579"><span class="linenos">1579</span></a><span class="sd"> Args:</span> -</span><span id="L-1580"><a href="#L-1580"><span class="linenos">1580</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="L-1581"><a href="#L-1581"><span class="linenos">1581</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1560"><a href="#L-1560"><span class="linenos">1560</span></a> <span class="c1"># CREATE property locations</span> +</span><span id="L-1561"><a href="#L-1561"><span class="linenos">1561</span></a> <span class="c1"># Form: schema specified</span> +</span><span id="L-1562"><a href="#L-1562"><span class="linenos">1562</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="L-1563"><a href="#L-1563"><span class="linenos">1563</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="L-1564"><a href="#L-1564"><span class="linenos">1564</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> +</span><span id="L-1565"><a href="#L-1565"><span class="linenos">1565</span></a> <span class="c1"># with ([POST_WITH])</span> +</span><span id="L-1566"><a href="#L-1566"><span class="linenos">1566</span></a> <span class="c1"># index (b) [POST_INDEX]</span> +</span><span id="L-1567"><a href="#L-1567"><span class="linenos">1567</span></a> <span class="c1">#</span> +</span><span id="L-1568"><a href="#L-1568"><span class="linenos">1568</span></a> <span class="c1"># Form: alias selection</span> +</span><span id="L-1569"><a href="#L-1569"><span class="linenos">1569</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="L-1570"><a href="#L-1570"><span class="linenos">1570</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="L-1571"><a href="#L-1571"><span class="linenos">1571</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> +</span><span id="L-1572"><a href="#L-1572"><span class="linenos">1572</span></a> <span class="c1"># index (c) [POST_INDEX]</span> +</span><span id="L-1573"><a href="#L-1573"><span class="linenos">1573</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="L-1574"><a href="#L-1574"><span class="linenos">1574</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1575"><a href="#L-1575"><span class="linenos">1575</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1576"><a href="#L-1576"><span class="linenos">1576</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1577"><a href="#L-1577"><span class="linenos">1577</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1578"><a href="#L-1578"><span class="linenos">1578</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1579"><a href="#L-1579"><span class="linenos">1579</span></a> <span class="n">POST_EXPRESSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1580"><a href="#L-1580"><span class="linenos">1580</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-1581"><a href="#L-1581"><span class="linenos">1581</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> </span><span id="L-1582"><a href="#L-1582"><span class="linenos">1582</span></a> -</span><span id="L-1583"><a href="#L-1583"><span class="linenos">1583</span></a><span class="sd"> Returns:</span> -</span><span id="L-1584"><a href="#L-1584"><span class="linenos">1584</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="L-1585"><a href="#L-1585"><span class="linenos">1585</span></a><span class="sd"> """</span> -</span><span id="L-1586"><a href="#L-1586"><span class="linenos">1586</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-1587"><a href="#L-1587"><span class="linenos">1587</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> -</span><span id="L-1588"><a href="#L-1588"><span class="linenos">1588</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="L-1589"><a href="#L-1589"><span class="linenos">1589</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> -</span><span id="L-1590"><a href="#L-1590"><span class="linenos">1590</span></a> <span class="p">)</span> -</span><span id="L-1591"><a href="#L-1591"><span class="linenos">1591</span></a> -</span><span id="L-1592"><a href="#L-1592"><span class="linenos">1592</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1593"><a href="#L-1593"><span class="linenos">1593</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> +</span><span id="L-1583"><a href="#L-1583"><span class="linenos">1583</span></a> <span class="nd">@classmethod</span> +</span><span id="L-1584"><a href="#L-1584"><span class="linenos">1584</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> +</span><span id="L-1585"><a href="#L-1585"><span class="linenos">1585</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-1586"><a href="#L-1586"><span class="linenos">1586</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-1587"><a href="#L-1587"><span class="linenos">1587</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> +</span><span id="L-1588"><a href="#L-1588"><span class="linenos">1588</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="L-1589"><a href="#L-1589"><span class="linenos">1589</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="L-1590"><a href="#L-1590"><span class="linenos">1590</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-1591"><a href="#L-1591"><span class="linenos">1591</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="L-1592"><a href="#L-1592"><span class="linenos">1592</span></a> +</span><span id="L-1593"><a href="#L-1593"><span class="linenos">1593</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> </span><span id="L-1594"><a href="#L-1594"><span class="linenos">1594</span></a> -</span><span id="L-1595"><a href="#L-1595"><span class="linenos">1595</span></a> <span class="nd">@property</span> -</span><span id="L-1596"><a href="#L-1596"><span class="linenos">1596</span></a> <span class="k">def</span> <span class="nf">ctes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1597"><a href="#L-1597"><span class="linenos">1597</span></a> <span class="n">with_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"with"</span><span class="p">)</span> -</span><span id="L-1598"><a href="#L-1598"><span class="linenos">1598</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">with_</span><span class="p">:</span> -</span><span id="L-1599"><a href="#L-1599"><span class="linenos">1599</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="L-1600"><a href="#L-1600"><span class="linenos">1600</span></a> <span class="k">return</span> <span class="n">with_</span><span class="o">.</span><span class="n">expressions</span> -</span><span id="L-1601"><a href="#L-1601"><span class="linenos">1601</span></a> -</span><span id="L-1602"><a href="#L-1602"><span class="linenos">1602</span></a> <span class="nd">@property</span> -</span><span id="L-1603"><a href="#L-1603"><span class="linenos">1603</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1604"><a href="#L-1604"><span class="linenos">1604</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `selects`"</span><span class="p">)</span> -</span><span id="L-1605"><a href="#L-1605"><span class="linenos">1605</span></a> -</span><span id="L-1606"><a href="#L-1606"><span class="linenos">1606</span></a> <span class="nd">@property</span> -</span><span id="L-1607"><a href="#L-1607"><span class="linenos">1607</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1608"><a href="#L-1608"><span class="linenos">1608</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `named_selects`"</span><span class="p">)</span> -</span><span id="L-1609"><a href="#L-1609"><span class="linenos">1609</span></a> -</span><span id="L-1610"><a href="#L-1610"><span class="linenos">1610</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="L-1611"><a href="#L-1611"><span class="linenos">1611</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1612"><a href="#L-1612"><span class="linenos">1612</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="L-1613"><a href="#L-1613"><span class="linenos">1613</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="L-1614"><a href="#L-1614"><span class="linenos">1614</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-1615"><a href="#L-1615"><span class="linenos">1615</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-1616"><a href="#L-1616"><span class="linenos">1616</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-1617"><a href="#L-1617"><span class="linenos">1617</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-1618"><a href="#L-1618"><span class="linenos">1618</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1619"><a href="#L-1619"><span class="linenos">1619</span></a> <span class="p">):</span> -</span><span id="L-1620"><a href="#L-1620"><span class="linenos">1620</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1621"><a href="#L-1621"><span class="linenos">1621</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="L-1595"><a href="#L-1595"><span class="linenos">1595</span></a> +</span><span id="L-1596"><a href="#L-1596"><span class="linenos">1596</span></a><span class="k">class</span> <span class="nc">Qualify</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1597"><a href="#L-1597"><span class="linenos">1597</span></a> <span class="k">pass</span> +</span><span id="L-1598"><a href="#L-1598"><span class="linenos">1598</span></a> +</span><span id="L-1599"><a href="#L-1599"><span class="linenos">1599</span></a> +</span><span id="L-1600"><a href="#L-1600"><span class="linenos">1600</span></a><span class="c1"># https://www.ibm.com/docs/en/ias?topic=procedures-return-statement-in-sql</span> +</span><span id="L-1601"><a href="#L-1601"><span class="linenos">1601</span></a><span class="k">class</span> <span class="nc">Return</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1602"><a href="#L-1602"><span class="linenos">1602</span></a> <span class="k">pass</span> +</span><span id="L-1603"><a href="#L-1603"><span class="linenos">1603</span></a> +</span><span id="L-1604"><a href="#L-1604"><span class="linenos">1604</span></a> +</span><span id="L-1605"><a href="#L-1605"><span class="linenos">1605</span></a><span class="k">class</span> <span class="nc">Reference</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1606"><a href="#L-1606"><span class="linenos">1606</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1607"><a href="#L-1607"><span class="linenos">1607</span></a> +</span><span id="L-1608"><a href="#L-1608"><span class="linenos">1608</span></a> +</span><span id="L-1609"><a href="#L-1609"><span class="linenos">1609</span></a><span class="k">class</span> <span class="nc">Tuple</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1610"><a href="#L-1610"><span class="linenos">1610</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1611"><a href="#L-1611"><span class="linenos">1611</span></a> +</span><span id="L-1612"><a href="#L-1612"><span class="linenos">1612</span></a> +</span><span id="L-1613"><a href="#L-1613"><span class="linenos">1613</span></a><span class="k">class</span> <span class="nc">Subqueryable</span><span class="p">(</span><span class="n">Unionable</span><span class="p">):</span> +</span><span id="L-1614"><a href="#L-1614"><span class="linenos">1614</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> +</span><span id="L-1615"><a href="#L-1615"><span class="linenos">1615</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1616"><a href="#L-1616"><span class="linenos">1616</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> +</span><span id="L-1617"><a href="#L-1617"><span class="linenos">1617</span></a> +</span><span id="L-1618"><a href="#L-1618"><span class="linenos">1618</span></a><span class="sd"> Example:</span> +</span><span id="L-1619"><a href="#L-1619"><span class="linenos">1619</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="L-1620"><a href="#L-1620"><span class="linenos">1620</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="L-1621"><a href="#L-1621"><span class="linenos">1621</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> </span><span id="L-1622"><a href="#L-1622"><span class="linenos">1622</span></a> -</span><span id="L-1623"><a href="#L-1623"><span class="linenos">1623</span></a><span class="sd"> Example:</span> -</span><span id="L-1624"><a href="#L-1624"><span class="linenos">1624</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="L-1625"><a href="#L-1625"><span class="linenos">1625</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="L-1623"><a href="#L-1623"><span class="linenos">1623</span></a><span class="sd"> Args:</span> +</span><span id="L-1624"><a href="#L-1624"><span class="linenos">1624</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="L-1625"><a href="#L-1625"><span class="linenos">1625</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> </span><span id="L-1626"><a href="#L-1626"><span class="linenos">1626</span></a> -</span><span id="L-1627"><a href="#L-1627"><span class="linenos">1627</span></a><span class="sd"> Args:</span> -</span><span id="L-1628"><a href="#L-1628"><span class="linenos">1628</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="L-1629"><a href="#L-1629"><span class="linenos">1629</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="L-1630"><a href="#L-1630"><span class="linenos">1630</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> -</span><span id="L-1631"><a href="#L-1631"><span class="linenos">1631</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1632"><a href="#L-1632"><span class="linenos">1632</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="L-1633"><a href="#L-1633"><span class="linenos">1633</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-1634"><a href="#L-1634"><span class="linenos">1634</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-1635"><a href="#L-1635"><span class="linenos">1635</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1636"><a href="#L-1636"><span class="linenos">1636</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1637"><a href="#L-1637"><span class="linenos">1637</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1627"><a href="#L-1627"><span class="linenos">1627</span></a><span class="sd"> Returns:</span> +</span><span id="L-1628"><a href="#L-1628"><span class="linenos">1628</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="L-1629"><a href="#L-1629"><span class="linenos">1629</span></a><span class="sd"> """</span> +</span><span id="L-1630"><a href="#L-1630"><span class="linenos">1630</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-1631"><a href="#L-1631"><span class="linenos">1631</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> +</span><span id="L-1632"><a href="#L-1632"><span class="linenos">1632</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="L-1633"><a href="#L-1633"><span class="linenos">1633</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> +</span><span id="L-1634"><a href="#L-1634"><span class="linenos">1634</span></a> <span class="p">)</span> +</span><span id="L-1635"><a href="#L-1635"><span class="linenos">1635</span></a> +</span><span id="L-1636"><a href="#L-1636"><span class="linenos">1636</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-1637"><a href="#L-1637"><span class="linenos">1637</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> </span><span id="L-1638"><a href="#L-1638"><span class="linenos">1638</span></a> -</span><span id="L-1639"><a href="#L-1639"><span class="linenos">1639</span></a><span class="sd"> Returns:</span> -</span><span id="L-1640"><a href="#L-1640"><span class="linenos">1640</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-1641"><a href="#L-1641"><span class="linenos">1641</span></a><span class="sd"> """</span> -</span><span id="L-1642"><a href="#L-1642"><span class="linenos">1642</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-1643"><a href="#L-1643"><span class="linenos">1643</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="L-1644"><a href="#L-1644"><span class="linenos">1644</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1645"><a href="#L-1645"><span class="linenos">1645</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> -</span><span id="L-1646"><a href="#L-1646"><span class="linenos">1646</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1647"><a href="#L-1647"><span class="linenos">1647</span></a> <span class="p">)</span> -</span><span id="L-1648"><a href="#L-1648"><span class="linenos">1648</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-1649"><a href="#L-1649"><span class="linenos">1649</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="L-1650"><a href="#L-1650"><span class="linenos">1650</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1651"><a href="#L-1651"><span class="linenos">1651</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1652"><a href="#L-1652"><span class="linenos">1652</span></a> <span class="p">)</span> -</span><span id="L-1653"><a href="#L-1653"><span class="linenos">1653</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> -</span><span id="L-1654"><a href="#L-1654"><span class="linenos">1654</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> -</span><span id="L-1655"><a href="#L-1655"><span class="linenos">1655</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> -</span><span id="L-1656"><a href="#L-1656"><span class="linenos">1656</span></a> <span class="p">)</span> -</span><span id="L-1657"><a href="#L-1657"><span class="linenos">1657</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-1658"><a href="#L-1658"><span class="linenos">1658</span></a> <span class="n">cte</span><span class="p">,</span> -</span><span id="L-1659"><a href="#L-1659"><span class="linenos">1659</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1660"><a href="#L-1660"><span class="linenos">1660</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> -</span><span id="L-1661"><a href="#L-1661"><span class="linenos">1661</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1662"><a href="#L-1662"><span class="linenos">1662</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1663"><a href="#L-1663"><span class="linenos">1663</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> -</span><span id="L-1664"><a href="#L-1664"><span class="linenos">1664</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> -</span><span id="L-1665"><a href="#L-1665"><span class="linenos">1665</span></a> <span class="p">)</span> +</span><span id="L-1639"><a href="#L-1639"><span class="linenos">1639</span></a> <span class="nd">@property</span> +</span><span id="L-1640"><a href="#L-1640"><span class="linenos">1640</span></a> <span class="k">def</span> <span class="nf">ctes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1641"><a href="#L-1641"><span class="linenos">1641</span></a> <span class="n">with_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"with"</span><span class="p">)</span> +</span><span id="L-1642"><a href="#L-1642"><span class="linenos">1642</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">with_</span><span class="p">:</span> +</span><span id="L-1643"><a href="#L-1643"><span class="linenos">1643</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="L-1644"><a href="#L-1644"><span class="linenos">1644</span></a> <span class="k">return</span> <span class="n">with_</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-1645"><a href="#L-1645"><span class="linenos">1645</span></a> +</span><span id="L-1646"><a href="#L-1646"><span class="linenos">1646</span></a> <span class="nd">@property</span> +</span><span id="L-1647"><a href="#L-1647"><span class="linenos">1647</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1648"><a href="#L-1648"><span class="linenos">1648</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `selects`"</span><span class="p">)</span> +</span><span id="L-1649"><a href="#L-1649"><span class="linenos">1649</span></a> +</span><span id="L-1650"><a href="#L-1650"><span class="linenos">1650</span></a> <span class="nd">@property</span> +</span><span id="L-1651"><a href="#L-1651"><span class="linenos">1651</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1652"><a href="#L-1652"><span class="linenos">1652</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `named_selects`"</span><span class="p">)</span> +</span><span id="L-1653"><a href="#L-1653"><span class="linenos">1653</span></a> +</span><span id="L-1654"><a href="#L-1654"><span class="linenos">1654</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="L-1655"><a href="#L-1655"><span class="linenos">1655</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1656"><a href="#L-1656"><span class="linenos">1656</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="L-1657"><a href="#L-1657"><span class="linenos">1657</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="L-1658"><a href="#L-1658"><span class="linenos">1658</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-1659"><a href="#L-1659"><span class="linenos">1659</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-1660"><a href="#L-1660"><span class="linenos">1660</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-1661"><a href="#L-1661"><span class="linenos">1661</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-1662"><a href="#L-1662"><span class="linenos">1662</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1663"><a href="#L-1663"><span class="linenos">1663</span></a> <span class="p">):</span> +</span><span id="L-1664"><a href="#L-1664"><span class="linenos">1664</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1665"><a href="#L-1665"><span class="linenos">1665</span></a><span class="sd"> Append to or set the common table expressions.</span> </span><span id="L-1666"><a href="#L-1666"><span class="linenos">1666</span></a> -</span><span id="L-1667"><a href="#L-1667"><span class="linenos">1667</span></a> -</span><span id="L-1668"><a href="#L-1668"><span class="linenos">1668</span></a><span class="n">QUERY_MODIFIERS</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1669"><a href="#L-1669"><span class="linenos">1669</span></a> <span class="s2">"match"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1670"><a href="#L-1670"><span class="linenos">1670</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1671"><a href="#L-1671"><span class="linenos">1671</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1672"><a href="#L-1672"><span class="linenos">1672</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1673"><a href="#L-1673"><span class="linenos">1673</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1674"><a href="#L-1674"><span class="linenos">1674</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1675"><a href="#L-1675"><span class="linenos">1675</span></a> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1676"><a href="#L-1676"><span class="linenos">1676</span></a> <span class="s2">"qualify"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1677"><a href="#L-1677"><span class="linenos">1677</span></a> <span class="s2">"windows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1678"><a href="#L-1678"><span class="linenos">1678</span></a> <span class="s2">"distribute"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1679"><a href="#L-1679"><span class="linenos">1679</span></a> <span class="s2">"sort"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1680"><a href="#L-1680"><span class="linenos">1680</span></a> <span class="s2">"cluster"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1681"><a href="#L-1681"><span class="linenos">1681</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1682"><a href="#L-1682"><span class="linenos">1682</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1683"><a href="#L-1683"><span class="linenos">1683</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1684"><a href="#L-1684"><span class="linenos">1684</span></a> <span class="s2">"lock"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1685"><a href="#L-1685"><span class="linenos">1685</span></a><span class="p">}</span> -</span><span id="L-1686"><a href="#L-1686"><span class="linenos">1686</span></a> -</span><span id="L-1687"><a href="#L-1687"><span class="linenos">1687</span></a> -</span><span id="L-1688"><a href="#L-1688"><span class="linenos">1688</span></a><span class="k">class</span> <span class="nc">Table</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1689"><a href="#L-1689"><span class="linenos">1689</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1690"><a href="#L-1690"><span class="linenos">1690</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1691"><a href="#L-1691"><span class="linenos">1691</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1692"><a href="#L-1692"><span class="linenos">1692</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1693"><a href="#L-1693"><span class="linenos">1693</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1694"><a href="#L-1694"><span class="linenos">1694</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1695"><a href="#L-1695"><span class="linenos">1695</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1696"><a href="#L-1696"><span class="linenos">1696</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1697"><a href="#L-1697"><span class="linenos">1697</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1698"><a href="#L-1698"><span class="linenos">1698</span></a> <span class="s2">"system_time"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1699"><a href="#L-1699"><span class="linenos">1699</span></a> <span class="p">}</span> -</span><span id="L-1700"><a href="#L-1700"><span class="linenos">1700</span></a> -</span><span id="L-1701"><a href="#L-1701"><span class="linenos">1701</span></a> <span class="nd">@property</span> -</span><span id="L-1702"><a href="#L-1702"><span class="linenos">1702</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1703"><a href="#L-1703"><span class="linenos">1703</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> -</span><span id="L-1704"><a href="#L-1704"><span class="linenos">1704</span></a> -</span><span id="L-1705"><a href="#L-1705"><span class="linenos">1705</span></a> <span class="nd">@property</span> -</span><span id="L-1706"><a href="#L-1706"><span class="linenos">1706</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-1707"><a href="#L-1707"><span class="linenos">1707</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> -</span><span id="L-1708"><a href="#L-1708"><span class="linenos">1708</span></a> -</span><span id="L-1709"><a href="#L-1709"><span class="linenos">1709</span></a> -</span><span id="L-1710"><a href="#L-1710"><span class="linenos">1710</span></a><span class="c1"># See the TSQL "Querying data in a system-versioned temporal table" page</span> -</span><span id="L-1711"><a href="#L-1711"><span class="linenos">1711</span></a><span class="k">class</span> <span class="nc">SystemTime</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1712"><a href="#L-1712"><span class="linenos">1712</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1713"><a href="#L-1713"><span class="linenos">1713</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1714"><a href="#L-1714"><span class="linenos">1714</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1715"><a href="#L-1715"><span class="linenos">1715</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1716"><a href="#L-1716"><span class="linenos">1716</span></a> <span class="p">}</span> -</span><span id="L-1717"><a href="#L-1717"><span class="linenos">1717</span></a> -</span><span id="L-1718"><a href="#L-1718"><span class="linenos">1718</span></a> -</span><span id="L-1719"><a href="#L-1719"><span class="linenos">1719</span></a><span class="k">class</span> <span class="nc">Union</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> -</span><span id="L-1720"><a href="#L-1720"><span class="linenos">1720</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1721"><a href="#L-1721"><span class="linenos">1721</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1722"><a href="#L-1722"><span class="linenos">1722</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1723"><a href="#L-1723"><span class="linenos">1723</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1724"><a href="#L-1724"><span class="linenos">1724</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1725"><a href="#L-1725"><span class="linenos">1725</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-1726"><a href="#L-1726"><span class="linenos">1726</span></a> <span class="p">}</span> -</span><span id="L-1727"><a href="#L-1727"><span class="linenos">1727</span></a> -</span><span id="L-1728"><a href="#L-1728"><span class="linenos">1728</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1729"><a href="#L-1729"><span class="linenos">1729</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1730"><a href="#L-1730"><span class="linenos">1730</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="L-1667"><a href="#L-1667"><span class="linenos">1667</span></a><span class="sd"> Example:</span> +</span><span id="L-1668"><a href="#L-1668"><span class="linenos">1668</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="L-1669"><a href="#L-1669"><span class="linenos">1669</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="L-1670"><a href="#L-1670"><span class="linenos">1670</span></a> +</span><span id="L-1671"><a href="#L-1671"><span class="linenos">1671</span></a><span class="sd"> Args:</span> +</span><span id="L-1672"><a href="#L-1672"><span class="linenos">1672</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="L-1673"><a href="#L-1673"><span class="linenos">1673</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="L-1674"><a href="#L-1674"><span class="linenos">1674</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> +</span><span id="L-1675"><a href="#L-1675"><span class="linenos">1675</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1676"><a href="#L-1676"><span class="linenos">1676</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="L-1677"><a href="#L-1677"><span class="linenos">1677</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-1678"><a href="#L-1678"><span class="linenos">1678</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-1679"><a href="#L-1679"><span class="linenos">1679</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-1680"><a href="#L-1680"><span class="linenos">1680</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1681"><a href="#L-1681"><span class="linenos">1681</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1682"><a href="#L-1682"><span class="linenos">1682</span></a> +</span><span id="L-1683"><a href="#L-1683"><span class="linenos">1683</span></a><span class="sd"> Returns:</span> +</span><span id="L-1684"><a href="#L-1684"><span class="linenos">1684</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-1685"><a href="#L-1685"><span class="linenos">1685</span></a><span class="sd"> """</span> +</span><span id="L-1686"><a href="#L-1686"><span class="linenos">1686</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-1687"><a href="#L-1687"><span class="linenos">1687</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="L-1688"><a href="#L-1688"><span class="linenos">1688</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1689"><a href="#L-1689"><span class="linenos">1689</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> +</span><span id="L-1690"><a href="#L-1690"><span class="linenos">1690</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1691"><a href="#L-1691"><span class="linenos">1691</span></a> <span class="p">)</span> +</span><span id="L-1692"><a href="#L-1692"><span class="linenos">1692</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-1693"><a href="#L-1693"><span class="linenos">1693</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="L-1694"><a href="#L-1694"><span class="linenos">1694</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1695"><a href="#L-1695"><span class="linenos">1695</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1696"><a href="#L-1696"><span class="linenos">1696</span></a> <span class="p">)</span> +</span><span id="L-1697"><a href="#L-1697"><span class="linenos">1697</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> +</span><span id="L-1698"><a href="#L-1698"><span class="linenos">1698</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> +</span><span id="L-1699"><a href="#L-1699"><span class="linenos">1699</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> +</span><span id="L-1700"><a href="#L-1700"><span class="linenos">1700</span></a> <span class="p">)</span> +</span><span id="L-1701"><a href="#L-1701"><span class="linenos">1701</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-1702"><a href="#L-1702"><span class="linenos">1702</span></a> <span class="n">cte</span><span class="p">,</span> +</span><span id="L-1703"><a href="#L-1703"><span class="linenos">1703</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1704"><a href="#L-1704"><span class="linenos">1704</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> +</span><span id="L-1705"><a href="#L-1705"><span class="linenos">1705</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1706"><a href="#L-1706"><span class="linenos">1706</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1707"><a href="#L-1707"><span class="linenos">1707</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> +</span><span id="L-1708"><a href="#L-1708"><span class="linenos">1708</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> +</span><span id="L-1709"><a href="#L-1709"><span class="linenos">1709</span></a> <span class="p">)</span> +</span><span id="L-1710"><a href="#L-1710"><span class="linenos">1710</span></a> +</span><span id="L-1711"><a href="#L-1711"><span class="linenos">1711</span></a> +</span><span id="L-1712"><a href="#L-1712"><span class="linenos">1712</span></a><span class="n">QUERY_MODIFIERS</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1713"><a href="#L-1713"><span class="linenos">1713</span></a> <span class="s2">"match"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1714"><a href="#L-1714"><span class="linenos">1714</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1715"><a href="#L-1715"><span class="linenos">1715</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1716"><a href="#L-1716"><span class="linenos">1716</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1717"><a href="#L-1717"><span class="linenos">1717</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1718"><a href="#L-1718"><span class="linenos">1718</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1719"><a href="#L-1719"><span class="linenos">1719</span></a> <span class="s2">"having"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1720"><a href="#L-1720"><span class="linenos">1720</span></a> <span class="s2">"qualify"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1721"><a href="#L-1721"><span class="linenos">1721</span></a> <span class="s2">"windows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1722"><a href="#L-1722"><span class="linenos">1722</span></a> <span class="s2">"distribute"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1723"><a href="#L-1723"><span class="linenos">1723</span></a> <span class="s2">"sort"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1724"><a href="#L-1724"><span class="linenos">1724</span></a> <span class="s2">"cluster"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1725"><a href="#L-1725"><span class="linenos">1725</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1726"><a href="#L-1726"><span class="linenos">1726</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1727"><a href="#L-1727"><span class="linenos">1727</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1728"><a href="#L-1728"><span class="linenos">1728</span></a> <span class="s2">"lock"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1729"><a href="#L-1729"><span class="linenos">1729</span></a><span class="p">}</span> +</span><span id="L-1730"><a href="#L-1730"><span class="linenos">1730</span></a> </span><span id="L-1731"><a href="#L-1731"><span class="linenos">1731</span></a> -</span><span id="L-1732"><a href="#L-1732"><span class="linenos">1732</span></a><span class="sd"> Example:</span> -</span><span id="L-1733"><a href="#L-1733"><span class="linenos">1733</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="L-1734"><a href="#L-1734"><span class="linenos">1734</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="L-1735"><a href="#L-1735"><span class="linenos">1735</span></a> -</span><span id="L-1736"><a href="#L-1736"><span class="linenos">1736</span></a><span class="sd"> Args:</span> -</span><span id="L-1737"><a href="#L-1737"><span class="linenos">1737</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="L-1738"><a href="#L-1738"><span class="linenos">1738</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-1739"><a href="#L-1739"><span class="linenos">1739</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="L-1740"><a href="#L-1740"><span class="linenos">1740</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="L-1741"><a href="#L-1741"><span class="linenos">1741</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1742"><a href="#L-1742"><span class="linenos">1742</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1743"><a href="#L-1743"><span class="linenos">1743</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1732"><a href="#L-1732"><span class="linenos">1732</span></a><span class="k">class</span> <span class="nc">Table</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1733"><a href="#L-1733"><span class="linenos">1733</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1734"><a href="#L-1734"><span class="linenos">1734</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1735"><a href="#L-1735"><span class="linenos">1735</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1736"><a href="#L-1736"><span class="linenos">1736</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1737"><a href="#L-1737"><span class="linenos">1737</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1738"><a href="#L-1738"><span class="linenos">1738</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1739"><a href="#L-1739"><span class="linenos">1739</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1740"><a href="#L-1740"><span class="linenos">1740</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1741"><a href="#L-1741"><span class="linenos">1741</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1742"><a href="#L-1742"><span class="linenos">1742</span></a> <span class="s2">"system_time"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1743"><a href="#L-1743"><span class="linenos">1743</span></a> <span class="p">}</span> </span><span id="L-1744"><a href="#L-1744"><span class="linenos">1744</span></a> -</span><span id="L-1745"><a href="#L-1745"><span class="linenos">1745</span></a><span class="sd"> Returns:</span> -</span><span id="L-1746"><a href="#L-1746"><span class="linenos">1746</span></a><span class="sd"> Select: The limited subqueryable.</span> -</span><span id="L-1747"><a href="#L-1747"><span class="linenos">1747</span></a><span class="sd"> """</span> -</span><span id="L-1748"><a href="#L-1748"><span class="linenos">1748</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="L-1749"><a href="#L-1749"><span class="linenos">1749</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="L-1750"><a href="#L-1750"><span class="linenos">1750</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> -</span><span id="L-1751"><a href="#L-1751"><span class="linenos">1751</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-1752"><a href="#L-1752"><span class="linenos">1752</span></a> <span class="p">)</span> +</span><span id="L-1745"><a href="#L-1745"><span class="linenos">1745</span></a> <span class="nd">@property</span> +</span><span id="L-1746"><a href="#L-1746"><span class="linenos">1746</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1747"><a href="#L-1747"><span class="linenos">1747</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> +</span><span id="L-1748"><a href="#L-1748"><span class="linenos">1748</span></a> +</span><span id="L-1749"><a href="#L-1749"><span class="linenos">1749</span></a> <span class="nd">@property</span> +</span><span id="L-1750"><a href="#L-1750"><span class="linenos">1750</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-1751"><a href="#L-1751"><span class="linenos">1751</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> +</span><span id="L-1752"><a href="#L-1752"><span class="linenos">1752</span></a> </span><span id="L-1753"><a href="#L-1753"><span class="linenos">1753</span></a> -</span><span id="L-1754"><a href="#L-1754"><span class="linenos">1754</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="L-1755"><a href="#L-1755"><span class="linenos">1755</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-1756"><a href="#L-1756"><span class="linenos">1756</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="L-1757"><a href="#L-1757"><span class="linenos">1757</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1758"><a href="#L-1758"><span class="linenos">1758</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-1759"><a href="#L-1759"><span class="linenos">1759</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1760"><a href="#L-1760"><span class="linenos">1760</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1761"><a href="#L-1761"><span class="linenos">1761</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="L-1762"><a href="#L-1762"><span class="linenos">1762</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> -</span><span id="L-1763"><a href="#L-1763"><span class="linenos">1763</span></a> -</span><span id="L-1764"><a href="#L-1764"><span class="linenos">1764</span></a><span class="sd"> Example:</span> -</span><span id="L-1765"><a href="#L-1765"><span class="linenos">1765</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-1766"><a href="#L-1766"><span class="linenos">1766</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> -</span><span id="L-1767"><a href="#L-1767"><span class="linenos">1767</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> -</span><span id="L-1768"><a href="#L-1768"><span class="linenos">1768</span></a> -</span><span id="L-1769"><a href="#L-1769"><span class="linenos">1769</span></a><span class="sd"> Args:</span> -</span><span id="L-1770"><a href="#L-1770"><span class="linenos">1770</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-1771"><a href="#L-1771"><span class="linenos">1771</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-1772"><a href="#L-1772"><span class="linenos">1772</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-1773"><a href="#L-1773"><span class="linenos">1773</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-1774"><a href="#L-1774"><span class="linenos">1774</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-1775"><a href="#L-1775"><span class="linenos">1775</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-1776"><a href="#L-1776"><span class="linenos">1776</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-1777"><a href="#L-1777"><span class="linenos">1777</span></a> -</span><span id="L-1778"><a href="#L-1778"><span class="linenos">1778</span></a><span class="sd"> Returns:</span> -</span><span id="L-1779"><a href="#L-1779"><span class="linenos">1779</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="L-1780"><a href="#L-1780"><span class="linenos">1780</span></a><span class="sd"> """</span> -</span><span id="L-1781"><a href="#L-1781"><span class="linenos">1781</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="L-1782"><a href="#L-1782"><span class="linenos">1782</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-1783"><a href="#L-1783"><span class="linenos">1783</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> -</span><span id="L-1784"><a href="#L-1784"><span class="linenos">1784</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="L-1785"><a href="#L-1785"><span class="linenos">1785</span></a> <span class="p">)</span> -</span><span id="L-1786"><a href="#L-1786"><span class="linenos">1786</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="L-1787"><a href="#L-1787"><span class="linenos">1787</span></a> -</span><span id="L-1788"><a href="#L-1788"><span class="linenos">1788</span></a> <span class="nd">@property</span> -</span><span id="L-1789"><a href="#L-1789"><span class="linenos">1789</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1790"><a href="#L-1790"><span class="linenos">1790</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">named_selects</span> -</span><span id="L-1791"><a href="#L-1791"><span class="linenos">1791</span></a> -</span><span id="L-1792"><a href="#L-1792"><span class="linenos">1792</span></a> <span class="nd">@property</span> -</span><span id="L-1793"><a href="#L-1793"><span class="linenos">1793</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1794"><a href="#L-1794"><span class="linenos">1794</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">selects</span> -</span><span id="L-1795"><a href="#L-1795"><span class="linenos">1795</span></a> -</span><span id="L-1796"><a href="#L-1796"><span class="linenos">1796</span></a> <span class="nd">@property</span> -</span><span id="L-1797"><a href="#L-1797"><span class="linenos">1797</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1798"><a href="#L-1798"><span class="linenos">1798</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-1799"><a href="#L-1799"><span class="linenos">1799</span></a> -</span><span id="L-1800"><a href="#L-1800"><span class="linenos">1800</span></a> <span class="nd">@property</span> -</span><span id="L-1801"><a href="#L-1801"><span class="linenos">1801</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-1802"><a href="#L-1802"><span class="linenos">1802</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> -</span><span id="L-1803"><a href="#L-1803"><span class="linenos">1803</span></a> -</span><span id="L-1804"><a href="#L-1804"><span class="linenos">1804</span></a> -</span><span id="L-1805"><a href="#L-1805"><span class="linenos">1805</span></a><span class="k">class</span> <span class="nc">Except</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> -</span><span id="L-1806"><a href="#L-1806"><span class="linenos">1806</span></a> <span class="k">pass</span> +</span><span id="L-1754"><a href="#L-1754"><span class="linenos">1754</span></a><span class="c1"># See the TSQL "Querying data in a system-versioned temporal table" page</span> +</span><span id="L-1755"><a href="#L-1755"><span class="linenos">1755</span></a><span class="k">class</span> <span class="nc">SystemTime</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1756"><a href="#L-1756"><span class="linenos">1756</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1757"><a href="#L-1757"><span class="linenos">1757</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1758"><a href="#L-1758"><span class="linenos">1758</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1759"><a href="#L-1759"><span class="linenos">1759</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1760"><a href="#L-1760"><span class="linenos">1760</span></a> <span class="p">}</span> +</span><span id="L-1761"><a href="#L-1761"><span class="linenos">1761</span></a> +</span><span id="L-1762"><a href="#L-1762"><span class="linenos">1762</span></a> +</span><span id="L-1763"><a href="#L-1763"><span class="linenos">1763</span></a><span class="k">class</span> <span class="nc">Union</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> +</span><span id="L-1764"><a href="#L-1764"><span class="linenos">1764</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1765"><a href="#L-1765"><span class="linenos">1765</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1766"><a href="#L-1766"><span class="linenos">1766</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1767"><a href="#L-1767"><span class="linenos">1767</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1768"><a href="#L-1768"><span class="linenos">1768</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1769"><a href="#L-1769"><span class="linenos">1769</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-1770"><a href="#L-1770"><span class="linenos">1770</span></a> <span class="p">}</span> +</span><span id="L-1771"><a href="#L-1771"><span class="linenos">1771</span></a> +</span><span id="L-1772"><a href="#L-1772"><span class="linenos">1772</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-1773"><a href="#L-1773"><span class="linenos">1773</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1774"><a href="#L-1774"><span class="linenos">1774</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="L-1775"><a href="#L-1775"><span class="linenos">1775</span></a> +</span><span id="L-1776"><a href="#L-1776"><span class="linenos">1776</span></a><span class="sd"> Example:</span> +</span><span id="L-1777"><a href="#L-1777"><span class="linenos">1777</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="L-1778"><a href="#L-1778"><span class="linenos">1778</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> +</span><span id="L-1779"><a href="#L-1779"><span class="linenos">1779</span></a> +</span><span id="L-1780"><a href="#L-1780"><span class="linenos">1780</span></a><span class="sd"> Args:</span> +</span><span id="L-1781"><a href="#L-1781"><span class="linenos">1781</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="L-1782"><a href="#L-1782"><span class="linenos">1782</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-1783"><a href="#L-1783"><span class="linenos">1783</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="L-1784"><a href="#L-1784"><span class="linenos">1784</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="L-1785"><a href="#L-1785"><span class="linenos">1785</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-1786"><a href="#L-1786"><span class="linenos">1786</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1787"><a href="#L-1787"><span class="linenos">1787</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1788"><a href="#L-1788"><span class="linenos">1788</span></a> +</span><span id="L-1789"><a href="#L-1789"><span class="linenos">1789</span></a><span class="sd"> Returns:</span> +</span><span id="L-1790"><a href="#L-1790"><span class="linenos">1790</span></a><span class="sd"> Select: The limited subqueryable.</span> +</span><span id="L-1791"><a href="#L-1791"><span class="linenos">1791</span></a><span class="sd"> """</span> +</span><span id="L-1792"><a href="#L-1792"><span class="linenos">1792</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="L-1793"><a href="#L-1793"><span class="linenos">1793</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="L-1794"><a href="#L-1794"><span class="linenos">1794</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> +</span><span id="L-1795"><a href="#L-1795"><span class="linenos">1795</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-1796"><a href="#L-1796"><span class="linenos">1796</span></a> <span class="p">)</span> +</span><span id="L-1797"><a href="#L-1797"><span class="linenos">1797</span></a> +</span><span id="L-1798"><a href="#L-1798"><span class="linenos">1798</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="L-1799"><a href="#L-1799"><span class="linenos">1799</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-1800"><a href="#L-1800"><span class="linenos">1800</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="L-1801"><a href="#L-1801"><span class="linenos">1801</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1802"><a href="#L-1802"><span class="linenos">1802</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-1803"><a href="#L-1803"><span class="linenos">1803</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1804"><a href="#L-1804"><span class="linenos">1804</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1805"><a href="#L-1805"><span class="linenos">1805</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="L-1806"><a href="#L-1806"><span class="linenos">1806</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> </span><span id="L-1807"><a href="#L-1807"><span class="linenos">1807</span></a> -</span><span id="L-1808"><a href="#L-1808"><span class="linenos">1808</span></a> -</span><span id="L-1809"><a href="#L-1809"><span class="linenos">1809</span></a><span class="k">class</span> <span class="nc">Intersect</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> -</span><span id="L-1810"><a href="#L-1810"><span class="linenos">1810</span></a> <span class="k">pass</span> -</span><span id="L-1811"><a href="#L-1811"><span class="linenos">1811</span></a> +</span><span id="L-1808"><a href="#L-1808"><span class="linenos">1808</span></a><span class="sd"> Example:</span> +</span><span id="L-1809"><a href="#L-1809"><span class="linenos">1809</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-1810"><a href="#L-1810"><span class="linenos">1810</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> +</span><span id="L-1811"><a href="#L-1811"><span class="linenos">1811</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> </span><span id="L-1812"><a href="#L-1812"><span class="linenos">1812</span></a> -</span><span id="L-1813"><a href="#L-1813"><span class="linenos">1813</span></a><span class="k">class</span> <span class="nc">Unnest</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="L-1814"><a href="#L-1814"><span class="linenos">1814</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1815"><a href="#L-1815"><span class="linenos">1815</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1816"><a href="#L-1816"><span class="linenos">1816</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1817"><a href="#L-1817"><span class="linenos">1817</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1818"><a href="#L-1818"><span class="linenos">1818</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1819"><a href="#L-1819"><span class="linenos">1819</span></a> <span class="p">}</span> -</span><span id="L-1820"><a href="#L-1820"><span class="linenos">1820</span></a> +</span><span id="L-1813"><a href="#L-1813"><span class="linenos">1813</span></a><span class="sd"> Args:</span> +</span><span id="L-1814"><a href="#L-1814"><span class="linenos">1814</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-1815"><a href="#L-1815"><span class="linenos">1815</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-1816"><a href="#L-1816"><span class="linenos">1816</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-1817"><a href="#L-1817"><span class="linenos">1817</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-1818"><a href="#L-1818"><span class="linenos">1818</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-1819"><a href="#L-1819"><span class="linenos">1819</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-1820"><a href="#L-1820"><span class="linenos">1820</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> </span><span id="L-1821"><a href="#L-1821"><span class="linenos">1821</span></a> -</span><span id="L-1822"><a href="#L-1822"><span class="linenos">1822</span></a><span class="k">class</span> <span class="nc">Update</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1823"><a href="#L-1823"><span class="linenos">1823</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1824"><a href="#L-1824"><span class="linenos">1824</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1825"><a href="#L-1825"><span class="linenos">1825</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1826"><a href="#L-1826"><span class="linenos">1826</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1827"><a href="#L-1827"><span class="linenos">1827</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1828"><a href="#L-1828"><span class="linenos">1828</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1829"><a href="#L-1829"><span class="linenos">1829</span></a> <span class="p">}</span> -</span><span id="L-1830"><a href="#L-1830"><span class="linenos">1830</span></a> +</span><span id="L-1822"><a href="#L-1822"><span class="linenos">1822</span></a><span class="sd"> Returns:</span> +</span><span id="L-1823"><a href="#L-1823"><span class="linenos">1823</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="L-1824"><a href="#L-1824"><span class="linenos">1824</span></a><span class="sd"> """</span> +</span><span id="L-1825"><a href="#L-1825"><span class="linenos">1825</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="L-1826"><a href="#L-1826"><span class="linenos">1826</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-1827"><a href="#L-1827"><span class="linenos">1827</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> +</span><span id="L-1828"><a href="#L-1828"><span class="linenos">1828</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="L-1829"><a href="#L-1829"><span class="linenos">1829</span></a> <span class="p">)</span> +</span><span id="L-1830"><a href="#L-1830"><span class="linenos">1830</span></a> <span class="k">return</span> <span class="n">this</span> </span><span id="L-1831"><a href="#L-1831"><span class="linenos">1831</span></a> -</span><span id="L-1832"><a href="#L-1832"><span class="linenos">1832</span></a><span class="k">class</span> <span class="nc">Values</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="L-1833"><a href="#L-1833"><span class="linenos">1833</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1834"><a href="#L-1834"><span class="linenos">1834</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-1835"><a href="#L-1835"><span class="linenos">1835</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1836"><a href="#L-1836"><span class="linenos">1836</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1837"><a href="#L-1837"><span class="linenos">1837</span></a> <span class="p">}</span> -</span><span id="L-1838"><a href="#L-1838"><span class="linenos">1838</span></a> +</span><span id="L-1832"><a href="#L-1832"><span class="linenos">1832</span></a> <span class="nd">@property</span> +</span><span id="L-1833"><a href="#L-1833"><span class="linenos">1833</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1834"><a href="#L-1834"><span class="linenos">1834</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">named_selects</span> +</span><span id="L-1835"><a href="#L-1835"><span class="linenos">1835</span></a> +</span><span id="L-1836"><a href="#L-1836"><span class="linenos">1836</span></a> <span class="nd">@property</span> +</span><span id="L-1837"><a href="#L-1837"><span class="linenos">1837</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-1838"><a href="#L-1838"><span class="linenos">1838</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">is_star</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">is_star</span> </span><span id="L-1839"><a href="#L-1839"><span class="linenos">1839</span></a> -</span><span id="L-1840"><a href="#L-1840"><span class="linenos">1840</span></a><span class="k">class</span> <span class="nc">Var</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1841"><a href="#L-1841"><span class="linenos">1841</span></a> <span class="k">pass</span> -</span><span id="L-1842"><a href="#L-1842"><span class="linenos">1842</span></a> +</span><span id="L-1840"><a href="#L-1840"><span class="linenos">1840</span></a> <span class="nd">@property</span> +</span><span id="L-1841"><a href="#L-1841"><span class="linenos">1841</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1842"><a href="#L-1842"><span class="linenos">1842</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">selects</span> </span><span id="L-1843"><a href="#L-1843"><span class="linenos">1843</span></a> -</span><span id="L-1844"><a href="#L-1844"><span class="linenos">1844</span></a><span class="k">class</span> <span class="nc">Schema</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1845"><a href="#L-1845"><span class="linenos">1845</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-1846"><a href="#L-1846"><span class="linenos">1846</span></a> +</span><span id="L-1844"><a href="#L-1844"><span class="linenos">1844</span></a> <span class="nd">@property</span> +</span><span id="L-1845"><a href="#L-1845"><span class="linenos">1845</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1846"><a href="#L-1846"><span class="linenos">1846</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> </span><span id="L-1847"><a href="#L-1847"><span class="linenos">1847</span></a> -</span><span id="L-1848"><a href="#L-1848"><span class="linenos">1848</span></a><span class="c1"># Used to represent the FOR UPDATE and FOR SHARE locking read types.</span> -</span><span id="L-1849"><a href="#L-1849"><span class="linenos">1849</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/innodb-locking-reads.html</span> -</span><span id="L-1850"><a href="#L-1850"><span class="linenos">1850</span></a><span class="k">class</span> <span class="nc">Lock</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-1851"><a href="#L-1851"><span class="linenos">1851</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"update"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1848"><a href="#L-1848"><span class="linenos">1848</span></a> <span class="nd">@property</span> +</span><span id="L-1849"><a href="#L-1849"><span class="linenos">1849</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-1850"><a href="#L-1850"><span class="linenos">1850</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> +</span><span id="L-1851"><a href="#L-1851"><span class="linenos">1851</span></a> </span><span id="L-1852"><a href="#L-1852"><span class="linenos">1852</span></a> -</span><span id="L-1853"><a href="#L-1853"><span class="linenos">1853</span></a> -</span><span id="L-1854"><a href="#L-1854"><span class="linenos">1854</span></a><span class="k">class</span> <span class="nc">Select</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> -</span><span id="L-1855"><a href="#L-1855"><span class="linenos">1855</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-1856"><a href="#L-1856"><span class="linenos">1856</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1857"><a href="#L-1857"><span class="linenos">1857</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1858"><a href="#L-1858"><span class="linenos">1858</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1859"><a href="#L-1859"><span class="linenos">1859</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1860"><a href="#L-1860"><span class="linenos">1860</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1861"><a href="#L-1861"><span class="linenos">1861</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-1862"><a href="#L-1862"><span class="linenos">1862</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-1863"><a href="#L-1863"><span class="linenos">1863</span></a> <span class="p">}</span> -</span><span id="L-1864"><a href="#L-1864"><span class="linenos">1864</span></a> -</span><span id="L-1865"><a href="#L-1865"><span class="linenos">1865</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1866"><a href="#L-1866"><span class="linenos">1866</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1867"><a href="#L-1867"><span class="linenos">1867</span></a><span class="sd"> Set the FROM expression.</span> +</span><span id="L-1853"><a href="#L-1853"><span class="linenos">1853</span></a><span class="k">class</span> <span class="nc">Except</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> +</span><span id="L-1854"><a href="#L-1854"><span class="linenos">1854</span></a> <span class="k">pass</span> +</span><span id="L-1855"><a href="#L-1855"><span class="linenos">1855</span></a> +</span><span id="L-1856"><a href="#L-1856"><span class="linenos">1856</span></a> +</span><span id="L-1857"><a href="#L-1857"><span class="linenos">1857</span></a><span class="k">class</span> <span class="nc">Intersect</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> +</span><span id="L-1858"><a href="#L-1858"><span class="linenos">1858</span></a> <span class="k">pass</span> +</span><span id="L-1859"><a href="#L-1859"><span class="linenos">1859</span></a> +</span><span id="L-1860"><a href="#L-1860"><span class="linenos">1860</span></a> +</span><span id="L-1861"><a href="#L-1861"><span class="linenos">1861</span></a><span class="k">class</span> <span class="nc">Unnest</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="L-1862"><a href="#L-1862"><span class="linenos">1862</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1863"><a href="#L-1863"><span class="linenos">1863</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1864"><a href="#L-1864"><span class="linenos">1864</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1865"><a href="#L-1865"><span class="linenos">1865</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1866"><a href="#L-1866"><span class="linenos">1866</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1867"><a href="#L-1867"><span class="linenos">1867</span></a> <span class="p">}</span> </span><span id="L-1868"><a href="#L-1868"><span class="linenos">1868</span></a> -</span><span id="L-1869"><a href="#L-1869"><span class="linenos">1869</span></a><span class="sd"> Example:</span> -</span><span id="L-1870"><a href="#L-1870"><span class="linenos">1870</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="L-1871"><a href="#L-1871"><span class="linenos">1871</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="L-1872"><a href="#L-1872"><span class="linenos">1872</span></a> -</span><span id="L-1873"><a href="#L-1873"><span class="linenos">1873</span></a><span class="sd"> Args:</span> -</span><span id="L-1874"><a href="#L-1874"><span class="linenos">1874</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1875"><a href="#L-1875"><span class="linenos">1875</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="L-1876"><a href="#L-1876"><span class="linenos">1876</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="L-1877"><a href="#L-1877"><span class="linenos">1877</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-1878"><a href="#L-1878"><span class="linenos">1878</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> -</span><span id="L-1879"><a href="#L-1879"><span class="linenos">1879</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1880"><a href="#L-1880"><span class="linenos">1880</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1881"><a href="#L-1881"><span class="linenos">1881</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-1882"><a href="#L-1882"><span class="linenos">1882</span></a> -</span><span id="L-1883"><a href="#L-1883"><span class="linenos">1883</span></a><span class="sd"> Returns:</span> -</span><span id="L-1884"><a href="#L-1884"><span class="linenos">1884</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-1885"><a href="#L-1885"><span class="linenos">1885</span></a><span class="sd"> """</span> -</span><span id="L-1886"><a href="#L-1886"><span class="linenos">1886</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-1887"><a href="#L-1887"><span class="linenos">1887</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1888"><a href="#L-1888"><span class="linenos">1888</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1889"><a href="#L-1889"><span class="linenos">1889</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> -</span><span id="L-1890"><a href="#L-1890"><span class="linenos">1890</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1891"><a href="#L-1891"><span class="linenos">1891</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1892"><a href="#L-1892"><span class="linenos">1892</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> -</span><span id="L-1893"><a href="#L-1893"><span class="linenos">1893</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> -</span><span id="L-1894"><a href="#L-1894"><span class="linenos">1894</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1895"><a href="#L-1895"><span class="linenos">1895</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1896"><a href="#L-1896"><span class="linenos">1896</span></a> <span class="p">)</span> -</span><span id="L-1897"><a href="#L-1897"><span class="linenos">1897</span></a> -</span><span id="L-1898"><a href="#L-1898"><span class="linenos">1898</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1899"><a href="#L-1899"><span class="linenos">1899</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1900"><a href="#L-1900"><span class="linenos">1900</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="L-1869"><a href="#L-1869"><span class="linenos">1869</span></a> +</span><span id="L-1870"><a href="#L-1870"><span class="linenos">1870</span></a><span class="k">class</span> <span class="nc">Update</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1871"><a href="#L-1871"><span class="linenos">1871</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1872"><a href="#L-1872"><span class="linenos">1872</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1873"><a href="#L-1873"><span class="linenos">1873</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1874"><a href="#L-1874"><span class="linenos">1874</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1875"><a href="#L-1875"><span class="linenos">1875</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1876"><a href="#L-1876"><span class="linenos">1876</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1877"><a href="#L-1877"><span class="linenos">1877</span></a> <span class="p">}</span> +</span><span id="L-1878"><a href="#L-1878"><span class="linenos">1878</span></a> +</span><span id="L-1879"><a href="#L-1879"><span class="linenos">1879</span></a> +</span><span id="L-1880"><a href="#L-1880"><span class="linenos">1880</span></a><span class="k">class</span> <span class="nc">Values</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="L-1881"><a href="#L-1881"><span class="linenos">1881</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1882"><a href="#L-1882"><span class="linenos">1882</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-1883"><a href="#L-1883"><span class="linenos">1883</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1884"><a href="#L-1884"><span class="linenos">1884</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1885"><a href="#L-1885"><span class="linenos">1885</span></a> <span class="p">}</span> +</span><span id="L-1886"><a href="#L-1886"><span class="linenos">1886</span></a> +</span><span id="L-1887"><a href="#L-1887"><span class="linenos">1887</span></a> +</span><span id="L-1888"><a href="#L-1888"><span class="linenos">1888</span></a><span class="k">class</span> <span class="nc">Var</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1889"><a href="#L-1889"><span class="linenos">1889</span></a> <span class="k">pass</span> +</span><span id="L-1890"><a href="#L-1890"><span class="linenos">1890</span></a> +</span><span id="L-1891"><a href="#L-1891"><span class="linenos">1891</span></a> +</span><span id="L-1892"><a href="#L-1892"><span class="linenos">1892</span></a><span class="k">class</span> <span class="nc">Schema</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1893"><a href="#L-1893"><span class="linenos">1893</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-1894"><a href="#L-1894"><span class="linenos">1894</span></a> +</span><span id="L-1895"><a href="#L-1895"><span class="linenos">1895</span></a> +</span><span id="L-1896"><a href="#L-1896"><span class="linenos">1896</span></a><span class="c1"># Used to represent the FOR UPDATE and FOR SHARE locking read types.</span> +</span><span id="L-1897"><a href="#L-1897"><span class="linenos">1897</span></a><span class="c1"># https://dev.mysql.com/doc/refman/8.0/en/innodb-locking-reads.html</span> +</span><span id="L-1898"><a href="#L-1898"><span class="linenos">1898</span></a><span class="k">class</span> <span class="nc">Lock</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-1899"><a href="#L-1899"><span class="linenos">1899</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"update"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-1900"><a href="#L-1900"><span class="linenos">1900</span></a> </span><span id="L-1901"><a href="#L-1901"><span class="linenos">1901</span></a> -</span><span id="L-1902"><a href="#L-1902"><span class="linenos">1902</span></a><span class="sd"> Example:</span> -</span><span id="L-1903"><a href="#L-1903"><span class="linenos">1903</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="L-1904"><a href="#L-1904"><span class="linenos">1904</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="L-1905"><a href="#L-1905"><span class="linenos">1905</span></a> -</span><span id="L-1906"><a href="#L-1906"><span class="linenos">1906</span></a><span class="sd"> Args:</span> -</span><span id="L-1907"><a href="#L-1907"><span class="linenos">1907</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1908"><a href="#L-1908"><span class="linenos">1908</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-1909"><a href="#L-1909"><span class="linenos">1909</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> -</span><span id="L-1910"><a href="#L-1910"><span class="linenos">1910</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> -</span><span id="L-1911"><a href="#L-1911"><span class="linenos">1911</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-1912"><a href="#L-1912"><span class="linenos">1912</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="L-1913"><a href="#L-1913"><span class="linenos">1913</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1914"><a href="#L-1914"><span class="linenos">1914</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1915"><a href="#L-1915"><span class="linenos">1915</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1902"><a href="#L-1902"><span class="linenos">1902</span></a><span class="k">class</span> <span class="nc">Select</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> +</span><span id="L-1903"><a href="#L-1903"><span class="linenos">1903</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-1904"><a href="#L-1904"><span class="linenos">1904</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1905"><a href="#L-1905"><span class="linenos">1905</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1906"><a href="#L-1906"><span class="linenos">1906</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1907"><a href="#L-1907"><span class="linenos">1907</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1908"><a href="#L-1908"><span class="linenos">1908</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1909"><a href="#L-1909"><span class="linenos">1909</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-1910"><a href="#L-1910"><span class="linenos">1910</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-1911"><a href="#L-1911"><span class="linenos">1911</span></a> <span class="p">}</span> +</span><span id="L-1912"><a href="#L-1912"><span class="linenos">1912</span></a> +</span><span id="L-1913"><a href="#L-1913"><span class="linenos">1913</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-1914"><a href="#L-1914"><span class="linenos">1914</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1915"><a href="#L-1915"><span class="linenos">1915</span></a><span class="sd"> Set the FROM expression.</span> </span><span id="L-1916"><a href="#L-1916"><span class="linenos">1916</span></a> -</span><span id="L-1917"><a href="#L-1917"><span class="linenos">1917</span></a><span class="sd"> Returns:</span> -</span><span id="L-1918"><a href="#L-1918"><span class="linenos">1918</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-1919"><a href="#L-1919"><span class="linenos">1919</span></a><span class="sd"> """</span> -</span><span id="L-1920"><a href="#L-1920"><span class="linenos">1920</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> -</span><span id="L-1921"><a href="#L-1921"><span class="linenos">1921</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="L-1922"><a href="#L-1922"><span class="linenos">1922</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-1923"><a href="#L-1923"><span class="linenos">1923</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1924"><a href="#L-1924"><span class="linenos">1924</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1925"><a href="#L-1925"><span class="linenos">1925</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> -</span><span id="L-1926"><a href="#L-1926"><span class="linenos">1926</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1927"><a href="#L-1927"><span class="linenos">1927</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1928"><a href="#L-1928"><span class="linenos">1928</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> -</span><span id="L-1929"><a href="#L-1929"><span class="linenos">1929</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> -</span><span id="L-1930"><a href="#L-1930"><span class="linenos">1930</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1931"><a href="#L-1931"><span class="linenos">1931</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1932"><a href="#L-1932"><span class="linenos">1932</span></a> <span class="p">)</span> -</span><span id="L-1933"><a href="#L-1933"><span class="linenos">1933</span></a> -</span><span id="L-1934"><a href="#L-1934"><span class="linenos">1934</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1935"><a href="#L-1935"><span class="linenos">1935</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1936"><a href="#L-1936"><span class="linenos">1936</span></a><span class="sd"> Set the ORDER BY expression.</span> -</span><span id="L-1937"><a href="#L-1937"><span class="linenos">1937</span></a> -</span><span id="L-1938"><a href="#L-1938"><span class="linenos">1938</span></a><span class="sd"> Example:</span> -</span><span id="L-1939"><a href="#L-1939"><span class="linenos">1939</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="L-1940"><a href="#L-1940"><span class="linenos">1940</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="L-1941"><a href="#L-1941"><span class="linenos">1941</span></a> -</span><span id="L-1942"><a href="#L-1942"><span class="linenos">1942</span></a><span class="sd"> Args:</span> -</span><span id="L-1943"><a href="#L-1943"><span class="linenos">1943</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1944"><a href="#L-1944"><span class="linenos">1944</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-1945"><a href="#L-1945"><span class="linenos">1945</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> -</span><span id="L-1946"><a href="#L-1946"><span class="linenos">1946</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-1947"><a href="#L-1947"><span class="linenos">1947</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-1948"><a href="#L-1948"><span class="linenos">1948</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1949"><a href="#L-1949"><span class="linenos">1949</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1950"><a href="#L-1950"><span class="linenos">1950</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-1951"><a href="#L-1951"><span class="linenos">1951</span></a> -</span><span id="L-1952"><a href="#L-1952"><span class="linenos">1952</span></a><span class="sd"> Returns:</span> -</span><span id="L-1953"><a href="#L-1953"><span class="linenos">1953</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-1954"><a href="#L-1954"><span class="linenos">1954</span></a><span class="sd"> """</span> -</span><span id="L-1955"><a href="#L-1955"><span class="linenos">1955</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-1956"><a href="#L-1956"><span class="linenos">1956</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1957"><a href="#L-1957"><span class="linenos">1957</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1958"><a href="#L-1958"><span class="linenos">1958</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> -</span><span id="L-1959"><a href="#L-1959"><span class="linenos">1959</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1960"><a href="#L-1960"><span class="linenos">1960</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1961"><a href="#L-1961"><span class="linenos">1961</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> -</span><span id="L-1962"><a href="#L-1962"><span class="linenos">1962</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> -</span><span id="L-1963"><a href="#L-1963"><span class="linenos">1963</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1964"><a href="#L-1964"><span class="linenos">1964</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1965"><a href="#L-1965"><span class="linenos">1965</span></a> <span class="p">)</span> -</span><span id="L-1966"><a href="#L-1966"><span class="linenos">1966</span></a> -</span><span id="L-1967"><a href="#L-1967"><span class="linenos">1967</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-1968"><a href="#L-1968"><span class="linenos">1968</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-1969"><a href="#L-1969"><span class="linenos">1969</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="L-1970"><a href="#L-1970"><span class="linenos">1970</span></a> -</span><span id="L-1971"><a href="#L-1971"><span class="linenos">1971</span></a><span class="sd"> Example:</span> -</span><span id="L-1972"><a href="#L-1972"><span class="linenos">1972</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> -</span><span id="L-1973"><a href="#L-1973"><span class="linenos">1973</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="L-1974"><a href="#L-1974"><span class="linenos">1974</span></a> -</span><span id="L-1975"><a href="#L-1975"><span class="linenos">1975</span></a><span class="sd"> Args:</span> -</span><span id="L-1976"><a href="#L-1976"><span class="linenos">1976</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-1977"><a href="#L-1977"><span class="linenos">1977</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-1978"><a href="#L-1978"><span class="linenos">1978</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> -</span><span id="L-1979"><a href="#L-1979"><span class="linenos">1979</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-1980"><a href="#L-1980"><span class="linenos">1980</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-1981"><a href="#L-1981"><span class="linenos">1981</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-1982"><a href="#L-1982"><span class="linenos">1982</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-1983"><a href="#L-1983"><span class="linenos">1983</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-1984"><a href="#L-1984"><span class="linenos">1984</span></a> -</span><span id="L-1985"><a href="#L-1985"><span class="linenos">1985</span></a><span class="sd"> Returns:</span> -</span><span id="L-1986"><a href="#L-1986"><span class="linenos">1986</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-1987"><a href="#L-1987"><span class="linenos">1987</span></a><span class="sd"> """</span> -</span><span id="L-1988"><a href="#L-1988"><span class="linenos">1988</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-1989"><a href="#L-1989"><span class="linenos">1989</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-1990"><a href="#L-1990"><span class="linenos">1990</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-1991"><a href="#L-1991"><span class="linenos">1991</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> -</span><span id="L-1992"><a href="#L-1992"><span class="linenos">1992</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-1993"><a href="#L-1993"><span class="linenos">1993</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-1994"><a href="#L-1994"><span class="linenos">1994</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> -</span><span id="L-1995"><a href="#L-1995"><span class="linenos">1995</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> -</span><span id="L-1996"><a href="#L-1996"><span class="linenos">1996</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-1997"><a href="#L-1997"><span class="linenos">1997</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-1998"><a href="#L-1998"><span class="linenos">1998</span></a> <span class="p">)</span> +</span><span id="L-1917"><a href="#L-1917"><span class="linenos">1917</span></a><span class="sd"> Example:</span> +</span><span id="L-1918"><a href="#L-1918"><span class="linenos">1918</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="L-1919"><a href="#L-1919"><span class="linenos">1919</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="L-1920"><a href="#L-1920"><span class="linenos">1920</span></a> +</span><span id="L-1921"><a href="#L-1921"><span class="linenos">1921</span></a><span class="sd"> Args:</span> +</span><span id="L-1922"><a href="#L-1922"><span class="linenos">1922</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-1923"><a href="#L-1923"><span class="linenos">1923</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="L-1924"><a href="#L-1924"><span class="linenos">1924</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="L-1925"><a href="#L-1925"><span class="linenos">1925</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-1926"><a href="#L-1926"><span class="linenos">1926</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> +</span><span id="L-1927"><a href="#L-1927"><span class="linenos">1927</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-1928"><a href="#L-1928"><span class="linenos">1928</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1929"><a href="#L-1929"><span class="linenos">1929</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1930"><a href="#L-1930"><span class="linenos">1930</span></a> +</span><span id="L-1931"><a href="#L-1931"><span class="linenos">1931</span></a><span class="sd"> Returns:</span> +</span><span id="L-1932"><a href="#L-1932"><span class="linenos">1932</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-1933"><a href="#L-1933"><span class="linenos">1933</span></a><span class="sd"> """</span> +</span><span id="L-1934"><a href="#L-1934"><span class="linenos">1934</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-1935"><a href="#L-1935"><span class="linenos">1935</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1936"><a href="#L-1936"><span class="linenos">1936</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1937"><a href="#L-1937"><span class="linenos">1937</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> +</span><span id="L-1938"><a href="#L-1938"><span class="linenos">1938</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1939"><a href="#L-1939"><span class="linenos">1939</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1940"><a href="#L-1940"><span class="linenos">1940</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> +</span><span id="L-1941"><a href="#L-1941"><span class="linenos">1941</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> +</span><span id="L-1942"><a href="#L-1942"><span class="linenos">1942</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1943"><a href="#L-1943"><span class="linenos">1943</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1944"><a href="#L-1944"><span class="linenos">1944</span></a> <span class="p">)</span> +</span><span id="L-1945"><a href="#L-1945"><span class="linenos">1945</span></a> +</span><span id="L-1946"><a href="#L-1946"><span class="linenos">1946</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-1947"><a href="#L-1947"><span class="linenos">1947</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1948"><a href="#L-1948"><span class="linenos">1948</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="L-1949"><a href="#L-1949"><span class="linenos">1949</span></a> +</span><span id="L-1950"><a href="#L-1950"><span class="linenos">1950</span></a><span class="sd"> Example:</span> +</span><span id="L-1951"><a href="#L-1951"><span class="linenos">1951</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="L-1952"><a href="#L-1952"><span class="linenos">1952</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="L-1953"><a href="#L-1953"><span class="linenos">1953</span></a> +</span><span id="L-1954"><a href="#L-1954"><span class="linenos">1954</span></a><span class="sd"> Args:</span> +</span><span id="L-1955"><a href="#L-1955"><span class="linenos">1955</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-1956"><a href="#L-1956"><span class="linenos">1956</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-1957"><a href="#L-1957"><span class="linenos">1957</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> +</span><span id="L-1958"><a href="#L-1958"><span class="linenos">1958</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> +</span><span id="L-1959"><a href="#L-1959"><span class="linenos">1959</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-1960"><a href="#L-1960"><span class="linenos">1960</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="L-1961"><a href="#L-1961"><span class="linenos">1961</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-1962"><a href="#L-1962"><span class="linenos">1962</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1963"><a href="#L-1963"><span class="linenos">1963</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-1964"><a href="#L-1964"><span class="linenos">1964</span></a> +</span><span id="L-1965"><a href="#L-1965"><span class="linenos">1965</span></a><span class="sd"> Returns:</span> +</span><span id="L-1966"><a href="#L-1966"><span class="linenos">1966</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-1967"><a href="#L-1967"><span class="linenos">1967</span></a><span class="sd"> """</span> +</span><span id="L-1968"><a href="#L-1968"><span class="linenos">1968</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> +</span><span id="L-1969"><a href="#L-1969"><span class="linenos">1969</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="L-1970"><a href="#L-1970"><span class="linenos">1970</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-1971"><a href="#L-1971"><span class="linenos">1971</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-1972"><a href="#L-1972"><span class="linenos">1972</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-1973"><a href="#L-1973"><span class="linenos">1973</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> +</span><span id="L-1974"><a href="#L-1974"><span class="linenos">1974</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-1975"><a href="#L-1975"><span class="linenos">1975</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-1976"><a href="#L-1976"><span class="linenos">1976</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> +</span><span id="L-1977"><a href="#L-1977"><span class="linenos">1977</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> +</span><span id="L-1978"><a href="#L-1978"><span class="linenos">1978</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-1979"><a href="#L-1979"><span class="linenos">1979</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-1980"><a href="#L-1980"><span class="linenos">1980</span></a> <span class="p">)</span> +</span><span id="L-1981"><a href="#L-1981"><span class="linenos">1981</span></a> +</span><span id="L-1982"><a href="#L-1982"><span class="linenos">1982</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-1983"><a href="#L-1983"><span class="linenos">1983</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-1984"><a href="#L-1984"><span class="linenos">1984</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="L-1985"><a href="#L-1985"><span class="linenos">1985</span></a> +</span><span id="L-1986"><a href="#L-1986"><span class="linenos">1986</span></a><span class="sd"> Example:</span> +</span><span id="L-1987"><a href="#L-1987"><span class="linenos">1987</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="L-1988"><a href="#L-1988"><span class="linenos">1988</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="L-1989"><a href="#L-1989"><span class="linenos">1989</span></a> +</span><span id="L-1990"><a href="#L-1990"><span class="linenos">1990</span></a><span class="sd"> Args:</span> +</span><span id="L-1991"><a href="#L-1991"><span class="linenos">1991</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-1992"><a href="#L-1992"><span class="linenos">1992</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-1993"><a href="#L-1993"><span class="linenos">1993</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> +</span><span id="L-1994"><a href="#L-1994"><span class="linenos">1994</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-1995"><a href="#L-1995"><span class="linenos">1995</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-1996"><a href="#L-1996"><span class="linenos">1996</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-1997"><a href="#L-1997"><span class="linenos">1997</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-1998"><a href="#L-1998"><span class="linenos">1998</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> </span><span id="L-1999"><a href="#L-1999"><span class="linenos">1999</span></a> -</span><span id="L-2000"><a href="#L-2000"><span class="linenos">2000</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2001"><a href="#L-2001"><span class="linenos">2001</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2002"><a href="#L-2002"><span class="linenos">2002</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="L-2003"><a href="#L-2003"><span class="linenos">2003</span></a> -</span><span id="L-2004"><a href="#L-2004"><span class="linenos">2004</span></a><span class="sd"> Example:</span> -</span><span id="L-2005"><a href="#L-2005"><span class="linenos">2005</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> -</span><span id="L-2006"><a href="#L-2006"><span class="linenos">2006</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="L-2007"><a href="#L-2007"><span class="linenos">2007</span></a> -</span><span id="L-2008"><a href="#L-2008"><span class="linenos">2008</span></a><span class="sd"> Args:</span> -</span><span id="L-2009"><a href="#L-2009"><span class="linenos">2009</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-2010"><a href="#L-2010"><span class="linenos">2010</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="L-2011"><a href="#L-2011"><span class="linenos">2011</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> -</span><span id="L-2012"><a href="#L-2012"><span class="linenos">2012</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-2013"><a href="#L-2013"><span class="linenos">2013</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="L-2014"><a href="#L-2014"><span class="linenos">2014</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-2015"><a href="#L-2015"><span class="linenos">2015</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2016"><a href="#L-2016"><span class="linenos">2016</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2017"><a href="#L-2017"><span class="linenos">2017</span></a> -</span><span id="L-2018"><a href="#L-2018"><span class="linenos">2018</span></a><span class="sd"> Returns:</span> -</span><span id="L-2019"><a href="#L-2019"><span class="linenos">2019</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2020"><a href="#L-2020"><span class="linenos">2020</span></a><span class="sd"> """</span> -</span><span id="L-2021"><a href="#L-2021"><span class="linenos">2021</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-2022"><a href="#L-2022"><span class="linenos">2022</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2023"><a href="#L-2023"><span class="linenos">2023</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2024"><a href="#L-2024"><span class="linenos">2024</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> -</span><span id="L-2025"><a href="#L-2025"><span class="linenos">2025</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2026"><a href="#L-2026"><span class="linenos">2026</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2027"><a href="#L-2027"><span class="linenos">2027</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> -</span><span id="L-2028"><a href="#L-2028"><span class="linenos">2028</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> -</span><span id="L-2029"><a href="#L-2029"><span class="linenos">2029</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2030"><a href="#L-2030"><span class="linenos">2030</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2031"><a href="#L-2031"><span class="linenos">2031</span></a> <span class="p">)</span> +</span><span id="L-2000"><a href="#L-2000"><span class="linenos">2000</span></a><span class="sd"> Returns:</span> +</span><span id="L-2001"><a href="#L-2001"><span class="linenos">2001</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2002"><a href="#L-2002"><span class="linenos">2002</span></a><span class="sd"> """</span> +</span><span id="L-2003"><a href="#L-2003"><span class="linenos">2003</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2004"><a href="#L-2004"><span class="linenos">2004</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2005"><a href="#L-2005"><span class="linenos">2005</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2006"><a href="#L-2006"><span class="linenos">2006</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> +</span><span id="L-2007"><a href="#L-2007"><span class="linenos">2007</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2008"><a href="#L-2008"><span class="linenos">2008</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2009"><a href="#L-2009"><span class="linenos">2009</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> +</span><span id="L-2010"><a href="#L-2010"><span class="linenos">2010</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> +</span><span id="L-2011"><a href="#L-2011"><span class="linenos">2011</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2012"><a href="#L-2012"><span class="linenos">2012</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2013"><a href="#L-2013"><span class="linenos">2013</span></a> <span class="p">)</span> +</span><span id="L-2014"><a href="#L-2014"><span class="linenos">2014</span></a> +</span><span id="L-2015"><a href="#L-2015"><span class="linenos">2015</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2016"><a href="#L-2016"><span class="linenos">2016</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2017"><a href="#L-2017"><span class="linenos">2017</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="L-2018"><a href="#L-2018"><span class="linenos">2018</span></a> +</span><span id="L-2019"><a href="#L-2019"><span class="linenos">2019</span></a><span class="sd"> Example:</span> +</span><span id="L-2020"><a href="#L-2020"><span class="linenos">2020</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> +</span><span id="L-2021"><a href="#L-2021"><span class="linenos">2021</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="L-2022"><a href="#L-2022"><span class="linenos">2022</span></a> +</span><span id="L-2023"><a href="#L-2023"><span class="linenos">2023</span></a><span class="sd"> Args:</span> +</span><span id="L-2024"><a href="#L-2024"><span class="linenos">2024</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-2025"><a href="#L-2025"><span class="linenos">2025</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2026"><a href="#L-2026"><span class="linenos">2026</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> +</span><span id="L-2027"><a href="#L-2027"><span class="linenos">2027</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-2028"><a href="#L-2028"><span class="linenos">2028</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-2029"><a href="#L-2029"><span class="linenos">2029</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-2030"><a href="#L-2030"><span class="linenos">2030</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2031"><a href="#L-2031"><span class="linenos">2031</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> </span><span id="L-2032"><a href="#L-2032"><span class="linenos">2032</span></a> -</span><span id="L-2033"><a href="#L-2033"><span class="linenos">2033</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2034"><a href="#L-2034"><span class="linenos">2034</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2035"><a href="#L-2035"><span class="linenos">2035</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="L-2036"><a href="#L-2036"><span class="linenos">2036</span></a> -</span><span id="L-2037"><a href="#L-2037"><span class="linenos">2037</span></a><span class="sd"> Example:</span> -</span><span id="L-2038"><a href="#L-2038"><span class="linenos">2038</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="L-2039"><a href="#L-2039"><span class="linenos">2039</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> -</span><span id="L-2040"><a href="#L-2040"><span class="linenos">2040</span></a> -</span><span id="L-2041"><a href="#L-2041"><span class="linenos">2041</span></a><span class="sd"> Args:</span> -</span><span id="L-2042"><a href="#L-2042"><span class="linenos">2042</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="L-2043"><a href="#L-2043"><span class="linenos">2043</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-2044"><a href="#L-2044"><span class="linenos">2044</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="L-2045"><a href="#L-2045"><span class="linenos">2045</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="L-2046"><a href="#L-2046"><span class="linenos">2046</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-2047"><a href="#L-2047"><span class="linenos">2047</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2048"><a href="#L-2048"><span class="linenos">2048</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2049"><a href="#L-2049"><span class="linenos">2049</span></a> -</span><span id="L-2050"><a href="#L-2050"><span class="linenos">2050</span></a><span class="sd"> Returns:</span> -</span><span id="L-2051"><a href="#L-2051"><span class="linenos">2051</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2052"><a href="#L-2052"><span class="linenos">2052</span></a><span class="sd"> """</span> -</span><span id="L-2053"><a href="#L-2053"><span class="linenos">2053</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-2054"><a href="#L-2054"><span class="linenos">2054</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-2055"><a href="#L-2055"><span class="linenos">2055</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2056"><a href="#L-2056"><span class="linenos">2056</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> -</span><span id="L-2057"><a href="#L-2057"><span class="linenos">2057</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> -</span><span id="L-2058"><a href="#L-2058"><span class="linenos">2058</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> -</span><span id="L-2059"><a href="#L-2059"><span class="linenos">2059</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2060"><a href="#L-2060"><span class="linenos">2060</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2061"><a href="#L-2061"><span class="linenos">2061</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2062"><a href="#L-2062"><span class="linenos">2062</span></a> <span class="p">)</span> -</span><span id="L-2063"><a href="#L-2063"><span class="linenos">2063</span></a> -</span><span id="L-2064"><a href="#L-2064"><span class="linenos">2064</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2065"><a href="#L-2065"><span class="linenos">2065</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2066"><a href="#L-2066"><span class="linenos">2066</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="L-2067"><a href="#L-2067"><span class="linenos">2067</span></a> -</span><span id="L-2068"><a href="#L-2068"><span class="linenos">2068</span></a><span class="sd"> Example:</span> -</span><span id="L-2069"><a href="#L-2069"><span class="linenos">2069</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="L-2070"><a href="#L-2070"><span class="linenos">2070</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</span><span id="L-2071"><a href="#L-2071"><span class="linenos">2071</span></a> -</span><span id="L-2072"><a href="#L-2072"><span class="linenos">2072</span></a><span class="sd"> Args:</span> -</span><span id="L-2073"><a href="#L-2073"><span class="linenos">2073</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="L-2074"><a href="#L-2074"><span class="linenos">2074</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="L-2075"><a href="#L-2075"><span class="linenos">2075</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="L-2076"><a href="#L-2076"><span class="linenos">2076</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="L-2077"><a href="#L-2077"><span class="linenos">2077</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-2078"><a href="#L-2078"><span class="linenos">2078</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2079"><a href="#L-2079"><span class="linenos">2079</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2033"><a href="#L-2033"><span class="linenos">2033</span></a><span class="sd"> Returns:</span> +</span><span id="L-2034"><a href="#L-2034"><span class="linenos">2034</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2035"><a href="#L-2035"><span class="linenos">2035</span></a><span class="sd"> """</span> +</span><span id="L-2036"><a href="#L-2036"><span class="linenos">2036</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2037"><a href="#L-2037"><span class="linenos">2037</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2038"><a href="#L-2038"><span class="linenos">2038</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2039"><a href="#L-2039"><span class="linenos">2039</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> +</span><span id="L-2040"><a href="#L-2040"><span class="linenos">2040</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2041"><a href="#L-2041"><span class="linenos">2041</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2042"><a href="#L-2042"><span class="linenos">2042</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> +</span><span id="L-2043"><a href="#L-2043"><span class="linenos">2043</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> +</span><span id="L-2044"><a href="#L-2044"><span class="linenos">2044</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2045"><a href="#L-2045"><span class="linenos">2045</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2046"><a href="#L-2046"><span class="linenos">2046</span></a> <span class="p">)</span> +</span><span id="L-2047"><a href="#L-2047"><span class="linenos">2047</span></a> +</span><span id="L-2048"><a href="#L-2048"><span class="linenos">2048</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2049"><a href="#L-2049"><span class="linenos">2049</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2050"><a href="#L-2050"><span class="linenos">2050</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="L-2051"><a href="#L-2051"><span class="linenos">2051</span></a> +</span><span id="L-2052"><a href="#L-2052"><span class="linenos">2052</span></a><span class="sd"> Example:</span> +</span><span id="L-2053"><a href="#L-2053"><span class="linenos">2053</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> +</span><span id="L-2054"><a href="#L-2054"><span class="linenos">2054</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="L-2055"><a href="#L-2055"><span class="linenos">2055</span></a> +</span><span id="L-2056"><a href="#L-2056"><span class="linenos">2056</span></a><span class="sd"> Args:</span> +</span><span id="L-2057"><a href="#L-2057"><span class="linenos">2057</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-2058"><a href="#L-2058"><span class="linenos">2058</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="L-2059"><a href="#L-2059"><span class="linenos">2059</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> +</span><span id="L-2060"><a href="#L-2060"><span class="linenos">2060</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-2061"><a href="#L-2061"><span class="linenos">2061</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="L-2062"><a href="#L-2062"><span class="linenos">2062</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-2063"><a href="#L-2063"><span class="linenos">2063</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2064"><a href="#L-2064"><span class="linenos">2064</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2065"><a href="#L-2065"><span class="linenos">2065</span></a> +</span><span id="L-2066"><a href="#L-2066"><span class="linenos">2066</span></a><span class="sd"> Returns:</span> +</span><span id="L-2067"><a href="#L-2067"><span class="linenos">2067</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2068"><a href="#L-2068"><span class="linenos">2068</span></a><span class="sd"> """</span> +</span><span id="L-2069"><a href="#L-2069"><span class="linenos">2069</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-2070"><a href="#L-2070"><span class="linenos">2070</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2071"><a href="#L-2071"><span class="linenos">2071</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2072"><a href="#L-2072"><span class="linenos">2072</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> +</span><span id="L-2073"><a href="#L-2073"><span class="linenos">2073</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2074"><a href="#L-2074"><span class="linenos">2074</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2075"><a href="#L-2075"><span class="linenos">2075</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> +</span><span id="L-2076"><a href="#L-2076"><span class="linenos">2076</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> +</span><span id="L-2077"><a href="#L-2077"><span class="linenos">2077</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2078"><a href="#L-2078"><span class="linenos">2078</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2079"><a href="#L-2079"><span class="linenos">2079</span></a> <span class="p">)</span> </span><span id="L-2080"><a href="#L-2080"><span class="linenos">2080</span></a> -</span><span id="L-2081"><a href="#L-2081"><span class="linenos">2081</span></a><span class="sd"> Returns:</span> -</span><span id="L-2082"><a href="#L-2082"><span class="linenos">2082</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2083"><a href="#L-2083"><span class="linenos">2083</span></a><span class="sd"> """</span> -</span><span id="L-2084"><a href="#L-2084"><span class="linenos">2084</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="L-2085"><a href="#L-2085"><span class="linenos">2085</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-2086"><a href="#L-2086"><span class="linenos">2086</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2087"><a href="#L-2087"><span class="linenos">2087</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> -</span><span id="L-2088"><a href="#L-2088"><span class="linenos">2088</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> -</span><span id="L-2089"><a href="#L-2089"><span class="linenos">2089</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> -</span><span id="L-2090"><a href="#L-2090"><span class="linenos">2090</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2091"><a href="#L-2091"><span class="linenos">2091</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2092"><a href="#L-2092"><span class="linenos">2092</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2093"><a href="#L-2093"><span class="linenos">2093</span></a> <span class="p">)</span> -</span><span id="L-2094"><a href="#L-2094"><span class="linenos">2094</span></a> -</span><span id="L-2095"><a href="#L-2095"><span class="linenos">2095</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="L-2096"><a href="#L-2096"><span class="linenos">2096</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2097"><a href="#L-2097"><span class="linenos">2097</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="L-2098"><a href="#L-2098"><span class="linenos">2098</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2099"><a href="#L-2099"><span class="linenos">2099</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-2100"><a href="#L-2100"><span class="linenos">2100</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2101"><a href="#L-2101"><span class="linenos">2101</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2102"><a href="#L-2102"><span class="linenos">2102</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2103"><a href="#L-2103"><span class="linenos">2103</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2104"><a href="#L-2104"><span class="linenos">2104</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</span><span id="L-2105"><a href="#L-2105"><span class="linenos">2105</span></a> -</span><span id="L-2106"><a href="#L-2106"><span class="linenos">2106</span></a><span class="sd"> Example:</span> -</span><span id="L-2107"><a href="#L-2107"><span class="linenos">2107</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="L-2108"><a href="#L-2108"><span class="linenos">2108</span></a><span class="sd"> 'SELECT x, y'</span> -</span><span id="L-2109"><a href="#L-2109"><span class="linenos">2109</span></a> -</span><span id="L-2110"><a href="#L-2110"><span class="linenos">2110</span></a><span class="sd"> Args:</span> -</span><span id="L-2111"><a href="#L-2111"><span class="linenos">2111</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="L-2112"><a href="#L-2112"><span class="linenos">2112</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2113"><a href="#L-2113"><span class="linenos">2113</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="L-2114"><a href="#L-2114"><span class="linenos">2114</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2115"><a href="#L-2115"><span class="linenos">2115</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="L-2116"><a href="#L-2116"><span class="linenos">2116</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="L-2117"><a href="#L-2117"><span class="linenos">2117</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="L-2118"><a href="#L-2118"><span class="linenos">2118</span></a> -</span><span id="L-2119"><a href="#L-2119"><span class="linenos">2119</span></a><span class="sd"> Returns:</span> -</span><span id="L-2120"><a href="#L-2120"><span class="linenos">2120</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2121"><a href="#L-2121"><span class="linenos">2121</span></a><span class="sd"> """</span> -</span><span id="L-2122"><a href="#L-2122"><span class="linenos">2122</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2123"><a href="#L-2123"><span class="linenos">2123</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2124"><a href="#L-2124"><span class="linenos">2124</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2125"><a href="#L-2125"><span class="linenos">2125</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-2126"><a href="#L-2126"><span class="linenos">2126</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2127"><a href="#L-2127"><span class="linenos">2127</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2128"><a href="#L-2128"><span class="linenos">2128</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2129"><a href="#L-2129"><span class="linenos">2129</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2130"><a href="#L-2130"><span class="linenos">2130</span></a> <span class="p">)</span> -</span><span id="L-2131"><a href="#L-2131"><span class="linenos">2131</span></a> -</span><span id="L-2132"><a href="#L-2132"><span class="linenos">2132</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2133"><a href="#L-2133"><span class="linenos">2133</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2134"><a href="#L-2134"><span class="linenos">2134</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</span><span id="L-2135"><a href="#L-2135"><span class="linenos">2135</span></a> -</span><span id="L-2136"><a href="#L-2136"><span class="linenos">2136</span></a><span class="sd"> Example:</span> -</span><span id="L-2137"><a href="#L-2137"><span class="linenos">2137</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="L-2138"><a href="#L-2138"><span class="linenos">2138</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</span><span id="L-2139"><a href="#L-2139"><span class="linenos">2139</span></a> -</span><span id="L-2140"><a href="#L-2140"><span class="linenos">2140</span></a><span class="sd"> Args:</span> -</span><span id="L-2141"><a href="#L-2141"><span class="linenos">2141</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-2142"><a href="#L-2142"><span class="linenos">2142</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2143"><a href="#L-2143"><span class="linenos">2143</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-2144"><a href="#L-2144"><span class="linenos">2144</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2145"><a href="#L-2145"><span class="linenos">2145</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-2146"><a href="#L-2146"><span class="linenos">2146</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2147"><a href="#L-2147"><span class="linenos">2147</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2148"><a href="#L-2148"><span class="linenos">2148</span></a> -</span><span id="L-2149"><a href="#L-2149"><span class="linenos">2149</span></a><span class="sd"> Returns:</span> -</span><span id="L-2150"><a href="#L-2150"><span class="linenos">2150</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2151"><a href="#L-2151"><span class="linenos">2151</span></a><span class="sd"> """</span> -</span><span id="L-2152"><a href="#L-2152"><span class="linenos">2152</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2153"><a href="#L-2153"><span class="linenos">2153</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2154"><a href="#L-2154"><span class="linenos">2154</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2155"><a href="#L-2155"><span class="linenos">2155</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> -</span><span id="L-2156"><a href="#L-2156"><span class="linenos">2156</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2157"><a href="#L-2157"><span class="linenos">2157</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> -</span><span id="L-2158"><a href="#L-2158"><span class="linenos">2158</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> -</span><span id="L-2159"><a href="#L-2159"><span class="linenos">2159</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2160"><a href="#L-2160"><span class="linenos">2160</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2161"><a href="#L-2161"><span class="linenos">2161</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2162"><a href="#L-2162"><span class="linenos">2162</span></a> <span class="p">)</span> -</span><span id="L-2163"><a href="#L-2163"><span class="linenos">2163</span></a> -</span><span id="L-2164"><a href="#L-2164"><span class="linenos">2164</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="L-2165"><a href="#L-2165"><span class="linenos">2165</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="L-2166"><a href="#L-2166"><span class="linenos">2166</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-2167"><a href="#L-2167"><span class="linenos">2167</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-2168"><a href="#L-2168"><span class="linenos">2168</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-2169"><a href="#L-2169"><span class="linenos">2169</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-2170"><a href="#L-2170"><span class="linenos">2170</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-2171"><a href="#L-2171"><span class="linenos">2171</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-2172"><a href="#L-2172"><span class="linenos">2172</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-2173"><a href="#L-2173"><span class="linenos">2173</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-2174"><a href="#L-2174"><span class="linenos">2174</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2175"><a href="#L-2175"><span class="linenos">2175</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2176"><a href="#L-2176"><span class="linenos">2176</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2177"><a href="#L-2177"><span class="linenos">2177</span></a><span class="sd"> Append to or set the JOIN expressions.</span> -</span><span id="L-2178"><a href="#L-2178"><span class="linenos">2178</span></a> -</span><span id="L-2179"><a href="#L-2179"><span class="linenos">2179</span></a><span class="sd"> Example:</span> -</span><span id="L-2180"><a href="#L-2180"><span class="linenos">2180</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="L-2181"><a href="#L-2181"><span class="linenos">2181</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="L-2182"><a href="#L-2182"><span class="linenos">2182</span></a> -</span><span id="L-2183"><a href="#L-2183"><span class="linenos">2183</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="L-2184"><a href="#L-2184"><span class="linenos">2184</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> -</span><span id="L-2185"><a href="#L-2185"><span class="linenos">2185</span></a> -</span><span id="L-2186"><a href="#L-2186"><span class="linenos">2186</span></a><span class="sd"> Use `join_type` to change the type of join:</span> +</span><span id="L-2081"><a href="#L-2081"><span class="linenos">2081</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2082"><a href="#L-2082"><span class="linenos">2082</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2083"><a href="#L-2083"><span class="linenos">2083</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="L-2084"><a href="#L-2084"><span class="linenos">2084</span></a> +</span><span id="L-2085"><a href="#L-2085"><span class="linenos">2085</span></a><span class="sd"> Example:</span> +</span><span id="L-2086"><a href="#L-2086"><span class="linenos">2086</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="L-2087"><a href="#L-2087"><span class="linenos">2087</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> +</span><span id="L-2088"><a href="#L-2088"><span class="linenos">2088</span></a> +</span><span id="L-2089"><a href="#L-2089"><span class="linenos">2089</span></a><span class="sd"> Args:</span> +</span><span id="L-2090"><a href="#L-2090"><span class="linenos">2090</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="L-2091"><a href="#L-2091"><span class="linenos">2091</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-2092"><a href="#L-2092"><span class="linenos">2092</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="L-2093"><a href="#L-2093"><span class="linenos">2093</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="L-2094"><a href="#L-2094"><span class="linenos">2094</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-2095"><a href="#L-2095"><span class="linenos">2095</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2096"><a href="#L-2096"><span class="linenos">2096</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2097"><a href="#L-2097"><span class="linenos">2097</span></a> +</span><span id="L-2098"><a href="#L-2098"><span class="linenos">2098</span></a><span class="sd"> Returns:</span> +</span><span id="L-2099"><a href="#L-2099"><span class="linenos">2099</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2100"><a href="#L-2100"><span class="linenos">2100</span></a><span class="sd"> """</span> +</span><span id="L-2101"><a href="#L-2101"><span class="linenos">2101</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-2102"><a href="#L-2102"><span class="linenos">2102</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-2103"><a href="#L-2103"><span class="linenos">2103</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2104"><a href="#L-2104"><span class="linenos">2104</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> +</span><span id="L-2105"><a href="#L-2105"><span class="linenos">2105</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> +</span><span id="L-2106"><a href="#L-2106"><span class="linenos">2106</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> +</span><span id="L-2107"><a href="#L-2107"><span class="linenos">2107</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2108"><a href="#L-2108"><span class="linenos">2108</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2109"><a href="#L-2109"><span class="linenos">2109</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2110"><a href="#L-2110"><span class="linenos">2110</span></a> <span class="p">)</span> +</span><span id="L-2111"><a href="#L-2111"><span class="linenos">2111</span></a> +</span><span id="L-2112"><a href="#L-2112"><span class="linenos">2112</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2113"><a href="#L-2113"><span class="linenos">2113</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2114"><a href="#L-2114"><span class="linenos">2114</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="L-2115"><a href="#L-2115"><span class="linenos">2115</span></a> +</span><span id="L-2116"><a href="#L-2116"><span class="linenos">2116</span></a><span class="sd"> Example:</span> +</span><span id="L-2117"><a href="#L-2117"><span class="linenos">2117</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="L-2118"><a href="#L-2118"><span class="linenos">2118</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> +</span><span id="L-2119"><a href="#L-2119"><span class="linenos">2119</span></a> +</span><span id="L-2120"><a href="#L-2120"><span class="linenos">2120</span></a><span class="sd"> Args:</span> +</span><span id="L-2121"><a href="#L-2121"><span class="linenos">2121</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="L-2122"><a href="#L-2122"><span class="linenos">2122</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="L-2123"><a href="#L-2123"><span class="linenos">2123</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="L-2124"><a href="#L-2124"><span class="linenos">2124</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="L-2125"><a href="#L-2125"><span class="linenos">2125</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-2126"><a href="#L-2126"><span class="linenos">2126</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2127"><a href="#L-2127"><span class="linenos">2127</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2128"><a href="#L-2128"><span class="linenos">2128</span></a> +</span><span id="L-2129"><a href="#L-2129"><span class="linenos">2129</span></a><span class="sd"> Returns:</span> +</span><span id="L-2130"><a href="#L-2130"><span class="linenos">2130</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2131"><a href="#L-2131"><span class="linenos">2131</span></a><span class="sd"> """</span> +</span><span id="L-2132"><a href="#L-2132"><span class="linenos">2132</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="L-2133"><a href="#L-2133"><span class="linenos">2133</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-2134"><a href="#L-2134"><span class="linenos">2134</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2135"><a href="#L-2135"><span class="linenos">2135</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> +</span><span id="L-2136"><a href="#L-2136"><span class="linenos">2136</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> +</span><span id="L-2137"><a href="#L-2137"><span class="linenos">2137</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> +</span><span id="L-2138"><a href="#L-2138"><span class="linenos">2138</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2139"><a href="#L-2139"><span class="linenos">2139</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2140"><a href="#L-2140"><span class="linenos">2140</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2141"><a href="#L-2141"><span class="linenos">2141</span></a> <span class="p">)</span> +</span><span id="L-2142"><a href="#L-2142"><span class="linenos">2142</span></a> +</span><span id="L-2143"><a href="#L-2143"><span class="linenos">2143</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="L-2144"><a href="#L-2144"><span class="linenos">2144</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2145"><a href="#L-2145"><span class="linenos">2145</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="L-2146"><a href="#L-2146"><span class="linenos">2146</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2147"><a href="#L-2147"><span class="linenos">2147</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-2148"><a href="#L-2148"><span class="linenos">2148</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2149"><a href="#L-2149"><span class="linenos">2149</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2150"><a href="#L-2150"><span class="linenos">2150</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2151"><a href="#L-2151"><span class="linenos">2151</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2152"><a href="#L-2152"><span class="linenos">2152</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="L-2153"><a href="#L-2153"><span class="linenos">2153</span></a> +</span><span id="L-2154"><a href="#L-2154"><span class="linenos">2154</span></a><span class="sd"> Example:</span> +</span><span id="L-2155"><a href="#L-2155"><span class="linenos">2155</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="L-2156"><a href="#L-2156"><span class="linenos">2156</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="L-2157"><a href="#L-2157"><span class="linenos">2157</span></a> +</span><span id="L-2158"><a href="#L-2158"><span class="linenos">2158</span></a><span class="sd"> Args:</span> +</span><span id="L-2159"><a href="#L-2159"><span class="linenos">2159</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="L-2160"><a href="#L-2160"><span class="linenos">2160</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2161"><a href="#L-2161"><span class="linenos">2161</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="L-2162"><a href="#L-2162"><span class="linenos">2162</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2163"><a href="#L-2163"><span class="linenos">2163</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="L-2164"><a href="#L-2164"><span class="linenos">2164</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2165"><a href="#L-2165"><span class="linenos">2165</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="L-2166"><a href="#L-2166"><span class="linenos">2166</span></a> +</span><span id="L-2167"><a href="#L-2167"><span class="linenos">2167</span></a><span class="sd"> Returns:</span> +</span><span id="L-2168"><a href="#L-2168"><span class="linenos">2168</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2169"><a href="#L-2169"><span class="linenos">2169</span></a><span class="sd"> """</span> +</span><span id="L-2170"><a href="#L-2170"><span class="linenos">2170</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2171"><a href="#L-2171"><span class="linenos">2171</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2172"><a href="#L-2172"><span class="linenos">2172</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2173"><a href="#L-2173"><span class="linenos">2173</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-2174"><a href="#L-2174"><span class="linenos">2174</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2175"><a href="#L-2175"><span class="linenos">2175</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2176"><a href="#L-2176"><span class="linenos">2176</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2177"><a href="#L-2177"><span class="linenos">2177</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2178"><a href="#L-2178"><span class="linenos">2178</span></a> <span class="p">)</span> +</span><span id="L-2179"><a href="#L-2179"><span class="linenos">2179</span></a> +</span><span id="L-2180"><a href="#L-2180"><span class="linenos">2180</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2181"><a href="#L-2181"><span class="linenos">2181</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2182"><a href="#L-2182"><span class="linenos">2182</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="L-2183"><a href="#L-2183"><span class="linenos">2183</span></a> +</span><span id="L-2184"><a href="#L-2184"><span class="linenos">2184</span></a><span class="sd"> Example:</span> +</span><span id="L-2185"><a href="#L-2185"><span class="linenos">2185</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="L-2186"><a href="#L-2186"><span class="linenos">2186</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> </span><span id="L-2187"><a href="#L-2187"><span class="linenos">2187</span></a> -</span><span id="L-2188"><a href="#L-2188"><span class="linenos">2188</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> -</span><span id="L-2189"><a href="#L-2189"><span class="linenos">2189</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="L-2190"><a href="#L-2190"><span class="linenos">2190</span></a> -</span><span id="L-2191"><a href="#L-2191"><span class="linenos">2191</span></a><span class="sd"> Args:</span> -</span><span id="L-2192"><a href="#L-2192"><span class="linenos">2192</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> -</span><span id="L-2193"><a href="#L-2193"><span class="linenos">2193</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2194"><a href="#L-2194"><span class="linenos">2194</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> -</span><span id="L-2195"><a href="#L-2195"><span class="linenos">2195</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2196"><a href="#L-2196"><span class="linenos">2196</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="L-2197"><a href="#L-2197"><span class="linenos">2197</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2198"><a href="#L-2198"><span class="linenos">2198</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="L-2199"><a href="#L-2199"><span class="linenos">2199</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="L-2200"><a href="#L-2200"><span class="linenos">2200</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> -</span><span id="L-2201"><a href="#L-2201"><span class="linenos">2201</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-2202"><a href="#L-2202"><span class="linenos">2202</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2203"><a href="#L-2203"><span class="linenos">2203</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2204"><a href="#L-2204"><span class="linenos">2204</span></a> -</span><span id="L-2205"><a href="#L-2205"><span class="linenos">2205</span></a><span class="sd"> Returns:</span> -</span><span id="L-2206"><a href="#L-2206"><span class="linenos">2206</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2207"><a href="#L-2207"><span class="linenos">2207</span></a><span class="sd"> """</span> -</span><span id="L-2208"><a href="#L-2208"><span class="linenos">2208</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> -</span><span id="L-2209"><a href="#L-2209"><span class="linenos">2209</span></a> -</span><span id="L-2210"><a href="#L-2210"><span class="linenos">2210</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="L-2211"><a href="#L-2211"><span class="linenos">2211</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="L-2212"><a href="#L-2212"><span class="linenos">2212</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="L-2213"><a href="#L-2213"><span class="linenos">2213</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="L-2214"><a href="#L-2214"><span class="linenos">2214</span></a> -</span><span id="L-2215"><a href="#L-2215"><span class="linenos">2215</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-2216"><a href="#L-2216"><span class="linenos">2216</span></a> -</span><span id="L-2217"><a href="#L-2217"><span class="linenos">2217</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> -</span><span id="L-2218"><a href="#L-2218"><span class="linenos">2218</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> -</span><span id="L-2219"><a href="#L-2219"><span class="linenos">2219</span></a> -</span><span id="L-2220"><a href="#L-2220"><span class="linenos">2220</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="L-2221"><a href="#L-2221"><span class="linenos">2221</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="L-2222"><a href="#L-2222"><span class="linenos">2222</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="L-2223"><a href="#L-2223"><span class="linenos">2223</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="L-2224"><a href="#L-2224"><span class="linenos">2224</span></a> -</span><span id="L-2225"><a href="#L-2225"><span class="linenos">2225</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="L-2188"><a href="#L-2188"><span class="linenos">2188</span></a><span class="sd"> Args:</span> +</span><span id="L-2189"><a href="#L-2189"><span class="linenos">2189</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-2190"><a href="#L-2190"><span class="linenos">2190</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2191"><a href="#L-2191"><span class="linenos">2191</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-2192"><a href="#L-2192"><span class="linenos">2192</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2193"><a href="#L-2193"><span class="linenos">2193</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-2194"><a href="#L-2194"><span class="linenos">2194</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2195"><a href="#L-2195"><span class="linenos">2195</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2196"><a href="#L-2196"><span class="linenos">2196</span></a> +</span><span id="L-2197"><a href="#L-2197"><span class="linenos">2197</span></a><span class="sd"> Returns:</span> +</span><span id="L-2198"><a href="#L-2198"><span class="linenos">2198</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2199"><a href="#L-2199"><span class="linenos">2199</span></a><span class="sd"> """</span> +</span><span id="L-2200"><a href="#L-2200"><span class="linenos">2200</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2201"><a href="#L-2201"><span class="linenos">2201</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2202"><a href="#L-2202"><span class="linenos">2202</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2203"><a href="#L-2203"><span class="linenos">2203</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> +</span><span id="L-2204"><a href="#L-2204"><span class="linenos">2204</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2205"><a href="#L-2205"><span class="linenos">2205</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> +</span><span id="L-2206"><a href="#L-2206"><span class="linenos">2206</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> +</span><span id="L-2207"><a href="#L-2207"><span class="linenos">2207</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2208"><a href="#L-2208"><span class="linenos">2208</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2209"><a href="#L-2209"><span class="linenos">2209</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2210"><a href="#L-2210"><span class="linenos">2210</span></a> <span class="p">)</span> +</span><span id="L-2211"><a href="#L-2211"><span class="linenos">2211</span></a> +</span><span id="L-2212"><a href="#L-2212"><span class="linenos">2212</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="L-2213"><a href="#L-2213"><span class="linenos">2213</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="L-2214"><a href="#L-2214"><span class="linenos">2214</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-2215"><a href="#L-2215"><span class="linenos">2215</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-2216"><a href="#L-2216"><span class="linenos">2216</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-2217"><a href="#L-2217"><span class="linenos">2217</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-2218"><a href="#L-2218"><span class="linenos">2218</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-2219"><a href="#L-2219"><span class="linenos">2219</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-2220"><a href="#L-2220"><span class="linenos">2220</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-2221"><a href="#L-2221"><span class="linenos">2221</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-2222"><a href="#L-2222"><span class="linenos">2222</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2223"><a href="#L-2223"><span class="linenos">2223</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2224"><a href="#L-2224"><span class="linenos">2224</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2225"><a href="#L-2225"><span class="linenos">2225</span></a><span class="sd"> Append to or set the JOIN expressions.</span> </span><span id="L-2226"><a href="#L-2226"><span class="linenos">2226</span></a> -</span><span id="L-2227"><a href="#L-2227"><span class="linenos">2227</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> -</span><span id="L-2228"><a href="#L-2228"><span class="linenos">2228</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> -</span><span id="L-2229"><a href="#L-2229"><span class="linenos">2229</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="L-2230"><a href="#L-2230"><span class="linenos">2230</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="L-2231"><a href="#L-2231"><span class="linenos">2231</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="L-2232"><a href="#L-2232"><span class="linenos">2232</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="L-2227"><a href="#L-2227"><span class="linenos">2227</span></a><span class="sd"> Example:</span> +</span><span id="L-2228"><a href="#L-2228"><span class="linenos">2228</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="L-2229"><a href="#L-2229"><span class="linenos">2229</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="L-2230"><a href="#L-2230"><span class="linenos">2230</span></a> +</span><span id="L-2231"><a href="#L-2231"><span class="linenos">2231</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="L-2232"><a href="#L-2232"><span class="linenos">2232</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> </span><span id="L-2233"><a href="#L-2233"><span class="linenos">2233</span></a> -</span><span id="L-2234"><a href="#L-2234"><span class="linenos">2234</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="L-2235"><a href="#L-2235"><span class="linenos">2235</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-2236"><a href="#L-2236"><span class="linenos">2236</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> -</span><span id="L-2237"><a href="#L-2237"><span class="linenos">2237</span></a> -</span><span id="L-2238"><a href="#L-2238"><span class="linenos">2238</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="L-2239"><a href="#L-2239"><span class="linenos">2239</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2240"><a href="#L-2240"><span class="linenos">2240</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="L-2241"><a href="#L-2241"><span class="linenos">2241</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> -</span><span id="L-2242"><a href="#L-2242"><span class="linenos">2242</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="L-2243"><a href="#L-2243"><span class="linenos">2243</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2244"><a href="#L-2244"><span class="linenos">2244</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2245"><a href="#L-2245"><span class="linenos">2245</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2246"><a href="#L-2246"><span class="linenos">2246</span></a> <span class="p">)</span> -</span><span id="L-2247"><a href="#L-2247"><span class="linenos">2247</span></a> -</span><span id="L-2248"><a href="#L-2248"><span class="linenos">2248</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="L-2249"><a href="#L-2249"><span class="linenos">2249</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> -</span><span id="L-2250"><a href="#L-2250"><span class="linenos">2250</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2251"><a href="#L-2251"><span class="linenos">2251</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="L-2252"><a href="#L-2252"><span class="linenos">2252</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2253"><a href="#L-2253"><span class="linenos">2253</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> -</span><span id="L-2254"><a href="#L-2254"><span class="linenos">2254</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2255"><a href="#L-2255"><span class="linenos">2255</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2256"><a href="#L-2256"><span class="linenos">2256</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2257"><a href="#L-2257"><span class="linenos">2257</span></a> <span class="p">)</span> -</span><span id="L-2258"><a href="#L-2258"><span class="linenos">2258</span></a> -</span><span id="L-2259"><a href="#L-2259"><span class="linenos">2259</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2260"><a href="#L-2260"><span class="linenos">2260</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2261"><a href="#L-2261"><span class="linenos">2261</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="L-2234"><a href="#L-2234"><span class="linenos">2234</span></a><span class="sd"> Use `join_type` to change the type of join:</span> +</span><span id="L-2235"><a href="#L-2235"><span class="linenos">2235</span></a> +</span><span id="L-2236"><a href="#L-2236"><span class="linenos">2236</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> +</span><span id="L-2237"><a href="#L-2237"><span class="linenos">2237</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="L-2238"><a href="#L-2238"><span class="linenos">2238</span></a> +</span><span id="L-2239"><a href="#L-2239"><span class="linenos">2239</span></a><span class="sd"> Args:</span> +</span><span id="L-2240"><a href="#L-2240"><span class="linenos">2240</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> +</span><span id="L-2241"><a href="#L-2241"><span class="linenos">2241</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2242"><a href="#L-2242"><span class="linenos">2242</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="L-2243"><a href="#L-2243"><span class="linenos">2243</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2244"><a href="#L-2244"><span class="linenos">2244</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> +</span><span id="L-2245"><a href="#L-2245"><span class="linenos">2245</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2246"><a href="#L-2246"><span class="linenos">2246</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="L-2247"><a href="#L-2247"><span class="linenos">2247</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="L-2248"><a href="#L-2248"><span class="linenos">2248</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> +</span><span id="L-2249"><a href="#L-2249"><span class="linenos">2249</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-2250"><a href="#L-2250"><span class="linenos">2250</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2251"><a href="#L-2251"><span class="linenos">2251</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2252"><a href="#L-2252"><span class="linenos">2252</span></a> +</span><span id="L-2253"><a href="#L-2253"><span class="linenos">2253</span></a><span class="sd"> Returns:</span> +</span><span id="L-2254"><a href="#L-2254"><span class="linenos">2254</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2255"><a href="#L-2255"><span class="linenos">2255</span></a><span class="sd"> """</span> +</span><span id="L-2256"><a href="#L-2256"><span class="linenos">2256</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> +</span><span id="L-2257"><a href="#L-2257"><span class="linenos">2257</span></a> +</span><span id="L-2258"><a href="#L-2258"><span class="linenos">2258</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="L-2259"><a href="#L-2259"><span class="linenos">2259</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> +</span><span id="L-2260"><a href="#L-2260"><span class="linenos">2260</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="L-2261"><a href="#L-2261"><span class="linenos">2261</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> </span><span id="L-2262"><a href="#L-2262"><span class="linenos">2262</span></a> -</span><span id="L-2263"><a href="#L-2263"><span class="linenos">2263</span></a><span class="sd"> Example:</span> -</span><span id="L-2264"><a href="#L-2264"><span class="linenos">2264</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="L-2265"><a href="#L-2265"><span class="linenos">2265</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="L-2266"><a href="#L-2266"><span class="linenos">2266</span></a> -</span><span id="L-2267"><a href="#L-2267"><span class="linenos">2267</span></a><span class="sd"> Args:</span> -</span><span id="L-2268"><a href="#L-2268"><span class="linenos">2268</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-2269"><a href="#L-2269"><span class="linenos">2269</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2270"><a href="#L-2270"><span class="linenos">2270</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-2271"><a href="#L-2271"><span class="linenos">2271</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-2272"><a href="#L-2272"><span class="linenos">2272</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-2273"><a href="#L-2273"><span class="linenos">2273</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-2274"><a href="#L-2274"><span class="linenos">2274</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2275"><a href="#L-2275"><span class="linenos">2275</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2276"><a href="#L-2276"><span class="linenos">2276</span></a> -</span><span id="L-2277"><a href="#L-2277"><span class="linenos">2277</span></a><span class="sd"> Returns:</span> -</span><span id="L-2278"><a href="#L-2278"><span class="linenos">2278</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2279"><a href="#L-2279"><span class="linenos">2279</span></a><span class="sd"> """</span> -</span><span id="L-2280"><a href="#L-2280"><span class="linenos">2280</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-2281"><a href="#L-2281"><span class="linenos">2281</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2282"><a href="#L-2282"><span class="linenos">2282</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2283"><a href="#L-2283"><span class="linenos">2283</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="L-2284"><a href="#L-2284"><span class="linenos">2284</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2285"><a href="#L-2285"><span class="linenos">2285</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="L-2286"><a href="#L-2286"><span class="linenos">2286</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2287"><a href="#L-2287"><span class="linenos">2287</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2288"><a href="#L-2288"><span class="linenos">2288</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2289"><a href="#L-2289"><span class="linenos">2289</span></a> <span class="p">)</span> -</span><span id="L-2290"><a href="#L-2290"><span class="linenos">2290</span></a> -</span><span id="L-2291"><a href="#L-2291"><span class="linenos">2291</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2292"><a href="#L-2292"><span class="linenos">2292</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2293"><a href="#L-2293"><span class="linenos">2293</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="L-2294"><a href="#L-2294"><span class="linenos">2294</span></a> -</span><span id="L-2295"><a href="#L-2295"><span class="linenos">2295</span></a><span class="sd"> Example:</span> -</span><span id="L-2296"><a href="#L-2296"><span class="linenos">2296</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> -</span><span id="L-2297"><a href="#L-2297"><span class="linenos">2297</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="L-2298"><a href="#L-2298"><span class="linenos">2298</span></a> -</span><span id="L-2299"><a href="#L-2299"><span class="linenos">2299</span></a><span class="sd"> Args:</span> -</span><span id="L-2300"><a href="#L-2300"><span class="linenos">2300</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-2301"><a href="#L-2301"><span class="linenos">2301</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2302"><a href="#L-2302"><span class="linenos">2302</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="L-2303"><a href="#L-2303"><span class="linenos">2303</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="L-2304"><a href="#L-2304"><span class="linenos">2304</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="L-2305"><a href="#L-2305"><span class="linenos">2305</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-2306"><a href="#L-2306"><span class="linenos">2306</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2307"><a href="#L-2307"><span class="linenos">2307</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-2308"><a href="#L-2308"><span class="linenos">2308</span></a> -</span><span id="L-2309"><a href="#L-2309"><span class="linenos">2309</span></a><span class="sd"> Returns:</span> -</span><span id="L-2310"><a href="#L-2310"><span class="linenos">2310</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2311"><a href="#L-2311"><span class="linenos">2311</span></a><span class="sd"> """</span> -</span><span id="L-2312"><a href="#L-2312"><span class="linenos">2312</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-2313"><a href="#L-2313"><span class="linenos">2313</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2314"><a href="#L-2314"><span class="linenos">2314</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2315"><a href="#L-2315"><span class="linenos">2315</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> -</span><span id="L-2316"><a href="#L-2316"><span class="linenos">2316</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2317"><a href="#L-2317"><span class="linenos">2317</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> -</span><span id="L-2318"><a href="#L-2318"><span class="linenos">2318</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2319"><a href="#L-2319"><span class="linenos">2319</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2320"><a href="#L-2320"><span class="linenos">2320</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2321"><a href="#L-2321"><span class="linenos">2321</span></a> <span class="p">)</span> -</span><span id="L-2322"><a href="#L-2322"><span class="linenos">2322</span></a> -</span><span id="L-2323"><a href="#L-2323"><span class="linenos">2323</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2324"><a href="#L-2324"><span class="linenos">2324</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-2325"><a href="#L-2325"><span class="linenos">2325</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-2326"><a href="#L-2326"><span class="linenos">2326</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="L-2327"><a href="#L-2327"><span class="linenos">2327</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> -</span><span id="L-2328"><a href="#L-2328"><span class="linenos">2328</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="L-2329"><a href="#L-2329"><span class="linenos">2329</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> -</span><span id="L-2330"><a href="#L-2330"><span class="linenos">2330</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2331"><a href="#L-2331"><span class="linenos">2331</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="L-2332"><a href="#L-2332"><span class="linenos">2332</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2333"><a href="#L-2333"><span class="linenos">2333</span></a> <span class="p">)</span> -</span><span id="L-2334"><a href="#L-2334"><span class="linenos">2334</span></a> -</span><span id="L-2335"><a href="#L-2335"><span class="linenos">2335</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2336"><a href="#L-2336"><span class="linenos">2336</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2337"><a href="#L-2337"><span class="linenos">2337</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="L-2263"><a href="#L-2263"><span class="linenos">2263</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-2264"><a href="#L-2264"><span class="linenos">2264</span></a> +</span><span id="L-2265"><a href="#L-2265"><span class="linenos">2265</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> +</span><span id="L-2266"><a href="#L-2266"><span class="linenos">2266</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> +</span><span id="L-2267"><a href="#L-2267"><span class="linenos">2267</span></a> +</span><span id="L-2268"><a href="#L-2268"><span class="linenos">2268</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="L-2269"><a href="#L-2269"><span class="linenos">2269</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="L-2270"><a href="#L-2270"><span class="linenos">2270</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="L-2271"><a href="#L-2271"><span class="linenos">2271</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="L-2272"><a href="#L-2272"><span class="linenos">2272</span></a> +</span><span id="L-2273"><a href="#L-2273"><span class="linenos">2273</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="L-2274"><a href="#L-2274"><span class="linenos">2274</span></a> +</span><span id="L-2275"><a href="#L-2275"><span class="linenos">2275</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> +</span><span id="L-2276"><a href="#L-2276"><span class="linenos">2276</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> +</span><span id="L-2277"><a href="#L-2277"><span class="linenos">2277</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="L-2278"><a href="#L-2278"><span class="linenos">2278</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="L-2279"><a href="#L-2279"><span class="linenos">2279</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="L-2280"><a href="#L-2280"><span class="linenos">2280</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="L-2281"><a href="#L-2281"><span class="linenos">2281</span></a> +</span><span id="L-2282"><a href="#L-2282"><span class="linenos">2282</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="L-2283"><a href="#L-2283"><span class="linenos">2283</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-2284"><a href="#L-2284"><span class="linenos">2284</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> +</span><span id="L-2285"><a href="#L-2285"><span class="linenos">2285</span></a> +</span><span id="L-2286"><a href="#L-2286"><span class="linenos">2286</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="L-2287"><a href="#L-2287"><span class="linenos">2287</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2288"><a href="#L-2288"><span class="linenos">2288</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="L-2289"><a href="#L-2289"><span class="linenos">2289</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> +</span><span id="L-2290"><a href="#L-2290"><span class="linenos">2290</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="L-2291"><a href="#L-2291"><span class="linenos">2291</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2292"><a href="#L-2292"><span class="linenos">2292</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2293"><a href="#L-2293"><span class="linenos">2293</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2294"><a href="#L-2294"><span class="linenos">2294</span></a> <span class="p">)</span> +</span><span id="L-2295"><a href="#L-2295"><span class="linenos">2295</span></a> +</span><span id="L-2296"><a href="#L-2296"><span class="linenos">2296</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="L-2297"><a href="#L-2297"><span class="linenos">2297</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> +</span><span id="L-2298"><a href="#L-2298"><span class="linenos">2298</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2299"><a href="#L-2299"><span class="linenos">2299</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="L-2300"><a href="#L-2300"><span class="linenos">2300</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2301"><a href="#L-2301"><span class="linenos">2301</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> +</span><span id="L-2302"><a href="#L-2302"><span class="linenos">2302</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2303"><a href="#L-2303"><span class="linenos">2303</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2304"><a href="#L-2304"><span class="linenos">2304</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2305"><a href="#L-2305"><span class="linenos">2305</span></a> <span class="p">)</span> +</span><span id="L-2306"><a href="#L-2306"><span class="linenos">2306</span></a> +</span><span id="L-2307"><a href="#L-2307"><span class="linenos">2307</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2308"><a href="#L-2308"><span class="linenos">2308</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2309"><a href="#L-2309"><span class="linenos">2309</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="L-2310"><a href="#L-2310"><span class="linenos">2310</span></a> +</span><span id="L-2311"><a href="#L-2311"><span class="linenos">2311</span></a><span class="sd"> Example:</span> +</span><span id="L-2312"><a href="#L-2312"><span class="linenos">2312</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="L-2313"><a href="#L-2313"><span class="linenos">2313</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="L-2314"><a href="#L-2314"><span class="linenos">2314</span></a> +</span><span id="L-2315"><a href="#L-2315"><span class="linenos">2315</span></a><span class="sd"> Args:</span> +</span><span id="L-2316"><a href="#L-2316"><span class="linenos">2316</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-2317"><a href="#L-2317"><span class="linenos">2317</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2318"><a href="#L-2318"><span class="linenos">2318</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-2319"><a href="#L-2319"><span class="linenos">2319</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-2320"><a href="#L-2320"><span class="linenos">2320</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-2321"><a href="#L-2321"><span class="linenos">2321</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-2322"><a href="#L-2322"><span class="linenos">2322</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2323"><a href="#L-2323"><span class="linenos">2323</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2324"><a href="#L-2324"><span class="linenos">2324</span></a> +</span><span id="L-2325"><a href="#L-2325"><span class="linenos">2325</span></a><span class="sd"> Returns:</span> +</span><span id="L-2326"><a href="#L-2326"><span class="linenos">2326</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2327"><a href="#L-2327"><span class="linenos">2327</span></a><span class="sd"> """</span> +</span><span id="L-2328"><a href="#L-2328"><span class="linenos">2328</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-2329"><a href="#L-2329"><span class="linenos">2329</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2330"><a href="#L-2330"><span class="linenos">2330</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2331"><a href="#L-2331"><span class="linenos">2331</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="L-2332"><a href="#L-2332"><span class="linenos">2332</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2333"><a href="#L-2333"><span class="linenos">2333</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="L-2334"><a href="#L-2334"><span class="linenos">2334</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2335"><a href="#L-2335"><span class="linenos">2335</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2336"><a href="#L-2336"><span class="linenos">2336</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2337"><a href="#L-2337"><span class="linenos">2337</span></a> <span class="p">)</span> </span><span id="L-2338"><a href="#L-2338"><span class="linenos">2338</span></a> -</span><span id="L-2339"><a href="#L-2339"><span class="linenos">2339</span></a><span class="sd"> Example:</span> -</span><span id="L-2340"><a href="#L-2340"><span class="linenos">2340</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="L-2341"><a href="#L-2341"><span class="linenos">2341</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="L-2339"><a href="#L-2339"><span class="linenos">2339</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2340"><a href="#L-2340"><span class="linenos">2340</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2341"><a href="#L-2341"><span class="linenos">2341</span></a><span class="sd"> Append to or set the HAVING expressions.</span> </span><span id="L-2342"><a href="#L-2342"><span class="linenos">2342</span></a> -</span><span id="L-2343"><a href="#L-2343"><span class="linenos">2343</span></a><span class="sd"> Args:</span> -</span><span id="L-2344"><a href="#L-2344"><span class="linenos">2344</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> -</span><span id="L-2345"><a href="#L-2345"><span class="linenos">2345</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2343"><a href="#L-2343"><span class="linenos">2343</span></a><span class="sd"> Example:</span> +</span><span id="L-2344"><a href="#L-2344"><span class="linenos">2344</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> +</span><span id="L-2345"><a href="#L-2345"><span class="linenos">2345</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> </span><span id="L-2346"><a href="#L-2346"><span class="linenos">2346</span></a> -</span><span id="L-2347"><a href="#L-2347"><span class="linenos">2347</span></a><span class="sd"> Returns:</span> -</span><span id="L-2348"><a href="#L-2348"><span class="linenos">2348</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="L-2349"><a href="#L-2349"><span class="linenos">2349</span></a><span class="sd"> """</span> -</span><span id="L-2350"><a href="#L-2350"><span class="linenos">2350</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-2351"><a href="#L-2351"><span class="linenos">2351</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-2352"><a href="#L-2352"><span class="linenos">2352</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-2353"><a href="#L-2353"><span class="linenos">2353</span></a> -</span><span id="L-2354"><a href="#L-2354"><span class="linenos">2354</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="L-2355"><a href="#L-2355"><span class="linenos">2355</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2356"><a href="#L-2356"><span class="linenos">2356</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> -</span><span id="L-2357"><a href="#L-2357"><span class="linenos">2357</span></a> -</span><span id="L-2358"><a href="#L-2358"><span class="linenos">2358</span></a><span class="sd"> Example:</span> -</span><span id="L-2359"><a href="#L-2359"><span class="linenos">2359</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="L-2360"><a href="#L-2360"><span class="linenos">2360</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> -</span><span id="L-2361"><a href="#L-2361"><span class="linenos">2361</span></a> -</span><span id="L-2362"><a href="#L-2362"><span class="linenos">2362</span></a><span class="sd"> Args:</span> -</span><span id="L-2363"><a href="#L-2363"><span class="linenos">2363</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="L-2364"><a href="#L-2364"><span class="linenos">2364</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-2365"><a href="#L-2365"><span class="linenos">2365</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> -</span><span id="L-2366"><a href="#L-2366"><span class="linenos">2366</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> -</span><span id="L-2367"><a href="#L-2367"><span class="linenos">2367</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="L-2368"><a href="#L-2368"><span class="linenos">2368</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> -</span><span id="L-2369"><a href="#L-2369"><span class="linenos">2369</span></a> -</span><span id="L-2370"><a href="#L-2370"><span class="linenos">2370</span></a><span class="sd"> Returns:</span> -</span><span id="L-2371"><a href="#L-2371"><span class="linenos">2371</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> -</span><span id="L-2372"><a href="#L-2372"><span class="linenos">2372</span></a><span class="sd"> """</span> -</span><span id="L-2373"><a href="#L-2373"><span class="linenos">2373</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-2374"><a href="#L-2374"><span class="linenos">2374</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-2375"><a href="#L-2375"><span class="linenos">2375</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="L-2376"><a href="#L-2376"><span class="linenos">2376</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="L-2377"><a href="#L-2377"><span class="linenos">2377</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-2378"><a href="#L-2378"><span class="linenos">2378</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-2379"><a href="#L-2379"><span class="linenos">2379</span></a> <span class="p">)</span> -</span><span id="L-2380"><a href="#L-2380"><span class="linenos">2380</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="L-2381"><a href="#L-2381"><span class="linenos">2381</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="L-2382"><a href="#L-2382"><span class="linenos">2382</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> -</span><span id="L-2383"><a href="#L-2383"><span class="linenos">2383</span></a> -</span><span id="L-2384"><a href="#L-2384"><span class="linenos">2384</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="L-2385"><a href="#L-2385"><span class="linenos">2385</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> -</span><span id="L-2386"><a href="#L-2386"><span class="linenos">2386</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> -</span><span id="L-2387"><a href="#L-2387"><span class="linenos">2387</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="L-2388"><a href="#L-2388"><span class="linenos">2388</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> -</span><span id="L-2389"><a href="#L-2389"><span class="linenos">2389</span></a> <span class="p">)</span> +</span><span id="L-2347"><a href="#L-2347"><span class="linenos">2347</span></a><span class="sd"> Args:</span> +</span><span id="L-2348"><a href="#L-2348"><span class="linenos">2348</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-2349"><a href="#L-2349"><span class="linenos">2349</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2350"><a href="#L-2350"><span class="linenos">2350</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="L-2351"><a href="#L-2351"><span class="linenos">2351</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="L-2352"><a href="#L-2352"><span class="linenos">2352</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="L-2353"><a href="#L-2353"><span class="linenos">2353</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-2354"><a href="#L-2354"><span class="linenos">2354</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2355"><a href="#L-2355"><span class="linenos">2355</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-2356"><a href="#L-2356"><span class="linenos">2356</span></a> +</span><span id="L-2357"><a href="#L-2357"><span class="linenos">2357</span></a><span class="sd"> Returns:</span> +</span><span id="L-2358"><a href="#L-2358"><span class="linenos">2358</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2359"><a href="#L-2359"><span class="linenos">2359</span></a><span class="sd"> """</span> +</span><span id="L-2360"><a href="#L-2360"><span class="linenos">2360</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-2361"><a href="#L-2361"><span class="linenos">2361</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2362"><a href="#L-2362"><span class="linenos">2362</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2363"><a href="#L-2363"><span class="linenos">2363</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> +</span><span id="L-2364"><a href="#L-2364"><span class="linenos">2364</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2365"><a href="#L-2365"><span class="linenos">2365</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> +</span><span id="L-2366"><a href="#L-2366"><span class="linenos">2366</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2367"><a href="#L-2367"><span class="linenos">2367</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2368"><a href="#L-2368"><span class="linenos">2368</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2369"><a href="#L-2369"><span class="linenos">2369</span></a> <span class="p">)</span> +</span><span id="L-2370"><a href="#L-2370"><span class="linenos">2370</span></a> +</span><span id="L-2371"><a href="#L-2371"><span class="linenos">2371</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2372"><a href="#L-2372"><span class="linenos">2372</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-2373"><a href="#L-2373"><span class="linenos">2373</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-2374"><a href="#L-2374"><span class="linenos">2374</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="L-2375"><a href="#L-2375"><span class="linenos">2375</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> +</span><span id="L-2376"><a href="#L-2376"><span class="linenos">2376</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="L-2377"><a href="#L-2377"><span class="linenos">2377</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> +</span><span id="L-2378"><a href="#L-2378"><span class="linenos">2378</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2379"><a href="#L-2379"><span class="linenos">2379</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="L-2380"><a href="#L-2380"><span class="linenos">2380</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2381"><a href="#L-2381"><span class="linenos">2381</span></a> <span class="p">)</span> +</span><span id="L-2382"><a href="#L-2382"><span class="linenos">2382</span></a> +</span><span id="L-2383"><a href="#L-2383"><span class="linenos">2383</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2384"><a href="#L-2384"><span class="linenos">2384</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2385"><a href="#L-2385"><span class="linenos">2385</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="L-2386"><a href="#L-2386"><span class="linenos">2386</span></a> +</span><span id="L-2387"><a href="#L-2387"><span class="linenos">2387</span></a><span class="sd"> Example:</span> +</span><span id="L-2388"><a href="#L-2388"><span class="linenos">2388</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="L-2389"><a href="#L-2389"><span class="linenos">2389</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> </span><span id="L-2390"><a href="#L-2390"><span class="linenos">2390</span></a> -</span><span id="L-2391"><a href="#L-2391"><span class="linenos">2391</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-2392"><a href="#L-2392"><span class="linenos">2392</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2393"><a href="#L-2393"><span class="linenos">2393</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="L-2391"><a href="#L-2391"><span class="linenos">2391</span></a><span class="sd"> Args:</span> +</span><span id="L-2392"><a href="#L-2392"><span class="linenos">2392</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> +</span><span id="L-2393"><a href="#L-2393"><span class="linenos">2393</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> </span><span id="L-2394"><a href="#L-2394"><span class="linenos">2394</span></a> -</span><span id="L-2395"><a href="#L-2395"><span class="linenos">2395</span></a><span class="sd"> Examples:</span> -</span><span id="L-2396"><a href="#L-2396"><span class="linenos">2396</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="L-2397"><a href="#L-2397"><span class="linenos">2397</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="L-2398"><a href="#L-2398"><span class="linenos">2398</span></a> -</span><span id="L-2399"><a href="#L-2399"><span class="linenos">2399</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="L-2400"><a href="#L-2400"><span class="linenos">2400</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="L-2395"><a href="#L-2395"><span class="linenos">2395</span></a><span class="sd"> Returns:</span> +</span><span id="L-2396"><a href="#L-2396"><span class="linenos">2396</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="L-2397"><a href="#L-2397"><span class="linenos">2397</span></a><span class="sd"> """</span> +</span><span id="L-2398"><a href="#L-2398"><span class="linenos">2398</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-2399"><a href="#L-2399"><span class="linenos">2399</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="L-2400"><a href="#L-2400"><span class="linenos">2400</span></a> <span class="k">return</span> <span class="n">instance</span> </span><span id="L-2401"><a href="#L-2401"><span class="linenos">2401</span></a> -</span><span id="L-2402"><a href="#L-2402"><span class="linenos">2402</span></a><span class="sd"> Args:</span> -</span><span id="L-2403"><a href="#L-2403"><span class="linenos">2403</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> -</span><span id="L-2404"><a href="#L-2404"><span class="linenos">2404</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2402"><a href="#L-2402"><span class="linenos">2402</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="L-2403"><a href="#L-2403"><span class="linenos">2403</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2404"><a href="#L-2404"><span class="linenos">2404</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> </span><span id="L-2405"><a href="#L-2405"><span class="linenos">2405</span></a> -</span><span id="L-2406"><a href="#L-2406"><span class="linenos">2406</span></a><span class="sd"> Returns:</span> -</span><span id="L-2407"><a href="#L-2407"><span class="linenos">2407</span></a><span class="sd"> The modified expression.</span> -</span><span id="L-2408"><a href="#L-2408"><span class="linenos">2408</span></a><span class="sd"> """</span> +</span><span id="L-2406"><a href="#L-2406"><span class="linenos">2406</span></a><span class="sd"> Example:</span> +</span><span id="L-2407"><a href="#L-2407"><span class="linenos">2407</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="L-2408"><a href="#L-2408"><span class="linenos">2408</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> </span><span id="L-2409"><a href="#L-2409"><span class="linenos">2409</span></a> -</span><span id="L-2410"><a href="#L-2410"><span class="linenos">2410</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-2411"><a href="#L-2411"><span class="linenos">2411</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> -</span><span id="L-2412"><a href="#L-2412"><span class="linenos">2412</span></a> -</span><span id="L-2413"><a href="#L-2413"><span class="linenos">2413</span></a> <span class="k">return</span> <span class="n">inst</span> -</span><span id="L-2414"><a href="#L-2414"><span class="linenos">2414</span></a> -</span><span id="L-2415"><a href="#L-2415"><span class="linenos">2415</span></a> <span class="nd">@property</span> -</span><span id="L-2416"><a href="#L-2416"><span class="linenos">2416</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="L-2417"><a href="#L-2417"><span class="linenos">2417</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">alias_or_name</span><span class="p">]</span> -</span><span id="L-2418"><a href="#L-2418"><span class="linenos">2418</span></a> -</span><span id="L-2419"><a href="#L-2419"><span class="linenos">2419</span></a> <span class="nd">@property</span> -</span><span id="L-2420"><a href="#L-2420"><span class="linenos">2420</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">Expression</span><span class="p">]:</span> -</span><span id="L-2421"><a href="#L-2421"><span class="linenos">2421</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> -</span><span id="L-2422"><a href="#L-2422"><span class="linenos">2422</span></a> -</span><span id="L-2423"><a href="#L-2423"><span class="linenos">2423</span></a> -</span><span id="L-2424"><a href="#L-2424"><span class="linenos">2424</span></a><span class="k">class</span> <span class="nc">Subquery</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> -</span><span id="L-2425"><a href="#L-2425"><span class="linenos">2425</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2426"><a href="#L-2426"><span class="linenos">2426</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2427"><a href="#L-2427"><span class="linenos">2427</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2428"><a href="#L-2428"><span class="linenos">2428</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2429"><a href="#L-2429"><span class="linenos">2429</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="L-2430"><a href="#L-2430"><span class="linenos">2430</span></a> <span class="p">}</span> +</span><span id="L-2410"><a href="#L-2410"><span class="linenos">2410</span></a><span class="sd"> Args:</span> +</span><span id="L-2411"><a href="#L-2411"><span class="linenos">2411</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="L-2412"><a href="#L-2412"><span class="linenos">2412</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-2413"><a href="#L-2413"><span class="linenos">2413</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> +</span><span id="L-2414"><a href="#L-2414"><span class="linenos">2414</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> +</span><span id="L-2415"><a href="#L-2415"><span class="linenos">2415</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="L-2416"><a href="#L-2416"><span class="linenos">2416</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> +</span><span id="L-2417"><a href="#L-2417"><span class="linenos">2417</span></a> +</span><span id="L-2418"><a href="#L-2418"><span class="linenos">2418</span></a><span class="sd"> Returns:</span> +</span><span id="L-2419"><a href="#L-2419"><span class="linenos">2419</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> +</span><span id="L-2420"><a href="#L-2420"><span class="linenos">2420</span></a><span class="sd"> """</span> +</span><span id="L-2421"><a href="#L-2421"><span class="linenos">2421</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-2422"><a href="#L-2422"><span class="linenos">2422</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-2423"><a href="#L-2423"><span class="linenos">2423</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="L-2424"><a href="#L-2424"><span class="linenos">2424</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="L-2425"><a href="#L-2425"><span class="linenos">2425</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-2426"><a href="#L-2426"><span class="linenos">2426</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-2427"><a href="#L-2427"><span class="linenos">2427</span></a> <span class="p">)</span> +</span><span id="L-2428"><a href="#L-2428"><span class="linenos">2428</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="L-2429"><a href="#L-2429"><span class="linenos">2429</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="L-2430"><a href="#L-2430"><span class="linenos">2430</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> </span><span id="L-2431"><a href="#L-2431"><span class="linenos">2431</span></a> -</span><span id="L-2432"><a href="#L-2432"><span class="linenos">2432</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2433"><a href="#L-2433"><span class="linenos">2433</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2434"><a href="#L-2434"><span class="linenos">2434</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="L-2435"><a href="#L-2435"><span class="linenos">2435</span></a><span class="sd"> """</span> -</span><span id="L-2436"><a href="#L-2436"><span class="linenos">2436</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="L-2437"><a href="#L-2437"><span class="linenos">2437</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> -</span><span id="L-2438"><a href="#L-2438"><span class="linenos">2438</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-2439"><a href="#L-2439"><span class="linenos">2439</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-2440"><a href="#L-2440"><span class="linenos">2440</span></a> -</span><span id="L-2441"><a href="#L-2441"><span class="linenos">2441</span></a> <span class="nd">@property</span> -</span><span id="L-2442"><a href="#L-2442"><span class="linenos">2442</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2443"><a href="#L-2443"><span class="linenos">2443</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> -</span><span id="L-2444"><a href="#L-2444"><span class="linenos">2444</span></a> -</span><span id="L-2445"><a href="#L-2445"><span class="linenos">2445</span></a> -</span><span id="L-2446"><a href="#L-2446"><span class="linenos">2446</span></a><span class="k">class</span> <span class="nc">TableSample</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2447"><a href="#L-2447"><span class="linenos">2447</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2448"><a href="#L-2448"><span class="linenos">2448</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2449"><a href="#L-2449"><span class="linenos">2449</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2450"><a href="#L-2450"><span class="linenos">2450</span></a> <span class="s2">"bucket_numerator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2451"><a href="#L-2451"><span class="linenos">2451</span></a> <span class="s2">"bucket_denominator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2452"><a href="#L-2452"><span class="linenos">2452</span></a> <span class="s2">"bucket_field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2453"><a href="#L-2453"><span class="linenos">2453</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2454"><a href="#L-2454"><span class="linenos">2454</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2455"><a href="#L-2455"><span class="linenos">2455</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2456"><a href="#L-2456"><span class="linenos">2456</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2457"><a href="#L-2457"><span class="linenos">2457</span></a> <span class="p">}</span> -</span><span id="L-2458"><a href="#L-2458"><span class="linenos">2458</span></a> -</span><span id="L-2459"><a href="#L-2459"><span class="linenos">2459</span></a> -</span><span id="L-2460"><a href="#L-2460"><span class="linenos">2460</span></a><span class="k">class</span> <span class="nc">Tag</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2461"><a href="#L-2461"><span class="linenos">2461</span></a><span class="w"> </span><span class="sd">"""Tags are used for generating arbitrary sql like SELECT <span>x</span>."""</span> +</span><span id="L-2432"><a href="#L-2432"><span class="linenos">2432</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="L-2433"><a href="#L-2433"><span class="linenos">2433</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> +</span><span id="L-2434"><a href="#L-2434"><span class="linenos">2434</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> +</span><span id="L-2435"><a href="#L-2435"><span class="linenos">2435</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="L-2436"><a href="#L-2436"><span class="linenos">2436</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> +</span><span id="L-2437"><a href="#L-2437"><span class="linenos">2437</span></a> <span class="p">)</span> +</span><span id="L-2438"><a href="#L-2438"><span class="linenos">2438</span></a> +</span><span id="L-2439"><a href="#L-2439"><span class="linenos">2439</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-2440"><a href="#L-2440"><span class="linenos">2440</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2441"><a href="#L-2441"><span class="linenos">2441</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="L-2442"><a href="#L-2442"><span class="linenos">2442</span></a> +</span><span id="L-2443"><a href="#L-2443"><span class="linenos">2443</span></a><span class="sd"> Examples:</span> +</span><span id="L-2444"><a href="#L-2444"><span class="linenos">2444</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="L-2445"><a href="#L-2445"><span class="linenos">2445</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> +</span><span id="L-2446"><a href="#L-2446"><span class="linenos">2446</span></a> +</span><span id="L-2447"><a href="#L-2447"><span class="linenos">2447</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="L-2448"><a href="#L-2448"><span class="linenos">2448</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="L-2449"><a href="#L-2449"><span class="linenos">2449</span></a> +</span><span id="L-2450"><a href="#L-2450"><span class="linenos">2450</span></a><span class="sd"> Args:</span> +</span><span id="L-2451"><a href="#L-2451"><span class="linenos">2451</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> +</span><span id="L-2452"><a href="#L-2452"><span class="linenos">2452</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="L-2453"><a href="#L-2453"><span class="linenos">2453</span></a> +</span><span id="L-2454"><a href="#L-2454"><span class="linenos">2454</span></a><span class="sd"> Returns:</span> +</span><span id="L-2455"><a href="#L-2455"><span class="linenos">2455</span></a><span class="sd"> The modified expression.</span> +</span><span id="L-2456"><a href="#L-2456"><span class="linenos">2456</span></a><span class="sd"> """</span> +</span><span id="L-2457"><a href="#L-2457"><span class="linenos">2457</span></a> +</span><span id="L-2458"><a href="#L-2458"><span class="linenos">2458</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-2459"><a href="#L-2459"><span class="linenos">2459</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> +</span><span id="L-2460"><a href="#L-2460"><span class="linenos">2460</span></a> +</span><span id="L-2461"><a href="#L-2461"><span class="linenos">2461</span></a> <span class="k">return</span> <span class="n">inst</span> </span><span id="L-2462"><a href="#L-2462"><span class="linenos">2462</span></a> -</span><span id="L-2463"><a href="#L-2463"><span class="linenos">2463</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2464"><a href="#L-2464"><span class="linenos">2464</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2465"><a href="#L-2465"><span class="linenos">2465</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2466"><a href="#L-2466"><span class="linenos">2466</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2467"><a href="#L-2467"><span class="linenos">2467</span></a> <span class="p">}</span> -</span><span id="L-2468"><a href="#L-2468"><span class="linenos">2468</span></a> -</span><span id="L-2469"><a href="#L-2469"><span class="linenos">2469</span></a> -</span><span id="L-2470"><a href="#L-2470"><span class="linenos">2470</span></a><span class="k">class</span> <span class="nc">Pivot</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2471"><a href="#L-2471"><span class="linenos">2471</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2472"><a href="#L-2472"><span class="linenos">2472</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2473"><a href="#L-2473"><span class="linenos">2473</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2474"><a href="#L-2474"><span class="linenos">2474</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2475"><a href="#L-2475"><span class="linenos">2475</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2476"><a href="#L-2476"><span class="linenos">2476</span></a> <span class="p">}</span> -</span><span id="L-2477"><a href="#L-2477"><span class="linenos">2477</span></a> -</span><span id="L-2478"><a href="#L-2478"><span class="linenos">2478</span></a> -</span><span id="L-2479"><a href="#L-2479"><span class="linenos">2479</span></a><span class="k">class</span> <span class="nc">Window</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2480"><a href="#L-2480"><span class="linenos">2480</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2481"><a href="#L-2481"><span class="linenos">2481</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2482"><a href="#L-2482"><span class="linenos">2482</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2483"><a href="#L-2483"><span class="linenos">2483</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2484"><a href="#L-2484"><span class="linenos">2484</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2485"><a href="#L-2485"><span class="linenos">2485</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2486"><a href="#L-2486"><span class="linenos">2486</span></a> <span class="p">}</span> -</span><span id="L-2487"><a href="#L-2487"><span class="linenos">2487</span></a> -</span><span id="L-2488"><a href="#L-2488"><span class="linenos">2488</span></a> -</span><span id="L-2489"><a href="#L-2489"><span class="linenos">2489</span></a><span class="k">class</span> <span class="nc">WindowSpec</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2490"><a href="#L-2490"><span class="linenos">2490</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2491"><a href="#L-2491"><span class="linenos">2491</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2492"><a href="#L-2492"><span class="linenos">2492</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2493"><a href="#L-2493"><span class="linenos">2493</span></a> <span class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2494"><a href="#L-2494"><span class="linenos">2494</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2495"><a href="#L-2495"><span class="linenos">2495</span></a> <span class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2496"><a href="#L-2496"><span class="linenos">2496</span></a> <span class="p">}</span> -</span><span id="L-2497"><a href="#L-2497"><span class="linenos">2497</span></a> -</span><span id="L-2498"><a href="#L-2498"><span class="linenos">2498</span></a> -</span><span id="L-2499"><a href="#L-2499"><span class="linenos">2499</span></a><span class="k">class</span> <span class="nc">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2500"><a href="#L-2500"><span class="linenos">2500</span></a> <span class="k">pass</span> +</span><span id="L-2463"><a href="#L-2463"><span class="linenos">2463</span></a> <span class="nd">@property</span> +</span><span id="L-2464"><a href="#L-2464"><span class="linenos">2464</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="L-2465"><a href="#L-2465"><span class="linenos">2465</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">alias_or_name</span><span class="p">]</span> +</span><span id="L-2466"><a href="#L-2466"><span class="linenos">2466</span></a> +</span><span id="L-2467"><a href="#L-2467"><span class="linenos">2467</span></a> <span class="nd">@property</span> +</span><span id="L-2468"><a href="#L-2468"><span class="linenos">2468</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-2469"><a href="#L-2469"><span class="linenos">2469</span></a> <span class="k">return</span> <span class="nb">any</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">is_star</span> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">)</span> +</span><span id="L-2470"><a href="#L-2470"><span class="linenos">2470</span></a> +</span><span id="L-2471"><a href="#L-2471"><span class="linenos">2471</span></a> <span class="nd">@property</span> +</span><span id="L-2472"><a href="#L-2472"><span class="linenos">2472</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">Expression</span><span class="p">]:</span> +</span><span id="L-2473"><a href="#L-2473"><span class="linenos">2473</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-2474"><a href="#L-2474"><span class="linenos">2474</span></a> +</span><span id="L-2475"><a href="#L-2475"><span class="linenos">2475</span></a> +</span><span id="L-2476"><a href="#L-2476"><span class="linenos">2476</span></a><span class="k">class</span> <span class="nc">Subquery</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> +</span><span id="L-2477"><a href="#L-2477"><span class="linenos">2477</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2478"><a href="#L-2478"><span class="linenos">2478</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2479"><a href="#L-2479"><span class="linenos">2479</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2480"><a href="#L-2480"><span class="linenos">2480</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2481"><a href="#L-2481"><span class="linenos">2481</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="L-2482"><a href="#L-2482"><span class="linenos">2482</span></a> <span class="p">}</span> +</span><span id="L-2483"><a href="#L-2483"><span class="linenos">2483</span></a> +</span><span id="L-2484"><a href="#L-2484"><span class="linenos">2484</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2485"><a href="#L-2485"><span class="linenos">2485</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-2486"><a href="#L-2486"><span class="linenos">2486</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="L-2487"><a href="#L-2487"><span class="linenos">2487</span></a><span class="sd"> """</span> +</span><span id="L-2488"><a href="#L-2488"><span class="linenos">2488</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="L-2489"><a href="#L-2489"><span class="linenos">2489</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> +</span><span id="L-2490"><a href="#L-2490"><span class="linenos">2490</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-2491"><a href="#L-2491"><span class="linenos">2491</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-2492"><a href="#L-2492"><span class="linenos">2492</span></a> +</span><span id="L-2493"><a href="#L-2493"><span class="linenos">2493</span></a> <span class="nd">@property</span> +</span><span id="L-2494"><a href="#L-2494"><span class="linenos">2494</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-2495"><a href="#L-2495"><span class="linenos">2495</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">is_star</span> +</span><span id="L-2496"><a href="#L-2496"><span class="linenos">2496</span></a> +</span><span id="L-2497"><a href="#L-2497"><span class="linenos">2497</span></a> <span class="nd">@property</span> +</span><span id="L-2498"><a href="#L-2498"><span class="linenos">2498</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2499"><a href="#L-2499"><span class="linenos">2499</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> +</span><span id="L-2500"><a href="#L-2500"><span class="linenos">2500</span></a> </span><span id="L-2501"><a href="#L-2501"><span class="linenos">2501</span></a> -</span><span id="L-2502"><a href="#L-2502"><span class="linenos">2502</span></a> -</span><span id="L-2503"><a href="#L-2503"><span class="linenos">2503</span></a><span class="k">class</span> <span class="nc">Star</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2504"><a href="#L-2504"><span class="linenos">2504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"except"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2505"><a href="#L-2505"><span class="linenos">2505</span></a> -</span><span id="L-2506"><a href="#L-2506"><span class="linenos">2506</span></a> <span class="nd">@property</span> -</span><span id="L-2507"><a href="#L-2507"><span class="linenos">2507</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-2508"><a href="#L-2508"><span class="linenos">2508</span></a> <span class="k">return</span> <span class="s2">"*"</span> -</span><span id="L-2509"><a href="#L-2509"><span class="linenos">2509</span></a> -</span><span id="L-2510"><a href="#L-2510"><span class="linenos">2510</span></a> <span class="nd">@property</span> -</span><span id="L-2511"><a href="#L-2511"><span class="linenos">2511</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2512"><a href="#L-2512"><span class="linenos">2512</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-2513"><a href="#L-2513"><span class="linenos">2513</span></a> +</span><span id="L-2502"><a href="#L-2502"><span class="linenos">2502</span></a><span class="k">class</span> <span class="nc">TableSample</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2503"><a href="#L-2503"><span class="linenos">2503</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2504"><a href="#L-2504"><span class="linenos">2504</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2505"><a href="#L-2505"><span class="linenos">2505</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2506"><a href="#L-2506"><span class="linenos">2506</span></a> <span class="s2">"bucket_numerator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2507"><a href="#L-2507"><span class="linenos">2507</span></a> <span class="s2">"bucket_denominator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2508"><a href="#L-2508"><span class="linenos">2508</span></a> <span class="s2">"bucket_field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2509"><a href="#L-2509"><span class="linenos">2509</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2510"><a href="#L-2510"><span class="linenos">2510</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2511"><a href="#L-2511"><span class="linenos">2511</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2512"><a href="#L-2512"><span class="linenos">2512</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2513"><a href="#L-2513"><span class="linenos">2513</span></a> <span class="p">}</span> </span><span id="L-2514"><a href="#L-2514"><span class="linenos">2514</span></a> -</span><span id="L-2515"><a href="#L-2515"><span class="linenos">2515</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2516"><a href="#L-2516"><span class="linenos">2516</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2517"><a href="#L-2517"><span class="linenos">2517</span></a> +</span><span id="L-2515"><a href="#L-2515"><span class="linenos">2515</span></a> +</span><span id="L-2516"><a href="#L-2516"><span class="linenos">2516</span></a><span class="k">class</span> <span class="nc">Tag</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2517"><a href="#L-2517"><span class="linenos">2517</span></a><span class="w"> </span><span class="sd">"""Tags are used for generating arbitrary sql like SELECT <span>x</span>."""</span> </span><span id="L-2518"><a href="#L-2518"><span class="linenos">2518</span></a> -</span><span id="L-2519"><a href="#L-2519"><span class="linenos">2519</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2520"><a href="#L-2520"><span class="linenos">2520</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2521"><a href="#L-2521"><span class="linenos">2521</span></a> -</span><span id="L-2522"><a href="#L-2522"><span class="linenos">2522</span></a> -</span><span id="L-2523"><a href="#L-2523"><span class="linenos">2523</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2524"><a href="#L-2524"><span class="linenos">2524</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2519"><a href="#L-2519"><span class="linenos">2519</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2520"><a href="#L-2520"><span class="linenos">2520</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2521"><a href="#L-2521"><span class="linenos">2521</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2522"><a href="#L-2522"><span class="linenos">2522</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2523"><a href="#L-2523"><span class="linenos">2523</span></a> <span class="p">}</span> +</span><span id="L-2524"><a href="#L-2524"><span class="linenos">2524</span></a> </span><span id="L-2525"><a href="#L-2525"><span class="linenos">2525</span></a> -</span><span id="L-2526"><a href="#L-2526"><span class="linenos">2526</span></a> -</span><span id="L-2527"><a href="#L-2527"><span class="linenos">2527</span></a><span class="k">class</span> <span class="nc">Null</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2528"><a href="#L-2528"><span class="linenos">2528</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="L-2529"><a href="#L-2529"><span class="linenos">2529</span></a> -</span><span id="L-2530"><a href="#L-2530"><span class="linenos">2530</span></a> <span class="nd">@property</span> -</span><span id="L-2531"><a href="#L-2531"><span class="linenos">2531</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-2532"><a href="#L-2532"><span class="linenos">2532</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> -</span><span id="L-2533"><a href="#L-2533"><span class="linenos">2533</span></a> +</span><span id="L-2526"><a href="#L-2526"><span class="linenos">2526</span></a><span class="k">class</span> <span class="nc">Pivot</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2527"><a href="#L-2527"><span class="linenos">2527</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2528"><a href="#L-2528"><span class="linenos">2528</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2529"><a href="#L-2529"><span class="linenos">2529</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2530"><a href="#L-2530"><span class="linenos">2530</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2531"><a href="#L-2531"><span class="linenos">2531</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2532"><a href="#L-2532"><span class="linenos">2532</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2533"><a href="#L-2533"><span class="linenos">2533</span></a> <span class="p">}</span> </span><span id="L-2534"><a href="#L-2534"><span class="linenos">2534</span></a> -</span><span id="L-2535"><a href="#L-2535"><span class="linenos">2535</span></a><span class="k">class</span> <span class="nc">Boolean</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2536"><a href="#L-2536"><span class="linenos">2536</span></a> <span class="k">pass</span> -</span><span id="L-2537"><a href="#L-2537"><span class="linenos">2537</span></a> -</span><span id="L-2538"><a href="#L-2538"><span class="linenos">2538</span></a> -</span><span id="L-2539"><a href="#L-2539"><span class="linenos">2539</span></a><span class="k">class</span> <span class="nc">DataType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2540"><a href="#L-2540"><span class="linenos">2540</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2541"><a href="#L-2541"><span class="linenos">2541</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2542"><a href="#L-2542"><span class="linenos">2542</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2543"><a href="#L-2543"><span class="linenos">2543</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2544"><a href="#L-2544"><span class="linenos">2544</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2545"><a href="#L-2545"><span class="linenos">2545</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2546"><a href="#L-2546"><span class="linenos">2546</span></a> <span class="p">}</span> -</span><span id="L-2547"><a href="#L-2547"><span class="linenos">2547</span></a> -</span><span id="L-2548"><a href="#L-2548"><span class="linenos">2548</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="L-2549"><a href="#L-2549"><span class="linenos">2549</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2550"><a href="#L-2550"><span class="linenos">2550</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2551"><a href="#L-2551"><span class="linenos">2551</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2552"><a href="#L-2552"><span class="linenos">2552</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2553"><a href="#L-2553"><span class="linenos">2553</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2554"><a href="#L-2554"><span class="linenos">2554</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2555"><a href="#L-2555"><span class="linenos">2555</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2556"><a href="#L-2556"><span class="linenos">2556</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2557"><a href="#L-2557"><span class="linenos">2557</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2558"><a href="#L-2558"><span class="linenos">2558</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2559"><a href="#L-2559"><span class="linenos">2559</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2560"><a href="#L-2560"><span class="linenos">2560</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2561"><a href="#L-2561"><span class="linenos">2561</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2562"><a href="#L-2562"><span class="linenos">2562</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2563"><a href="#L-2563"><span class="linenos">2563</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2564"><a href="#L-2564"><span class="linenos">2564</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2565"><a href="#L-2565"><span class="linenos">2565</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2566"><a href="#L-2566"><span class="linenos">2566</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2567"><a href="#L-2567"><span class="linenos">2567</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2568"><a href="#L-2568"><span class="linenos">2568</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2569"><a href="#L-2569"><span class="linenos">2569</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2570"><a href="#L-2570"><span class="linenos">2570</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2571"><a href="#L-2571"><span class="linenos">2571</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2572"><a href="#L-2572"><span class="linenos">2572</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2573"><a href="#L-2573"><span class="linenos">2573</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2574"><a href="#L-2574"><span class="linenos">2574</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2575"><a href="#L-2575"><span class="linenos">2575</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2576"><a href="#L-2576"><span class="linenos">2576</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2577"><a href="#L-2577"><span class="linenos">2577</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2578"><a href="#L-2578"><span class="linenos">2578</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2579"><a href="#L-2579"><span class="linenos">2579</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2580"><a href="#L-2580"><span class="linenos">2580</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2581"><a href="#L-2581"><span class="linenos">2581</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2582"><a href="#L-2582"><span class="linenos">2582</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2583"><a href="#L-2583"><span class="linenos">2583</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2584"><a href="#L-2584"><span class="linenos">2584</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2585"><a href="#L-2585"><span class="linenos">2585</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2586"><a href="#L-2586"><span class="linenos">2586</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2587"><a href="#L-2587"><span class="linenos">2587</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2588"><a href="#L-2588"><span class="linenos">2588</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2589"><a href="#L-2589"><span class="linenos">2589</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2590"><a href="#L-2590"><span class="linenos">2590</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2591"><a href="#L-2591"><span class="linenos">2591</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2592"><a href="#L-2592"><span class="linenos">2592</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2593"><a href="#L-2593"><span class="linenos">2593</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2594"><a href="#L-2594"><span class="linenos">2594</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2595"><a href="#L-2595"><span class="linenos">2595</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2596"><a href="#L-2596"><span class="linenos">2596</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2597"><a href="#L-2597"><span class="linenos">2597</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2598"><a href="#L-2598"><span class="linenos">2598</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="L-2599"><a href="#L-2599"><span class="linenos">2599</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> -</span><span id="L-2600"><a href="#L-2600"><span class="linenos">2600</span></a> -</span><span id="L-2601"><a href="#L-2601"><span class="linenos">2601</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2602"><a href="#L-2602"><span class="linenos">2602</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> -</span><span id="L-2603"><a href="#L-2603"><span class="linenos">2603</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> -</span><span id="L-2604"><a href="#L-2604"><span class="linenos">2604</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> -</span><span id="L-2605"><a href="#L-2605"><span class="linenos">2605</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> -</span><span id="L-2606"><a href="#L-2606"><span class="linenos">2606</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> -</span><span id="L-2607"><a href="#L-2607"><span class="linenos">2607</span></a> <span class="p">}</span> -</span><span id="L-2608"><a href="#L-2608"><span class="linenos">2608</span></a> -</span><span id="L-2609"><a href="#L-2609"><span class="linenos">2609</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2610"><a href="#L-2610"><span class="linenos">2610</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> -</span><span id="L-2611"><a href="#L-2611"><span class="linenos">2611</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> -</span><span id="L-2612"><a href="#L-2612"><span class="linenos">2612</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> -</span><span id="L-2613"><a href="#L-2613"><span class="linenos">2613</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> -</span><span id="L-2614"><a href="#L-2614"><span class="linenos">2614</span></a> <span class="p">}</span> -</span><span id="L-2615"><a href="#L-2615"><span class="linenos">2615</span></a> -</span><span id="L-2616"><a href="#L-2616"><span class="linenos">2616</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2617"><a href="#L-2617"><span class="linenos">2617</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> -</span><span id="L-2618"><a href="#L-2618"><span class="linenos">2618</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> -</span><span id="L-2619"><a href="#L-2619"><span class="linenos">2619</span></a> <span class="p">}</span> -</span><span id="L-2620"><a href="#L-2620"><span class="linenos">2620</span></a> -</span><span id="L-2621"><a href="#L-2621"><span class="linenos">2621</span></a> <span class="n">NUMERIC_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">INTEGER_TYPES</span><span class="p">,</span> <span class="o">*</span><span class="n">FLOAT_TYPES</span><span class="p">}</span> -</span><span id="L-2622"><a href="#L-2622"><span class="linenos">2622</span></a> -</span><span id="L-2623"><a href="#L-2623"><span class="linenos">2623</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2624"><a href="#L-2624"><span class="linenos">2624</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> -</span><span id="L-2625"><a href="#L-2625"><span class="linenos">2625</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> -</span><span id="L-2626"><a href="#L-2626"><span class="linenos">2626</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> -</span><span id="L-2627"><a href="#L-2627"><span class="linenos">2627</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> -</span><span id="L-2628"><a href="#L-2628"><span class="linenos">2628</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> -</span><span id="L-2629"><a href="#L-2629"><span class="linenos">2629</span></a> <span class="p">}</span> -</span><span id="L-2630"><a href="#L-2630"><span class="linenos">2630</span></a> -</span><span id="L-2631"><a href="#L-2631"><span class="linenos">2631</span></a> <span class="nd">@classmethod</span> -</span><span id="L-2632"><a href="#L-2632"><span class="linenos">2632</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="L-2633"><a href="#L-2633"><span class="linenos">2633</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> -</span><span id="L-2634"><a href="#L-2634"><span class="linenos">2634</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="L-2635"><a href="#L-2635"><span class="linenos">2635</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> -</span><span id="L-2636"><a href="#L-2636"><span class="linenos">2636</span></a> -</span><span id="L-2637"><a href="#L-2637"><span class="linenos">2637</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-2638"><a href="#L-2638"><span class="linenos">2638</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> -</span><span id="L-2639"><a href="#L-2639"><span class="linenos">2639</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> -</span><span id="L-2640"><a href="#L-2640"><span class="linenos">2640</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-2641"><a href="#L-2641"><span class="linenos">2641</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> -</span><span id="L-2642"><a href="#L-2642"><span class="linenos">2642</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-2643"><a href="#L-2643"><span class="linenos">2643</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-2644"><a href="#L-2644"><span class="linenos">2644</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> -</span><span id="L-2645"><a href="#L-2645"><span class="linenos">2645</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="L-2646"><a href="#L-2646"><span class="linenos">2646</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> -</span><span id="L-2647"><a href="#L-2647"><span class="linenos">2647</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="L-2648"><a href="#L-2648"><span class="linenos">2648</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-2649"><a href="#L-2649"><span class="linenos">2649</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> -</span><span id="L-2650"><a href="#L-2650"><span class="linenos">2650</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> -</span><span id="L-2651"><a href="#L-2651"><span class="linenos">2651</span></a> -</span><span id="L-2652"><a href="#L-2652"><span class="linenos">2652</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-2653"><a href="#L-2653"><span class="linenos">2653</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> -</span><span id="L-2654"><a href="#L-2654"><span class="linenos">2654</span></a> -</span><span id="L-2655"><a href="#L-2655"><span class="linenos">2655</span></a> -</span><span id="L-2656"><a href="#L-2656"><span class="linenos">2656</span></a><span class="c1"># https://www.postgresql.org/docs/15/datatype-pseudo.html</span> -</span><span id="L-2657"><a href="#L-2657"><span class="linenos">2657</span></a><span class="k">class</span> <span class="nc">PseudoType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2658"><a href="#L-2658"><span class="linenos">2658</span></a> <span class="k">pass</span> -</span><span id="L-2659"><a href="#L-2659"><span class="linenos">2659</span></a> -</span><span id="L-2660"><a href="#L-2660"><span class="linenos">2660</span></a> -</span><span id="L-2661"><a href="#L-2661"><span class="linenos">2661</span></a><span class="k">class</span> <span class="nc">StructKwarg</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2662"><a href="#L-2662"><span class="linenos">2662</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-2663"><a href="#L-2663"><span class="linenos">2663</span></a> -</span><span id="L-2664"><a href="#L-2664"><span class="linenos">2664</span></a> -</span><span id="L-2665"><a href="#L-2665"><span class="linenos">2665</span></a><span class="c1"># WHERE x <OP> EXISTS|ALL|ANY|SOME(SELECT ...)</span> -</span><span id="L-2666"><a href="#L-2666"><span class="linenos">2666</span></a><span class="k">class</span> <span class="nc">SubqueryPredicate</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2667"><a href="#L-2667"><span class="linenos">2667</span></a> <span class="k">pass</span> -</span><span id="L-2668"><a href="#L-2668"><span class="linenos">2668</span></a> -</span><span id="L-2669"><a href="#L-2669"><span class="linenos">2669</span></a> -</span><span id="L-2670"><a href="#L-2670"><span class="linenos">2670</span></a><span class="k">class</span> <span class="nc">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="L-2671"><a href="#L-2671"><span class="linenos">2671</span></a> <span class="k">pass</span> -</span><span id="L-2672"><a href="#L-2672"><span class="linenos">2672</span></a> +</span><span id="L-2535"><a href="#L-2535"><span class="linenos">2535</span></a> +</span><span id="L-2536"><a href="#L-2536"><span class="linenos">2536</span></a><span class="k">class</span> <span class="nc">Window</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2537"><a href="#L-2537"><span class="linenos">2537</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2538"><a href="#L-2538"><span class="linenos">2538</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2539"><a href="#L-2539"><span class="linenos">2539</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2540"><a href="#L-2540"><span class="linenos">2540</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2541"><a href="#L-2541"><span class="linenos">2541</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2542"><a href="#L-2542"><span class="linenos">2542</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2543"><a href="#L-2543"><span class="linenos">2543</span></a> <span class="p">}</span> +</span><span id="L-2544"><a href="#L-2544"><span class="linenos">2544</span></a> +</span><span id="L-2545"><a href="#L-2545"><span class="linenos">2545</span></a> +</span><span id="L-2546"><a href="#L-2546"><span class="linenos">2546</span></a><span class="k">class</span> <span class="nc">WindowSpec</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2547"><a href="#L-2547"><span class="linenos">2547</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2548"><a href="#L-2548"><span class="linenos">2548</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2549"><a href="#L-2549"><span class="linenos">2549</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2550"><a href="#L-2550"><span class="linenos">2550</span></a> <span class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2551"><a href="#L-2551"><span class="linenos">2551</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2552"><a href="#L-2552"><span class="linenos">2552</span></a> <span class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2553"><a href="#L-2553"><span class="linenos">2553</span></a> <span class="p">}</span> +</span><span id="L-2554"><a href="#L-2554"><span class="linenos">2554</span></a> +</span><span id="L-2555"><a href="#L-2555"><span class="linenos">2555</span></a> +</span><span id="L-2556"><a href="#L-2556"><span class="linenos">2556</span></a><span class="k">class</span> <span class="nc">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2557"><a href="#L-2557"><span class="linenos">2557</span></a> <span class="k">pass</span> +</span><span id="L-2558"><a href="#L-2558"><span class="linenos">2558</span></a> +</span><span id="L-2559"><a href="#L-2559"><span class="linenos">2559</span></a> +</span><span id="L-2560"><a href="#L-2560"><span class="linenos">2560</span></a><span class="k">class</span> <span class="nc">Star</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2561"><a href="#L-2561"><span class="linenos">2561</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"except"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2562"><a href="#L-2562"><span class="linenos">2562</span></a> +</span><span id="L-2563"><a href="#L-2563"><span class="linenos">2563</span></a> <span class="nd">@property</span> +</span><span id="L-2564"><a href="#L-2564"><span class="linenos">2564</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-2565"><a href="#L-2565"><span class="linenos">2565</span></a> <span class="k">return</span> <span class="s2">"*"</span> +</span><span id="L-2566"><a href="#L-2566"><span class="linenos">2566</span></a> +</span><span id="L-2567"><a href="#L-2567"><span class="linenos">2567</span></a> <span class="nd">@property</span> +</span><span id="L-2568"><a href="#L-2568"><span class="linenos">2568</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2569"><a href="#L-2569"><span class="linenos">2569</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-2570"><a href="#L-2570"><span class="linenos">2570</span></a> +</span><span id="L-2571"><a href="#L-2571"><span class="linenos">2571</span></a> +</span><span id="L-2572"><a href="#L-2572"><span class="linenos">2572</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2573"><a href="#L-2573"><span class="linenos">2573</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2574"><a href="#L-2574"><span class="linenos">2574</span></a> +</span><span id="L-2575"><a href="#L-2575"><span class="linenos">2575</span></a> +</span><span id="L-2576"><a href="#L-2576"><span class="linenos">2576</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2577"><a href="#L-2577"><span class="linenos">2577</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2578"><a href="#L-2578"><span class="linenos">2578</span></a> +</span><span id="L-2579"><a href="#L-2579"><span class="linenos">2579</span></a> +</span><span id="L-2580"><a href="#L-2580"><span class="linenos">2580</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2581"><a href="#L-2581"><span class="linenos">2581</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2582"><a href="#L-2582"><span class="linenos">2582</span></a> +</span><span id="L-2583"><a href="#L-2583"><span class="linenos">2583</span></a> +</span><span id="L-2584"><a href="#L-2584"><span class="linenos">2584</span></a><span class="k">class</span> <span class="nc">Null</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2585"><a href="#L-2585"><span class="linenos">2585</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-2586"><a href="#L-2586"><span class="linenos">2586</span></a> +</span><span id="L-2587"><a href="#L-2587"><span class="linenos">2587</span></a> <span class="nd">@property</span> +</span><span id="L-2588"><a href="#L-2588"><span class="linenos">2588</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-2589"><a href="#L-2589"><span class="linenos">2589</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> +</span><span id="L-2590"><a href="#L-2590"><span class="linenos">2590</span></a> +</span><span id="L-2591"><a href="#L-2591"><span class="linenos">2591</span></a> +</span><span id="L-2592"><a href="#L-2592"><span class="linenos">2592</span></a><span class="k">class</span> <span class="nc">Boolean</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2593"><a href="#L-2593"><span class="linenos">2593</span></a> <span class="k">pass</span> +</span><span id="L-2594"><a href="#L-2594"><span class="linenos">2594</span></a> +</span><span id="L-2595"><a href="#L-2595"><span class="linenos">2595</span></a> +</span><span id="L-2596"><a href="#L-2596"><span class="linenos">2596</span></a><span class="k">class</span> <span class="nc">DataType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2597"><a href="#L-2597"><span class="linenos">2597</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2598"><a href="#L-2598"><span class="linenos">2598</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2599"><a href="#L-2599"><span class="linenos">2599</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2600"><a href="#L-2600"><span class="linenos">2600</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2601"><a href="#L-2601"><span class="linenos">2601</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2602"><a href="#L-2602"><span class="linenos">2602</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2603"><a href="#L-2603"><span class="linenos">2603</span></a> <span class="p">}</span> +</span><span id="L-2604"><a href="#L-2604"><span class="linenos">2604</span></a> +</span><span id="L-2605"><a href="#L-2605"><span class="linenos">2605</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="L-2606"><a href="#L-2606"><span class="linenos">2606</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2607"><a href="#L-2607"><span class="linenos">2607</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2608"><a href="#L-2608"><span class="linenos">2608</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2609"><a href="#L-2609"><span class="linenos">2609</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2610"><a href="#L-2610"><span class="linenos">2610</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2611"><a href="#L-2611"><span class="linenos">2611</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2612"><a href="#L-2612"><span class="linenos">2612</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2613"><a href="#L-2613"><span class="linenos">2613</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2614"><a href="#L-2614"><span class="linenos">2614</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2615"><a href="#L-2615"><span class="linenos">2615</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2616"><a href="#L-2616"><span class="linenos">2616</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2617"><a href="#L-2617"><span class="linenos">2617</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2618"><a href="#L-2618"><span class="linenos">2618</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2619"><a href="#L-2619"><span class="linenos">2619</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2620"><a href="#L-2620"><span class="linenos">2620</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2621"><a href="#L-2621"><span class="linenos">2621</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2622"><a href="#L-2622"><span class="linenos">2622</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2623"><a href="#L-2623"><span class="linenos">2623</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2624"><a href="#L-2624"><span class="linenos">2624</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2625"><a href="#L-2625"><span class="linenos">2625</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2626"><a href="#L-2626"><span class="linenos">2626</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2627"><a href="#L-2627"><span class="linenos">2627</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2628"><a href="#L-2628"><span class="linenos">2628</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2629"><a href="#L-2629"><span class="linenos">2629</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2630"><a href="#L-2630"><span class="linenos">2630</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2631"><a href="#L-2631"><span class="linenos">2631</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2632"><a href="#L-2632"><span class="linenos">2632</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2633"><a href="#L-2633"><span class="linenos">2633</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2634"><a href="#L-2634"><span class="linenos">2634</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2635"><a href="#L-2635"><span class="linenos">2635</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2636"><a href="#L-2636"><span class="linenos">2636</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2637"><a href="#L-2637"><span class="linenos">2637</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2638"><a href="#L-2638"><span class="linenos">2638</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2639"><a href="#L-2639"><span class="linenos">2639</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2640"><a href="#L-2640"><span class="linenos">2640</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2641"><a href="#L-2641"><span class="linenos">2641</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2642"><a href="#L-2642"><span class="linenos">2642</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2643"><a href="#L-2643"><span class="linenos">2643</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2644"><a href="#L-2644"><span class="linenos">2644</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2645"><a href="#L-2645"><span class="linenos">2645</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2646"><a href="#L-2646"><span class="linenos">2646</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2647"><a href="#L-2647"><span class="linenos">2647</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2648"><a href="#L-2648"><span class="linenos">2648</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2649"><a href="#L-2649"><span class="linenos">2649</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2650"><a href="#L-2650"><span class="linenos">2650</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2651"><a href="#L-2651"><span class="linenos">2651</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2652"><a href="#L-2652"><span class="linenos">2652</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2653"><a href="#L-2653"><span class="linenos">2653</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2654"><a href="#L-2654"><span class="linenos">2654</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2655"><a href="#L-2655"><span class="linenos">2655</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2656"><a href="#L-2656"><span class="linenos">2656</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="L-2657"><a href="#L-2657"><span class="linenos">2657</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> +</span><span id="L-2658"><a href="#L-2658"><span class="linenos">2658</span></a> +</span><span id="L-2659"><a href="#L-2659"><span class="linenos">2659</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2660"><a href="#L-2660"><span class="linenos">2660</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> +</span><span id="L-2661"><a href="#L-2661"><span class="linenos">2661</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> +</span><span id="L-2662"><a href="#L-2662"><span class="linenos">2662</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> +</span><span id="L-2663"><a href="#L-2663"><span class="linenos">2663</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> +</span><span id="L-2664"><a href="#L-2664"><span class="linenos">2664</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> +</span><span id="L-2665"><a href="#L-2665"><span class="linenos">2665</span></a> <span class="p">}</span> +</span><span id="L-2666"><a href="#L-2666"><span class="linenos">2666</span></a> +</span><span id="L-2667"><a href="#L-2667"><span class="linenos">2667</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2668"><a href="#L-2668"><span class="linenos">2668</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> +</span><span id="L-2669"><a href="#L-2669"><span class="linenos">2669</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> +</span><span id="L-2670"><a href="#L-2670"><span class="linenos">2670</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> +</span><span id="L-2671"><a href="#L-2671"><span class="linenos">2671</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> +</span><span id="L-2672"><a href="#L-2672"><span class="linenos">2672</span></a> <span class="p">}</span> </span><span id="L-2673"><a href="#L-2673"><span class="linenos">2673</span></a> -</span><span id="L-2674"><a href="#L-2674"><span class="linenos">2674</span></a><span class="k">class</span> <span class="nc">Any</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="L-2675"><a href="#L-2675"><span class="linenos">2675</span></a> <span class="k">pass</span> -</span><span id="L-2676"><a href="#L-2676"><span class="linenos">2676</span></a> -</span><span id="L-2677"><a href="#L-2677"><span class="linenos">2677</span></a> -</span><span id="L-2678"><a href="#L-2678"><span class="linenos">2678</span></a><span class="k">class</span> <span class="nc">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="L-2679"><a href="#L-2679"><span class="linenos">2679</span></a> <span class="k">pass</span> +</span><span id="L-2674"><a href="#L-2674"><span class="linenos">2674</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2675"><a href="#L-2675"><span class="linenos">2675</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> +</span><span id="L-2676"><a href="#L-2676"><span class="linenos">2676</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> +</span><span id="L-2677"><a href="#L-2677"><span class="linenos">2677</span></a> <span class="p">}</span> +</span><span id="L-2678"><a href="#L-2678"><span class="linenos">2678</span></a> +</span><span id="L-2679"><a href="#L-2679"><span class="linenos">2679</span></a> <span class="n">NUMERIC_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">INTEGER_TYPES</span><span class="p">,</span> <span class="o">*</span><span class="n">FLOAT_TYPES</span><span class="p">}</span> </span><span id="L-2680"><a href="#L-2680"><span class="linenos">2680</span></a> -</span><span id="L-2681"><a href="#L-2681"><span class="linenos">2681</span></a> -</span><span id="L-2682"><a href="#L-2682"><span class="linenos">2682</span></a><span class="c1"># Commands to interact with the databases or engines. For most of the command</span> -</span><span id="L-2683"><a href="#L-2683"><span class="linenos">2683</span></a><span class="c1"># expressions we parse whatever comes after the command's name as a string.</span> -</span><span id="L-2684"><a href="#L-2684"><span class="linenos">2684</span></a><span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2685"><a href="#L-2685"><span class="linenos">2685</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2686"><a href="#L-2686"><span class="linenos">2686</span></a> -</span><span id="L-2687"><a href="#L-2687"><span class="linenos">2687</span></a> -</span><span id="L-2688"><a href="#L-2688"><span class="linenos">2688</span></a><span class="k">class</span> <span class="nc">Transaction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2689"><a href="#L-2689"><span class="linenos">2689</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"modes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2690"><a href="#L-2690"><span class="linenos">2690</span></a> -</span><span id="L-2691"><a href="#L-2691"><span class="linenos">2691</span></a> -</span><span id="L-2692"><a href="#L-2692"><span class="linenos">2692</span></a><span class="k">class</span> <span class="nc">Commit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2693"><a href="#L-2693"><span class="linenos">2693</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"chain"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2681"><a href="#L-2681"><span class="linenos">2681</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2682"><a href="#L-2682"><span class="linenos">2682</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> +</span><span id="L-2683"><a href="#L-2683"><span class="linenos">2683</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> +</span><span id="L-2684"><a href="#L-2684"><span class="linenos">2684</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> +</span><span id="L-2685"><a href="#L-2685"><span class="linenos">2685</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> +</span><span id="L-2686"><a href="#L-2686"><span class="linenos">2686</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> +</span><span id="L-2687"><a href="#L-2687"><span class="linenos">2687</span></a> <span class="p">}</span> +</span><span id="L-2688"><a href="#L-2688"><span class="linenos">2688</span></a> +</span><span id="L-2689"><a href="#L-2689"><span class="linenos">2689</span></a> <span class="nd">@classmethod</span> +</span><span id="L-2690"><a href="#L-2690"><span class="linenos">2690</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="L-2691"><a href="#L-2691"><span class="linenos">2691</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> +</span><span id="L-2692"><a href="#L-2692"><span class="linenos">2692</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="L-2693"><a href="#L-2693"><span class="linenos">2693</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> </span><span id="L-2694"><a href="#L-2694"><span class="linenos">2694</span></a> -</span><span id="L-2695"><a href="#L-2695"><span class="linenos">2695</span></a> -</span><span id="L-2696"><a href="#L-2696"><span class="linenos">2696</span></a><span class="k">class</span> <span class="nc">Rollback</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2697"><a href="#L-2697"><span class="linenos">2697</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"savepoint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2698"><a href="#L-2698"><span class="linenos">2698</span></a> -</span><span id="L-2699"><a href="#L-2699"><span class="linenos">2699</span></a> -</span><span id="L-2700"><a href="#L-2700"><span class="linenos">2700</span></a><span class="k">class</span> <span class="nc">AlterTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2701"><a href="#L-2701"><span class="linenos">2701</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"actions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2702"><a href="#L-2702"><span class="linenos">2702</span></a> -</span><span id="L-2703"><a href="#L-2703"><span class="linenos">2703</span></a> -</span><span id="L-2704"><a href="#L-2704"><span class="linenos">2704</span></a><span class="k">class</span> <span class="nc">AddConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2705"><a href="#L-2705"><span class="linenos">2705</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"enforced"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2706"><a href="#L-2706"><span class="linenos">2706</span></a> -</span><span id="L-2707"><a href="#L-2707"><span class="linenos">2707</span></a> -</span><span id="L-2708"><a href="#L-2708"><span class="linenos">2708</span></a><span class="k">class</span> <span class="nc">DropPartition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2709"><a href="#L-2709"><span class="linenos">2709</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2710"><a href="#L-2710"><span class="linenos">2710</span></a> -</span><span id="L-2711"><a href="#L-2711"><span class="linenos">2711</span></a> -</span><span id="L-2712"><a href="#L-2712"><span class="linenos">2712</span></a><span class="c1"># Binary expressions like (ADD a b)</span> -</span><span id="L-2713"><a href="#L-2713"><span class="linenos">2713</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2714"><a href="#L-2714"><span class="linenos">2714</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-2715"><a href="#L-2715"><span class="linenos">2715</span></a> -</span><span id="L-2716"><a href="#L-2716"><span class="linenos">2716</span></a> <span class="nd">@property</span> -</span><span id="L-2717"><a href="#L-2717"><span class="linenos">2717</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2718"><a href="#L-2718"><span class="linenos">2718</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-2719"><a href="#L-2719"><span class="linenos">2719</span></a> -</span><span id="L-2720"><a href="#L-2720"><span class="linenos">2720</span></a> <span class="nd">@property</span> -</span><span id="L-2721"><a href="#L-2721"><span class="linenos">2721</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2722"><a href="#L-2722"><span class="linenos">2722</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> -</span><span id="L-2723"><a href="#L-2723"><span class="linenos">2723</span></a> -</span><span id="L-2724"><a href="#L-2724"><span class="linenos">2724</span></a> -</span><span id="L-2725"><a href="#L-2725"><span class="linenos">2725</span></a><span class="k">class</span> <span class="nc">Add</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2726"><a href="#L-2726"><span class="linenos">2726</span></a> <span class="k">pass</span> +</span><span id="L-2695"><a href="#L-2695"><span class="linenos">2695</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-2696"><a href="#L-2696"><span class="linenos">2696</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> +</span><span id="L-2697"><a href="#L-2697"><span class="linenos">2697</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> +</span><span id="L-2698"><a href="#L-2698"><span class="linenos">2698</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-2699"><a href="#L-2699"><span class="linenos">2699</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> +</span><span id="L-2700"><a href="#L-2700"><span class="linenos">2700</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-2701"><a href="#L-2701"><span class="linenos">2701</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-2702"><a href="#L-2702"><span class="linenos">2702</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> +</span><span id="L-2703"><a href="#L-2703"><span class="linenos">2703</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="L-2704"><a href="#L-2704"><span class="linenos">2704</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> +</span><span id="L-2705"><a href="#L-2705"><span class="linenos">2705</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="L-2706"><a href="#L-2706"><span class="linenos">2706</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-2707"><a href="#L-2707"><span class="linenos">2707</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> +</span><span id="L-2708"><a href="#L-2708"><span class="linenos">2708</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> +</span><span id="L-2709"><a href="#L-2709"><span class="linenos">2709</span></a> +</span><span id="L-2710"><a href="#L-2710"><span class="linenos">2710</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-2711"><a href="#L-2711"><span class="linenos">2711</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> +</span><span id="L-2712"><a href="#L-2712"><span class="linenos">2712</span></a> +</span><span id="L-2713"><a href="#L-2713"><span class="linenos">2713</span></a> +</span><span id="L-2714"><a href="#L-2714"><span class="linenos">2714</span></a><span class="c1"># https://www.postgresql.org/docs/15/datatype-pseudo.html</span> +</span><span id="L-2715"><a href="#L-2715"><span class="linenos">2715</span></a><span class="k">class</span> <span class="nc">PseudoType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2716"><a href="#L-2716"><span class="linenos">2716</span></a> <span class="k">pass</span> +</span><span id="L-2717"><a href="#L-2717"><span class="linenos">2717</span></a> +</span><span id="L-2718"><a href="#L-2718"><span class="linenos">2718</span></a> +</span><span id="L-2719"><a href="#L-2719"><span class="linenos">2719</span></a><span class="k">class</span> <span class="nc">StructKwarg</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2720"><a href="#L-2720"><span class="linenos">2720</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2721"><a href="#L-2721"><span class="linenos">2721</span></a> +</span><span id="L-2722"><a href="#L-2722"><span class="linenos">2722</span></a> +</span><span id="L-2723"><a href="#L-2723"><span class="linenos">2723</span></a><span class="c1"># WHERE x <OP> EXISTS|ALL|ANY|SOME(SELECT ...)</span> +</span><span id="L-2724"><a href="#L-2724"><span class="linenos">2724</span></a><span class="k">class</span> <span class="nc">SubqueryPredicate</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2725"><a href="#L-2725"><span class="linenos">2725</span></a> <span class="k">pass</span> +</span><span id="L-2726"><a href="#L-2726"><span class="linenos">2726</span></a> </span><span id="L-2727"><a href="#L-2727"><span class="linenos">2727</span></a> -</span><span id="L-2728"><a href="#L-2728"><span class="linenos">2728</span></a> -</span><span id="L-2729"><a href="#L-2729"><span class="linenos">2729</span></a><span class="k">class</span> <span class="nc">Connector</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2730"><a href="#L-2730"><span class="linenos">2730</span></a> <span class="k">pass</span> +</span><span id="L-2728"><a href="#L-2728"><span class="linenos">2728</span></a><span class="k">class</span> <span class="nc">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="L-2729"><a href="#L-2729"><span class="linenos">2729</span></a> <span class="k">pass</span> +</span><span id="L-2730"><a href="#L-2730"><span class="linenos">2730</span></a> </span><span id="L-2731"><a href="#L-2731"><span class="linenos">2731</span></a> -</span><span id="L-2732"><a href="#L-2732"><span class="linenos">2732</span></a> -</span><span id="L-2733"><a href="#L-2733"><span class="linenos">2733</span></a><span class="k">class</span> <span class="nc">And</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> -</span><span id="L-2734"><a href="#L-2734"><span class="linenos">2734</span></a> <span class="k">pass</span> +</span><span id="L-2732"><a href="#L-2732"><span class="linenos">2732</span></a><span class="k">class</span> <span class="nc">Any</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="L-2733"><a href="#L-2733"><span class="linenos">2733</span></a> <span class="k">pass</span> +</span><span id="L-2734"><a href="#L-2734"><span class="linenos">2734</span></a> </span><span id="L-2735"><a href="#L-2735"><span class="linenos">2735</span></a> -</span><span id="L-2736"><a href="#L-2736"><span class="linenos">2736</span></a> -</span><span id="L-2737"><a href="#L-2737"><span class="linenos">2737</span></a><span class="k">class</span> <span class="nc">Or</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> -</span><span id="L-2738"><a href="#L-2738"><span class="linenos">2738</span></a> <span class="k">pass</span> +</span><span id="L-2736"><a href="#L-2736"><span class="linenos">2736</span></a><span class="k">class</span> <span class="nc">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="L-2737"><a href="#L-2737"><span class="linenos">2737</span></a> <span class="k">pass</span> +</span><span id="L-2738"><a href="#L-2738"><span class="linenos">2738</span></a> </span><span id="L-2739"><a href="#L-2739"><span class="linenos">2739</span></a> -</span><span id="L-2740"><a href="#L-2740"><span class="linenos">2740</span></a> -</span><span id="L-2741"><a href="#L-2741"><span class="linenos">2741</span></a><span class="k">class</span> <span class="nc">BitwiseAnd</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2742"><a href="#L-2742"><span class="linenos">2742</span></a> <span class="k">pass</span> -</span><span id="L-2743"><a href="#L-2743"><span class="linenos">2743</span></a> +</span><span id="L-2740"><a href="#L-2740"><span class="linenos">2740</span></a><span class="c1"># Commands to interact with the databases or engines. For most of the command</span> +</span><span id="L-2741"><a href="#L-2741"><span class="linenos">2741</span></a><span class="c1"># expressions we parse whatever comes after the command's name as a string.</span> +</span><span id="L-2742"><a href="#L-2742"><span class="linenos">2742</span></a><span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2743"><a href="#L-2743"><span class="linenos">2743</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2744"><a href="#L-2744"><span class="linenos">2744</span></a> -</span><span id="L-2745"><a href="#L-2745"><span class="linenos">2745</span></a><span class="k">class</span> <span class="nc">BitwiseLeftShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2746"><a href="#L-2746"><span class="linenos">2746</span></a> <span class="k">pass</span> -</span><span id="L-2747"><a href="#L-2747"><span class="linenos">2747</span></a> +</span><span id="L-2745"><a href="#L-2745"><span class="linenos">2745</span></a> +</span><span id="L-2746"><a href="#L-2746"><span class="linenos">2746</span></a><span class="k">class</span> <span class="nc">Transaction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2747"><a href="#L-2747"><span class="linenos">2747</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"modes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2748"><a href="#L-2748"><span class="linenos">2748</span></a> -</span><span id="L-2749"><a href="#L-2749"><span class="linenos">2749</span></a><span class="k">class</span> <span class="nc">BitwiseOr</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2750"><a href="#L-2750"><span class="linenos">2750</span></a> <span class="k">pass</span> -</span><span id="L-2751"><a href="#L-2751"><span class="linenos">2751</span></a> +</span><span id="L-2749"><a href="#L-2749"><span class="linenos">2749</span></a> +</span><span id="L-2750"><a href="#L-2750"><span class="linenos">2750</span></a><span class="k">class</span> <span class="nc">Commit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2751"><a href="#L-2751"><span class="linenos">2751</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"chain"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2752"><a href="#L-2752"><span class="linenos">2752</span></a> -</span><span id="L-2753"><a href="#L-2753"><span class="linenos">2753</span></a><span class="k">class</span> <span class="nc">BitwiseRightShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2754"><a href="#L-2754"><span class="linenos">2754</span></a> <span class="k">pass</span> -</span><span id="L-2755"><a href="#L-2755"><span class="linenos">2755</span></a> +</span><span id="L-2753"><a href="#L-2753"><span class="linenos">2753</span></a> +</span><span id="L-2754"><a href="#L-2754"><span class="linenos">2754</span></a><span class="k">class</span> <span class="nc">Rollback</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2755"><a href="#L-2755"><span class="linenos">2755</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"savepoint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2756"><a href="#L-2756"><span class="linenos">2756</span></a> -</span><span id="L-2757"><a href="#L-2757"><span class="linenos">2757</span></a><span class="k">class</span> <span class="nc">BitwiseXor</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2758"><a href="#L-2758"><span class="linenos">2758</span></a> <span class="k">pass</span> -</span><span id="L-2759"><a href="#L-2759"><span class="linenos">2759</span></a> +</span><span id="L-2757"><a href="#L-2757"><span class="linenos">2757</span></a> +</span><span id="L-2758"><a href="#L-2758"><span class="linenos">2758</span></a><span class="k">class</span> <span class="nc">AlterTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2759"><a href="#L-2759"><span class="linenos">2759</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"actions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2760"><a href="#L-2760"><span class="linenos">2760</span></a> -</span><span id="L-2761"><a href="#L-2761"><span class="linenos">2761</span></a><span class="k">class</span> <span class="nc">Div</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2762"><a href="#L-2762"><span class="linenos">2762</span></a> <span class="k">pass</span> -</span><span id="L-2763"><a href="#L-2763"><span class="linenos">2763</span></a> +</span><span id="L-2761"><a href="#L-2761"><span class="linenos">2761</span></a> +</span><span id="L-2762"><a href="#L-2762"><span class="linenos">2762</span></a><span class="k">class</span> <span class="nc">AddConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2763"><a href="#L-2763"><span class="linenos">2763</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"enforced"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2764"><a href="#L-2764"><span class="linenos">2764</span></a> -</span><span id="L-2765"><a href="#L-2765"><span class="linenos">2765</span></a><span class="k">class</span> <span class="nc">Dot</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2766"><a href="#L-2766"><span class="linenos">2766</span></a> <span class="nd">@property</span> -</span><span id="L-2767"><a href="#L-2767"><span class="linenos">2767</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-2768"><a href="#L-2768"><span class="linenos">2768</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-2765"><a href="#L-2765"><span class="linenos">2765</span></a> +</span><span id="L-2766"><a href="#L-2766"><span class="linenos">2766</span></a><span class="k">class</span> <span class="nc">DropPartition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2767"><a href="#L-2767"><span class="linenos">2767</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2768"><a href="#L-2768"><span class="linenos">2768</span></a> </span><span id="L-2769"><a href="#L-2769"><span class="linenos">2769</span></a> -</span><span id="L-2770"><a href="#L-2770"><span class="linenos">2770</span></a> -</span><span id="L-2771"><a href="#L-2771"><span class="linenos">2771</span></a><span class="k">class</span> <span class="nc">DPipe</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2772"><a href="#L-2772"><span class="linenos">2772</span></a> <span class="k">pass</span> +</span><span id="L-2770"><a href="#L-2770"><span class="linenos">2770</span></a><span class="c1"># Binary expressions like (ADD a b)</span> +</span><span id="L-2771"><a href="#L-2771"><span class="linenos">2771</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2772"><a href="#L-2772"><span class="linenos">2772</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-2773"><a href="#L-2773"><span class="linenos">2773</span></a> -</span><span id="L-2774"><a href="#L-2774"><span class="linenos">2774</span></a> -</span><span id="L-2775"><a href="#L-2775"><span class="linenos">2775</span></a><span class="k">class</span> <span class="nc">EQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2776"><a href="#L-2776"><span class="linenos">2776</span></a> <span class="k">pass</span> +</span><span id="L-2774"><a href="#L-2774"><span class="linenos">2774</span></a> <span class="nd">@property</span> +</span><span id="L-2775"><a href="#L-2775"><span class="linenos">2775</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2776"><a href="#L-2776"><span class="linenos">2776</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> </span><span id="L-2777"><a href="#L-2777"><span class="linenos">2777</span></a> -</span><span id="L-2778"><a href="#L-2778"><span class="linenos">2778</span></a> -</span><span id="L-2779"><a href="#L-2779"><span class="linenos">2779</span></a><span class="k">class</span> <span class="nc">NullSafeEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2780"><a href="#L-2780"><span class="linenos">2780</span></a> <span class="k">pass</span> +</span><span id="L-2778"><a href="#L-2778"><span class="linenos">2778</span></a> <span class="nd">@property</span> +</span><span id="L-2779"><a href="#L-2779"><span class="linenos">2779</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2780"><a href="#L-2780"><span class="linenos">2780</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> </span><span id="L-2781"><a href="#L-2781"><span class="linenos">2781</span></a> </span><span id="L-2782"><a href="#L-2782"><span class="linenos">2782</span></a> -</span><span id="L-2783"><a href="#L-2783"><span class="linenos">2783</span></a><span class="k">class</span> <span class="nc">NullSafeNEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2783"><a href="#L-2783"><span class="linenos">2783</span></a><span class="k">class</span> <span class="nc">Add</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2784"><a href="#L-2784"><span class="linenos">2784</span></a> <span class="k">pass</span> </span><span id="L-2785"><a href="#L-2785"><span class="linenos">2785</span></a> </span><span id="L-2786"><a href="#L-2786"><span class="linenos">2786</span></a> -</span><span id="L-2787"><a href="#L-2787"><span class="linenos">2787</span></a><span class="k">class</span> <span class="nc">Distance</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2787"><a href="#L-2787"><span class="linenos">2787</span></a><span class="k">class</span> <span class="nc">Connector</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> </span><span id="L-2788"><a href="#L-2788"><span class="linenos">2788</span></a> <span class="k">pass</span> </span><span id="L-2789"><a href="#L-2789"><span class="linenos">2789</span></a> </span><span id="L-2790"><a href="#L-2790"><span class="linenos">2790</span></a> -</span><span id="L-2791"><a href="#L-2791"><span class="linenos">2791</span></a><span class="k">class</span> <span class="nc">Escape</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2791"><a href="#L-2791"><span class="linenos">2791</span></a><span class="k">class</span> <span class="nc">And</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> </span><span id="L-2792"><a href="#L-2792"><span class="linenos">2792</span></a> <span class="k">pass</span> </span><span id="L-2793"><a href="#L-2793"><span class="linenos">2793</span></a> </span><span id="L-2794"><a href="#L-2794"><span class="linenos">2794</span></a> -</span><span id="L-2795"><a href="#L-2795"><span class="linenos">2795</span></a><span class="k">class</span> <span class="nc">Glob</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2795"><a href="#L-2795"><span class="linenos">2795</span></a><span class="k">class</span> <span class="nc">Or</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> </span><span id="L-2796"><a href="#L-2796"><span class="linenos">2796</span></a> <span class="k">pass</span> </span><span id="L-2797"><a href="#L-2797"><span class="linenos">2797</span></a> </span><span id="L-2798"><a href="#L-2798"><span class="linenos">2798</span></a> -</span><span id="L-2799"><a href="#L-2799"><span class="linenos">2799</span></a><span class="k">class</span> <span class="nc">GT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2799"><a href="#L-2799"><span class="linenos">2799</span></a><span class="k">class</span> <span class="nc">BitwiseAnd</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2800"><a href="#L-2800"><span class="linenos">2800</span></a> <span class="k">pass</span> </span><span id="L-2801"><a href="#L-2801"><span class="linenos">2801</span></a> </span><span id="L-2802"><a href="#L-2802"><span class="linenos">2802</span></a> -</span><span id="L-2803"><a href="#L-2803"><span class="linenos">2803</span></a><span class="k">class</span> <span class="nc">GTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2803"><a href="#L-2803"><span class="linenos">2803</span></a><span class="k">class</span> <span class="nc">BitwiseLeftShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2804"><a href="#L-2804"><span class="linenos">2804</span></a> <span class="k">pass</span> </span><span id="L-2805"><a href="#L-2805"><span class="linenos">2805</span></a> </span><span id="L-2806"><a href="#L-2806"><span class="linenos">2806</span></a> -</span><span id="L-2807"><a href="#L-2807"><span class="linenos">2807</span></a><span class="k">class</span> <span class="nc">ILike</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2807"><a href="#L-2807"><span class="linenos">2807</span></a><span class="k">class</span> <span class="nc">BitwiseOr</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2808"><a href="#L-2808"><span class="linenos">2808</span></a> <span class="k">pass</span> </span><span id="L-2809"><a href="#L-2809"><span class="linenos">2809</span></a> </span><span id="L-2810"><a href="#L-2810"><span class="linenos">2810</span></a> -</span><span id="L-2811"><a href="#L-2811"><span class="linenos">2811</span></a><span class="k">class</span> <span class="nc">ILikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2811"><a href="#L-2811"><span class="linenos">2811</span></a><span class="k">class</span> <span class="nc">BitwiseRightShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2812"><a href="#L-2812"><span class="linenos">2812</span></a> <span class="k">pass</span> </span><span id="L-2813"><a href="#L-2813"><span class="linenos">2813</span></a> </span><span id="L-2814"><a href="#L-2814"><span class="linenos">2814</span></a> -</span><span id="L-2815"><a href="#L-2815"><span class="linenos">2815</span></a><span class="k">class</span> <span class="nc">IntDiv</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2815"><a href="#L-2815"><span class="linenos">2815</span></a><span class="k">class</span> <span class="nc">BitwiseXor</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2816"><a href="#L-2816"><span class="linenos">2816</span></a> <span class="k">pass</span> </span><span id="L-2817"><a href="#L-2817"><span class="linenos">2817</span></a> </span><span id="L-2818"><a href="#L-2818"><span class="linenos">2818</span></a> -</span><span id="L-2819"><a href="#L-2819"><span class="linenos">2819</span></a><span class="k">class</span> <span class="nc">Is</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2819"><a href="#L-2819"><span class="linenos">2819</span></a><span class="k">class</span> <span class="nc">Div</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2820"><a href="#L-2820"><span class="linenos">2820</span></a> <span class="k">pass</span> </span><span id="L-2821"><a href="#L-2821"><span class="linenos">2821</span></a> </span><span id="L-2822"><a href="#L-2822"><span class="linenos">2822</span></a> -</span><span id="L-2823"><a href="#L-2823"><span class="linenos">2823</span></a><span class="k">class</span> <span class="nc">Kwarg</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2824"><a href="#L-2824"><span class="linenos">2824</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> -</span><span id="L-2825"><a href="#L-2825"><span class="linenos">2825</span></a> -</span><span id="L-2826"><a href="#L-2826"><span class="linenos">2826</span></a> -</span><span id="L-2827"><a href="#L-2827"><span class="linenos">2827</span></a><span class="k">class</span> <span class="nc">Like</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2828"><a href="#L-2828"><span class="linenos">2828</span></a> <span class="k">pass</span> -</span><span id="L-2829"><a href="#L-2829"><span class="linenos">2829</span></a> -</span><span id="L-2830"><a href="#L-2830"><span class="linenos">2830</span></a> -</span><span id="L-2831"><a href="#L-2831"><span class="linenos">2831</span></a><span class="k">class</span> <span class="nc">LikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2832"><a href="#L-2832"><span class="linenos">2832</span></a> <span class="k">pass</span> -</span><span id="L-2833"><a href="#L-2833"><span class="linenos">2833</span></a> -</span><span id="L-2834"><a href="#L-2834"><span class="linenos">2834</span></a> -</span><span id="L-2835"><a href="#L-2835"><span class="linenos">2835</span></a><span class="k">class</span> <span class="nc">LT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2836"><a href="#L-2836"><span class="linenos">2836</span></a> <span class="k">pass</span> -</span><span id="L-2837"><a href="#L-2837"><span class="linenos">2837</span></a> -</span><span id="L-2838"><a href="#L-2838"><span class="linenos">2838</span></a> -</span><span id="L-2839"><a href="#L-2839"><span class="linenos">2839</span></a><span class="k">class</span> <span class="nc">LTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2840"><a href="#L-2840"><span class="linenos">2840</span></a> <span class="k">pass</span> -</span><span id="L-2841"><a href="#L-2841"><span class="linenos">2841</span></a> -</span><span id="L-2842"><a href="#L-2842"><span class="linenos">2842</span></a> -</span><span id="L-2843"><a href="#L-2843"><span class="linenos">2843</span></a><span class="k">class</span> <span class="nc">Mod</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2844"><a href="#L-2844"><span class="linenos">2844</span></a> <span class="k">pass</span> -</span><span id="L-2845"><a href="#L-2845"><span class="linenos">2845</span></a> -</span><span id="L-2846"><a href="#L-2846"><span class="linenos">2846</span></a> -</span><span id="L-2847"><a href="#L-2847"><span class="linenos">2847</span></a><span class="k">class</span> <span class="nc">Mul</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2848"><a href="#L-2848"><span class="linenos">2848</span></a> <span class="k">pass</span> -</span><span id="L-2849"><a href="#L-2849"><span class="linenos">2849</span></a> -</span><span id="L-2850"><a href="#L-2850"><span class="linenos">2850</span></a> -</span><span id="L-2851"><a href="#L-2851"><span class="linenos">2851</span></a><span class="k">class</span> <span class="nc">NEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2852"><a href="#L-2852"><span class="linenos">2852</span></a> <span class="k">pass</span> -</span><span id="L-2853"><a href="#L-2853"><span class="linenos">2853</span></a> -</span><span id="L-2854"><a href="#L-2854"><span class="linenos">2854</span></a> -</span><span id="L-2855"><a href="#L-2855"><span class="linenos">2855</span></a><span class="k">class</span> <span class="nc">SimilarTo</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2856"><a href="#L-2856"><span class="linenos">2856</span></a> <span class="k">pass</span> -</span><span id="L-2857"><a href="#L-2857"><span class="linenos">2857</span></a> -</span><span id="L-2858"><a href="#L-2858"><span class="linenos">2858</span></a> -</span><span id="L-2859"><a href="#L-2859"><span class="linenos">2859</span></a><span class="k">class</span> <span class="nc">Slice</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2860"><a href="#L-2860"><span class="linenos">2860</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2861"><a href="#L-2861"><span class="linenos">2861</span></a> -</span><span id="L-2862"><a href="#L-2862"><span class="linenos">2862</span></a> -</span><span id="L-2863"><a href="#L-2863"><span class="linenos">2863</span></a><span class="k">class</span> <span class="nc">Sub</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-2864"><a href="#L-2864"><span class="linenos">2864</span></a> <span class="k">pass</span> -</span><span id="L-2865"><a href="#L-2865"><span class="linenos">2865</span></a> -</span><span id="L-2866"><a href="#L-2866"><span class="linenos">2866</span></a> -</span><span id="L-2867"><a href="#L-2867"><span class="linenos">2867</span></a><span class="c1"># Unary Expressions</span> -</span><span id="L-2868"><a href="#L-2868"><span class="linenos">2868</span></a><span class="c1"># (NOT a)</span> -</span><span id="L-2869"><a href="#L-2869"><span class="linenos">2869</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2823"><a href="#L-2823"><span class="linenos">2823</span></a><span class="k">class</span> <span class="nc">Dot</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2824"><a href="#L-2824"><span class="linenos">2824</span></a> <span class="nd">@property</span> +</span><span id="L-2825"><a href="#L-2825"><span class="linenos">2825</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-2826"><a href="#L-2826"><span class="linenos">2826</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-2827"><a href="#L-2827"><span class="linenos">2827</span></a> +</span><span id="L-2828"><a href="#L-2828"><span class="linenos">2828</span></a> +</span><span id="L-2829"><a href="#L-2829"><span class="linenos">2829</span></a><span class="k">class</span> <span class="nc">DPipe</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2830"><a href="#L-2830"><span class="linenos">2830</span></a> <span class="k">pass</span> +</span><span id="L-2831"><a href="#L-2831"><span class="linenos">2831</span></a> +</span><span id="L-2832"><a href="#L-2832"><span class="linenos">2832</span></a> +</span><span id="L-2833"><a href="#L-2833"><span class="linenos">2833</span></a><span class="k">class</span> <span class="nc">EQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2834"><a href="#L-2834"><span class="linenos">2834</span></a> <span class="k">pass</span> +</span><span id="L-2835"><a href="#L-2835"><span class="linenos">2835</span></a> +</span><span id="L-2836"><a href="#L-2836"><span class="linenos">2836</span></a> +</span><span id="L-2837"><a href="#L-2837"><span class="linenos">2837</span></a><span class="k">class</span> <span class="nc">NullSafeEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2838"><a href="#L-2838"><span class="linenos">2838</span></a> <span class="k">pass</span> +</span><span id="L-2839"><a href="#L-2839"><span class="linenos">2839</span></a> +</span><span id="L-2840"><a href="#L-2840"><span class="linenos">2840</span></a> +</span><span id="L-2841"><a href="#L-2841"><span class="linenos">2841</span></a><span class="k">class</span> <span class="nc">NullSafeNEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2842"><a href="#L-2842"><span class="linenos">2842</span></a> <span class="k">pass</span> +</span><span id="L-2843"><a href="#L-2843"><span class="linenos">2843</span></a> +</span><span id="L-2844"><a href="#L-2844"><span class="linenos">2844</span></a> +</span><span id="L-2845"><a href="#L-2845"><span class="linenos">2845</span></a><span class="k">class</span> <span class="nc">Distance</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2846"><a href="#L-2846"><span class="linenos">2846</span></a> <span class="k">pass</span> +</span><span id="L-2847"><a href="#L-2847"><span class="linenos">2847</span></a> +</span><span id="L-2848"><a href="#L-2848"><span class="linenos">2848</span></a> +</span><span id="L-2849"><a href="#L-2849"><span class="linenos">2849</span></a><span class="k">class</span> <span class="nc">Escape</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2850"><a href="#L-2850"><span class="linenos">2850</span></a> <span class="k">pass</span> +</span><span id="L-2851"><a href="#L-2851"><span class="linenos">2851</span></a> +</span><span id="L-2852"><a href="#L-2852"><span class="linenos">2852</span></a> +</span><span id="L-2853"><a href="#L-2853"><span class="linenos">2853</span></a><span class="k">class</span> <span class="nc">Glob</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2854"><a href="#L-2854"><span class="linenos">2854</span></a> <span class="k">pass</span> +</span><span id="L-2855"><a href="#L-2855"><span class="linenos">2855</span></a> +</span><span id="L-2856"><a href="#L-2856"><span class="linenos">2856</span></a> +</span><span id="L-2857"><a href="#L-2857"><span class="linenos">2857</span></a><span class="k">class</span> <span class="nc">GT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2858"><a href="#L-2858"><span class="linenos">2858</span></a> <span class="k">pass</span> +</span><span id="L-2859"><a href="#L-2859"><span class="linenos">2859</span></a> +</span><span id="L-2860"><a href="#L-2860"><span class="linenos">2860</span></a> +</span><span id="L-2861"><a href="#L-2861"><span class="linenos">2861</span></a><span class="k">class</span> <span class="nc">GTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2862"><a href="#L-2862"><span class="linenos">2862</span></a> <span class="k">pass</span> +</span><span id="L-2863"><a href="#L-2863"><span class="linenos">2863</span></a> +</span><span id="L-2864"><a href="#L-2864"><span class="linenos">2864</span></a> +</span><span id="L-2865"><a href="#L-2865"><span class="linenos">2865</span></a><span class="k">class</span> <span class="nc">ILike</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2866"><a href="#L-2866"><span class="linenos">2866</span></a> <span class="k">pass</span> +</span><span id="L-2867"><a href="#L-2867"><span class="linenos">2867</span></a> +</span><span id="L-2868"><a href="#L-2868"><span class="linenos">2868</span></a> +</span><span id="L-2869"><a href="#L-2869"><span class="linenos">2869</span></a><span class="k">class</span> <span class="nc">ILikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> </span><span id="L-2870"><a href="#L-2870"><span class="linenos">2870</span></a> <span class="k">pass</span> </span><span id="L-2871"><a href="#L-2871"><span class="linenos">2871</span></a> </span><span id="L-2872"><a href="#L-2872"><span class="linenos">2872</span></a> -</span><span id="L-2873"><a href="#L-2873"><span class="linenos">2873</span></a><span class="k">class</span> <span class="nc">BitwiseNot</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="L-2873"><a href="#L-2873"><span class="linenos">2873</span></a><span class="k">class</span> <span class="nc">IntDiv</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> </span><span id="L-2874"><a href="#L-2874"><span class="linenos">2874</span></a> <span class="k">pass</span> </span><span id="L-2875"><a href="#L-2875"><span class="linenos">2875</span></a> </span><span id="L-2876"><a href="#L-2876"><span class="linenos">2876</span></a> -</span><span id="L-2877"><a href="#L-2877"><span class="linenos">2877</span></a><span class="k">class</span> <span class="nc">Not</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2877"><a href="#L-2877"><span class="linenos">2877</span></a><span class="k">class</span> <span class="nc">Is</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> </span><span id="L-2878"><a href="#L-2878"><span class="linenos">2878</span></a> <span class="k">pass</span> </span><span id="L-2879"><a href="#L-2879"><span class="linenos">2879</span></a> </span><span id="L-2880"><a href="#L-2880"><span class="linenos">2880</span></a> -</span><span id="L-2881"><a href="#L-2881"><span class="linenos">2881</span></a><span class="k">class</span> <span class="nc">Paren</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2882"><a href="#L-2882"><span class="linenos">2882</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2881"><a href="#L-2881"><span class="linenos">2881</span></a><span class="k">class</span> <span class="nc">Kwarg</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2882"><a href="#L-2882"><span class="linenos">2882</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> </span><span id="L-2883"><a href="#L-2883"><span class="linenos">2883</span></a> </span><span id="L-2884"><a href="#L-2884"><span class="linenos">2884</span></a> -</span><span id="L-2885"><a href="#L-2885"><span class="linenos">2885</span></a><span class="k">class</span> <span class="nc">Neg</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="L-2885"><a href="#L-2885"><span class="linenos">2885</span></a><span class="k">class</span> <span class="nc">Like</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> </span><span id="L-2886"><a href="#L-2886"><span class="linenos">2886</span></a> <span class="k">pass</span> </span><span id="L-2887"><a href="#L-2887"><span class="linenos">2887</span></a> </span><span id="L-2888"><a href="#L-2888"><span class="linenos">2888</span></a> -</span><span id="L-2889"><a href="#L-2889"><span class="linenos">2889</span></a><span class="c1"># Special Functions</span> -</span><span id="L-2890"><a href="#L-2890"><span class="linenos">2890</span></a><span class="k">class</span> <span class="nc">Alias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2891"><a href="#L-2891"><span class="linenos">2891</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2889"><a href="#L-2889"><span class="linenos">2889</span></a><span class="k">class</span> <span class="nc">LikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2890"><a href="#L-2890"><span class="linenos">2890</span></a> <span class="k">pass</span> +</span><span id="L-2891"><a href="#L-2891"><span class="linenos">2891</span></a> </span><span id="L-2892"><a href="#L-2892"><span class="linenos">2892</span></a> -</span><span id="L-2893"><a href="#L-2893"><span class="linenos">2893</span></a> <span class="nd">@property</span> -</span><span id="L-2894"><a href="#L-2894"><span class="linenos">2894</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2895"><a href="#L-2895"><span class="linenos">2895</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> +</span><span id="L-2893"><a href="#L-2893"><span class="linenos">2893</span></a><span class="k">class</span> <span class="nc">LT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2894"><a href="#L-2894"><span class="linenos">2894</span></a> <span class="k">pass</span> +</span><span id="L-2895"><a href="#L-2895"><span class="linenos">2895</span></a> </span><span id="L-2896"><a href="#L-2896"><span class="linenos">2896</span></a> -</span><span id="L-2897"><a href="#L-2897"><span class="linenos">2897</span></a> -</span><span id="L-2898"><a href="#L-2898"><span class="linenos">2898</span></a><span class="k">class</span> <span class="nc">Aliases</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2899"><a href="#L-2899"><span class="linenos">2899</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2897"><a href="#L-2897"><span class="linenos">2897</span></a><span class="k">class</span> <span class="nc">LTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2898"><a href="#L-2898"><span class="linenos">2898</span></a> <span class="k">pass</span> +</span><span id="L-2899"><a href="#L-2899"><span class="linenos">2899</span></a> </span><span id="L-2900"><a href="#L-2900"><span class="linenos">2900</span></a> -</span><span id="L-2901"><a href="#L-2901"><span class="linenos">2901</span></a> <span class="nd">@property</span> -</span><span id="L-2902"><a href="#L-2902"><span class="linenos">2902</span></a> <span class="k">def</span> <span class="nf">aliases</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-2903"><a href="#L-2903"><span class="linenos">2903</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-2901"><a href="#L-2901"><span class="linenos">2901</span></a><span class="k">class</span> <span class="nc">Mod</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2902"><a href="#L-2902"><span class="linenos">2902</span></a> <span class="k">pass</span> +</span><span id="L-2903"><a href="#L-2903"><span class="linenos">2903</span></a> </span><span id="L-2904"><a href="#L-2904"><span class="linenos">2904</span></a> -</span><span id="L-2905"><a href="#L-2905"><span class="linenos">2905</span></a> -</span><span id="L-2906"><a href="#L-2906"><span class="linenos">2906</span></a><span class="k">class</span> <span class="nc">AtTimeZone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2907"><a href="#L-2907"><span class="linenos">2907</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2905"><a href="#L-2905"><span class="linenos">2905</span></a><span class="k">class</span> <span class="nc">Mul</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2906"><a href="#L-2906"><span class="linenos">2906</span></a> <span class="k">pass</span> +</span><span id="L-2907"><a href="#L-2907"><span class="linenos">2907</span></a> </span><span id="L-2908"><a href="#L-2908"><span class="linenos">2908</span></a> -</span><span id="L-2909"><a href="#L-2909"><span class="linenos">2909</span></a> -</span><span id="L-2910"><a href="#L-2910"><span class="linenos">2910</span></a><span class="k">class</span> <span class="nc">Between</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2911"><a href="#L-2911"><span class="linenos">2911</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"low"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"high"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2909"><a href="#L-2909"><span class="linenos">2909</span></a><span class="k">class</span> <span class="nc">NEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2910"><a href="#L-2910"><span class="linenos">2910</span></a> <span class="k">pass</span> +</span><span id="L-2911"><a href="#L-2911"><span class="linenos">2911</span></a> </span><span id="L-2912"><a href="#L-2912"><span class="linenos">2912</span></a> -</span><span id="L-2913"><a href="#L-2913"><span class="linenos">2913</span></a> -</span><span id="L-2914"><a href="#L-2914"><span class="linenos">2914</span></a><span class="k">class</span> <span class="nc">Bracket</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2915"><a href="#L-2915"><span class="linenos">2915</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2913"><a href="#L-2913"><span class="linenos">2913</span></a><span class="k">class</span> <span class="nc">SimilarTo</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2914"><a href="#L-2914"><span class="linenos">2914</span></a> <span class="k">pass</span> +</span><span id="L-2915"><a href="#L-2915"><span class="linenos">2915</span></a> </span><span id="L-2916"><a href="#L-2916"><span class="linenos">2916</span></a> -</span><span id="L-2917"><a href="#L-2917"><span class="linenos">2917</span></a> -</span><span id="L-2918"><a href="#L-2918"><span class="linenos">2918</span></a><span class="k">class</span> <span class="nc">Distinct</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2919"><a href="#L-2919"><span class="linenos">2919</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2917"><a href="#L-2917"><span class="linenos">2917</span></a><span class="k">class</span> <span class="nc">Slice</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2918"><a href="#L-2918"><span class="linenos">2918</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2919"><a href="#L-2919"><span class="linenos">2919</span></a> </span><span id="L-2920"><a href="#L-2920"><span class="linenos">2920</span></a> -</span><span id="L-2921"><a href="#L-2921"><span class="linenos">2921</span></a> -</span><span id="L-2922"><a href="#L-2922"><span class="linenos">2922</span></a><span class="k">class</span> <span class="nc">In</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="L-2923"><a href="#L-2923"><span class="linenos">2923</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-2924"><a href="#L-2924"><span class="linenos">2924</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-2925"><a href="#L-2925"><span class="linenos">2925</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2926"><a href="#L-2926"><span class="linenos">2926</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2927"><a href="#L-2927"><span class="linenos">2927</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2928"><a href="#L-2928"><span class="linenos">2928</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2929"><a href="#L-2929"><span class="linenos">2929</span></a> <span class="s2">"is_global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-2930"><a href="#L-2930"><span class="linenos">2930</span></a> <span class="p">}</span> -</span><span id="L-2931"><a href="#L-2931"><span class="linenos">2931</span></a> -</span><span id="L-2932"><a href="#L-2932"><span class="linenos">2932</span></a> -</span><span id="L-2933"><a href="#L-2933"><span class="linenos">2933</span></a><span class="k">class</span> <span class="nc">TimeUnit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2934"><a href="#L-2934"><span class="linenos">2934</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> -</span><span id="L-2935"><a href="#L-2935"><span class="linenos">2935</span></a> -</span><span id="L-2936"><a href="#L-2936"><span class="linenos">2936</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2921"><a href="#L-2921"><span class="linenos">2921</span></a><span class="k">class</span> <span class="nc">Sub</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-2922"><a href="#L-2922"><span class="linenos">2922</span></a> <span class="k">pass</span> +</span><span id="L-2923"><a href="#L-2923"><span class="linenos">2923</span></a> +</span><span id="L-2924"><a href="#L-2924"><span class="linenos">2924</span></a> +</span><span id="L-2925"><a href="#L-2925"><span class="linenos">2925</span></a><span class="c1"># Unary Expressions</span> +</span><span id="L-2926"><a href="#L-2926"><span class="linenos">2926</span></a><span class="c1"># (NOT a)</span> +</span><span id="L-2927"><a href="#L-2927"><span class="linenos">2927</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2928"><a href="#L-2928"><span class="linenos">2928</span></a> <span class="k">pass</span> +</span><span id="L-2929"><a href="#L-2929"><span class="linenos">2929</span></a> +</span><span id="L-2930"><a href="#L-2930"><span class="linenos">2930</span></a> +</span><span id="L-2931"><a href="#L-2931"><span class="linenos">2931</span></a><span class="k">class</span> <span class="nc">BitwiseNot</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="L-2932"><a href="#L-2932"><span class="linenos">2932</span></a> <span class="k">pass</span> +</span><span id="L-2933"><a href="#L-2933"><span class="linenos">2933</span></a> +</span><span id="L-2934"><a href="#L-2934"><span class="linenos">2934</span></a> +</span><span id="L-2935"><a href="#L-2935"><span class="linenos">2935</span></a><span class="k">class</span> <span class="nc">Not</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2936"><a href="#L-2936"><span class="linenos">2936</span></a> <span class="k">pass</span> </span><span id="L-2937"><a href="#L-2937"><span class="linenos">2937</span></a> -</span><span id="L-2938"><a href="#L-2938"><span class="linenos">2938</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> -</span><span id="L-2939"><a href="#L-2939"><span class="linenos">2939</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> -</span><span id="L-2940"><a href="#L-2940"><span class="linenos">2940</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> -</span><span id="L-2941"><a href="#L-2941"><span class="linenos">2941</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="L-2942"><a href="#L-2942"><span class="linenos">2942</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> -</span><span id="L-2943"><a href="#L-2943"><span class="linenos">2943</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> -</span><span id="L-2944"><a href="#L-2944"><span class="linenos">2944</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> +</span><span id="L-2938"><a href="#L-2938"><span class="linenos">2938</span></a> +</span><span id="L-2939"><a href="#L-2939"><span class="linenos">2939</span></a><span class="k">class</span> <span class="nc">Paren</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2940"><a href="#L-2940"><span class="linenos">2940</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2941"><a href="#L-2941"><span class="linenos">2941</span></a> +</span><span id="L-2942"><a href="#L-2942"><span class="linenos">2942</span></a> +</span><span id="L-2943"><a href="#L-2943"><span class="linenos">2943</span></a><span class="k">class</span> <span class="nc">Neg</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="L-2944"><a href="#L-2944"><span class="linenos">2944</span></a> <span class="k">pass</span> </span><span id="L-2945"><a href="#L-2945"><span class="linenos">2945</span></a> </span><span id="L-2946"><a href="#L-2946"><span class="linenos">2946</span></a> -</span><span id="L-2947"><a href="#L-2947"><span class="linenos">2947</span></a><span class="k">class</span> <span class="nc">Interval</span><span class="p">(</span><span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-2948"><a href="#L-2948"><span class="linenos">2948</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-2949"><a href="#L-2949"><span class="linenos">2949</span></a> +</span><span id="L-2947"><a href="#L-2947"><span class="linenos">2947</span></a><span class="c1"># Special Functions</span> +</span><span id="L-2948"><a href="#L-2948"><span class="linenos">2948</span></a><span class="k">class</span> <span class="nc">Alias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2949"><a href="#L-2949"><span class="linenos">2949</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-2950"><a href="#L-2950"><span class="linenos">2950</span></a> -</span><span id="L-2951"><a href="#L-2951"><span class="linenos">2951</span></a><span class="k">class</span> <span class="nc">IgnoreNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2952"><a href="#L-2952"><span class="linenos">2952</span></a> <span class="k">pass</span> -</span><span id="L-2953"><a href="#L-2953"><span class="linenos">2953</span></a> +</span><span id="L-2951"><a href="#L-2951"><span class="linenos">2951</span></a> <span class="nd">@property</span> +</span><span id="L-2952"><a href="#L-2952"><span class="linenos">2952</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2953"><a href="#L-2953"><span class="linenos">2953</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> </span><span id="L-2954"><a href="#L-2954"><span class="linenos">2954</span></a> -</span><span id="L-2955"><a href="#L-2955"><span class="linenos">2955</span></a><span class="k">class</span> <span class="nc">RespectNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-2956"><a href="#L-2956"><span class="linenos">2956</span></a> <span class="k">pass</span> -</span><span id="L-2957"><a href="#L-2957"><span class="linenos">2957</span></a> +</span><span id="L-2955"><a href="#L-2955"><span class="linenos">2955</span></a> +</span><span id="L-2956"><a href="#L-2956"><span class="linenos">2956</span></a><span class="k">class</span> <span class="nc">Aliases</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2957"><a href="#L-2957"><span class="linenos">2957</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-2958"><a href="#L-2958"><span class="linenos">2958</span></a> -</span><span id="L-2959"><a href="#L-2959"><span class="linenos">2959</span></a><span class="c1"># Functions</span> -</span><span id="L-2960"><a href="#L-2960"><span class="linenos">2960</span></a><span class="k">class</span> <span class="nc">Func</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="L-2961"><a href="#L-2961"><span class="linenos">2961</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-2962"><a href="#L-2962"><span class="linenos">2962</span></a><span class="sd"> The base class for all function expressions.</span> +</span><span id="L-2959"><a href="#L-2959"><span class="linenos">2959</span></a> <span class="nd">@property</span> +</span><span id="L-2960"><a href="#L-2960"><span class="linenos">2960</span></a> <span class="k">def</span> <span class="nf">aliases</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-2961"><a href="#L-2961"><span class="linenos">2961</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="L-2962"><a href="#L-2962"><span class="linenos">2962</span></a> </span><span id="L-2963"><a href="#L-2963"><span class="linenos">2963</span></a> -</span><span id="L-2964"><a href="#L-2964"><span class="linenos">2964</span></a><span class="sd"> Attributes:</span> -</span><span id="L-2965"><a href="#L-2965"><span class="linenos">2965</span></a><span class="sd"> is_var_len_args (bool): if set to True the last argument defined in arg_types will be</span> -</span><span id="L-2966"><a href="#L-2966"><span class="linenos">2966</span></a><span class="sd"> treated as a variable length argument and the argument's value will be stored as a list.</span> -</span><span id="L-2967"><a href="#L-2967"><span class="linenos">2967</span></a><span class="sd"> _sql_names (list): determines the SQL name (1st item in the list) and aliases (subsequent items)</span> -</span><span id="L-2968"><a href="#L-2968"><span class="linenos">2968</span></a><span class="sd"> for this function expression. These values are used to map this node to a name during parsing</span> -</span><span id="L-2969"><a href="#L-2969"><span class="linenos">2969</span></a><span class="sd"> as well as to provide the function's name during SQL string generation. By default the SQL</span> -</span><span id="L-2970"><a href="#L-2970"><span class="linenos">2970</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> -</span><span id="L-2971"><a href="#L-2971"><span class="linenos">2971</span></a><span class="sd"> """</span> -</span><span id="L-2972"><a href="#L-2972"><span class="linenos">2972</span></a> -</span><span id="L-2973"><a href="#L-2973"><span class="linenos">2973</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="L-2964"><a href="#L-2964"><span class="linenos">2964</span></a><span class="k">class</span> <span class="nc">AtTimeZone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2965"><a href="#L-2965"><span class="linenos">2965</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2966"><a href="#L-2966"><span class="linenos">2966</span></a> +</span><span id="L-2967"><a href="#L-2967"><span class="linenos">2967</span></a> +</span><span id="L-2968"><a href="#L-2968"><span class="linenos">2968</span></a><span class="k">class</span> <span class="nc">Between</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2969"><a href="#L-2969"><span class="linenos">2969</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"low"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"high"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-2970"><a href="#L-2970"><span class="linenos">2970</span></a> +</span><span id="L-2971"><a href="#L-2971"><span class="linenos">2971</span></a> +</span><span id="L-2972"><a href="#L-2972"><span class="linenos">2972</span></a><span class="k">class</span> <span class="nc">Bracket</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-2973"><a href="#L-2973"><span class="linenos">2973</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-2974"><a href="#L-2974"><span class="linenos">2974</span></a> -</span><span id="L-2975"><a href="#L-2975"><span class="linenos">2975</span></a> <span class="nd">@classmethod</span> -</span><span id="L-2976"><a href="#L-2976"><span class="linenos">2976</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> -</span><span id="L-2977"><a href="#L-2977"><span class="linenos">2977</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> -</span><span id="L-2978"><a href="#L-2978"><span class="linenos">2978</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="L-2979"><a href="#L-2979"><span class="linenos">2979</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> -</span><span id="L-2980"><a href="#L-2980"><span class="linenos">2980</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> -</span><span id="L-2981"><a href="#L-2981"><span class="linenos">2981</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> -</span><span id="L-2982"><a href="#L-2982"><span class="linenos">2982</span></a> -</span><span id="L-2983"><a href="#L-2983"><span class="linenos">2983</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> -</span><span id="L-2984"><a href="#L-2984"><span class="linenos">2984</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> -</span><span id="L-2985"><a href="#L-2985"><span class="linenos">2985</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-2986"><a href="#L-2986"><span class="linenos">2986</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> -</span><span id="L-2987"><a href="#L-2987"><span class="linenos">2987</span></a> -</span><span id="L-2988"><a href="#L-2988"><span class="linenos">2988</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> +</span><span id="L-2975"><a href="#L-2975"><span class="linenos">2975</span></a> +</span><span id="L-2976"><a href="#L-2976"><span class="linenos">2976</span></a><span class="k">class</span> <span class="nc">Distinct</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2977"><a href="#L-2977"><span class="linenos">2977</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2978"><a href="#L-2978"><span class="linenos">2978</span></a> +</span><span id="L-2979"><a href="#L-2979"><span class="linenos">2979</span></a> +</span><span id="L-2980"><a href="#L-2980"><span class="linenos">2980</span></a><span class="k">class</span> <span class="nc">In</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="L-2981"><a href="#L-2981"><span class="linenos">2981</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-2982"><a href="#L-2982"><span class="linenos">2982</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-2983"><a href="#L-2983"><span class="linenos">2983</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2984"><a href="#L-2984"><span class="linenos">2984</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2985"><a href="#L-2985"><span class="linenos">2985</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2986"><a href="#L-2986"><span class="linenos">2986</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2987"><a href="#L-2987"><span class="linenos">2987</span></a> <span class="s2">"is_global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-2988"><a href="#L-2988"><span class="linenos">2988</span></a> <span class="p">}</span> </span><span id="L-2989"><a href="#L-2989"><span class="linenos">2989</span></a> -</span><span id="L-2990"><a href="#L-2990"><span class="linenos">2990</span></a> <span class="nd">@classmethod</span> -</span><span id="L-2991"><a href="#L-2991"><span class="linenos">2991</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="L-2992"><a href="#L-2992"><span class="linenos">2992</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> -</span><span id="L-2993"><a href="#L-2993"><span class="linenos">2993</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="L-2994"><a href="#L-2994"><span class="linenos">2994</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="L-2995"><a href="#L-2995"><span class="linenos">2995</span></a> <span class="p">)</span> -</span><span id="L-2996"><a href="#L-2996"><span class="linenos">2996</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> -</span><span id="L-2997"><a href="#L-2997"><span class="linenos">2997</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> -</span><span id="L-2998"><a href="#L-2998"><span class="linenos">2998</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> -</span><span id="L-2999"><a href="#L-2999"><span class="linenos">2999</span></a> -</span><span id="L-3000"><a href="#L-3000"><span class="linenos">3000</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3001"><a href="#L-3001"><span class="linenos">3001</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="L-3002"><a href="#L-3002"><span class="linenos">3002</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> +</span><span id="L-2990"><a href="#L-2990"><span class="linenos">2990</span></a> +</span><span id="L-2991"><a href="#L-2991"><span class="linenos">2991</span></a><span class="k">class</span> <span class="nc">TimeUnit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-2992"><a href="#L-2992"><span class="linenos">2992</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> +</span><span id="L-2993"><a href="#L-2993"><span class="linenos">2993</span></a> +</span><span id="L-2994"><a href="#L-2994"><span class="linenos">2994</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-2995"><a href="#L-2995"><span class="linenos">2995</span></a> +</span><span id="L-2996"><a href="#L-2996"><span class="linenos">2996</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> +</span><span id="L-2997"><a href="#L-2997"><span class="linenos">2997</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> +</span><span id="L-2998"><a href="#L-2998"><span class="linenos">2998</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> +</span><span id="L-2999"><a href="#L-2999"><span class="linenos">2999</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-3000"><a href="#L-3000"><span class="linenos">3000</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> +</span><span id="L-3001"><a href="#L-3001"><span class="linenos">3001</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> +</span><span id="L-3002"><a href="#L-3002"><span class="linenos">3002</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> </span><span id="L-3003"><a href="#L-3003"><span class="linenos">3003</span></a> -</span><span id="L-3004"><a href="#L-3004"><span class="linenos">3004</span></a> <span class="nd">@classmethod</span> -</span><span id="L-3005"><a href="#L-3005"><span class="linenos">3005</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="L-3006"><a href="#L-3006"><span class="linenos">3006</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> +</span><span id="L-3004"><a href="#L-3004"><span class="linenos">3004</span></a> +</span><span id="L-3005"><a href="#L-3005"><span class="linenos">3005</span></a><span class="k">class</span> <span class="nc">Interval</span><span class="p">(</span><span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3006"><a href="#L-3006"><span class="linenos">3006</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3007"><a href="#L-3007"><span class="linenos">3007</span></a> </span><span id="L-3008"><a href="#L-3008"><span class="linenos">3008</span></a> -</span><span id="L-3009"><a href="#L-3009"><span class="linenos">3009</span></a><span class="k">class</span> <span class="nc">AggFunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3009"><a href="#L-3009"><span class="linenos">3009</span></a><span class="k">class</span> <span class="nc">IgnoreNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> </span><span id="L-3010"><a href="#L-3010"><span class="linenos">3010</span></a> <span class="k">pass</span> </span><span id="L-3011"><a href="#L-3011"><span class="linenos">3011</span></a> </span><span id="L-3012"><a href="#L-3012"><span class="linenos">3012</span></a> -</span><span id="L-3013"><a href="#L-3013"><span class="linenos">3013</span></a><span class="k">class</span> <span class="nc">Abs</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3013"><a href="#L-3013"><span class="linenos">3013</span></a><span class="k">class</span> <span class="nc">RespectNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> </span><span id="L-3014"><a href="#L-3014"><span class="linenos">3014</span></a> <span class="k">pass</span> </span><span id="L-3015"><a href="#L-3015"><span class="linenos">3015</span></a> </span><span id="L-3016"><a href="#L-3016"><span class="linenos">3016</span></a> -</span><span id="L-3017"><a href="#L-3017"><span class="linenos">3017</span></a><span class="k">class</span> <span class="nc">Anonymous</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3018"><a href="#L-3018"><span class="linenos">3018</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3019"><a href="#L-3019"><span class="linenos">3019</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3020"><a href="#L-3020"><span class="linenos">3020</span></a> +</span><span id="L-3017"><a href="#L-3017"><span class="linenos">3017</span></a><span class="c1"># Functions</span> +</span><span id="L-3018"><a href="#L-3018"><span class="linenos">3018</span></a><span class="k">class</span> <span class="nc">Func</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="L-3019"><a href="#L-3019"><span class="linenos">3019</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3020"><a href="#L-3020"><span class="linenos">3020</span></a><span class="sd"> The base class for all function expressions.</span> </span><span id="L-3021"><a href="#L-3021"><span class="linenos">3021</span></a> -</span><span id="L-3022"><a href="#L-3022"><span class="linenos">3022</span></a><span class="k">class</span> <span class="nc">ApproxDistinct</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3023"><a href="#L-3023"><span class="linenos">3023</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3024"><a href="#L-3024"><span class="linenos">3024</span></a> -</span><span id="L-3025"><a href="#L-3025"><span class="linenos">3025</span></a> -</span><span id="L-3026"><a href="#L-3026"><span class="linenos">3026</span></a><span class="k">class</span> <span class="nc">Array</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3027"><a href="#L-3027"><span class="linenos">3027</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3028"><a href="#L-3028"><span class="linenos">3028</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3029"><a href="#L-3029"><span class="linenos">3029</span></a> +</span><span id="L-3022"><a href="#L-3022"><span class="linenos">3022</span></a><span class="sd"> Attributes:</span> +</span><span id="L-3023"><a href="#L-3023"><span class="linenos">3023</span></a><span class="sd"> is_var_len_args (bool): if set to True the last argument defined in arg_types will be</span> +</span><span id="L-3024"><a href="#L-3024"><span class="linenos">3024</span></a><span class="sd"> treated as a variable length argument and the argument's value will be stored as a list.</span> +</span><span id="L-3025"><a href="#L-3025"><span class="linenos">3025</span></a><span class="sd"> _sql_names (list): determines the SQL name (1st item in the list) and aliases (subsequent items)</span> +</span><span id="L-3026"><a href="#L-3026"><span class="linenos">3026</span></a><span class="sd"> for this function expression. These values are used to map this node to a name during parsing</span> +</span><span id="L-3027"><a href="#L-3027"><span class="linenos">3027</span></a><span class="sd"> as well as to provide the function's name during SQL string generation. By default the SQL</span> +</span><span id="L-3028"><a href="#L-3028"><span class="linenos">3028</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> +</span><span id="L-3029"><a href="#L-3029"><span class="linenos">3029</span></a><span class="sd"> """</span> </span><span id="L-3030"><a href="#L-3030"><span class="linenos">3030</span></a> -</span><span id="L-3031"><a href="#L-3031"><span class="linenos">3031</span></a><span class="k">class</span> <span class="nc">GenerateSeries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3032"><a href="#L-3032"><span class="linenos">3032</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"start"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"step"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3033"><a href="#L-3033"><span class="linenos">3033</span></a> -</span><span id="L-3034"><a href="#L-3034"><span class="linenos">3034</span></a> -</span><span id="L-3035"><a href="#L-3035"><span class="linenos">3035</span></a><span class="k">class</span> <span class="nc">ArrayAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3036"><a href="#L-3036"><span class="linenos">3036</span></a> <span class="k">pass</span> -</span><span id="L-3037"><a href="#L-3037"><span class="linenos">3037</span></a> -</span><span id="L-3038"><a href="#L-3038"><span class="linenos">3038</span></a> -</span><span id="L-3039"><a href="#L-3039"><span class="linenos">3039</span></a><span class="k">class</span> <span class="nc">ArrayAll</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3040"><a href="#L-3040"><span class="linenos">3040</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3041"><a href="#L-3041"><span class="linenos">3041</span></a> -</span><span id="L-3042"><a href="#L-3042"><span class="linenos">3042</span></a> -</span><span id="L-3043"><a href="#L-3043"><span class="linenos">3043</span></a><span class="k">class</span> <span class="nc">ArrayAny</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3044"><a href="#L-3044"><span class="linenos">3044</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3031"><a href="#L-3031"><span class="linenos">3031</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="L-3032"><a href="#L-3032"><span class="linenos">3032</span></a> +</span><span id="L-3033"><a href="#L-3033"><span class="linenos">3033</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3034"><a href="#L-3034"><span class="linenos">3034</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> +</span><span id="L-3035"><a href="#L-3035"><span class="linenos">3035</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> +</span><span id="L-3036"><a href="#L-3036"><span class="linenos">3036</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="L-3037"><a href="#L-3037"><span class="linenos">3037</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> +</span><span id="L-3038"><a href="#L-3038"><span class="linenos">3038</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> +</span><span id="L-3039"><a href="#L-3039"><span class="linenos">3039</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> +</span><span id="L-3040"><a href="#L-3040"><span class="linenos">3040</span></a> +</span><span id="L-3041"><a href="#L-3041"><span class="linenos">3041</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> +</span><span id="L-3042"><a href="#L-3042"><span class="linenos">3042</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> +</span><span id="L-3043"><a href="#L-3043"><span class="linenos">3043</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-3044"><a href="#L-3044"><span class="linenos">3044</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> </span><span id="L-3045"><a href="#L-3045"><span class="linenos">3045</span></a> -</span><span id="L-3046"><a href="#L-3046"><span class="linenos">3046</span></a> -</span><span id="L-3047"><a href="#L-3047"><span class="linenos">3047</span></a><span class="k">class</span> <span class="nc">ArrayConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3048"><a href="#L-3048"><span class="linenos">3048</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3049"><a href="#L-3049"><span class="linenos">3049</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3050"><a href="#L-3050"><span class="linenos">3050</span></a> -</span><span id="L-3051"><a href="#L-3051"><span class="linenos">3051</span></a> -</span><span id="L-3052"><a href="#L-3052"><span class="linenos">3052</span></a><span class="k">class</span> <span class="nc">ArrayContains</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3053"><a href="#L-3053"><span class="linenos">3053</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3054"><a href="#L-3054"><span class="linenos">3054</span></a> -</span><span id="L-3055"><a href="#L-3055"><span class="linenos">3055</span></a> -</span><span id="L-3056"><a href="#L-3056"><span class="linenos">3056</span></a><span class="k">class</span> <span class="nc">ArrayFilter</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3057"><a href="#L-3057"><span class="linenos">3057</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3058"><a href="#L-3058"><span class="linenos">3058</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"FILTER"</span><span class="p">,</span> <span class="s2">"ARRAY_FILTER"</span><span class="p">]</span> -</span><span id="L-3059"><a href="#L-3059"><span class="linenos">3059</span></a> -</span><span id="L-3060"><a href="#L-3060"><span class="linenos">3060</span></a> -</span><span id="L-3061"><a href="#L-3061"><span class="linenos">3061</span></a><span class="k">class</span> <span class="nc">ArraySize</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3062"><a href="#L-3062"><span class="linenos">3062</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3063"><a href="#L-3063"><span class="linenos">3063</span></a> -</span><span id="L-3064"><a href="#L-3064"><span class="linenos">3064</span></a> -</span><span id="L-3065"><a href="#L-3065"><span class="linenos">3065</span></a><span class="k">class</span> <span class="nc">ArraySort</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3066"><a href="#L-3066"><span class="linenos">3066</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3067"><a href="#L-3067"><span class="linenos">3067</span></a> -</span><span id="L-3068"><a href="#L-3068"><span class="linenos">3068</span></a> -</span><span id="L-3069"><a href="#L-3069"><span class="linenos">3069</span></a><span class="k">class</span> <span class="nc">ArraySum</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3070"><a href="#L-3070"><span class="linenos">3070</span></a> <span class="k">pass</span> -</span><span id="L-3071"><a href="#L-3071"><span class="linenos">3071</span></a> -</span><span id="L-3072"><a href="#L-3072"><span class="linenos">3072</span></a> -</span><span id="L-3073"><a href="#L-3073"><span class="linenos">3073</span></a><span class="k">class</span> <span class="nc">ArrayUnionAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3074"><a href="#L-3074"><span class="linenos">3074</span></a> <span class="k">pass</span> -</span><span id="L-3075"><a href="#L-3075"><span class="linenos">3075</span></a> -</span><span id="L-3076"><a href="#L-3076"><span class="linenos">3076</span></a> -</span><span id="L-3077"><a href="#L-3077"><span class="linenos">3077</span></a><span class="k">class</span> <span class="nc">Avg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3078"><a href="#L-3078"><span class="linenos">3078</span></a> <span class="k">pass</span> +</span><span id="L-3046"><a href="#L-3046"><span class="linenos">3046</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> +</span><span id="L-3047"><a href="#L-3047"><span class="linenos">3047</span></a> +</span><span id="L-3048"><a href="#L-3048"><span class="linenos">3048</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3049"><a href="#L-3049"><span class="linenos">3049</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="L-3050"><a href="#L-3050"><span class="linenos">3050</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> +</span><span id="L-3051"><a href="#L-3051"><span class="linenos">3051</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="L-3052"><a href="#L-3052"><span class="linenos">3052</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="L-3053"><a href="#L-3053"><span class="linenos">3053</span></a> <span class="p">)</span> +</span><span id="L-3054"><a href="#L-3054"><span class="linenos">3054</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> +</span><span id="L-3055"><a href="#L-3055"><span class="linenos">3055</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> +</span><span id="L-3056"><a href="#L-3056"><span class="linenos">3056</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> +</span><span id="L-3057"><a href="#L-3057"><span class="linenos">3057</span></a> +</span><span id="L-3058"><a href="#L-3058"><span class="linenos">3058</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3059"><a href="#L-3059"><span class="linenos">3059</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="L-3060"><a href="#L-3060"><span class="linenos">3060</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> +</span><span id="L-3061"><a href="#L-3061"><span class="linenos">3061</span></a> +</span><span id="L-3062"><a href="#L-3062"><span class="linenos">3062</span></a> <span class="nd">@classmethod</span> +</span><span id="L-3063"><a href="#L-3063"><span class="linenos">3063</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="L-3064"><a href="#L-3064"><span class="linenos">3064</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> +</span><span id="L-3065"><a href="#L-3065"><span class="linenos">3065</span></a> +</span><span id="L-3066"><a href="#L-3066"><span class="linenos">3066</span></a> +</span><span id="L-3067"><a href="#L-3067"><span class="linenos">3067</span></a><span class="k">class</span> <span class="nc">AggFunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3068"><a href="#L-3068"><span class="linenos">3068</span></a> <span class="k">pass</span> +</span><span id="L-3069"><a href="#L-3069"><span class="linenos">3069</span></a> +</span><span id="L-3070"><a href="#L-3070"><span class="linenos">3070</span></a> +</span><span id="L-3071"><a href="#L-3071"><span class="linenos">3071</span></a><span class="k">class</span> <span class="nc">Abs</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3072"><a href="#L-3072"><span class="linenos">3072</span></a> <span class="k">pass</span> +</span><span id="L-3073"><a href="#L-3073"><span class="linenos">3073</span></a> +</span><span id="L-3074"><a href="#L-3074"><span class="linenos">3074</span></a> +</span><span id="L-3075"><a href="#L-3075"><span class="linenos">3075</span></a><span class="k">class</span> <span class="nc">Anonymous</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3076"><a href="#L-3076"><span class="linenos">3076</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3077"><a href="#L-3077"><span class="linenos">3077</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3078"><a href="#L-3078"><span class="linenos">3078</span></a> </span><span id="L-3079"><a href="#L-3079"><span class="linenos">3079</span></a> -</span><span id="L-3080"><a href="#L-3080"><span class="linenos">3080</span></a> -</span><span id="L-3081"><a href="#L-3081"><span class="linenos">3081</span></a><span class="k">class</span> <span class="nc">AnyValue</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3082"><a href="#L-3082"><span class="linenos">3082</span></a> <span class="k">pass</span> +</span><span id="L-3080"><a href="#L-3080"><span class="linenos">3080</span></a><span class="k">class</span> <span class="nc">ApproxDistinct</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3081"><a href="#L-3081"><span class="linenos">3081</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3082"><a href="#L-3082"><span class="linenos">3082</span></a> </span><span id="L-3083"><a href="#L-3083"><span class="linenos">3083</span></a> -</span><span id="L-3084"><a href="#L-3084"><span class="linenos">3084</span></a> -</span><span id="L-3085"><a href="#L-3085"><span class="linenos">3085</span></a><span class="k">class</span> <span class="nc">Case</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3086"><a href="#L-3086"><span class="linenos">3086</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"ifs"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3084"><a href="#L-3084"><span class="linenos">3084</span></a><span class="k">class</span> <span class="nc">Array</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3085"><a href="#L-3085"><span class="linenos">3085</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3086"><a href="#L-3086"><span class="linenos">3086</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span><span id="L-3087"><a href="#L-3087"><span class="linenos">3087</span></a> </span><span id="L-3088"><a href="#L-3088"><span class="linenos">3088</span></a> -</span><span id="L-3089"><a href="#L-3089"><span class="linenos">3089</span></a><span class="k">class</span> <span class="nc">Cast</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3090"><a href="#L-3090"><span class="linenos">3090</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"to"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3089"><a href="#L-3089"><span class="linenos">3089</span></a><span class="k">class</span> <span class="nc">GenerateSeries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3090"><a href="#L-3090"><span class="linenos">3090</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"start"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"step"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3091"><a href="#L-3091"><span class="linenos">3091</span></a> -</span><span id="L-3092"><a href="#L-3092"><span class="linenos">3092</span></a> <span class="nd">@property</span> -</span><span id="L-3093"><a href="#L-3093"><span class="linenos">3093</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-3094"><a href="#L-3094"><span class="linenos">3094</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-3092"><a href="#L-3092"><span class="linenos">3092</span></a> +</span><span id="L-3093"><a href="#L-3093"><span class="linenos">3093</span></a><span class="k">class</span> <span class="nc">ArrayAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3094"><a href="#L-3094"><span class="linenos">3094</span></a> <span class="k">pass</span> </span><span id="L-3095"><a href="#L-3095"><span class="linenos">3095</span></a> -</span><span id="L-3096"><a href="#L-3096"><span class="linenos">3096</span></a> <span class="nd">@property</span> -</span><span id="L-3097"><a href="#L-3097"><span class="linenos">3097</span></a> <span class="k">def</span> <span class="nf">to</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-3098"><a href="#L-3098"><span class="linenos">3098</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"to"</span><span class="p">]</span> +</span><span id="L-3096"><a href="#L-3096"><span class="linenos">3096</span></a> +</span><span id="L-3097"><a href="#L-3097"><span class="linenos">3097</span></a><span class="k">class</span> <span class="nc">ArrayAll</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3098"><a href="#L-3098"><span class="linenos">3098</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3099"><a href="#L-3099"><span class="linenos">3099</span></a> -</span><span id="L-3100"><a href="#L-3100"><span class="linenos">3100</span></a> <span class="nd">@property</span> -</span><span id="L-3101"><a href="#L-3101"><span class="linenos">3101</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="L-3102"><a href="#L-3102"><span class="linenos">3102</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-3100"><a href="#L-3100"><span class="linenos">3100</span></a> +</span><span id="L-3101"><a href="#L-3101"><span class="linenos">3101</span></a><span class="k">class</span> <span class="nc">ArrayAny</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3102"><a href="#L-3102"><span class="linenos">3102</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3103"><a href="#L-3103"><span class="linenos">3103</span></a> -</span><span id="L-3104"><a href="#L-3104"><span class="linenos">3104</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="L-3105"><a href="#L-3105"><span class="linenos">3105</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="L-3106"><a href="#L-3106"><span class="linenos">3106</span></a> -</span><span id="L-3107"><a href="#L-3107"><span class="linenos">3107</span></a> -</span><span id="L-3108"><a href="#L-3108"><span class="linenos">3108</span></a><span class="k">class</span> <span class="nc">Collate</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3109"><a href="#L-3109"><span class="linenos">3109</span></a> <span class="k">pass</span> -</span><span id="L-3110"><a href="#L-3110"><span class="linenos">3110</span></a> -</span><span id="L-3111"><a href="#L-3111"><span class="linenos">3111</span></a> -</span><span id="L-3112"><a href="#L-3112"><span class="linenos">3112</span></a><span class="k">class</span> <span class="nc">TryCast</span><span class="p">(</span><span class="n">Cast</span><span class="p">):</span> -</span><span id="L-3113"><a href="#L-3113"><span class="linenos">3113</span></a> <span class="k">pass</span> -</span><span id="L-3114"><a href="#L-3114"><span class="linenos">3114</span></a> -</span><span id="L-3115"><a href="#L-3115"><span class="linenos">3115</span></a> -</span><span id="L-3116"><a href="#L-3116"><span class="linenos">3116</span></a><span class="k">class</span> <span class="nc">Ceil</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3117"><a href="#L-3117"><span class="linenos">3117</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3118"><a href="#L-3118"><span class="linenos">3118</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CEIL"</span><span class="p">,</span> <span class="s2">"CEILING"</span><span class="p">]</span> -</span><span id="L-3119"><a href="#L-3119"><span class="linenos">3119</span></a> -</span><span id="L-3120"><a href="#L-3120"><span class="linenos">3120</span></a> -</span><span id="L-3121"><a href="#L-3121"><span class="linenos">3121</span></a><span class="k">class</span> <span class="nc">Coalesce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3122"><a href="#L-3122"><span class="linenos">3122</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3123"><a href="#L-3123"><span class="linenos">3123</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3124"><a href="#L-3124"><span class="linenos">3124</span></a> +</span><span id="L-3104"><a href="#L-3104"><span class="linenos">3104</span></a> +</span><span id="L-3105"><a href="#L-3105"><span class="linenos">3105</span></a><span class="k">class</span> <span class="nc">ArrayConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3106"><a href="#L-3106"><span class="linenos">3106</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3107"><a href="#L-3107"><span class="linenos">3107</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3108"><a href="#L-3108"><span class="linenos">3108</span></a> +</span><span id="L-3109"><a href="#L-3109"><span class="linenos">3109</span></a> +</span><span id="L-3110"><a href="#L-3110"><span class="linenos">3110</span></a><span class="k">class</span> <span class="nc">ArrayContains</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3111"><a href="#L-3111"><span class="linenos">3111</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3112"><a href="#L-3112"><span class="linenos">3112</span></a> +</span><span id="L-3113"><a href="#L-3113"><span class="linenos">3113</span></a> +</span><span id="L-3114"><a href="#L-3114"><span class="linenos">3114</span></a><span class="k">class</span> <span class="nc">ArrayFilter</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3115"><a href="#L-3115"><span class="linenos">3115</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3116"><a href="#L-3116"><span class="linenos">3116</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"FILTER"</span><span class="p">,</span> <span class="s2">"ARRAY_FILTER"</span><span class="p">]</span> +</span><span id="L-3117"><a href="#L-3117"><span class="linenos">3117</span></a> +</span><span id="L-3118"><a href="#L-3118"><span class="linenos">3118</span></a> +</span><span id="L-3119"><a href="#L-3119"><span class="linenos">3119</span></a><span class="k">class</span> <span class="nc">ArraySize</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3120"><a href="#L-3120"><span class="linenos">3120</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3121"><a href="#L-3121"><span class="linenos">3121</span></a> +</span><span id="L-3122"><a href="#L-3122"><span class="linenos">3122</span></a> +</span><span id="L-3123"><a href="#L-3123"><span class="linenos">3123</span></a><span class="k">class</span> <span class="nc">ArraySort</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3124"><a href="#L-3124"><span class="linenos">3124</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3125"><a href="#L-3125"><span class="linenos">3125</span></a> -</span><span id="L-3126"><a href="#L-3126"><span class="linenos">3126</span></a><span class="k">class</span> <span class="nc">Concat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3127"><a href="#L-3127"><span class="linenos">3127</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3128"><a href="#L-3128"><span class="linenos">3128</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3126"><a href="#L-3126"><span class="linenos">3126</span></a> +</span><span id="L-3127"><a href="#L-3127"><span class="linenos">3127</span></a><span class="k">class</span> <span class="nc">ArraySum</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3128"><a href="#L-3128"><span class="linenos">3128</span></a> <span class="k">pass</span> </span><span id="L-3129"><a href="#L-3129"><span class="linenos">3129</span></a> </span><span id="L-3130"><a href="#L-3130"><span class="linenos">3130</span></a> -</span><span id="L-3131"><a href="#L-3131"><span class="linenos">3131</span></a><span class="k">class</span> <span class="nc">ConcatWs</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> -</span><span id="L-3132"><a href="#L-3132"><span class="linenos">3132</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CONCAT_WS"</span><span class="p">]</span> +</span><span id="L-3131"><a href="#L-3131"><span class="linenos">3131</span></a><span class="k">class</span> <span class="nc">ArrayUnionAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3132"><a href="#L-3132"><span class="linenos">3132</span></a> <span class="k">pass</span> </span><span id="L-3133"><a href="#L-3133"><span class="linenos">3133</span></a> </span><span id="L-3134"><a href="#L-3134"><span class="linenos">3134</span></a> -</span><span id="L-3135"><a href="#L-3135"><span class="linenos">3135</span></a><span class="k">class</span> <span class="nc">Count</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3136"><a href="#L-3136"><span class="linenos">3136</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3135"><a href="#L-3135"><span class="linenos">3135</span></a><span class="k">class</span> <span class="nc">Avg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3136"><a href="#L-3136"><span class="linenos">3136</span></a> <span class="k">pass</span> </span><span id="L-3137"><a href="#L-3137"><span class="linenos">3137</span></a> </span><span id="L-3138"><a href="#L-3138"><span class="linenos">3138</span></a> -</span><span id="L-3139"><a href="#L-3139"><span class="linenos">3139</span></a><span class="k">class</span> <span class="nc">CurrentDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3140"><a href="#L-3140"><span class="linenos">3140</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3139"><a href="#L-3139"><span class="linenos">3139</span></a><span class="k">class</span> <span class="nc">AnyValue</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3140"><a href="#L-3140"><span class="linenos">3140</span></a> <span class="k">pass</span> </span><span id="L-3141"><a href="#L-3141"><span class="linenos">3141</span></a> </span><span id="L-3142"><a href="#L-3142"><span class="linenos">3142</span></a> -</span><span id="L-3143"><a href="#L-3143"><span class="linenos">3143</span></a><span class="k">class</span> <span class="nc">CurrentDatetime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3144"><a href="#L-3144"><span class="linenos">3144</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3143"><a href="#L-3143"><span class="linenos">3143</span></a><span class="k">class</span> <span class="nc">Case</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3144"><a href="#L-3144"><span class="linenos">3144</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"ifs"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3145"><a href="#L-3145"><span class="linenos">3145</span></a> </span><span id="L-3146"><a href="#L-3146"><span class="linenos">3146</span></a> -</span><span id="L-3147"><a href="#L-3147"><span class="linenos">3147</span></a><span class="k">class</span> <span class="nc">CurrentTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3148"><a href="#L-3148"><span class="linenos">3148</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3147"><a href="#L-3147"><span class="linenos">3147</span></a><span class="k">class</span> <span class="nc">Cast</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3148"><a href="#L-3148"><span class="linenos">3148</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"to"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3149"><a href="#L-3149"><span class="linenos">3149</span></a> -</span><span id="L-3150"><a href="#L-3150"><span class="linenos">3150</span></a> -</span><span id="L-3151"><a href="#L-3151"><span class="linenos">3151</span></a><span class="k">class</span> <span class="nc">CurrentTimestamp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3152"><a href="#L-3152"><span class="linenos">3152</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3150"><a href="#L-3150"><span class="linenos">3150</span></a> <span class="nd">@property</span> +</span><span id="L-3151"><a href="#L-3151"><span class="linenos">3151</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-3152"><a href="#L-3152"><span class="linenos">3152</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span> </span><span id="L-3153"><a href="#L-3153"><span class="linenos">3153</span></a> -</span><span id="L-3154"><a href="#L-3154"><span class="linenos">3154</span></a> -</span><span id="L-3155"><a href="#L-3155"><span class="linenos">3155</span></a><span class="k">class</span> <span class="nc">DateAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3156"><a href="#L-3156"><span class="linenos">3156</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3154"><a href="#L-3154"><span class="linenos">3154</span></a> <span class="nd">@property</span> +</span><span id="L-3155"><a href="#L-3155"><span class="linenos">3155</span></a> <span class="k">def</span> <span class="nf">to</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-3156"><a href="#L-3156"><span class="linenos">3156</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"to"</span><span class="p">]</span> </span><span id="L-3157"><a href="#L-3157"><span class="linenos">3157</span></a> -</span><span id="L-3158"><a href="#L-3158"><span class="linenos">3158</span></a> -</span><span id="L-3159"><a href="#L-3159"><span class="linenos">3159</span></a><span class="k">class</span> <span class="nc">DateSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3160"><a href="#L-3160"><span class="linenos">3160</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3158"><a href="#L-3158"><span class="linenos">3158</span></a> <span class="nd">@property</span> +</span><span id="L-3159"><a href="#L-3159"><span class="linenos">3159</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="L-3160"><a href="#L-3160"><span class="linenos">3160</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span><span id="L-3161"><a href="#L-3161"><span class="linenos">3161</span></a> -</span><span id="L-3162"><a href="#L-3162"><span class="linenos">3162</span></a> -</span><span id="L-3163"><a href="#L-3163"><span class="linenos">3163</span></a><span class="k">class</span> <span class="nc">DateDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3164"><a href="#L-3164"><span class="linenos">3164</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3162"><a href="#L-3162"><span class="linenos">3162</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="L-3163"><a href="#L-3163"><span class="linenos">3163</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="L-3164"><a href="#L-3164"><span class="linenos">3164</span></a> </span><span id="L-3165"><a href="#L-3165"><span class="linenos">3165</span></a> -</span><span id="L-3166"><a href="#L-3166"><span class="linenos">3166</span></a> -</span><span id="L-3167"><a href="#L-3167"><span class="linenos">3167</span></a><span class="k">class</span> <span class="nc">DateTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3168"><a href="#L-3168"><span class="linenos">3168</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3166"><a href="#L-3166"><span class="linenos">3166</span></a><span class="k">class</span> <span class="nc">Collate</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3167"><a href="#L-3167"><span class="linenos">3167</span></a> <span class="k">pass</span> +</span><span id="L-3168"><a href="#L-3168"><span class="linenos">3168</span></a> </span><span id="L-3169"><a href="#L-3169"><span class="linenos">3169</span></a> -</span><span id="L-3170"><a href="#L-3170"><span class="linenos">3170</span></a> -</span><span id="L-3171"><a href="#L-3171"><span class="linenos">3171</span></a><span class="k">class</span> <span class="nc">DatetimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3172"><a href="#L-3172"><span class="linenos">3172</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3170"><a href="#L-3170"><span class="linenos">3170</span></a><span class="k">class</span> <span class="nc">TryCast</span><span class="p">(</span><span class="n">Cast</span><span class="p">):</span> +</span><span id="L-3171"><a href="#L-3171"><span class="linenos">3171</span></a> <span class="k">pass</span> +</span><span id="L-3172"><a href="#L-3172"><span class="linenos">3172</span></a> </span><span id="L-3173"><a href="#L-3173"><span class="linenos">3173</span></a> -</span><span id="L-3174"><a href="#L-3174"><span class="linenos">3174</span></a> -</span><span id="L-3175"><a href="#L-3175"><span class="linenos">3175</span></a><span class="k">class</span> <span class="nc">DatetimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3176"><a href="#L-3176"><span class="linenos">3176</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3174"><a href="#L-3174"><span class="linenos">3174</span></a><span class="k">class</span> <span class="nc">Ceil</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3175"><a href="#L-3175"><span class="linenos">3175</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3176"><a href="#L-3176"><span class="linenos">3176</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CEIL"</span><span class="p">,</span> <span class="s2">"CEILING"</span><span class="p">]</span> </span><span id="L-3177"><a href="#L-3177"><span class="linenos">3177</span></a> </span><span id="L-3178"><a href="#L-3178"><span class="linenos">3178</span></a> -</span><span id="L-3179"><a href="#L-3179"><span class="linenos">3179</span></a><span class="k">class</span> <span class="nc">DatetimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3180"><a href="#L-3180"><span class="linenos">3180</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3181"><a href="#L-3181"><span class="linenos">3181</span></a> +</span><span id="L-3179"><a href="#L-3179"><span class="linenos">3179</span></a><span class="k">class</span> <span class="nc">Coalesce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3180"><a href="#L-3180"><span class="linenos">3180</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3181"><a href="#L-3181"><span class="linenos">3181</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span><span id="L-3182"><a href="#L-3182"><span class="linenos">3182</span></a> -</span><span id="L-3183"><a href="#L-3183"><span class="linenos">3183</span></a><span class="k">class</span> <span class="nc">DatetimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3184"><a href="#L-3184"><span class="linenos">3184</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3185"><a href="#L-3185"><span class="linenos">3185</span></a> -</span><span id="L-3186"><a href="#L-3186"><span class="linenos">3186</span></a> -</span><span id="L-3187"><a href="#L-3187"><span class="linenos">3187</span></a><span class="k">class</span> <span class="nc">DayOfWeek</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3188"><a href="#L-3188"><span class="linenos">3188</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_WEEK"</span><span class="p">,</span> <span class="s2">"DAYOFWEEK"</span><span class="p">]</span> -</span><span id="L-3189"><a href="#L-3189"><span class="linenos">3189</span></a> -</span><span id="L-3190"><a href="#L-3190"><span class="linenos">3190</span></a> -</span><span id="L-3191"><a href="#L-3191"><span class="linenos">3191</span></a><span class="k">class</span> <span class="nc">DayOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3192"><a href="#L-3192"><span class="linenos">3192</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_MONTH"</span><span class="p">,</span> <span class="s2">"DAYOFMONTH"</span><span class="p">]</span> -</span><span id="L-3193"><a href="#L-3193"><span class="linenos">3193</span></a> -</span><span id="L-3194"><a href="#L-3194"><span class="linenos">3194</span></a> -</span><span id="L-3195"><a href="#L-3195"><span class="linenos">3195</span></a><span class="k">class</span> <span class="nc">DayOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3196"><a href="#L-3196"><span class="linenos">3196</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_YEAR"</span><span class="p">,</span> <span class="s2">"DAYOFYEAR"</span><span class="p">]</span> -</span><span id="L-3197"><a href="#L-3197"><span class="linenos">3197</span></a> -</span><span id="L-3198"><a href="#L-3198"><span class="linenos">3198</span></a> -</span><span id="L-3199"><a href="#L-3199"><span class="linenos">3199</span></a><span class="k">class</span> <span class="nc">WeekOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3200"><a href="#L-3200"><span class="linenos">3200</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"WEEK_OF_YEAR"</span><span class="p">,</span> <span class="s2">"WEEKOFYEAR"</span><span class="p">]</span> -</span><span id="L-3201"><a href="#L-3201"><span class="linenos">3201</span></a> -</span><span id="L-3202"><a href="#L-3202"><span class="linenos">3202</span></a> -</span><span id="L-3203"><a href="#L-3203"><span class="linenos">3203</span></a><span class="k">class</span> <span class="nc">LastDateOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3204"><a href="#L-3204"><span class="linenos">3204</span></a> <span class="k">pass</span> -</span><span id="L-3205"><a href="#L-3205"><span class="linenos">3205</span></a> -</span><span id="L-3206"><a href="#L-3206"><span class="linenos">3206</span></a> -</span><span id="L-3207"><a href="#L-3207"><span class="linenos">3207</span></a><span class="k">class</span> <span class="nc">Extract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3208"><a href="#L-3208"><span class="linenos">3208</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3209"><a href="#L-3209"><span class="linenos">3209</span></a> -</span><span id="L-3210"><a href="#L-3210"><span class="linenos">3210</span></a> -</span><span id="L-3211"><a href="#L-3211"><span class="linenos">3211</span></a><span class="k">class</span> <span class="nc">TimestampAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3212"><a href="#L-3212"><span class="linenos">3212</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3213"><a href="#L-3213"><span class="linenos">3213</span></a> -</span><span id="L-3214"><a href="#L-3214"><span class="linenos">3214</span></a> -</span><span id="L-3215"><a href="#L-3215"><span class="linenos">3215</span></a><span class="k">class</span> <span class="nc">TimestampSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3216"><a href="#L-3216"><span class="linenos">3216</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3217"><a href="#L-3217"><span class="linenos">3217</span></a> -</span><span id="L-3218"><a href="#L-3218"><span class="linenos">3218</span></a> -</span><span id="L-3219"><a href="#L-3219"><span class="linenos">3219</span></a><span class="k">class</span> <span class="nc">TimestampDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3220"><a href="#L-3220"><span class="linenos">3220</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3221"><a href="#L-3221"><span class="linenos">3221</span></a> -</span><span id="L-3222"><a href="#L-3222"><span class="linenos">3222</span></a> -</span><span id="L-3223"><a href="#L-3223"><span class="linenos">3223</span></a><span class="k">class</span> <span class="nc">TimestampTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3224"><a href="#L-3224"><span class="linenos">3224</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3225"><a href="#L-3225"><span class="linenos">3225</span></a> -</span><span id="L-3226"><a href="#L-3226"><span class="linenos">3226</span></a> -</span><span id="L-3227"><a href="#L-3227"><span class="linenos">3227</span></a><span class="k">class</span> <span class="nc">TimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3228"><a href="#L-3228"><span class="linenos">3228</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3229"><a href="#L-3229"><span class="linenos">3229</span></a> -</span><span id="L-3230"><a href="#L-3230"><span class="linenos">3230</span></a> -</span><span id="L-3231"><a href="#L-3231"><span class="linenos">3231</span></a><span class="k">class</span> <span class="nc">TimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3232"><a href="#L-3232"><span class="linenos">3232</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3233"><a href="#L-3233"><span class="linenos">3233</span></a> -</span><span id="L-3234"><a href="#L-3234"><span class="linenos">3234</span></a> -</span><span id="L-3235"><a href="#L-3235"><span class="linenos">3235</span></a><span class="k">class</span> <span class="nc">TimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3236"><a href="#L-3236"><span class="linenos">3236</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3237"><a href="#L-3237"><span class="linenos">3237</span></a> -</span><span id="L-3238"><a href="#L-3238"><span class="linenos">3238</span></a> -</span><span id="L-3239"><a href="#L-3239"><span class="linenos">3239</span></a><span class="k">class</span> <span class="nc">TimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3240"><a href="#L-3240"><span class="linenos">3240</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3241"><a href="#L-3241"><span class="linenos">3241</span></a> -</span><span id="L-3242"><a href="#L-3242"><span class="linenos">3242</span></a> -</span><span id="L-3243"><a href="#L-3243"><span class="linenos">3243</span></a><span class="k">class</span> <span class="nc">DateFromParts</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3244"><a href="#L-3244"><span class="linenos">3244</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEFROMPARTS"</span><span class="p">]</span> -</span><span id="L-3245"><a href="#L-3245"><span class="linenos">3245</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"year"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"month"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"day"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3246"><a href="#L-3246"><span class="linenos">3246</span></a> +</span><span id="L-3183"><a href="#L-3183"><span class="linenos">3183</span></a> +</span><span id="L-3184"><a href="#L-3184"><span class="linenos">3184</span></a><span class="k">class</span> <span class="nc">Concat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3185"><a href="#L-3185"><span class="linenos">3185</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3186"><a href="#L-3186"><span class="linenos">3186</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3187"><a href="#L-3187"><span class="linenos">3187</span></a> +</span><span id="L-3188"><a href="#L-3188"><span class="linenos">3188</span></a> +</span><span id="L-3189"><a href="#L-3189"><span class="linenos">3189</span></a><span class="k">class</span> <span class="nc">ConcatWs</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> +</span><span id="L-3190"><a href="#L-3190"><span class="linenos">3190</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CONCAT_WS"</span><span class="p">]</span> +</span><span id="L-3191"><a href="#L-3191"><span class="linenos">3191</span></a> +</span><span id="L-3192"><a href="#L-3192"><span class="linenos">3192</span></a> +</span><span id="L-3193"><a href="#L-3193"><span class="linenos">3193</span></a><span class="k">class</span> <span class="nc">Count</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3194"><a href="#L-3194"><span class="linenos">3194</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3195"><a href="#L-3195"><span class="linenos">3195</span></a> +</span><span id="L-3196"><a href="#L-3196"><span class="linenos">3196</span></a> +</span><span id="L-3197"><a href="#L-3197"><span class="linenos">3197</span></a><span class="k">class</span> <span class="nc">CurrentDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3198"><a href="#L-3198"><span class="linenos">3198</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3199"><a href="#L-3199"><span class="linenos">3199</span></a> +</span><span id="L-3200"><a href="#L-3200"><span class="linenos">3200</span></a> +</span><span id="L-3201"><a href="#L-3201"><span class="linenos">3201</span></a><span class="k">class</span> <span class="nc">CurrentDatetime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3202"><a href="#L-3202"><span class="linenos">3202</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3203"><a href="#L-3203"><span class="linenos">3203</span></a> +</span><span id="L-3204"><a href="#L-3204"><span class="linenos">3204</span></a> +</span><span id="L-3205"><a href="#L-3205"><span class="linenos">3205</span></a><span class="k">class</span> <span class="nc">CurrentTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3206"><a href="#L-3206"><span class="linenos">3206</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3207"><a href="#L-3207"><span class="linenos">3207</span></a> +</span><span id="L-3208"><a href="#L-3208"><span class="linenos">3208</span></a> +</span><span id="L-3209"><a href="#L-3209"><span class="linenos">3209</span></a><span class="k">class</span> <span class="nc">CurrentTimestamp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3210"><a href="#L-3210"><span class="linenos">3210</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3211"><a href="#L-3211"><span class="linenos">3211</span></a> +</span><span id="L-3212"><a href="#L-3212"><span class="linenos">3212</span></a> +</span><span id="L-3213"><a href="#L-3213"><span class="linenos">3213</span></a><span class="k">class</span> <span class="nc">DateAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3214"><a href="#L-3214"><span class="linenos">3214</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3215"><a href="#L-3215"><span class="linenos">3215</span></a> +</span><span id="L-3216"><a href="#L-3216"><span class="linenos">3216</span></a> +</span><span id="L-3217"><a href="#L-3217"><span class="linenos">3217</span></a><span class="k">class</span> <span class="nc">DateSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3218"><a href="#L-3218"><span class="linenos">3218</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3219"><a href="#L-3219"><span class="linenos">3219</span></a> +</span><span id="L-3220"><a href="#L-3220"><span class="linenos">3220</span></a> +</span><span id="L-3221"><a href="#L-3221"><span class="linenos">3221</span></a><span class="k">class</span> <span class="nc">DateDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3222"><a href="#L-3222"><span class="linenos">3222</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3223"><a href="#L-3223"><span class="linenos">3223</span></a> +</span><span id="L-3224"><a href="#L-3224"><span class="linenos">3224</span></a> +</span><span id="L-3225"><a href="#L-3225"><span class="linenos">3225</span></a><span class="k">class</span> <span class="nc">DateTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3226"><a href="#L-3226"><span class="linenos">3226</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3227"><a href="#L-3227"><span class="linenos">3227</span></a> +</span><span id="L-3228"><a href="#L-3228"><span class="linenos">3228</span></a> +</span><span id="L-3229"><a href="#L-3229"><span class="linenos">3229</span></a><span class="k">class</span> <span class="nc">DatetimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3230"><a href="#L-3230"><span class="linenos">3230</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3231"><a href="#L-3231"><span class="linenos">3231</span></a> +</span><span id="L-3232"><a href="#L-3232"><span class="linenos">3232</span></a> +</span><span id="L-3233"><a href="#L-3233"><span class="linenos">3233</span></a><span class="k">class</span> <span class="nc">DatetimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3234"><a href="#L-3234"><span class="linenos">3234</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3235"><a href="#L-3235"><span class="linenos">3235</span></a> +</span><span id="L-3236"><a href="#L-3236"><span class="linenos">3236</span></a> +</span><span id="L-3237"><a href="#L-3237"><span class="linenos">3237</span></a><span class="k">class</span> <span class="nc">DatetimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3238"><a href="#L-3238"><span class="linenos">3238</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3239"><a href="#L-3239"><span class="linenos">3239</span></a> +</span><span id="L-3240"><a href="#L-3240"><span class="linenos">3240</span></a> +</span><span id="L-3241"><a href="#L-3241"><span class="linenos">3241</span></a><span class="k">class</span> <span class="nc">DatetimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3242"><a href="#L-3242"><span class="linenos">3242</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3243"><a href="#L-3243"><span class="linenos">3243</span></a> +</span><span id="L-3244"><a href="#L-3244"><span class="linenos">3244</span></a> +</span><span id="L-3245"><a href="#L-3245"><span class="linenos">3245</span></a><span class="k">class</span> <span class="nc">DayOfWeek</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3246"><a href="#L-3246"><span class="linenos">3246</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_WEEK"</span><span class="p">,</span> <span class="s2">"DAYOFWEEK"</span><span class="p">]</span> </span><span id="L-3247"><a href="#L-3247"><span class="linenos">3247</span></a> -</span><span id="L-3248"><a href="#L-3248"><span class="linenos">3248</span></a><span class="k">class</span> <span class="nc">DateStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3249"><a href="#L-3249"><span class="linenos">3249</span></a> <span class="k">pass</span> -</span><span id="L-3250"><a href="#L-3250"><span class="linenos">3250</span></a> +</span><span id="L-3248"><a href="#L-3248"><span class="linenos">3248</span></a> +</span><span id="L-3249"><a href="#L-3249"><span class="linenos">3249</span></a><span class="k">class</span> <span class="nc">DayOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3250"><a href="#L-3250"><span class="linenos">3250</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_MONTH"</span><span class="p">,</span> <span class="s2">"DAYOFMONTH"</span><span class="p">]</span> </span><span id="L-3251"><a href="#L-3251"><span class="linenos">3251</span></a> -</span><span id="L-3252"><a href="#L-3252"><span class="linenos">3252</span></a><span class="k">class</span> <span class="nc">DateToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3253"><a href="#L-3253"><span class="linenos">3253</span></a> <span class="k">pass</span> -</span><span id="L-3254"><a href="#L-3254"><span class="linenos">3254</span></a> +</span><span id="L-3252"><a href="#L-3252"><span class="linenos">3252</span></a> +</span><span id="L-3253"><a href="#L-3253"><span class="linenos">3253</span></a><span class="k">class</span> <span class="nc">DayOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3254"><a href="#L-3254"><span class="linenos">3254</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_YEAR"</span><span class="p">,</span> <span class="s2">"DAYOFYEAR"</span><span class="p">]</span> </span><span id="L-3255"><a href="#L-3255"><span class="linenos">3255</span></a> -</span><span id="L-3256"><a href="#L-3256"><span class="linenos">3256</span></a><span class="k">class</span> <span class="nc">DateToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3257"><a href="#L-3257"><span class="linenos">3257</span></a> <span class="k">pass</span> -</span><span id="L-3258"><a href="#L-3258"><span class="linenos">3258</span></a> +</span><span id="L-3256"><a href="#L-3256"><span class="linenos">3256</span></a> +</span><span id="L-3257"><a href="#L-3257"><span class="linenos">3257</span></a><span class="k">class</span> <span class="nc">WeekOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3258"><a href="#L-3258"><span class="linenos">3258</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"WEEK_OF_YEAR"</span><span class="p">,</span> <span class="s2">"WEEKOFYEAR"</span><span class="p">]</span> </span><span id="L-3259"><a href="#L-3259"><span class="linenos">3259</span></a> -</span><span id="L-3260"><a href="#L-3260"><span class="linenos">3260</span></a><span class="k">class</span> <span class="nc">Day</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3261"><a href="#L-3261"><span class="linenos">3261</span></a> <span class="k">pass</span> -</span><span id="L-3262"><a href="#L-3262"><span class="linenos">3262</span></a> +</span><span id="L-3260"><a href="#L-3260"><span class="linenos">3260</span></a> +</span><span id="L-3261"><a href="#L-3261"><span class="linenos">3261</span></a><span class="k">class</span> <span class="nc">LastDateOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3262"><a href="#L-3262"><span class="linenos">3262</span></a> <span class="k">pass</span> </span><span id="L-3263"><a href="#L-3263"><span class="linenos">3263</span></a> -</span><span id="L-3264"><a href="#L-3264"><span class="linenos">3264</span></a><span class="k">class</span> <span class="nc">Decode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3265"><a href="#L-3265"><span class="linenos">3265</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3266"><a href="#L-3266"><span class="linenos">3266</span></a> +</span><span id="L-3264"><a href="#L-3264"><span class="linenos">3264</span></a> +</span><span id="L-3265"><a href="#L-3265"><span class="linenos">3265</span></a><span class="k">class</span> <span class="nc">Extract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3266"><a href="#L-3266"><span class="linenos">3266</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3267"><a href="#L-3267"><span class="linenos">3267</span></a> -</span><span id="L-3268"><a href="#L-3268"><span class="linenos">3268</span></a><span class="k">class</span> <span class="nc">DiToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3269"><a href="#L-3269"><span class="linenos">3269</span></a> <span class="k">pass</span> -</span><span id="L-3270"><a href="#L-3270"><span class="linenos">3270</span></a> +</span><span id="L-3268"><a href="#L-3268"><span class="linenos">3268</span></a> +</span><span id="L-3269"><a href="#L-3269"><span class="linenos">3269</span></a><span class="k">class</span> <span class="nc">TimestampAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3270"><a href="#L-3270"><span class="linenos">3270</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3271"><a href="#L-3271"><span class="linenos">3271</span></a> -</span><span id="L-3272"><a href="#L-3272"><span class="linenos">3272</span></a><span class="k">class</span> <span class="nc">Encode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3273"><a href="#L-3273"><span class="linenos">3273</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3274"><a href="#L-3274"><span class="linenos">3274</span></a> +</span><span id="L-3272"><a href="#L-3272"><span class="linenos">3272</span></a> +</span><span id="L-3273"><a href="#L-3273"><span class="linenos">3273</span></a><span class="k">class</span> <span class="nc">TimestampSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3274"><a href="#L-3274"><span class="linenos">3274</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3275"><a href="#L-3275"><span class="linenos">3275</span></a> -</span><span id="L-3276"><a href="#L-3276"><span class="linenos">3276</span></a><span class="k">class</span> <span class="nc">Exp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3277"><a href="#L-3277"><span class="linenos">3277</span></a> <span class="k">pass</span> -</span><span id="L-3278"><a href="#L-3278"><span class="linenos">3278</span></a> +</span><span id="L-3276"><a href="#L-3276"><span class="linenos">3276</span></a> +</span><span id="L-3277"><a href="#L-3277"><span class="linenos">3277</span></a><span class="k">class</span> <span class="nc">TimestampDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3278"><a href="#L-3278"><span class="linenos">3278</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3279"><a href="#L-3279"><span class="linenos">3279</span></a> -</span><span id="L-3280"><a href="#L-3280"><span class="linenos">3280</span></a><span class="k">class</span> <span class="nc">Explode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3281"><a href="#L-3281"><span class="linenos">3281</span></a> <span class="k">pass</span> -</span><span id="L-3282"><a href="#L-3282"><span class="linenos">3282</span></a> +</span><span id="L-3280"><a href="#L-3280"><span class="linenos">3280</span></a> +</span><span id="L-3281"><a href="#L-3281"><span class="linenos">3281</span></a><span class="k">class</span> <span class="nc">TimestampTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3282"><a href="#L-3282"><span class="linenos">3282</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3283"><a href="#L-3283"><span class="linenos">3283</span></a> -</span><span id="L-3284"><a href="#L-3284"><span class="linenos">3284</span></a><span class="k">class</span> <span class="nc">Floor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3285"><a href="#L-3285"><span class="linenos">3285</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3286"><a href="#L-3286"><span class="linenos">3286</span></a> +</span><span id="L-3284"><a href="#L-3284"><span class="linenos">3284</span></a> +</span><span id="L-3285"><a href="#L-3285"><span class="linenos">3285</span></a><span class="k">class</span> <span class="nc">TimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3286"><a href="#L-3286"><span class="linenos">3286</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3287"><a href="#L-3287"><span class="linenos">3287</span></a> -</span><span id="L-3288"><a href="#L-3288"><span class="linenos">3288</span></a><span class="k">class</span> <span class="nc">Greatest</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3289"><a href="#L-3289"><span class="linenos">3289</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3290"><a href="#L-3290"><span class="linenos">3290</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3288"><a href="#L-3288"><span class="linenos">3288</span></a> +</span><span id="L-3289"><a href="#L-3289"><span class="linenos">3289</span></a><span class="k">class</span> <span class="nc">TimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3290"><a href="#L-3290"><span class="linenos">3290</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3291"><a href="#L-3291"><span class="linenos">3291</span></a> </span><span id="L-3292"><a href="#L-3292"><span class="linenos">3292</span></a> -</span><span id="L-3293"><a href="#L-3293"><span class="linenos">3293</span></a><span class="k">class</span> <span class="nc">GroupConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3294"><a href="#L-3294"><span class="linenos">3294</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"separator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3293"><a href="#L-3293"><span class="linenos">3293</span></a><span class="k">class</span> <span class="nc">TimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3294"><a href="#L-3294"><span class="linenos">3294</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3295"><a href="#L-3295"><span class="linenos">3295</span></a> </span><span id="L-3296"><a href="#L-3296"><span class="linenos">3296</span></a> -</span><span id="L-3297"><a href="#L-3297"><span class="linenos">3297</span></a><span class="k">class</span> <span class="nc">Hex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3298"><a href="#L-3298"><span class="linenos">3298</span></a> <span class="k">pass</span> +</span><span id="L-3297"><a href="#L-3297"><span class="linenos">3297</span></a><span class="k">class</span> <span class="nc">TimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3298"><a href="#L-3298"><span class="linenos">3298</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3299"><a href="#L-3299"><span class="linenos">3299</span></a> </span><span id="L-3300"><a href="#L-3300"><span class="linenos">3300</span></a> -</span><span id="L-3301"><a href="#L-3301"><span class="linenos">3301</span></a><span class="k">class</span> <span class="nc">If</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3302"><a href="#L-3302"><span class="linenos">3302</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3303"><a href="#L-3303"><span class="linenos">3303</span></a> +</span><span id="L-3301"><a href="#L-3301"><span class="linenos">3301</span></a><span class="k">class</span> <span class="nc">DateFromParts</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3302"><a href="#L-3302"><span class="linenos">3302</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEFROMPARTS"</span><span class="p">]</span> +</span><span id="L-3303"><a href="#L-3303"><span class="linenos">3303</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"year"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"month"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"day"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3304"><a href="#L-3304"><span class="linenos">3304</span></a> -</span><span id="L-3305"><a href="#L-3305"><span class="linenos">3305</span></a><span class="k">class</span> <span class="nc">IfNull</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3306"><a href="#L-3306"><span class="linenos">3306</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3307"><a href="#L-3307"><span class="linenos">3307</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"IFNULL"</span><span class="p">,</span> <span class="s2">"NVL"</span><span class="p">]</span> +</span><span id="L-3305"><a href="#L-3305"><span class="linenos">3305</span></a> +</span><span id="L-3306"><a href="#L-3306"><span class="linenos">3306</span></a><span class="k">class</span> <span class="nc">DateStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3307"><a href="#L-3307"><span class="linenos">3307</span></a> <span class="k">pass</span> </span><span id="L-3308"><a href="#L-3308"><span class="linenos">3308</span></a> </span><span id="L-3309"><a href="#L-3309"><span class="linenos">3309</span></a> -</span><span id="L-3310"><a href="#L-3310"><span class="linenos">3310</span></a><span class="k">class</span> <span class="nc">Initcap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3310"><a href="#L-3310"><span class="linenos">3310</span></a><span class="k">class</span> <span class="nc">DateToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> </span><span id="L-3311"><a href="#L-3311"><span class="linenos">3311</span></a> <span class="k">pass</span> </span><span id="L-3312"><a href="#L-3312"><span class="linenos">3312</span></a> </span><span id="L-3313"><a href="#L-3313"><span class="linenos">3313</span></a> -</span><span id="L-3314"><a href="#L-3314"><span class="linenos">3314</span></a><span class="k">class</span> <span class="nc">JSONBContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="L-3315"><a href="#L-3315"><span class="linenos">3315</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_CONTAINS"</span><span class="p">]</span> +</span><span id="L-3314"><a href="#L-3314"><span class="linenos">3314</span></a><span class="k">class</span> <span class="nc">DateToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3315"><a href="#L-3315"><span class="linenos">3315</span></a> <span class="k">pass</span> </span><span id="L-3316"><a href="#L-3316"><span class="linenos">3316</span></a> </span><span id="L-3317"><a href="#L-3317"><span class="linenos">3317</span></a> -</span><span id="L-3318"><a href="#L-3318"><span class="linenos">3318</span></a><span class="k">class</span> <span class="nc">JSONExtract</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="L-3319"><a href="#L-3319"><span class="linenos">3319</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT"</span><span class="p">]</span> +</span><span id="L-3318"><a href="#L-3318"><span class="linenos">3318</span></a><span class="k">class</span> <span class="nc">Day</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3319"><a href="#L-3319"><span class="linenos">3319</span></a> <span class="k">pass</span> </span><span id="L-3320"><a href="#L-3320"><span class="linenos">3320</span></a> </span><span id="L-3321"><a href="#L-3321"><span class="linenos">3321</span></a> -</span><span id="L-3322"><a href="#L-3322"><span class="linenos">3322</span></a><span class="k">class</span> <span class="nc">JSONExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="L-3323"><a href="#L-3323"><span class="linenos">3323</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT_SCALAR"</span><span class="p">]</span> +</span><span id="L-3322"><a href="#L-3322"><span class="linenos">3322</span></a><span class="k">class</span> <span class="nc">Decode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3323"><a href="#L-3323"><span class="linenos">3323</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3324"><a href="#L-3324"><span class="linenos">3324</span></a> </span><span id="L-3325"><a href="#L-3325"><span class="linenos">3325</span></a> -</span><span id="L-3326"><a href="#L-3326"><span class="linenos">3326</span></a><span class="k">class</span> <span class="nc">JSONBExtract</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="L-3327"><a href="#L-3327"><span class="linenos">3327</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT"</span><span class="p">]</span> +</span><span id="L-3326"><a href="#L-3326"><span class="linenos">3326</span></a><span class="k">class</span> <span class="nc">DiToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3327"><a href="#L-3327"><span class="linenos">3327</span></a> <span class="k">pass</span> </span><span id="L-3328"><a href="#L-3328"><span class="linenos">3328</span></a> </span><span id="L-3329"><a href="#L-3329"><span class="linenos">3329</span></a> -</span><span id="L-3330"><a href="#L-3330"><span class="linenos">3330</span></a><span class="k">class</span> <span class="nc">JSONBExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="L-3331"><a href="#L-3331"><span class="linenos">3331</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT_SCALAR"</span><span class="p">]</span> +</span><span id="L-3330"><a href="#L-3330"><span class="linenos">3330</span></a><span class="k">class</span> <span class="nc">Encode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3331"><a href="#L-3331"><span class="linenos">3331</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3332"><a href="#L-3332"><span class="linenos">3332</span></a> </span><span id="L-3333"><a href="#L-3333"><span class="linenos">3333</span></a> -</span><span id="L-3334"><a href="#L-3334"><span class="linenos">3334</span></a><span class="k">class</span> <span class="nc">Least</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3335"><a href="#L-3335"><span class="linenos">3335</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3336"><a href="#L-3336"><span class="linenos">3336</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3334"><a href="#L-3334"><span class="linenos">3334</span></a><span class="k">class</span> <span class="nc">Exp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3335"><a href="#L-3335"><span class="linenos">3335</span></a> <span class="k">pass</span> +</span><span id="L-3336"><a href="#L-3336"><span class="linenos">3336</span></a> </span><span id="L-3337"><a href="#L-3337"><span class="linenos">3337</span></a> -</span><span id="L-3338"><a href="#L-3338"><span class="linenos">3338</span></a> -</span><span id="L-3339"><a href="#L-3339"><span class="linenos">3339</span></a><span class="k">class</span> <span class="nc">Length</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3340"><a href="#L-3340"><span class="linenos">3340</span></a> <span class="k">pass</span> +</span><span id="L-3338"><a href="#L-3338"><span class="linenos">3338</span></a><span class="k">class</span> <span class="nc">Explode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3339"><a href="#L-3339"><span class="linenos">3339</span></a> <span class="k">pass</span> +</span><span id="L-3340"><a href="#L-3340"><span class="linenos">3340</span></a> </span><span id="L-3341"><a href="#L-3341"><span class="linenos">3341</span></a> -</span><span id="L-3342"><a href="#L-3342"><span class="linenos">3342</span></a> -</span><span id="L-3343"><a href="#L-3343"><span class="linenos">3343</span></a><span class="k">class</span> <span class="nc">Levenshtein</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3344"><a href="#L-3344"><span class="linenos">3344</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3345"><a href="#L-3345"><span class="linenos">3345</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3346"><a href="#L-3346"><span class="linenos">3346</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3347"><a href="#L-3347"><span class="linenos">3347</span></a> <span class="s2">"ins_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3348"><a href="#L-3348"><span class="linenos">3348</span></a> <span class="s2">"del_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3349"><a href="#L-3349"><span class="linenos">3349</span></a> <span class="s2">"sub_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3350"><a href="#L-3350"><span class="linenos">3350</span></a> <span class="p">}</span> -</span><span id="L-3351"><a href="#L-3351"><span class="linenos">3351</span></a> -</span><span id="L-3352"><a href="#L-3352"><span class="linenos">3352</span></a> -</span><span id="L-3353"><a href="#L-3353"><span class="linenos">3353</span></a><span class="k">class</span> <span class="nc">Ln</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3354"><a href="#L-3354"><span class="linenos">3354</span></a> <span class="k">pass</span> -</span><span id="L-3355"><a href="#L-3355"><span class="linenos">3355</span></a> -</span><span id="L-3356"><a href="#L-3356"><span class="linenos">3356</span></a> -</span><span id="L-3357"><a href="#L-3357"><span class="linenos">3357</span></a><span class="k">class</span> <span class="nc">Log</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3358"><a href="#L-3358"><span class="linenos">3358</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3359"><a href="#L-3359"><span class="linenos">3359</span></a> -</span><span id="L-3360"><a href="#L-3360"><span class="linenos">3360</span></a> -</span><span id="L-3361"><a href="#L-3361"><span class="linenos">3361</span></a><span class="k">class</span> <span class="nc">Log2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3362"><a href="#L-3362"><span class="linenos">3362</span></a> <span class="k">pass</span> -</span><span id="L-3363"><a href="#L-3363"><span class="linenos">3363</span></a> -</span><span id="L-3364"><a href="#L-3364"><span class="linenos">3364</span></a> -</span><span id="L-3365"><a href="#L-3365"><span class="linenos">3365</span></a><span class="k">class</span> <span class="nc">Log10</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3366"><a href="#L-3366"><span class="linenos">3366</span></a> <span class="k">pass</span> +</span><span id="L-3342"><a href="#L-3342"><span class="linenos">3342</span></a><span class="k">class</span> <span class="nc">Floor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3343"><a href="#L-3343"><span class="linenos">3343</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3344"><a href="#L-3344"><span class="linenos">3344</span></a> +</span><span id="L-3345"><a href="#L-3345"><span class="linenos">3345</span></a> +</span><span id="L-3346"><a href="#L-3346"><span class="linenos">3346</span></a><span class="k">class</span> <span class="nc">Greatest</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3347"><a href="#L-3347"><span class="linenos">3347</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3348"><a href="#L-3348"><span class="linenos">3348</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3349"><a href="#L-3349"><span class="linenos">3349</span></a> +</span><span id="L-3350"><a href="#L-3350"><span class="linenos">3350</span></a> +</span><span id="L-3351"><a href="#L-3351"><span class="linenos">3351</span></a><span class="k">class</span> <span class="nc">GroupConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3352"><a href="#L-3352"><span class="linenos">3352</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"separator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3353"><a href="#L-3353"><span class="linenos">3353</span></a> +</span><span id="L-3354"><a href="#L-3354"><span class="linenos">3354</span></a> +</span><span id="L-3355"><a href="#L-3355"><span class="linenos">3355</span></a><span class="k">class</span> <span class="nc">Hex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3356"><a href="#L-3356"><span class="linenos">3356</span></a> <span class="k">pass</span> +</span><span id="L-3357"><a href="#L-3357"><span class="linenos">3357</span></a> +</span><span id="L-3358"><a href="#L-3358"><span class="linenos">3358</span></a> +</span><span id="L-3359"><a href="#L-3359"><span class="linenos">3359</span></a><span class="k">class</span> <span class="nc">If</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3360"><a href="#L-3360"><span class="linenos">3360</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3361"><a href="#L-3361"><span class="linenos">3361</span></a> +</span><span id="L-3362"><a href="#L-3362"><span class="linenos">3362</span></a> +</span><span id="L-3363"><a href="#L-3363"><span class="linenos">3363</span></a><span class="k">class</span> <span class="nc">IfNull</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3364"><a href="#L-3364"><span class="linenos">3364</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3365"><a href="#L-3365"><span class="linenos">3365</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"IFNULL"</span><span class="p">,</span> <span class="s2">"NVL"</span><span class="p">]</span> +</span><span id="L-3366"><a href="#L-3366"><span class="linenos">3366</span></a> </span><span id="L-3367"><a href="#L-3367"><span class="linenos">3367</span></a> -</span><span id="L-3368"><a href="#L-3368"><span class="linenos">3368</span></a> -</span><span id="L-3369"><a href="#L-3369"><span class="linenos">3369</span></a><span class="k">class</span> <span class="nc">LogicalOr</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3370"><a href="#L-3370"><span class="linenos">3370</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_OR"</span><span class="p">,</span> <span class="s2">"BOOL_OR"</span><span class="p">]</span> +</span><span id="L-3368"><a href="#L-3368"><span class="linenos">3368</span></a><span class="k">class</span> <span class="nc">Initcap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3369"><a href="#L-3369"><span class="linenos">3369</span></a> <span class="k">pass</span> +</span><span id="L-3370"><a href="#L-3370"><span class="linenos">3370</span></a> </span><span id="L-3371"><a href="#L-3371"><span class="linenos">3371</span></a> -</span><span id="L-3372"><a href="#L-3372"><span class="linenos">3372</span></a> -</span><span id="L-3373"><a href="#L-3373"><span class="linenos">3373</span></a><span class="k">class</span> <span class="nc">Lower</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3374"><a href="#L-3374"><span class="linenos">3374</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOWER"</span><span class="p">,</span> <span class="s2">"LCASE"</span><span class="p">]</span> +</span><span id="L-3372"><a href="#L-3372"><span class="linenos">3372</span></a><span class="k">class</span> <span class="nc">JSONBContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="L-3373"><a href="#L-3373"><span class="linenos">3373</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_CONTAINS"</span><span class="p">]</span> +</span><span id="L-3374"><a href="#L-3374"><span class="linenos">3374</span></a> </span><span id="L-3375"><a href="#L-3375"><span class="linenos">3375</span></a> -</span><span id="L-3376"><a href="#L-3376"><span class="linenos">3376</span></a> -</span><span id="L-3377"><a href="#L-3377"><span class="linenos">3377</span></a><span class="k">class</span> <span class="nc">Map</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3378"><a href="#L-3378"><span class="linenos">3378</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3376"><a href="#L-3376"><span class="linenos">3376</span></a><span class="k">class</span> <span class="nc">JSONExtract</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="L-3377"><a href="#L-3377"><span class="linenos">3377</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT"</span><span class="p">]</span> +</span><span id="L-3378"><a href="#L-3378"><span class="linenos">3378</span></a> </span><span id="L-3379"><a href="#L-3379"><span class="linenos">3379</span></a> -</span><span id="L-3380"><a href="#L-3380"><span class="linenos">3380</span></a> -</span><span id="L-3381"><a href="#L-3381"><span class="linenos">3381</span></a><span class="k">class</span> <span class="nc">VarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3382"><a href="#L-3382"><span class="linenos">3382</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3383"><a href="#L-3383"><span class="linenos">3383</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3384"><a href="#L-3384"><span class="linenos">3384</span></a> -</span><span id="L-3385"><a href="#L-3385"><span class="linenos">3385</span></a> -</span><span id="L-3386"><a href="#L-3386"><span class="linenos">3386</span></a><span class="k">class</span> <span class="nc">Matches</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3387"><a href="#L-3387"><span class="linenos">3387</span></a><span class="w"> </span><span class="sd">"""Oracle/Snowflake decode.</span> -</span><span id="L-3388"><a href="#L-3388"><span class="linenos">3388</span></a><span class="sd"> https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm</span> -</span><span id="L-3389"><a href="#L-3389"><span class="linenos">3389</span></a><span class="sd"> Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</span> -</span><span id="L-3390"><a href="#L-3390"><span class="linenos">3390</span></a><span class="sd"> """</span> +</span><span id="L-3380"><a href="#L-3380"><span class="linenos">3380</span></a><span class="k">class</span> <span class="nc">JSONExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="L-3381"><a href="#L-3381"><span class="linenos">3381</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT_SCALAR"</span><span class="p">]</span> +</span><span id="L-3382"><a href="#L-3382"><span class="linenos">3382</span></a> +</span><span id="L-3383"><a href="#L-3383"><span class="linenos">3383</span></a> +</span><span id="L-3384"><a href="#L-3384"><span class="linenos">3384</span></a><span class="k">class</span> <span class="nc">JSONBExtract</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="L-3385"><a href="#L-3385"><span class="linenos">3385</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT"</span><span class="p">]</span> +</span><span id="L-3386"><a href="#L-3386"><span class="linenos">3386</span></a> +</span><span id="L-3387"><a href="#L-3387"><span class="linenos">3387</span></a> +</span><span id="L-3388"><a href="#L-3388"><span class="linenos">3388</span></a><span class="k">class</span> <span class="nc">JSONBExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="L-3389"><a href="#L-3389"><span class="linenos">3389</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT_SCALAR"</span><span class="p">]</span> +</span><span id="L-3390"><a href="#L-3390"><span class="linenos">3390</span></a> </span><span id="L-3391"><a href="#L-3391"><span class="linenos">3391</span></a> -</span><span id="L-3392"><a href="#L-3392"><span class="linenos">3392</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3393"><a href="#L-3393"><span class="linenos">3393</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3394"><a href="#L-3394"><span class="linenos">3394</span></a> +</span><span id="L-3392"><a href="#L-3392"><span class="linenos">3392</span></a><span class="k">class</span> <span class="nc">Least</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3393"><a href="#L-3393"><span class="linenos">3393</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3394"><a href="#L-3394"><span class="linenos">3394</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span><span id="L-3395"><a href="#L-3395"><span class="linenos">3395</span></a> -</span><span id="L-3396"><a href="#L-3396"><span class="linenos">3396</span></a><span class="k">class</span> <span class="nc">Max</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3397"><a href="#L-3397"><span class="linenos">3397</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3398"><a href="#L-3398"><span class="linenos">3398</span></a> +</span><span id="L-3396"><a href="#L-3396"><span class="linenos">3396</span></a> +</span><span id="L-3397"><a href="#L-3397"><span class="linenos">3397</span></a><span class="k">class</span> <span class="nc">Length</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3398"><a href="#L-3398"><span class="linenos">3398</span></a> <span class="k">pass</span> </span><span id="L-3399"><a href="#L-3399"><span class="linenos">3399</span></a> -</span><span id="L-3400"><a href="#L-3400"><span class="linenos">3400</span></a><span class="k">class</span> <span class="nc">Min</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3401"><a href="#L-3401"><span class="linenos">3401</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3402"><a href="#L-3402"><span class="linenos">3402</span></a> -</span><span id="L-3403"><a href="#L-3403"><span class="linenos">3403</span></a> -</span><span id="L-3404"><a href="#L-3404"><span class="linenos">3404</span></a><span class="k">class</span> <span class="nc">Month</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3405"><a href="#L-3405"><span class="linenos">3405</span></a> <span class="k">pass</span> -</span><span id="L-3406"><a href="#L-3406"><span class="linenos">3406</span></a> -</span><span id="L-3407"><a href="#L-3407"><span class="linenos">3407</span></a> -</span><span id="L-3408"><a href="#L-3408"><span class="linenos">3408</span></a><span class="k">class</span> <span class="nc">Nvl2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3409"><a href="#L-3409"><span class="linenos">3409</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3400"><a href="#L-3400"><span class="linenos">3400</span></a> +</span><span id="L-3401"><a href="#L-3401"><span class="linenos">3401</span></a><span class="k">class</span> <span class="nc">Levenshtein</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3402"><a href="#L-3402"><span class="linenos">3402</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3403"><a href="#L-3403"><span class="linenos">3403</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3404"><a href="#L-3404"><span class="linenos">3404</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3405"><a href="#L-3405"><span class="linenos">3405</span></a> <span class="s2">"ins_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3406"><a href="#L-3406"><span class="linenos">3406</span></a> <span class="s2">"del_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3407"><a href="#L-3407"><span class="linenos">3407</span></a> <span class="s2">"sub_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3408"><a href="#L-3408"><span class="linenos">3408</span></a> <span class="p">}</span> +</span><span id="L-3409"><a href="#L-3409"><span class="linenos">3409</span></a> </span><span id="L-3410"><a href="#L-3410"><span class="linenos">3410</span></a> -</span><span id="L-3411"><a href="#L-3411"><span class="linenos">3411</span></a> -</span><span id="L-3412"><a href="#L-3412"><span class="linenos">3412</span></a><span class="k">class</span> <span class="nc">Posexplode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3413"><a href="#L-3413"><span class="linenos">3413</span></a> <span class="k">pass</span> +</span><span id="L-3411"><a href="#L-3411"><span class="linenos">3411</span></a><span class="k">class</span> <span class="nc">Ln</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3412"><a href="#L-3412"><span class="linenos">3412</span></a> <span class="k">pass</span> +</span><span id="L-3413"><a href="#L-3413"><span class="linenos">3413</span></a> </span><span id="L-3414"><a href="#L-3414"><span class="linenos">3414</span></a> -</span><span id="L-3415"><a href="#L-3415"><span class="linenos">3415</span></a> -</span><span id="L-3416"><a href="#L-3416"><span class="linenos">3416</span></a><span class="k">class</span> <span class="nc">Pow</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="L-3417"><a href="#L-3417"><span class="linenos">3417</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"POWER"</span><span class="p">,</span> <span class="s2">"POW"</span><span class="p">]</span> +</span><span id="L-3415"><a href="#L-3415"><span class="linenos">3415</span></a><span class="k">class</span> <span class="nc">Log</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3416"><a href="#L-3416"><span class="linenos">3416</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3417"><a href="#L-3417"><span class="linenos">3417</span></a> </span><span id="L-3418"><a href="#L-3418"><span class="linenos">3418</span></a> -</span><span id="L-3419"><a href="#L-3419"><span class="linenos">3419</span></a> -</span><span id="L-3420"><a href="#L-3420"><span class="linenos">3420</span></a><span class="k">class</span> <span class="nc">PercentileCont</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3421"><a href="#L-3421"><span class="linenos">3421</span></a> <span class="k">pass</span> +</span><span id="L-3419"><a href="#L-3419"><span class="linenos">3419</span></a><span class="k">class</span> <span class="nc">Log2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3420"><a href="#L-3420"><span class="linenos">3420</span></a> <span class="k">pass</span> +</span><span id="L-3421"><a href="#L-3421"><span class="linenos">3421</span></a> </span><span id="L-3422"><a href="#L-3422"><span class="linenos">3422</span></a> -</span><span id="L-3423"><a href="#L-3423"><span class="linenos">3423</span></a> -</span><span id="L-3424"><a href="#L-3424"><span class="linenos">3424</span></a><span class="k">class</span> <span class="nc">PercentileDisc</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3425"><a href="#L-3425"><span class="linenos">3425</span></a> <span class="k">pass</span> +</span><span id="L-3423"><a href="#L-3423"><span class="linenos">3423</span></a><span class="k">class</span> <span class="nc">Log10</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3424"><a href="#L-3424"><span class="linenos">3424</span></a> <span class="k">pass</span> +</span><span id="L-3425"><a href="#L-3425"><span class="linenos">3425</span></a> </span><span id="L-3426"><a href="#L-3426"><span class="linenos">3426</span></a> -</span><span id="L-3427"><a href="#L-3427"><span class="linenos">3427</span></a> -</span><span id="L-3428"><a href="#L-3428"><span class="linenos">3428</span></a><span class="k">class</span> <span class="nc">Quantile</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3429"><a href="#L-3429"><span class="linenos">3429</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3427"><a href="#L-3427"><span class="linenos">3427</span></a><span class="k">class</span> <span class="nc">LogicalOr</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3428"><a href="#L-3428"><span class="linenos">3428</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_OR"</span><span class="p">,</span> <span class="s2">"BOOL_OR"</span><span class="p">]</span> +</span><span id="L-3429"><a href="#L-3429"><span class="linenos">3429</span></a> </span><span id="L-3430"><a href="#L-3430"><span class="linenos">3430</span></a> -</span><span id="L-3431"><a href="#L-3431"><span class="linenos">3431</span></a> -</span><span id="L-3432"><a href="#L-3432"><span class="linenos">3432</span></a><span class="c1"># Clickhouse-specific:</span> -</span><span id="L-3433"><a href="#L-3433"><span class="linenos">3433</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/quantiles/#quantiles</span> -</span><span id="L-3434"><a href="#L-3434"><span class="linenos">3434</span></a><span class="k">class</span> <span class="nc">Quantiles</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3435"><a href="#L-3435"><span class="linenos">3435</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3436"><a href="#L-3436"><span class="linenos">3436</span></a> +</span><span id="L-3431"><a href="#L-3431"><span class="linenos">3431</span></a><span class="k">class</span> <span class="nc">Lower</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3432"><a href="#L-3432"><span class="linenos">3432</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOWER"</span><span class="p">,</span> <span class="s2">"LCASE"</span><span class="p">]</span> +</span><span id="L-3433"><a href="#L-3433"><span class="linenos">3433</span></a> +</span><span id="L-3434"><a href="#L-3434"><span class="linenos">3434</span></a> +</span><span id="L-3435"><a href="#L-3435"><span class="linenos">3435</span></a><span class="k">class</span> <span class="nc">Map</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3436"><a href="#L-3436"><span class="linenos">3436</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3437"><a href="#L-3437"><span class="linenos">3437</span></a> -</span><span id="L-3438"><a href="#L-3438"><span class="linenos">3438</span></a><span class="k">class</span> <span class="nc">QuantileIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3439"><a href="#L-3439"><span class="linenos">3439</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3440"><a href="#L-3440"><span class="linenos">3440</span></a> -</span><span id="L-3441"><a href="#L-3441"><span class="linenos">3441</span></a> -</span><span id="L-3442"><a href="#L-3442"><span class="linenos">3442</span></a><span class="k">class</span> <span class="nc">ApproxQuantile</span><span class="p">(</span><span class="n">Quantile</span><span class="p">):</span> -</span><span id="L-3443"><a href="#L-3443"><span class="linenos">3443</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"weight"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3444"><a href="#L-3444"><span class="linenos">3444</span></a> -</span><span id="L-3445"><a href="#L-3445"><span class="linenos">3445</span></a> -</span><span id="L-3446"><a href="#L-3446"><span class="linenos">3446</span></a><span class="k">class</span> <span class="nc">ReadCSV</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3447"><a href="#L-3447"><span class="linenos">3447</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"READ_CSV"</span><span class="p">]</span> -</span><span id="L-3448"><a href="#L-3448"><span class="linenos">3448</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="L-3449"><a href="#L-3449"><span class="linenos">3449</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3450"><a href="#L-3450"><span class="linenos">3450</span></a> -</span><span id="L-3451"><a href="#L-3451"><span class="linenos">3451</span></a> -</span><span id="L-3452"><a href="#L-3452"><span class="linenos">3452</span></a><span class="k">class</span> <span class="nc">Reduce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3453"><a href="#L-3453"><span class="linenos">3453</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"merge"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"finish"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3454"><a href="#L-3454"><span class="linenos">3454</span></a> -</span><span id="L-3455"><a href="#L-3455"><span class="linenos">3455</span></a> -</span><span id="L-3456"><a href="#L-3456"><span class="linenos">3456</span></a><span class="k">class</span> <span class="nc">RegexpExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3457"><a href="#L-3457"><span class="linenos">3457</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3458"><a href="#L-3458"><span class="linenos">3458</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3459"><a href="#L-3459"><span class="linenos">3459</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3460"><a href="#L-3460"><span class="linenos">3460</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3461"><a href="#L-3461"><span class="linenos">3461</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3462"><a href="#L-3462"><span class="linenos">3462</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3463"><a href="#L-3463"><span class="linenos">3463</span></a> <span class="p">}</span> +</span><span id="L-3438"><a href="#L-3438"><span class="linenos">3438</span></a> +</span><span id="L-3439"><a href="#L-3439"><span class="linenos">3439</span></a><span class="k">class</span> <span class="nc">VarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3440"><a href="#L-3440"><span class="linenos">3440</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3441"><a href="#L-3441"><span class="linenos">3441</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3442"><a href="#L-3442"><span class="linenos">3442</span></a> +</span><span id="L-3443"><a href="#L-3443"><span class="linenos">3443</span></a> +</span><span id="L-3444"><a href="#L-3444"><span class="linenos">3444</span></a><span class="k">class</span> <span class="nc">Matches</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3445"><a href="#L-3445"><span class="linenos">3445</span></a><span class="w"> </span><span class="sd">"""Oracle/Snowflake decode.</span> +</span><span id="L-3446"><a href="#L-3446"><span class="linenos">3446</span></a><span class="sd"> https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm</span> +</span><span id="L-3447"><a href="#L-3447"><span class="linenos">3447</span></a><span class="sd"> Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</span> +</span><span id="L-3448"><a href="#L-3448"><span class="linenos">3448</span></a><span class="sd"> """</span> +</span><span id="L-3449"><a href="#L-3449"><span class="linenos">3449</span></a> +</span><span id="L-3450"><a href="#L-3450"><span class="linenos">3450</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3451"><a href="#L-3451"><span class="linenos">3451</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3452"><a href="#L-3452"><span class="linenos">3452</span></a> +</span><span id="L-3453"><a href="#L-3453"><span class="linenos">3453</span></a> +</span><span id="L-3454"><a href="#L-3454"><span class="linenos">3454</span></a><span class="k">class</span> <span class="nc">Max</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3455"><a href="#L-3455"><span class="linenos">3455</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3456"><a href="#L-3456"><span class="linenos">3456</span></a> +</span><span id="L-3457"><a href="#L-3457"><span class="linenos">3457</span></a> +</span><span id="L-3458"><a href="#L-3458"><span class="linenos">3458</span></a><span class="k">class</span> <span class="nc">Min</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3459"><a href="#L-3459"><span class="linenos">3459</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3460"><a href="#L-3460"><span class="linenos">3460</span></a> +</span><span id="L-3461"><a href="#L-3461"><span class="linenos">3461</span></a> +</span><span id="L-3462"><a href="#L-3462"><span class="linenos">3462</span></a><span class="k">class</span> <span class="nc">Month</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3463"><a href="#L-3463"><span class="linenos">3463</span></a> <span class="k">pass</span> </span><span id="L-3464"><a href="#L-3464"><span class="linenos">3464</span></a> </span><span id="L-3465"><a href="#L-3465"><span class="linenos">3465</span></a> -</span><span id="L-3466"><a href="#L-3466"><span class="linenos">3466</span></a><span class="k">class</span> <span class="nc">RegexpLike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3467"><a href="#L-3467"><span class="linenos">3467</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3466"><a href="#L-3466"><span class="linenos">3466</span></a><span class="k">class</span> <span class="nc">Nvl2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3467"><a href="#L-3467"><span class="linenos">3467</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3468"><a href="#L-3468"><span class="linenos">3468</span></a> </span><span id="L-3469"><a href="#L-3469"><span class="linenos">3469</span></a> -</span><span id="L-3470"><a href="#L-3470"><span class="linenos">3470</span></a><span class="k">class</span> <span class="nc">RegexpILike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3471"><a href="#L-3471"><span class="linenos">3471</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3470"><a href="#L-3470"><span class="linenos">3470</span></a><span class="k">class</span> <span class="nc">Posexplode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3471"><a href="#L-3471"><span class="linenos">3471</span></a> <span class="k">pass</span> </span><span id="L-3472"><a href="#L-3472"><span class="linenos">3472</span></a> </span><span id="L-3473"><a href="#L-3473"><span class="linenos">3473</span></a> -</span><span id="L-3474"><a href="#L-3474"><span class="linenos">3474</span></a><span class="k">class</span> <span class="nc">RegexpSplit</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3475"><a href="#L-3475"><span class="linenos">3475</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3474"><a href="#L-3474"><span class="linenos">3474</span></a><span class="k">class</span> <span class="nc">Pow</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="L-3475"><a href="#L-3475"><span class="linenos">3475</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"POWER"</span><span class="p">,</span> <span class="s2">"POW"</span><span class="p">]</span> </span><span id="L-3476"><a href="#L-3476"><span class="linenos">3476</span></a> </span><span id="L-3477"><a href="#L-3477"><span class="linenos">3477</span></a> -</span><span id="L-3478"><a href="#L-3478"><span class="linenos">3478</span></a><span class="k">class</span> <span class="nc">Repeat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3479"><a href="#L-3479"><span class="linenos">3479</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"times"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3478"><a href="#L-3478"><span class="linenos">3478</span></a><span class="k">class</span> <span class="nc">PercentileCont</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3479"><a href="#L-3479"><span class="linenos">3479</span></a> <span class="k">pass</span> </span><span id="L-3480"><a href="#L-3480"><span class="linenos">3480</span></a> </span><span id="L-3481"><a href="#L-3481"><span class="linenos">3481</span></a> -</span><span id="L-3482"><a href="#L-3482"><span class="linenos">3482</span></a><span class="k">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3483"><a href="#L-3483"><span class="linenos">3483</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3482"><a href="#L-3482"><span class="linenos">3482</span></a><span class="k">class</span> <span class="nc">PercentileDisc</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3483"><a href="#L-3483"><span class="linenos">3483</span></a> <span class="k">pass</span> </span><span id="L-3484"><a href="#L-3484"><span class="linenos">3484</span></a> </span><span id="L-3485"><a href="#L-3485"><span class="linenos">3485</span></a> -</span><span id="L-3486"><a href="#L-3486"><span class="linenos">3486</span></a><span class="k">class</span> <span class="nc">RowNumber</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3487"><a href="#L-3487"><span class="linenos">3487</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-3486"><a href="#L-3486"><span class="linenos">3486</span></a><span class="k">class</span> <span class="nc">Quantile</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3487"><a href="#L-3487"><span class="linenos">3487</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3488"><a href="#L-3488"><span class="linenos">3488</span></a> </span><span id="L-3489"><a href="#L-3489"><span class="linenos">3489</span></a> -</span><span id="L-3490"><a href="#L-3490"><span class="linenos">3490</span></a><span class="k">class</span> <span class="nc">SafeDivide</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3491"><a href="#L-3491"><span class="linenos">3491</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3492"><a href="#L-3492"><span class="linenos">3492</span></a> -</span><span id="L-3493"><a href="#L-3493"><span class="linenos">3493</span></a> -</span><span id="L-3494"><a href="#L-3494"><span class="linenos">3494</span></a><span class="k">class</span> <span class="nc">SetAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3495"><a href="#L-3495"><span class="linenos">3495</span></a> <span class="k">pass</span> -</span><span id="L-3496"><a href="#L-3496"><span class="linenos">3496</span></a> -</span><span id="L-3497"><a href="#L-3497"><span class="linenos">3497</span></a> -</span><span id="L-3498"><a href="#L-3498"><span class="linenos">3498</span></a><span class="k">class</span> <span class="nc">SortArray</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3499"><a href="#L-3499"><span class="linenos">3499</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"asc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3500"><a href="#L-3500"><span class="linenos">3500</span></a> -</span><span id="L-3501"><a href="#L-3501"><span class="linenos">3501</span></a> -</span><span id="L-3502"><a href="#L-3502"><span class="linenos">3502</span></a><span class="k">class</span> <span class="nc">Split</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3503"><a href="#L-3503"><span class="linenos">3503</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3504"><a href="#L-3504"><span class="linenos">3504</span></a> -</span><span id="L-3505"><a href="#L-3505"><span class="linenos">3505</span></a> -</span><span id="L-3506"><a href="#L-3506"><span class="linenos">3506</span></a><span class="c1"># Start may be omitted in the case of postgres</span> -</span><span id="L-3507"><a href="#L-3507"><span class="linenos">3507</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/functions-string.html @ Table 9-6</span> -</span><span id="L-3508"><a href="#L-3508"><span class="linenos">3508</span></a><span class="k">class</span> <span class="nc">Substring</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3509"><a href="#L-3509"><span class="linenos">3509</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"length"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3510"><a href="#L-3510"><span class="linenos">3510</span></a> -</span><span id="L-3511"><a href="#L-3511"><span class="linenos">3511</span></a> -</span><span id="L-3512"><a href="#L-3512"><span class="linenos">3512</span></a><span class="k">class</span> <span class="nc">StrPosition</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3513"><a href="#L-3513"><span class="linenos">3513</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3514"><a href="#L-3514"><span class="linenos">3514</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3515"><a href="#L-3515"><span class="linenos">3515</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3516"><a href="#L-3516"><span class="linenos">3516</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3517"><a href="#L-3517"><span class="linenos">3517</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3518"><a href="#L-3518"><span class="linenos">3518</span></a> <span class="p">}</span> -</span><span id="L-3519"><a href="#L-3519"><span class="linenos">3519</span></a> -</span><span id="L-3520"><a href="#L-3520"><span class="linenos">3520</span></a> -</span><span id="L-3521"><a href="#L-3521"><span class="linenos">3521</span></a><span class="k">class</span> <span class="nc">StrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3522"><a href="#L-3522"><span class="linenos">3522</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3490"><a href="#L-3490"><span class="linenos">3490</span></a><span class="c1"># Clickhouse-specific:</span> +</span><span id="L-3491"><a href="#L-3491"><span class="linenos">3491</span></a><span class="c1"># https://clickhouse.com/docs/en/sql-reference/aggregate-functions/reference/quantiles/#quantiles</span> +</span><span id="L-3492"><a href="#L-3492"><span class="linenos">3492</span></a><span class="k">class</span> <span class="nc">Quantiles</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3493"><a href="#L-3493"><span class="linenos">3493</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3494"><a href="#L-3494"><span class="linenos">3494</span></a> +</span><span id="L-3495"><a href="#L-3495"><span class="linenos">3495</span></a> +</span><span id="L-3496"><a href="#L-3496"><span class="linenos">3496</span></a><span class="k">class</span> <span class="nc">QuantileIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3497"><a href="#L-3497"><span class="linenos">3497</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3498"><a href="#L-3498"><span class="linenos">3498</span></a> +</span><span id="L-3499"><a href="#L-3499"><span class="linenos">3499</span></a> +</span><span id="L-3500"><a href="#L-3500"><span class="linenos">3500</span></a><span class="k">class</span> <span class="nc">ApproxQuantile</span><span class="p">(</span><span class="n">Quantile</span><span class="p">):</span> +</span><span id="L-3501"><a href="#L-3501"><span class="linenos">3501</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"weight"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3502"><a href="#L-3502"><span class="linenos">3502</span></a> +</span><span id="L-3503"><a href="#L-3503"><span class="linenos">3503</span></a> +</span><span id="L-3504"><a href="#L-3504"><span class="linenos">3504</span></a><span class="k">class</span> <span class="nc">ReadCSV</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3505"><a href="#L-3505"><span class="linenos">3505</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"READ_CSV"</span><span class="p">]</span> +</span><span id="L-3506"><a href="#L-3506"><span class="linenos">3506</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3507"><a href="#L-3507"><span class="linenos">3507</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3508"><a href="#L-3508"><span class="linenos">3508</span></a> +</span><span id="L-3509"><a href="#L-3509"><span class="linenos">3509</span></a> +</span><span id="L-3510"><a href="#L-3510"><span class="linenos">3510</span></a><span class="k">class</span> <span class="nc">Reduce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3511"><a href="#L-3511"><span class="linenos">3511</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"merge"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"finish"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3512"><a href="#L-3512"><span class="linenos">3512</span></a> +</span><span id="L-3513"><a href="#L-3513"><span class="linenos">3513</span></a> +</span><span id="L-3514"><a href="#L-3514"><span class="linenos">3514</span></a><span class="k">class</span> <span class="nc">RegexpExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3515"><a href="#L-3515"><span class="linenos">3515</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3516"><a href="#L-3516"><span class="linenos">3516</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3517"><a href="#L-3517"><span class="linenos">3517</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3518"><a href="#L-3518"><span class="linenos">3518</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3519"><a href="#L-3519"><span class="linenos">3519</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3520"><a href="#L-3520"><span class="linenos">3520</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3521"><a href="#L-3521"><span class="linenos">3521</span></a> <span class="p">}</span> +</span><span id="L-3522"><a href="#L-3522"><span class="linenos">3522</span></a> </span><span id="L-3523"><a href="#L-3523"><span class="linenos">3523</span></a> -</span><span id="L-3524"><a href="#L-3524"><span class="linenos">3524</span></a> -</span><span id="L-3525"><a href="#L-3525"><span class="linenos">3525</span></a><span class="k">class</span> <span class="nc">StrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3526"><a href="#L-3526"><span class="linenos">3526</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3524"><a href="#L-3524"><span class="linenos">3524</span></a><span class="k">class</span> <span class="nc">RegexpLike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3525"><a href="#L-3525"><span class="linenos">3525</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3526"><a href="#L-3526"><span class="linenos">3526</span></a> </span><span id="L-3527"><a href="#L-3527"><span class="linenos">3527</span></a> -</span><span id="L-3528"><a href="#L-3528"><span class="linenos">3528</span></a> -</span><span id="L-3529"><a href="#L-3529"><span class="linenos">3529</span></a><span class="c1"># Spark allows unix_timestamp()</span> -</span><span id="L-3530"><a href="#L-3530"><span class="linenos">3530</span></a><span class="c1"># https://spark.apache.org/docs/3.1.3/api/python/reference/api/pyspark.sql.functions.unix_timestamp.html</span> -</span><span id="L-3531"><a href="#L-3531"><span class="linenos">3531</span></a><span class="k">class</span> <span class="nc">StrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3532"><a href="#L-3532"><span class="linenos">3532</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3533"><a href="#L-3533"><span class="linenos">3533</span></a> +</span><span id="L-3528"><a href="#L-3528"><span class="linenos">3528</span></a><span class="k">class</span> <span class="nc">RegexpILike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3529"><a href="#L-3529"><span class="linenos">3529</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3530"><a href="#L-3530"><span class="linenos">3530</span></a> +</span><span id="L-3531"><a href="#L-3531"><span class="linenos">3531</span></a> +</span><span id="L-3532"><a href="#L-3532"><span class="linenos">3532</span></a><span class="k">class</span> <span class="nc">RegexpSplit</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3533"><a href="#L-3533"><span class="linenos">3533</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3534"><a href="#L-3534"><span class="linenos">3534</span></a> -</span><span id="L-3535"><a href="#L-3535"><span class="linenos">3535</span></a><span class="k">class</span> <span class="nc">NumberToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3536"><a href="#L-3536"><span class="linenos">3536</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3537"><a href="#L-3537"><span class="linenos">3537</span></a> +</span><span id="L-3535"><a href="#L-3535"><span class="linenos">3535</span></a> +</span><span id="L-3536"><a href="#L-3536"><span class="linenos">3536</span></a><span class="k">class</span> <span class="nc">Repeat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3537"><a href="#L-3537"><span class="linenos">3537</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"times"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3538"><a href="#L-3538"><span class="linenos">3538</span></a> -</span><span id="L-3539"><a href="#L-3539"><span class="linenos">3539</span></a><span class="k">class</span> <span class="nc">Struct</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3540"><a href="#L-3540"><span class="linenos">3540</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3541"><a href="#L-3541"><span class="linenos">3541</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="L-3539"><a href="#L-3539"><span class="linenos">3539</span></a> +</span><span id="L-3540"><a href="#L-3540"><span class="linenos">3540</span></a><span class="k">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3541"><a href="#L-3541"><span class="linenos">3541</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3542"><a href="#L-3542"><span class="linenos">3542</span></a> </span><span id="L-3543"><a href="#L-3543"><span class="linenos">3543</span></a> -</span><span id="L-3544"><a href="#L-3544"><span class="linenos">3544</span></a><span class="k">class</span> <span class="nc">StructExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3545"><a href="#L-3545"><span class="linenos">3545</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3544"><a href="#L-3544"><span class="linenos">3544</span></a><span class="k">class</span> <span class="nc">RowNumber</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3545"><a href="#L-3545"><span class="linenos">3545</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> </span><span id="L-3546"><a href="#L-3546"><span class="linenos">3546</span></a> </span><span id="L-3547"><a href="#L-3547"><span class="linenos">3547</span></a> -</span><span id="L-3548"><a href="#L-3548"><span class="linenos">3548</span></a><span class="k">class</span> <span class="nc">Sum</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3549"><a href="#L-3549"><span class="linenos">3549</span></a> <span class="k">pass</span> +</span><span id="L-3548"><a href="#L-3548"><span class="linenos">3548</span></a><span class="k">class</span> <span class="nc">SafeDivide</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3549"><a href="#L-3549"><span class="linenos">3549</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3550"><a href="#L-3550"><span class="linenos">3550</span></a> </span><span id="L-3551"><a href="#L-3551"><span class="linenos">3551</span></a> -</span><span id="L-3552"><a href="#L-3552"><span class="linenos">3552</span></a><span class="k">class</span> <span class="nc">Sqrt</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3552"><a href="#L-3552"><span class="linenos">3552</span></a><span class="k">class</span> <span class="nc">SetAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> </span><span id="L-3553"><a href="#L-3553"><span class="linenos">3553</span></a> <span class="k">pass</span> </span><span id="L-3554"><a href="#L-3554"><span class="linenos">3554</span></a> </span><span id="L-3555"><a href="#L-3555"><span class="linenos">3555</span></a> -</span><span id="L-3556"><a href="#L-3556"><span class="linenos">3556</span></a><span class="k">class</span> <span class="nc">Stddev</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3557"><a href="#L-3557"><span class="linenos">3557</span></a> <span class="k">pass</span> +</span><span id="L-3556"><a href="#L-3556"><span class="linenos">3556</span></a><span class="k">class</span> <span class="nc">SortArray</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3557"><a href="#L-3557"><span class="linenos">3557</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"asc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3558"><a href="#L-3558"><span class="linenos">3558</span></a> </span><span id="L-3559"><a href="#L-3559"><span class="linenos">3559</span></a> -</span><span id="L-3560"><a href="#L-3560"><span class="linenos">3560</span></a><span class="k">class</span> <span class="nc">StddevPop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3561"><a href="#L-3561"><span class="linenos">3561</span></a> <span class="k">pass</span> +</span><span id="L-3560"><a href="#L-3560"><span class="linenos">3560</span></a><span class="k">class</span> <span class="nc">Split</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3561"><a href="#L-3561"><span class="linenos">3561</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3562"><a href="#L-3562"><span class="linenos">3562</span></a> </span><span id="L-3563"><a href="#L-3563"><span class="linenos">3563</span></a> -</span><span id="L-3564"><a href="#L-3564"><span class="linenos">3564</span></a><span class="k">class</span> <span class="nc">StddevSamp</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3565"><a href="#L-3565"><span class="linenos">3565</span></a> <span class="k">pass</span> -</span><span id="L-3566"><a href="#L-3566"><span class="linenos">3566</span></a> -</span><span id="L-3567"><a href="#L-3567"><span class="linenos">3567</span></a> -</span><span id="L-3568"><a href="#L-3568"><span class="linenos">3568</span></a><span class="k">class</span> <span class="nc">TimeToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3569"><a href="#L-3569"><span class="linenos">3569</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="L-3570"><a href="#L-3570"><span class="linenos">3570</span></a> -</span><span id="L-3571"><a href="#L-3571"><span class="linenos">3571</span></a> -</span><span id="L-3572"><a href="#L-3572"><span class="linenos">3572</span></a><span class="k">class</span> <span class="nc">TimeToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3573"><a href="#L-3573"><span class="linenos">3573</span></a> <span class="k">pass</span> -</span><span id="L-3574"><a href="#L-3574"><span class="linenos">3574</span></a> -</span><span id="L-3575"><a href="#L-3575"><span class="linenos">3575</span></a> -</span><span id="L-3576"><a href="#L-3576"><span class="linenos">3576</span></a><span class="k">class</span> <span class="nc">TimeToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3577"><a href="#L-3577"><span class="linenos">3577</span></a> <span class="k">pass</span> +</span><span id="L-3564"><a href="#L-3564"><span class="linenos">3564</span></a><span class="c1"># Start may be omitted in the case of postgres</span> +</span><span id="L-3565"><a href="#L-3565"><span class="linenos">3565</span></a><span class="c1"># https://www.postgresql.org/docs/9.1/functions-string.html @ Table 9-6</span> +</span><span id="L-3566"><a href="#L-3566"><span class="linenos">3566</span></a><span class="k">class</span> <span class="nc">Substring</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3567"><a href="#L-3567"><span class="linenos">3567</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"length"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3568"><a href="#L-3568"><span class="linenos">3568</span></a> +</span><span id="L-3569"><a href="#L-3569"><span class="linenos">3569</span></a> +</span><span id="L-3570"><a href="#L-3570"><span class="linenos">3570</span></a><span class="k">class</span> <span class="nc">StrPosition</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3571"><a href="#L-3571"><span class="linenos">3571</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3572"><a href="#L-3572"><span class="linenos">3572</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3573"><a href="#L-3573"><span class="linenos">3573</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3574"><a href="#L-3574"><span class="linenos">3574</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3575"><a href="#L-3575"><span class="linenos">3575</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3576"><a href="#L-3576"><span class="linenos">3576</span></a> <span class="p">}</span> +</span><span id="L-3577"><a href="#L-3577"><span class="linenos">3577</span></a> </span><span id="L-3578"><a href="#L-3578"><span class="linenos">3578</span></a> -</span><span id="L-3579"><a href="#L-3579"><span class="linenos">3579</span></a> -</span><span id="L-3580"><a href="#L-3580"><span class="linenos">3580</span></a><span class="k">class</span> <span class="nc">TimeStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3581"><a href="#L-3581"><span class="linenos">3581</span></a> <span class="k">pass</span> +</span><span id="L-3579"><a href="#L-3579"><span class="linenos">3579</span></a><span class="k">class</span> <span class="nc">StrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3580"><a href="#L-3580"><span class="linenos">3580</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3581"><a href="#L-3581"><span class="linenos">3581</span></a> </span><span id="L-3582"><a href="#L-3582"><span class="linenos">3582</span></a> -</span><span id="L-3583"><a href="#L-3583"><span class="linenos">3583</span></a> -</span><span id="L-3584"><a href="#L-3584"><span class="linenos">3584</span></a><span class="k">class</span> <span class="nc">TimeStrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3585"><a href="#L-3585"><span class="linenos">3585</span></a> <span class="k">pass</span> +</span><span id="L-3583"><a href="#L-3583"><span class="linenos">3583</span></a><span class="k">class</span> <span class="nc">StrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3584"><a href="#L-3584"><span class="linenos">3584</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3585"><a href="#L-3585"><span class="linenos">3585</span></a> </span><span id="L-3586"><a href="#L-3586"><span class="linenos">3586</span></a> -</span><span id="L-3587"><a href="#L-3587"><span class="linenos">3587</span></a> -</span><span id="L-3588"><a href="#L-3588"><span class="linenos">3588</span></a><span class="k">class</span> <span class="nc">TimeStrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3589"><a href="#L-3589"><span class="linenos">3589</span></a> <span class="k">pass</span> -</span><span id="L-3590"><a href="#L-3590"><span class="linenos">3590</span></a> +</span><span id="L-3587"><a href="#L-3587"><span class="linenos">3587</span></a><span class="c1"># Spark allows unix_timestamp()</span> +</span><span id="L-3588"><a href="#L-3588"><span class="linenos">3588</span></a><span class="c1"># https://spark.apache.org/docs/3.1.3/api/python/reference/api/pyspark.sql.functions.unix_timestamp.html</span> +</span><span id="L-3589"><a href="#L-3589"><span class="linenos">3589</span></a><span class="k">class</span> <span class="nc">StrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3590"><a href="#L-3590"><span class="linenos">3590</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3591"><a href="#L-3591"><span class="linenos">3591</span></a> -</span><span id="L-3592"><a href="#L-3592"><span class="linenos">3592</span></a><span class="k">class</span> <span class="nc">Trim</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3593"><a href="#L-3593"><span class="linenos">3593</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="L-3594"><a href="#L-3594"><span class="linenos">3594</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="L-3595"><a href="#L-3595"><span class="linenos">3595</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3596"><a href="#L-3596"><span class="linenos">3596</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3597"><a href="#L-3597"><span class="linenos">3597</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3598"><a href="#L-3598"><span class="linenos">3598</span></a> <span class="p">}</span> -</span><span id="L-3599"><a href="#L-3599"><span class="linenos">3599</span></a> +</span><span id="L-3592"><a href="#L-3592"><span class="linenos">3592</span></a> +</span><span id="L-3593"><a href="#L-3593"><span class="linenos">3593</span></a><span class="k">class</span> <span class="nc">NumberToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3594"><a href="#L-3594"><span class="linenos">3594</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3595"><a href="#L-3595"><span class="linenos">3595</span></a> +</span><span id="L-3596"><a href="#L-3596"><span class="linenos">3596</span></a> +</span><span id="L-3597"><a href="#L-3597"><span class="linenos">3597</span></a><span class="k">class</span> <span class="nc">Struct</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3598"><a href="#L-3598"><span class="linenos">3598</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3599"><a href="#L-3599"><span class="linenos">3599</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span><span id="L-3600"><a href="#L-3600"><span class="linenos">3600</span></a> -</span><span id="L-3601"><a href="#L-3601"><span class="linenos">3601</span></a><span class="k">class</span> <span class="nc">TsOrDsAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="L-3602"><a href="#L-3602"><span class="linenos">3602</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3603"><a href="#L-3603"><span class="linenos">3603</span></a> +</span><span id="L-3601"><a href="#L-3601"><span class="linenos">3601</span></a> +</span><span id="L-3602"><a href="#L-3602"><span class="linenos">3602</span></a><span class="k">class</span> <span class="nc">StructExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3603"><a href="#L-3603"><span class="linenos">3603</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3604"><a href="#L-3604"><span class="linenos">3604</span></a> -</span><span id="L-3605"><a href="#L-3605"><span class="linenos">3605</span></a><span class="k">class</span> <span class="nc">TsOrDsToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3606"><a href="#L-3606"><span class="linenos">3606</span></a> <span class="k">pass</span> -</span><span id="L-3607"><a href="#L-3607"><span class="linenos">3607</span></a> +</span><span id="L-3605"><a href="#L-3605"><span class="linenos">3605</span></a> +</span><span id="L-3606"><a href="#L-3606"><span class="linenos">3606</span></a><span class="k">class</span> <span class="nc">Sum</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3607"><a href="#L-3607"><span class="linenos">3607</span></a> <span class="k">pass</span> </span><span id="L-3608"><a href="#L-3608"><span class="linenos">3608</span></a> -</span><span id="L-3609"><a href="#L-3609"><span class="linenos">3609</span></a><span class="k">class</span> <span class="nc">TsOrDsToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3610"><a href="#L-3610"><span class="linenos">3610</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3611"><a href="#L-3611"><span class="linenos">3611</span></a> +</span><span id="L-3609"><a href="#L-3609"><span class="linenos">3609</span></a> +</span><span id="L-3610"><a href="#L-3610"><span class="linenos">3610</span></a><span class="k">class</span> <span class="nc">Sqrt</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3611"><a href="#L-3611"><span class="linenos">3611</span></a> <span class="k">pass</span> </span><span id="L-3612"><a href="#L-3612"><span class="linenos">3612</span></a> -</span><span id="L-3613"><a href="#L-3613"><span class="linenos">3613</span></a><span class="k">class</span> <span class="nc">TsOrDiToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3614"><a href="#L-3614"><span class="linenos">3614</span></a> <span class="k">pass</span> -</span><span id="L-3615"><a href="#L-3615"><span class="linenos">3615</span></a> +</span><span id="L-3613"><a href="#L-3613"><span class="linenos">3613</span></a> +</span><span id="L-3614"><a href="#L-3614"><span class="linenos">3614</span></a><span class="k">class</span> <span class="nc">Stddev</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3615"><a href="#L-3615"><span class="linenos">3615</span></a> <span class="k">pass</span> </span><span id="L-3616"><a href="#L-3616"><span class="linenos">3616</span></a> -</span><span id="L-3617"><a href="#L-3617"><span class="linenos">3617</span></a><span class="k">class</span> <span class="nc">Unhex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3618"><a href="#L-3618"><span class="linenos">3618</span></a> <span class="k">pass</span> -</span><span id="L-3619"><a href="#L-3619"><span class="linenos">3619</span></a> +</span><span id="L-3617"><a href="#L-3617"><span class="linenos">3617</span></a> +</span><span id="L-3618"><a href="#L-3618"><span class="linenos">3618</span></a><span class="k">class</span> <span class="nc">StddevPop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3619"><a href="#L-3619"><span class="linenos">3619</span></a> <span class="k">pass</span> </span><span id="L-3620"><a href="#L-3620"><span class="linenos">3620</span></a> -</span><span id="L-3621"><a href="#L-3621"><span class="linenos">3621</span></a><span class="k">class</span> <span class="nc">UnixToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3622"><a href="#L-3622"><span class="linenos">3622</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3623"><a href="#L-3623"><span class="linenos">3623</span></a> +</span><span id="L-3621"><a href="#L-3621"><span class="linenos">3621</span></a> +</span><span id="L-3622"><a href="#L-3622"><span class="linenos">3622</span></a><span class="k">class</span> <span class="nc">StddevSamp</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3623"><a href="#L-3623"><span class="linenos">3623</span></a> <span class="k">pass</span> </span><span id="L-3624"><a href="#L-3624"><span class="linenos">3624</span></a> -</span><span id="L-3625"><a href="#L-3625"><span class="linenos">3625</span></a><span class="c1"># https://prestodb.io/docs/current/functions/datetime.html</span> -</span><span id="L-3626"><a href="#L-3626"><span class="linenos">3626</span></a><span class="c1"># presto has weird zone/hours/minutes</span> -</span><span id="L-3627"><a href="#L-3627"><span class="linenos">3627</span></a><span class="k">class</span> <span class="nc">UnixToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3628"><a href="#L-3628"><span class="linenos">3628</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"scale"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"hours"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"minutes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3625"><a href="#L-3625"><span class="linenos">3625</span></a> +</span><span id="L-3626"><a href="#L-3626"><span class="linenos">3626</span></a><span class="k">class</span> <span class="nc">TimeToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3627"><a href="#L-3627"><span class="linenos">3627</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3628"><a href="#L-3628"><span class="linenos">3628</span></a> </span><span id="L-3629"><a href="#L-3629"><span class="linenos">3629</span></a> -</span><span id="L-3630"><a href="#L-3630"><span class="linenos">3630</span></a> <span class="n">SECONDS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"seconds"</span><span class="p">)</span> -</span><span id="L-3631"><a href="#L-3631"><span class="linenos">3631</span></a> <span class="n">MILLIS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"millis"</span><span class="p">)</span> -</span><span id="L-3632"><a href="#L-3632"><span class="linenos">3632</span></a> <span class="n">MICROS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"micros"</span><span class="p">)</span> +</span><span id="L-3630"><a href="#L-3630"><span class="linenos">3630</span></a><span class="k">class</span> <span class="nc">TimeToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3631"><a href="#L-3631"><span class="linenos">3631</span></a> <span class="k">pass</span> +</span><span id="L-3632"><a href="#L-3632"><span class="linenos">3632</span></a> </span><span id="L-3633"><a href="#L-3633"><span class="linenos">3633</span></a> -</span><span id="L-3634"><a href="#L-3634"><span class="linenos">3634</span></a> -</span><span id="L-3635"><a href="#L-3635"><span class="linenos">3635</span></a><span class="k">class</span> <span class="nc">UnixToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3636"><a href="#L-3636"><span class="linenos">3636</span></a> <span class="k">pass</span> +</span><span id="L-3634"><a href="#L-3634"><span class="linenos">3634</span></a><span class="k">class</span> <span class="nc">TimeToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3635"><a href="#L-3635"><span class="linenos">3635</span></a> <span class="k">pass</span> +</span><span id="L-3636"><a href="#L-3636"><span class="linenos">3636</span></a> </span><span id="L-3637"><a href="#L-3637"><span class="linenos">3637</span></a> -</span><span id="L-3638"><a href="#L-3638"><span class="linenos">3638</span></a> -</span><span id="L-3639"><a href="#L-3639"><span class="linenos">3639</span></a><span class="k">class</span> <span class="nc">Upper</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3640"><a href="#L-3640"><span class="linenos">3640</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"UPPER"</span><span class="p">,</span> <span class="s2">"UCASE"</span><span class="p">]</span> +</span><span id="L-3638"><a href="#L-3638"><span class="linenos">3638</span></a><span class="k">class</span> <span class="nc">TimeStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3639"><a href="#L-3639"><span class="linenos">3639</span></a> <span class="k">pass</span> +</span><span id="L-3640"><a href="#L-3640"><span class="linenos">3640</span></a> </span><span id="L-3641"><a href="#L-3641"><span class="linenos">3641</span></a> -</span><span id="L-3642"><a href="#L-3642"><span class="linenos">3642</span></a> -</span><span id="L-3643"><a href="#L-3643"><span class="linenos">3643</span></a><span class="k">class</span> <span class="nc">Variance</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3644"><a href="#L-3644"><span class="linenos">3644</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE"</span><span class="p">,</span> <span class="s2">"VARIANCE_SAMP"</span><span class="p">,</span> <span class="s2">"VAR_SAMP"</span><span class="p">]</span> +</span><span id="L-3642"><a href="#L-3642"><span class="linenos">3642</span></a><span class="k">class</span> <span class="nc">TimeStrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3643"><a href="#L-3643"><span class="linenos">3643</span></a> <span class="k">pass</span> +</span><span id="L-3644"><a href="#L-3644"><span class="linenos">3644</span></a> </span><span id="L-3645"><a href="#L-3645"><span class="linenos">3645</span></a> -</span><span id="L-3646"><a href="#L-3646"><span class="linenos">3646</span></a> -</span><span id="L-3647"><a href="#L-3647"><span class="linenos">3647</span></a><span class="k">class</span> <span class="nc">VariancePop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="L-3648"><a href="#L-3648"><span class="linenos">3648</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE_POP"</span><span class="p">,</span> <span class="s2">"VAR_POP"</span><span class="p">]</span> +</span><span id="L-3646"><a href="#L-3646"><span class="linenos">3646</span></a><span class="k">class</span> <span class="nc">TimeStrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3647"><a href="#L-3647"><span class="linenos">3647</span></a> <span class="k">pass</span> +</span><span id="L-3648"><a href="#L-3648"><span class="linenos">3648</span></a> </span><span id="L-3649"><a href="#L-3649"><span class="linenos">3649</span></a> -</span><span id="L-3650"><a href="#L-3650"><span class="linenos">3650</span></a> -</span><span id="L-3651"><a href="#L-3651"><span class="linenos">3651</span></a><span class="k">class</span> <span class="nc">Week</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3652"><a href="#L-3652"><span class="linenos">3652</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"mode"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="L-3653"><a href="#L-3653"><span class="linenos">3653</span></a> -</span><span id="L-3654"><a href="#L-3654"><span class="linenos">3654</span></a> -</span><span id="L-3655"><a href="#L-3655"><span class="linenos">3655</span></a><span class="k">class</span> <span class="nc">XMLTable</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3656"><a href="#L-3656"><span class="linenos">3656</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"passing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"by_ref"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3650"><a href="#L-3650"><span class="linenos">3650</span></a><span class="k">class</span> <span class="nc">Trim</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3651"><a href="#L-3651"><span class="linenos">3651</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="L-3652"><a href="#L-3652"><span class="linenos">3652</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="L-3653"><a href="#L-3653"><span class="linenos">3653</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3654"><a href="#L-3654"><span class="linenos">3654</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3655"><a href="#L-3655"><span class="linenos">3655</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3656"><a href="#L-3656"><span class="linenos">3656</span></a> <span class="p">}</span> </span><span id="L-3657"><a href="#L-3657"><span class="linenos">3657</span></a> </span><span id="L-3658"><a href="#L-3658"><span class="linenos">3658</span></a> -</span><span id="L-3659"><a href="#L-3659"><span class="linenos">3659</span></a><span class="k">class</span> <span class="nc">Year</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3660"><a href="#L-3660"><span class="linenos">3660</span></a> <span class="k">pass</span> +</span><span id="L-3659"><a href="#L-3659"><span class="linenos">3659</span></a><span class="k">class</span> <span class="nc">TsOrDsAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="L-3660"><a href="#L-3660"><span class="linenos">3660</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3661"><a href="#L-3661"><span class="linenos">3661</span></a> </span><span id="L-3662"><a href="#L-3662"><span class="linenos">3662</span></a> -</span><span id="L-3663"><a href="#L-3663"><span class="linenos">3663</span></a><span class="k">class</span> <span class="nc">Use</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3664"><a href="#L-3664"><span class="linenos">3664</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3663"><a href="#L-3663"><span class="linenos">3663</span></a><span class="k">class</span> <span class="nc">TsOrDsToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3664"><a href="#L-3664"><span class="linenos">3664</span></a> <span class="k">pass</span> </span><span id="L-3665"><a href="#L-3665"><span class="linenos">3665</span></a> </span><span id="L-3666"><a href="#L-3666"><span class="linenos">3666</span></a> -</span><span id="L-3667"><a href="#L-3667"><span class="linenos">3667</span></a><span class="k">class</span> <span class="nc">Merge</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3668"><a href="#L-3668"><span class="linenos">3668</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3667"><a href="#L-3667"><span class="linenos">3667</span></a><span class="k">class</span> <span class="nc">TsOrDsToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3668"><a href="#L-3668"><span class="linenos">3668</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span><span id="L-3669"><a href="#L-3669"><span class="linenos">3669</span></a> </span><span id="L-3670"><a href="#L-3670"><span class="linenos">3670</span></a> -</span><span id="L-3671"><a href="#L-3671"><span class="linenos">3671</span></a><span class="k">class</span> <span class="nc">When</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="L-3672"><a href="#L-3672"><span class="linenos">3672</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"then"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3671"><a href="#L-3671"><span class="linenos">3671</span></a><span class="k">class</span> <span class="nc">TsOrDiToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3672"><a href="#L-3672"><span class="linenos">3672</span></a> <span class="k">pass</span> </span><span id="L-3673"><a href="#L-3673"><span class="linenos">3673</span></a> </span><span id="L-3674"><a href="#L-3674"><span class="linenos">3674</span></a> -</span><span id="L-3675"><a href="#L-3675"><span class="linenos">3675</span></a><span class="k">def</span> <span class="nf">_norm_args</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> -</span><span id="L-3676"><a href="#L-3676"><span class="linenos">3676</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="L-3675"><a href="#L-3675"><span class="linenos">3675</span></a><span class="k">class</span> <span class="nc">Unhex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3676"><a href="#L-3676"><span class="linenos">3676</span></a> <span class="k">pass</span> </span><span id="L-3677"><a href="#L-3677"><span class="linenos">3677</span></a> -</span><span id="L-3678"><a href="#L-3678"><span class="linenos">3678</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-3679"><a href="#L-3679"><span class="linenos">3679</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="L-3680"><a href="#L-3680"><span class="linenos">3680</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="p">[</span><span class="n">_norm_arg</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="n">arg</span><span class="p">]</span> -</span><span id="L-3681"><a href="#L-3681"><span class="linenos">3681</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">arg</span><span class="p">:</span> -</span><span id="L-3682"><a href="#L-3682"><span class="linenos">3682</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="L-3683"><a href="#L-3683"><span class="linenos">3683</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-3684"><a href="#L-3684"><span class="linenos">3684</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> -</span><span id="L-3685"><a href="#L-3685"><span class="linenos">3685</span></a> -</span><span id="L-3686"><a href="#L-3686"><span class="linenos">3686</span></a> <span class="k">if</span> <span class="n">arg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">arg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span><span class="p">:</span> -</span><span id="L-3687"><a href="#L-3687"><span class="linenos">3687</span></a> <span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">arg</span> -</span><span id="L-3688"><a href="#L-3688"><span class="linenos">3688</span></a> -</span><span id="L-3689"><a href="#L-3689"><span class="linenos">3689</span></a> <span class="k">return</span> <span class="n">args</span> -</span><span id="L-3690"><a href="#L-3690"><span class="linenos">3690</span></a> +</span><span id="L-3678"><a href="#L-3678"><span class="linenos">3678</span></a> +</span><span id="L-3679"><a href="#L-3679"><span class="linenos">3679</span></a><span class="k">class</span> <span class="nc">UnixToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3680"><a href="#L-3680"><span class="linenos">3680</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3681"><a href="#L-3681"><span class="linenos">3681</span></a> +</span><span id="L-3682"><a href="#L-3682"><span class="linenos">3682</span></a> +</span><span id="L-3683"><a href="#L-3683"><span class="linenos">3683</span></a><span class="c1"># https://prestodb.io/docs/current/functions/datetime.html</span> +</span><span id="L-3684"><a href="#L-3684"><span class="linenos">3684</span></a><span class="c1"># presto has weird zone/hours/minutes</span> +</span><span id="L-3685"><a href="#L-3685"><span class="linenos">3685</span></a><span class="k">class</span> <span class="nc">UnixToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3686"><a href="#L-3686"><span class="linenos">3686</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"scale"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"hours"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"minutes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3687"><a href="#L-3687"><span class="linenos">3687</span></a> +</span><span id="L-3688"><a href="#L-3688"><span class="linenos">3688</span></a> <span class="n">SECONDS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"seconds"</span><span class="p">)</span> +</span><span id="L-3689"><a href="#L-3689"><span class="linenos">3689</span></a> <span class="n">MILLIS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"millis"</span><span class="p">)</span> +</span><span id="L-3690"><a href="#L-3690"><span class="linenos">3690</span></a> <span class="n">MICROS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"micros"</span><span class="p">)</span> </span><span id="L-3691"><a href="#L-3691"><span class="linenos">3691</span></a> -</span><span id="L-3692"><a href="#L-3692"><span class="linenos">3692</span></a><span class="k">def</span> <span class="nf">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">):</span> -</span><span id="L-3693"><a href="#L-3693"><span class="linenos">3693</span></a> <span class="k">return</span> <span class="n">arg</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="k">else</span> <span class="n">arg</span> -</span><span id="L-3694"><a href="#L-3694"><span class="linenos">3694</span></a> +</span><span id="L-3692"><a href="#L-3692"><span class="linenos">3692</span></a> +</span><span id="L-3693"><a href="#L-3693"><span class="linenos">3693</span></a><span class="k">class</span> <span class="nc">UnixToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3694"><a href="#L-3694"><span class="linenos">3694</span></a> <span class="k">pass</span> </span><span id="L-3695"><a href="#L-3695"><span class="linenos">3695</span></a> -</span><span id="L-3696"><a href="#L-3696"><span class="linenos">3696</span></a><span class="n">ALL_FUNCTIONS</span> <span class="o">=</span> <span class="n">subclasses</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">Func</span><span class="p">,</span> <span class="p">(</span><span class="n">AggFunc</span><span class="p">,</span> <span class="n">Anonymous</span><span class="p">,</span> <span class="n">Func</span><span class="p">))</span> -</span><span id="L-3697"><a href="#L-3697"><span class="linenos">3697</span></a> -</span><span id="L-3698"><a href="#L-3698"><span class="linenos">3698</span></a> -</span><span id="L-3699"><a href="#L-3699"><span class="linenos">3699</span></a><span class="c1"># Helpers</span> -</span><span id="L-3700"><a href="#L-3700"><span class="linenos">3700</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="L-3701"><a href="#L-3701"><span class="linenos">3701</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="L-3702"><a href="#L-3702"><span class="linenos">3702</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="L-3703"><a href="#L-3703"><span class="linenos">3703</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">IntoType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-3704"><a href="#L-3704"><span class="linenos">3704</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-3705"><a href="#L-3705"><span class="linenos">3705</span></a> <span class="n">prefix</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-3706"><a href="#L-3706"><span class="linenos">3706</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-3707"><a href="#L-3707"><span class="linenos">3707</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3708"><a href="#L-3708"><span class="linenos">3708</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-3709"><a href="#L-3709"><span class="linenos">3709</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> -</span><span id="L-3710"><a href="#L-3710"><span class="linenos">3710</span></a> -</span><span id="L-3711"><a href="#L-3711"><span class="linenos">3711</span></a><span class="sd"> Example:</span> -</span><span id="L-3712"><a href="#L-3712"><span class="linenos">3712</span></a><span class="sd"> >>> maybe_parse("1")</span> -</span><span id="L-3713"><a href="#L-3713"><span class="linenos">3713</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> -</span><span id="L-3714"><a href="#L-3714"><span class="linenos">3714</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> -</span><span id="L-3715"><a href="#L-3715"><span class="linenos">3715</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> +</span><span id="L-3696"><a href="#L-3696"><span class="linenos">3696</span></a> +</span><span id="L-3697"><a href="#L-3697"><span class="linenos">3697</span></a><span class="k">class</span> <span class="nc">Upper</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3698"><a href="#L-3698"><span class="linenos">3698</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"UPPER"</span><span class="p">,</span> <span class="s2">"UCASE"</span><span class="p">]</span> +</span><span id="L-3699"><a href="#L-3699"><span class="linenos">3699</span></a> +</span><span id="L-3700"><a href="#L-3700"><span class="linenos">3700</span></a> +</span><span id="L-3701"><a href="#L-3701"><span class="linenos">3701</span></a><span class="k">class</span> <span class="nc">Variance</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3702"><a href="#L-3702"><span class="linenos">3702</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE"</span><span class="p">,</span> <span class="s2">"VARIANCE_SAMP"</span><span class="p">,</span> <span class="s2">"VAR_SAMP"</span><span class="p">]</span> +</span><span id="L-3703"><a href="#L-3703"><span class="linenos">3703</span></a> +</span><span id="L-3704"><a href="#L-3704"><span class="linenos">3704</span></a> +</span><span id="L-3705"><a href="#L-3705"><span class="linenos">3705</span></a><span class="k">class</span> <span class="nc">VariancePop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="L-3706"><a href="#L-3706"><span class="linenos">3706</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE_POP"</span><span class="p">,</span> <span class="s2">"VAR_POP"</span><span class="p">]</span> +</span><span id="L-3707"><a href="#L-3707"><span class="linenos">3707</span></a> +</span><span id="L-3708"><a href="#L-3708"><span class="linenos">3708</span></a> +</span><span id="L-3709"><a href="#L-3709"><span class="linenos">3709</span></a><span class="k">class</span> <span class="nc">Week</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3710"><a href="#L-3710"><span class="linenos">3710</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"mode"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3711"><a href="#L-3711"><span class="linenos">3711</span></a> +</span><span id="L-3712"><a href="#L-3712"><span class="linenos">3712</span></a> +</span><span id="L-3713"><a href="#L-3713"><span class="linenos">3713</span></a><span class="k">class</span> <span class="nc">XMLTable</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3714"><a href="#L-3714"><span class="linenos">3714</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"passing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"by_ref"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3715"><a href="#L-3715"><span class="linenos">3715</span></a> </span><span id="L-3716"><a href="#L-3716"><span class="linenos">3716</span></a> -</span><span id="L-3717"><a href="#L-3717"><span class="linenos">3717</span></a><span class="sd"> Args:</span> -</span><span id="L-3718"><a href="#L-3718"><span class="linenos">3718</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> -</span><span id="L-3719"><a href="#L-3719"><span class="linenos">3719</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> -</span><span id="L-3720"><a href="#L-3720"><span class="linenos">3720</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="L-3721"><a href="#L-3721"><span class="linenos">3721</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-3722"><a href="#L-3722"><span class="linenos">3722</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> -</span><span id="L-3723"><a href="#L-3723"><span class="linenos">3723</span></a><span class="sd"> (automatically includes a space)</span> -</span><span id="L-3724"><a href="#L-3724"><span class="linenos">3724</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="L-3725"><a href="#L-3725"><span class="linenos">3725</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-3726"><a href="#L-3726"><span class="linenos">3726</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-3717"><a href="#L-3717"><span class="linenos">3717</span></a><span class="k">class</span> <span class="nc">Year</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3718"><a href="#L-3718"><span class="linenos">3718</span></a> <span class="k">pass</span> +</span><span id="L-3719"><a href="#L-3719"><span class="linenos">3719</span></a> +</span><span id="L-3720"><a href="#L-3720"><span class="linenos">3720</span></a> +</span><span id="L-3721"><a href="#L-3721"><span class="linenos">3721</span></a><span class="k">class</span> <span class="nc">Use</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3722"><a href="#L-3722"><span class="linenos">3722</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="L-3723"><a href="#L-3723"><span class="linenos">3723</span></a> +</span><span id="L-3724"><a href="#L-3724"><span class="linenos">3724</span></a> +</span><span id="L-3725"><a href="#L-3725"><span class="linenos">3725</span></a><span class="k">class</span> <span class="nc">Merge</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3726"><a href="#L-3726"><span class="linenos">3726</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span><span id="L-3727"><a href="#L-3727"><span class="linenos">3727</span></a> -</span><span id="L-3728"><a href="#L-3728"><span class="linenos">3728</span></a><span class="sd"> Returns:</span> -</span><span id="L-3729"><a href="#L-3729"><span class="linenos">3729</span></a><span class="sd"> Expression: the parsed or given expression.</span> -</span><span id="L-3730"><a href="#L-3730"><span class="linenos">3730</span></a><span class="sd"> """</span> -</span><span id="L-3731"><a href="#L-3731"><span class="linenos">3731</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-3732"><a href="#L-3732"><span class="linenos">3732</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> -</span><span id="L-3733"><a href="#L-3733"><span class="linenos">3733</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="L-3734"><a href="#L-3734"><span class="linenos">3734</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> +</span><span id="L-3728"><a href="#L-3728"><span class="linenos">3728</span></a> +</span><span id="L-3729"><a href="#L-3729"><span class="linenos">3729</span></a><span class="k">class</span> <span class="nc">When</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="L-3730"><a href="#L-3730"><span class="linenos">3730</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"then"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="L-3731"><a href="#L-3731"><span class="linenos">3731</span></a> +</span><span id="L-3732"><a href="#L-3732"><span class="linenos">3732</span></a> +</span><span id="L-3733"><a href="#L-3733"><span class="linenos">3733</span></a><span class="k">def</span> <span class="nf">_norm_args</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> +</span><span id="L-3734"><a href="#L-3734"><span class="linenos">3734</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{}</span> </span><span id="L-3735"><a href="#L-3735"><span class="linenos">3735</span></a> -</span><span id="L-3736"><a href="#L-3736"><span class="linenos">3736</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> -</span><span id="L-3737"><a href="#L-3737"><span class="linenos">3737</span></a> -</span><span id="L-3738"><a href="#L-3738"><span class="linenos">3738</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">)</span> -</span><span id="L-3739"><a href="#L-3739"><span class="linenos">3739</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> -</span><span id="L-3740"><a href="#L-3740"><span class="linenos">3740</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">prefix</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="L-3741"><a href="#L-3741"><span class="linenos">3741</span></a> <span class="k">return</span> <span class="n">sqlglot</span><span class="o">.</span><span class="n">parse_one</span><span class="p">(</span><span class="n">sql</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3742"><a href="#L-3742"><span class="linenos">3742</span></a> +</span><span id="L-3736"><a href="#L-3736"><span class="linenos">3736</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-3737"><a href="#L-3737"><span class="linenos">3737</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="L-3738"><a href="#L-3738"><span class="linenos">3738</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="p">[</span><span class="n">_norm_arg</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="k">for</span> <span class="n">a</span> <span class="ow">in</span> <span class="n">arg</span><span class="p">]</span> +</span><span id="L-3739"><a href="#L-3739"><span class="linenos">3739</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">arg</span><span class="p">:</span> +</span><span id="L-3740"><a href="#L-3740"><span class="linenos">3740</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="L-3741"><a href="#L-3741"><span class="linenos">3741</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-3742"><a href="#L-3742"><span class="linenos">3742</span></a> <span class="n">arg</span> <span class="o">=</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> </span><span id="L-3743"><a href="#L-3743"><span class="linenos">3743</span></a> -</span><span id="L-3744"><a href="#L-3744"><span class="linenos">3744</span></a><span class="k">def</span> <span class="nf">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="L-3745"><a href="#L-3745"><span class="linenos">3745</span></a> <span class="k">return</span> <span class="n">instance</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="n">instance</span> +</span><span id="L-3744"><a href="#L-3744"><span class="linenos">3744</span></a> <span class="k">if</span> <span class="n">arg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">arg</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span><span class="p">:</span> +</span><span id="L-3745"><a href="#L-3745"><span class="linenos">3745</span></a> <span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">arg</span> </span><span id="L-3746"><a href="#L-3746"><span class="linenos">3746</span></a> -</span><span id="L-3747"><a href="#L-3747"><span class="linenos">3747</span></a> -</span><span id="L-3748"><a href="#L-3748"><span class="linenos">3748</span></a><span class="k">def</span> <span class="nf">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> -</span><span id="L-3749"><a href="#L-3749"><span class="linenos">3749</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">)</span> -</span><span id="L-3750"><a href="#L-3750"><span class="linenos">3750</span></a> -</span><span id="L-3751"><a href="#L-3751"><span class="linenos">3751</span></a> -</span><span id="L-3752"><a href="#L-3752"><span class="linenos">3752</span></a><span class="k">def</span> <span class="nf">_apply_builder</span><span class="p">(</span> -</span><span id="L-3753"><a href="#L-3753"><span class="linenos">3753</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-3754"><a href="#L-3754"><span class="linenos">3754</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-3755"><a href="#L-3755"><span class="linenos">3755</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-3756"><a href="#L-3756"><span class="linenos">3756</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3757"><a href="#L-3757"><span class="linenos">3757</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3758"><a href="#L-3758"><span class="linenos">3758</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3759"><a href="#L-3759"><span class="linenos">3759</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3760"><a href="#L-3760"><span class="linenos">3760</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3761"><a href="#L-3761"><span class="linenos">3761</span></a><span class="p">):</span> -</span><span id="L-3762"><a href="#L-3762"><span class="linenos">3762</span></a> <span class="k">if</span> <span class="n">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> -</span><span id="L-3763"><a href="#L-3763"><span class="linenos">3763</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-3764"><a href="#L-3764"><span class="linenos">3764</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-3765"><a href="#L-3765"><span class="linenos">3765</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-3766"><a href="#L-3766"><span class="linenos">3766</span></a> <span class="n">sql_or_expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-3767"><a href="#L-3767"><span class="linenos">3767</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-3768"><a href="#L-3768"><span class="linenos">3768</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-3769"><a href="#L-3769"><span class="linenos">3769</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3770"><a href="#L-3770"><span class="linenos">3770</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3771"><a href="#L-3771"><span class="linenos">3771</span></a> <span class="p">)</span> -</span><span id="L-3772"><a href="#L-3772"><span class="linenos">3772</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span> -</span><span id="L-3773"><a href="#L-3773"><span class="linenos">3773</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-3747"><a href="#L-3747"><span class="linenos">3747</span></a> <span class="k">return</span> <span class="n">args</span> +</span><span id="L-3748"><a href="#L-3748"><span class="linenos">3748</span></a> +</span><span id="L-3749"><a href="#L-3749"><span class="linenos">3749</span></a> +</span><span id="L-3750"><a href="#L-3750"><span class="linenos">3750</span></a><span class="k">def</span> <span class="nf">_norm_arg</span><span class="p">(</span><span class="n">arg</span><span class="p">):</span> +</span><span id="L-3751"><a href="#L-3751"><span class="linenos">3751</span></a> <span class="k">return</span> <span class="n">arg</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="k">else</span> <span class="n">arg</span> +</span><span id="L-3752"><a href="#L-3752"><span class="linenos">3752</span></a> +</span><span id="L-3753"><a href="#L-3753"><span class="linenos">3753</span></a> +</span><span id="L-3754"><a href="#L-3754"><span class="linenos">3754</span></a><span class="n">ALL_FUNCTIONS</span> <span class="o">=</span> <span class="n">subclasses</span><span class="p">(</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">Func</span><span class="p">,</span> <span class="p">(</span><span class="n">AggFunc</span><span class="p">,</span> <span class="n">Anonymous</span><span class="p">,</span> <span class="n">Func</span><span class="p">))</span> +</span><span id="L-3755"><a href="#L-3755"><span class="linenos">3755</span></a> +</span><span id="L-3756"><a href="#L-3756"><span class="linenos">3756</span></a> +</span><span id="L-3757"><a href="#L-3757"><span class="linenos">3757</span></a><span class="c1"># Helpers</span> +</span><span id="L-3758"><a href="#L-3758"><span class="linenos">3758</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="L-3759"><a href="#L-3759"><span class="linenos">3759</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="L-3760"><a href="#L-3760"><span class="linenos">3760</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="L-3761"><a href="#L-3761"><span class="linenos">3761</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">IntoType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-3762"><a href="#L-3762"><span class="linenos">3762</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-3763"><a href="#L-3763"><span class="linenos">3763</span></a> <span class="n">prefix</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-3764"><a href="#L-3764"><span class="linenos">3764</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-3765"><a href="#L-3765"><span class="linenos">3765</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3766"><a href="#L-3766"><span class="linenos">3766</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-3767"><a href="#L-3767"><span class="linenos">3767</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> +</span><span id="L-3768"><a href="#L-3768"><span class="linenos">3768</span></a> +</span><span id="L-3769"><a href="#L-3769"><span class="linenos">3769</span></a><span class="sd"> Example:</span> +</span><span id="L-3770"><a href="#L-3770"><span class="linenos">3770</span></a><span class="sd"> >>> maybe_parse("1")</span> +</span><span id="L-3771"><a href="#L-3771"><span class="linenos">3771</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> +</span><span id="L-3772"><a href="#L-3772"><span class="linenos">3772</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> +</span><span id="L-3773"><a href="#L-3773"><span class="linenos">3773</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> </span><span id="L-3774"><a href="#L-3774"><span class="linenos">3774</span></a> -</span><span id="L-3775"><a href="#L-3775"><span class="linenos">3775</span></a> -</span><span id="L-3776"><a href="#L-3776"><span class="linenos">3776</span></a><span class="k">def</span> <span class="nf">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="L-3777"><a href="#L-3777"><span class="linenos">3777</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-3778"><a href="#L-3778"><span class="linenos">3778</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-3779"><a href="#L-3779"><span class="linenos">3779</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-3780"><a href="#L-3780"><span class="linenos">3780</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3781"><a href="#L-3781"><span class="linenos">3781</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3782"><a href="#L-3782"><span class="linenos">3782</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3783"><a href="#L-3783"><span class="linenos">3783</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3784"><a href="#L-3784"><span class="linenos">3784</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3785"><a href="#L-3785"><span class="linenos">3785</span></a> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3786"><a href="#L-3786"><span class="linenos">3786</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3787"><a href="#L-3787"><span class="linenos">3787</span></a><span class="p">):</span> -</span><span id="L-3788"><a href="#L-3788"><span class="linenos">3788</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-3789"><a href="#L-3789"><span class="linenos">3789</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-3790"><a href="#L-3790"><span class="linenos">3790</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">:</span> -</span><span id="L-3791"><a href="#L-3791"><span class="linenos">3791</span></a> <span class="k">if</span> <span class="n">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> -</span><span id="L-3792"><a href="#L-3792"><span class="linenos">3792</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">expression</span><span class="p">])</span> -</span><span id="L-3793"><a href="#L-3793"><span class="linenos">3793</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-3794"><a href="#L-3794"><span class="linenos">3794</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-3795"><a href="#L-3795"><span class="linenos">3795</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-3796"><a href="#L-3796"><span class="linenos">3796</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3797"><a href="#L-3797"><span class="linenos">3797</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-3798"><a href="#L-3798"><span class="linenos">3798</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3799"><a href="#L-3799"><span class="linenos">3799</span></a> <span class="p">)</span> -</span><span id="L-3800"><a href="#L-3800"><span class="linenos">3800</span></a> <span class="n">parsed</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">)</span> +</span><span id="L-3775"><a href="#L-3775"><span class="linenos">3775</span></a><span class="sd"> Args:</span> +</span><span id="L-3776"><a href="#L-3776"><span class="linenos">3776</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> +</span><span id="L-3777"><a href="#L-3777"><span class="linenos">3777</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> +</span><span id="L-3778"><a href="#L-3778"><span class="linenos">3778</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="L-3779"><a href="#L-3779"><span class="linenos">3779</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-3780"><a href="#L-3780"><span class="linenos">3780</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> +</span><span id="L-3781"><a href="#L-3781"><span class="linenos">3781</span></a><span class="sd"> (automatically includes a space)</span> +</span><span id="L-3782"><a href="#L-3782"><span class="linenos">3782</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="L-3783"><a href="#L-3783"><span class="linenos">3783</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-3784"><a href="#L-3784"><span class="linenos">3784</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-3785"><a href="#L-3785"><span class="linenos">3785</span></a> +</span><span id="L-3786"><a href="#L-3786"><span class="linenos">3786</span></a><span class="sd"> Returns:</span> +</span><span id="L-3787"><a href="#L-3787"><span class="linenos">3787</span></a><span class="sd"> Expression: the parsed or given expression.</span> +</span><span id="L-3788"><a href="#L-3788"><span class="linenos">3788</span></a><span class="sd"> """</span> +</span><span id="L-3789"><a href="#L-3789"><span class="linenos">3789</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-3790"><a href="#L-3790"><span class="linenos">3790</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> +</span><span id="L-3791"><a href="#L-3791"><span class="linenos">3791</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="L-3792"><a href="#L-3792"><span class="linenos">3792</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> +</span><span id="L-3793"><a href="#L-3793"><span class="linenos">3793</span></a> +</span><span id="L-3794"><a href="#L-3794"><span class="linenos">3794</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> +</span><span id="L-3795"><a href="#L-3795"><span class="linenos">3795</span></a> +</span><span id="L-3796"><a href="#L-3796"><span class="linenos">3796</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">)</span> +</span><span id="L-3797"><a href="#L-3797"><span class="linenos">3797</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> +</span><span id="L-3798"><a href="#L-3798"><span class="linenos">3798</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">prefix</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="L-3799"><a href="#L-3799"><span class="linenos">3799</span></a> <span class="k">return</span> <span class="n">sqlglot</span><span class="o">.</span><span class="n">parse_one</span><span class="p">(</span><span class="n">sql</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-3800"><a href="#L-3800"><span class="linenos">3800</span></a> </span><span id="L-3801"><a href="#L-3801"><span class="linenos">3801</span></a> -</span><span id="L-3802"><a href="#L-3802"><span class="linenos">3802</span></a> <span class="n">existing</span> <span class="o">=</span> <span class="n">instance</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> -</span><span id="L-3803"><a href="#L-3803"><span class="linenos">3803</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing</span><span class="p">:</span> -</span><span id="L-3804"><a href="#L-3804"><span class="linenos">3804</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="n">existing</span><span class="o">.</span><span class="n">expressions</span> <span class="o">+</span> <span class="n">parsed</span> +</span><span id="L-3802"><a href="#L-3802"><span class="linenos">3802</span></a><span class="k">def</span> <span class="nf">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="L-3803"><a href="#L-3803"><span class="linenos">3803</span></a> <span class="k">return</span> <span class="n">instance</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="n">instance</span> +</span><span id="L-3804"><a href="#L-3804"><span class="linenos">3804</span></a> </span><span id="L-3805"><a href="#L-3805"><span class="linenos">3805</span></a> -</span><span id="L-3806"><a href="#L-3806"><span class="linenos">3806</span></a> <span class="n">child</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">parsed</span><span class="p">)</span> -</span><span id="L-3807"><a href="#L-3807"><span class="linenos">3807</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="p">(</span><span class="n">properties</span> <span class="ow">or</span> <span class="p">{})</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-3808"><a href="#L-3808"><span class="linenos">3808</span></a> <span class="n">child</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span> -</span><span id="L-3809"><a href="#L-3809"><span class="linenos">3809</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">child</span><span class="p">)</span> -</span><span id="L-3810"><a href="#L-3810"><span class="linenos">3810</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-3811"><a href="#L-3811"><span class="linenos">3811</span></a> -</span><span id="L-3812"><a href="#L-3812"><span class="linenos">3812</span></a> -</span><span id="L-3813"><a href="#L-3813"><span class="linenos">3813</span></a><span class="k">def</span> <span class="nf">_apply_list_builder</span><span class="p">(</span> -</span><span id="L-3814"><a href="#L-3814"><span class="linenos">3814</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-3815"><a href="#L-3815"><span class="linenos">3815</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-3816"><a href="#L-3816"><span class="linenos">3816</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-3817"><a href="#L-3817"><span class="linenos">3817</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3818"><a href="#L-3818"><span class="linenos">3818</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3819"><a href="#L-3819"><span class="linenos">3819</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3820"><a href="#L-3820"><span class="linenos">3820</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3821"><a href="#L-3821"><span class="linenos">3821</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3822"><a href="#L-3822"><span class="linenos">3822</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3823"><a href="#L-3823"><span class="linenos">3823</span></a><span class="p">):</span> -</span><span id="L-3824"><a href="#L-3824"><span class="linenos">3824</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-3825"><a href="#L-3825"><span class="linenos">3825</span></a> -</span><span id="L-3826"><a href="#L-3826"><span class="linenos">3826</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span> -</span><span id="L-3827"><a href="#L-3827"><span class="linenos">3827</span></a> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="L-3828"><a href="#L-3828"><span class="linenos">3828</span></a> <span class="n">sql_or_expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="L-3829"><a href="#L-3829"><span class="linenos">3829</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> -</span><span id="L-3830"><a href="#L-3830"><span class="linenos">3830</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> -</span><span id="L-3831"><a href="#L-3831"><span class="linenos">3831</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-3832"><a href="#L-3832"><span class="linenos">3832</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3833"><a href="#L-3833"><span class="linenos">3833</span></a> <span class="p">)</span> -</span><span id="L-3834"><a href="#L-3834"><span class="linenos">3834</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span> -</span><span id="L-3835"><a href="#L-3835"><span class="linenos">3835</span></a> <span class="p">]</span> -</span><span id="L-3836"><a href="#L-3836"><span class="linenos">3836</span></a> -</span><span id="L-3837"><a href="#L-3837"><span class="linenos">3837</span></a> <span class="n">existing_expressions</span> <span class="o">=</span> <span class="n">inst</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> -</span><span id="L-3838"><a href="#L-3838"><span class="linenos">3838</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing_expressions</span><span class="p">:</span> -</span><span id="L-3839"><a href="#L-3839"><span class="linenos">3839</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="n">existing_expressions</span> <span class="o">+</span> <span class="n">expressions</span> -</span><span id="L-3840"><a href="#L-3840"><span class="linenos">3840</span></a> -</span><span id="L-3841"><a href="#L-3841"><span class="linenos">3841</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">expressions</span><span class="p">)</span> -</span><span id="L-3842"><a href="#L-3842"><span class="linenos">3842</span></a> <span class="k">return</span> <span class="n">inst</span> -</span><span id="L-3843"><a href="#L-3843"><span class="linenos">3843</span></a> -</span><span id="L-3844"><a href="#L-3844"><span class="linenos">3844</span></a> -</span><span id="L-3845"><a href="#L-3845"><span class="linenos">3845</span></a><span class="k">def</span> <span class="nf">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="L-3846"><a href="#L-3846"><span class="linenos">3846</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-3847"><a href="#L-3847"><span class="linenos">3847</span></a> <span class="n">instance</span><span class="p">,</span> -</span><span id="L-3848"><a href="#L-3848"><span class="linenos">3848</span></a> <span class="n">arg</span><span class="p">,</span> -</span><span id="L-3849"><a href="#L-3849"><span class="linenos">3849</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3850"><a href="#L-3850"><span class="linenos">3850</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3851"><a href="#L-3851"><span class="linenos">3851</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="L-3852"><a href="#L-3852"><span class="linenos">3852</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="L-3853"><a href="#L-3853"><span class="linenos">3853</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-3854"><a href="#L-3854"><span class="linenos">3854</span></a><span class="p">):</span> -</span><span id="L-3855"><a href="#L-3855"><span class="linenos">3855</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">exp</span> <span class="k">for</span> <span class="n">exp</span> <span class="ow">in</span> <span class="n">expressions</span> <span class="k">if</span> <span class="n">exp</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">exp</span> <span class="o">!=</span> <span class="s2">""</span><span class="p">]</span> -</span><span id="L-3856"><a href="#L-3856"><span class="linenos">3856</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> -</span><span id="L-3857"><a href="#L-3857"><span class="linenos">3857</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="L-3858"><a href="#L-3858"><span class="linenos">3858</span></a> -</span><span id="L-3859"><a href="#L-3859"><span class="linenos">3859</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="L-3860"><a href="#L-3860"><span class="linenos">3860</span></a> -</span><span id="L-3861"><a href="#L-3861"><span class="linenos">3861</span></a> <span class="n">existing</span> <span class="o">=</span> <span class="n">inst</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> -</span><span id="L-3862"><a href="#L-3862"><span class="linenos">3862</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-3863"><a href="#L-3863"><span class="linenos">3863</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">existing</span><span class="o">.</span><span class="n">this</span> <span class="k">if</span> <span class="n">into</span> <span class="k">else</span> <span class="n">existing</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> -</span><span id="L-3864"><a href="#L-3864"><span class="linenos">3864</span></a> -</span><span id="L-3865"><a href="#L-3865"><span class="linenos">3865</span></a> <span class="n">node</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3866"><a href="#L-3866"><span class="linenos">3866</span></a> -</span><span id="L-3867"><a href="#L-3867"><span class="linenos">3867</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">into</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">node</span><span class="p">)</span> <span class="k">if</span> <span class="n">into</span> <span class="k">else</span> <span class="n">node</span><span class="p">)</span> -</span><span id="L-3868"><a href="#L-3868"><span class="linenos">3868</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-3806"><a href="#L-3806"><span class="linenos">3806</span></a><span class="k">def</span> <span class="nf">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> +</span><span id="L-3807"><a href="#L-3807"><span class="linenos">3807</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">)</span> +</span><span id="L-3808"><a href="#L-3808"><span class="linenos">3808</span></a> +</span><span id="L-3809"><a href="#L-3809"><span class="linenos">3809</span></a> +</span><span id="L-3810"><a href="#L-3810"><span class="linenos">3810</span></a><span class="k">def</span> <span class="nf">_apply_builder</span><span class="p">(</span> +</span><span id="L-3811"><a href="#L-3811"><span class="linenos">3811</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-3812"><a href="#L-3812"><span class="linenos">3812</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-3813"><a href="#L-3813"><span class="linenos">3813</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-3814"><a href="#L-3814"><span class="linenos">3814</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3815"><a href="#L-3815"><span class="linenos">3815</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3816"><a href="#L-3816"><span class="linenos">3816</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3817"><a href="#L-3817"><span class="linenos">3817</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3818"><a href="#L-3818"><span class="linenos">3818</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3819"><a href="#L-3819"><span class="linenos">3819</span></a><span class="p">):</span> +</span><span id="L-3820"><a href="#L-3820"><span class="linenos">3820</span></a> <span class="k">if</span> <span class="n">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> +</span><span id="L-3821"><a href="#L-3821"><span class="linenos">3821</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-3822"><a href="#L-3822"><span class="linenos">3822</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-3823"><a href="#L-3823"><span class="linenos">3823</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-3824"><a href="#L-3824"><span class="linenos">3824</span></a> <span class="n">sql_or_expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-3825"><a href="#L-3825"><span class="linenos">3825</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-3826"><a href="#L-3826"><span class="linenos">3826</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-3827"><a href="#L-3827"><span class="linenos">3827</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-3828"><a href="#L-3828"><span class="linenos">3828</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3829"><a href="#L-3829"><span class="linenos">3829</span></a> <span class="p">)</span> +</span><span id="L-3830"><a href="#L-3830"><span class="linenos">3830</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">expression</span><span class="p">)</span> +</span><span id="L-3831"><a href="#L-3831"><span class="linenos">3831</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-3832"><a href="#L-3832"><span class="linenos">3832</span></a> +</span><span id="L-3833"><a href="#L-3833"><span class="linenos">3833</span></a> +</span><span id="L-3834"><a href="#L-3834"><span class="linenos">3834</span></a><span class="k">def</span> <span class="nf">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="L-3835"><a href="#L-3835"><span class="linenos">3835</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-3836"><a href="#L-3836"><span class="linenos">3836</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-3837"><a href="#L-3837"><span class="linenos">3837</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-3838"><a href="#L-3838"><span class="linenos">3838</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3839"><a href="#L-3839"><span class="linenos">3839</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3840"><a href="#L-3840"><span class="linenos">3840</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3841"><a href="#L-3841"><span class="linenos">3841</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3842"><a href="#L-3842"><span class="linenos">3842</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3843"><a href="#L-3843"><span class="linenos">3843</span></a> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3844"><a href="#L-3844"><span class="linenos">3844</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3845"><a href="#L-3845"><span class="linenos">3845</span></a><span class="p">):</span> +</span><span id="L-3846"><a href="#L-3846"><span class="linenos">3846</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-3847"><a href="#L-3847"><span class="linenos">3847</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-3848"><a href="#L-3848"><span class="linenos">3848</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">:</span> +</span><span id="L-3849"><a href="#L-3849"><span class="linenos">3849</span></a> <span class="k">if</span> <span class="n">_is_wrong_expression</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="p">):</span> +</span><span id="L-3850"><a href="#L-3850"><span class="linenos">3850</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">expression</span><span class="p">])</span> +</span><span id="L-3851"><a href="#L-3851"><span class="linenos">3851</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-3852"><a href="#L-3852"><span class="linenos">3852</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-3853"><a href="#L-3853"><span class="linenos">3853</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-3854"><a href="#L-3854"><span class="linenos">3854</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-3855"><a href="#L-3855"><span class="linenos">3855</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-3856"><a href="#L-3856"><span class="linenos">3856</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3857"><a href="#L-3857"><span class="linenos">3857</span></a> <span class="p">)</span> +</span><span id="L-3858"><a href="#L-3858"><span class="linenos">3858</span></a> <span class="n">parsed</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">expressions</span><span class="p">)</span> +</span><span id="L-3859"><a href="#L-3859"><span class="linenos">3859</span></a> +</span><span id="L-3860"><a href="#L-3860"><span class="linenos">3860</span></a> <span class="n">existing</span> <span class="o">=</span> <span class="n">instance</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> +</span><span id="L-3861"><a href="#L-3861"><span class="linenos">3861</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing</span><span class="p">:</span> +</span><span id="L-3862"><a href="#L-3862"><span class="linenos">3862</span></a> <span class="n">parsed</span> <span class="o">=</span> <span class="n">existing</span><span class="o">.</span><span class="n">expressions</span> <span class="o">+</span> <span class="n">parsed</span> +</span><span id="L-3863"><a href="#L-3863"><span class="linenos">3863</span></a> +</span><span id="L-3864"><a href="#L-3864"><span class="linenos">3864</span></a> <span class="n">child</span> <span class="o">=</span> <span class="n">into</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">parsed</span><span class="p">)</span> +</span><span id="L-3865"><a href="#L-3865"><span class="linenos">3865</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="p">(</span><span class="n">properties</span> <span class="ow">or</span> <span class="p">{})</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-3866"><a href="#L-3866"><span class="linenos">3866</span></a> <span class="n">child</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span> +</span><span id="L-3867"><a href="#L-3867"><span class="linenos">3867</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">child</span><span class="p">)</span> +</span><span id="L-3868"><a href="#L-3868"><span class="linenos">3868</span></a> <span class="k">return</span> <span class="n">instance</span> </span><span id="L-3869"><a href="#L-3869"><span class="linenos">3869</span></a> </span><span id="L-3870"><a href="#L-3870"><span class="linenos">3870</span></a> -</span><span id="L-3871"><a href="#L-3871"><span class="linenos">3871</span></a><span class="k">def</span> <span class="nf">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">operator</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-3872"><a href="#L-3872"><span class="linenos">3872</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">]</span> -</span><span id="L-3873"><a href="#L-3873"><span class="linenos">3873</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> -</span><span id="L-3874"><a href="#L-3874"><span class="linenos">3874</span></a> <span class="k">if</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span> -</span><span id="L-3875"><a href="#L-3875"><span class="linenos">3875</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">)</span> -</span><span id="L-3876"><a href="#L-3876"><span class="linenos">3876</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span> -</span><span id="L-3877"><a href="#L-3877"><span class="linenos">3877</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">operator</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">expression</span><span class="p">))</span> -</span><span id="L-3878"><a href="#L-3878"><span class="linenos">3878</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="L-3879"><a href="#L-3879"><span class="linenos">3879</span></a> -</span><span id="L-3880"><a href="#L-3880"><span class="linenos">3880</span></a> -</span><span id="L-3881"><a href="#L-3881"><span class="linenos">3881</span></a><span class="k">def</span> <span class="nf">_wrap_operator</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> -</span><span id="L-3882"><a href="#L-3882"><span class="linenos">3882</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">Not</span><span class="p">)):</span> -</span><span id="L-3883"><a href="#L-3883"><span class="linenos">3883</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-3884"><a href="#L-3884"><span class="linenos">3884</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="L-3885"><a href="#L-3885"><span class="linenos">3885</span></a> -</span><span id="L-3886"><a href="#L-3886"><span class="linenos">3886</span></a> -</span><span id="L-3887"><a href="#L-3887"><span class="linenos">3887</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-3888"><a href="#L-3888"><span class="linenos">3888</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3889"><a href="#L-3889"><span class="linenos">3889</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> -</span><span id="L-3890"><a href="#L-3890"><span class="linenos">3890</span></a> -</span><span id="L-3891"><a href="#L-3891"><span class="linenos">3891</span></a><span class="sd"> Example:</span> -</span><span id="L-3892"><a href="#L-3892"><span class="linenos">3892</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-3893"><a href="#L-3893"><span class="linenos">3893</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="L-3871"><a href="#L-3871"><span class="linenos">3871</span></a><span class="k">def</span> <span class="nf">_apply_list_builder</span><span class="p">(</span> +</span><span id="L-3872"><a href="#L-3872"><span class="linenos">3872</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-3873"><a href="#L-3873"><span class="linenos">3873</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-3874"><a href="#L-3874"><span class="linenos">3874</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-3875"><a href="#L-3875"><span class="linenos">3875</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3876"><a href="#L-3876"><span class="linenos">3876</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3877"><a href="#L-3877"><span class="linenos">3877</span></a> <span class="n">prefix</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3878"><a href="#L-3878"><span class="linenos">3878</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3879"><a href="#L-3879"><span class="linenos">3879</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3880"><a href="#L-3880"><span class="linenos">3880</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3881"><a href="#L-3881"><span class="linenos">3881</span></a><span class="p">):</span> +</span><span id="L-3882"><a href="#L-3882"><span class="linenos">3882</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-3883"><a href="#L-3883"><span class="linenos">3883</span></a> +</span><span id="L-3884"><a href="#L-3884"><span class="linenos">3884</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span> +</span><span id="L-3885"><a href="#L-3885"><span class="linenos">3885</span></a> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="L-3886"><a href="#L-3886"><span class="linenos">3886</span></a> <span class="n">sql_or_expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="L-3887"><a href="#L-3887"><span class="linenos">3887</span></a> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> +</span><span id="L-3888"><a href="#L-3888"><span class="linenos">3888</span></a> <span class="n">prefix</span><span class="o">=</span><span class="n">prefix</span><span class="p">,</span> +</span><span id="L-3889"><a href="#L-3889"><span class="linenos">3889</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-3890"><a href="#L-3890"><span class="linenos">3890</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3891"><a href="#L-3891"><span class="linenos">3891</span></a> <span class="p">)</span> +</span><span id="L-3892"><a href="#L-3892"><span class="linenos">3892</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span> +</span><span id="L-3893"><a href="#L-3893"><span class="linenos">3893</span></a> <span class="p">]</span> </span><span id="L-3894"><a href="#L-3894"><span class="linenos">3894</span></a> -</span><span id="L-3895"><a href="#L-3895"><span class="linenos">3895</span></a><span class="sd"> Args:</span> -</span><span id="L-3896"><a href="#L-3896"><span class="linenos">3896</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-3897"><a href="#L-3897"><span class="linenos">3897</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3898"><a href="#L-3898"><span class="linenos">3898</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-3899"><a href="#L-3899"><span class="linenos">3899</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3900"><a href="#L-3900"><span class="linenos">3900</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-3901"><a href="#L-3901"><span class="linenos">3901</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-3902"><a href="#L-3902"><span class="linenos">3902</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-3903"><a href="#L-3903"><span class="linenos">3903</span></a><span class="sd"> Returns:</span> -</span><span id="L-3904"><a href="#L-3904"><span class="linenos">3904</span></a><span class="sd"> Union: the syntax tree for the UNION expression.</span> -</span><span id="L-3905"><a href="#L-3905"><span class="linenos">3905</span></a><span class="sd"> """</span> -</span><span id="L-3906"><a href="#L-3906"><span class="linenos">3906</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3907"><a href="#L-3907"><span class="linenos">3907</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3908"><a href="#L-3908"><span class="linenos">3908</span></a> -</span><span id="L-3909"><a href="#L-3909"><span class="linenos">3909</span></a> <span class="k">return</span> <span class="n">Union</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> -</span><span id="L-3910"><a href="#L-3910"><span class="linenos">3910</span></a> -</span><span id="L-3911"><a href="#L-3911"><span class="linenos">3911</span></a> -</span><span id="L-3912"><a href="#L-3912"><span class="linenos">3912</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-3913"><a href="#L-3913"><span class="linenos">3913</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3914"><a href="#L-3914"><span class="linenos">3914</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> -</span><span id="L-3915"><a href="#L-3915"><span class="linenos">3915</span></a> -</span><span id="L-3916"><a href="#L-3916"><span class="linenos">3916</span></a><span class="sd"> Example:</span> -</span><span id="L-3917"><a href="#L-3917"><span class="linenos">3917</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-3918"><a href="#L-3918"><span class="linenos">3918</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="L-3919"><a href="#L-3919"><span class="linenos">3919</span></a> -</span><span id="L-3920"><a href="#L-3920"><span class="linenos">3920</span></a><span class="sd"> Args:</span> -</span><span id="L-3921"><a href="#L-3921"><span class="linenos">3921</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-3922"><a href="#L-3922"><span class="linenos">3922</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3923"><a href="#L-3923"><span class="linenos">3923</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-3924"><a href="#L-3924"><span class="linenos">3924</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3925"><a href="#L-3925"><span class="linenos">3925</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-3926"><a href="#L-3926"><span class="linenos">3926</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-3927"><a href="#L-3927"><span class="linenos">3927</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-3928"><a href="#L-3928"><span class="linenos">3928</span></a><span class="sd"> Returns:</span> -</span><span id="L-3929"><a href="#L-3929"><span class="linenos">3929</span></a><span class="sd"> Intersect: the syntax tree for the INTERSECT expression.</span> -</span><span id="L-3930"><a href="#L-3930"><span class="linenos">3930</span></a><span class="sd"> """</span> -</span><span id="L-3931"><a href="#L-3931"><span class="linenos">3931</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3932"><a href="#L-3932"><span class="linenos">3932</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3933"><a href="#L-3933"><span class="linenos">3933</span></a> -</span><span id="L-3934"><a href="#L-3934"><span class="linenos">3934</span></a> <span class="k">return</span> <span class="n">Intersect</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> -</span><span id="L-3935"><a href="#L-3935"><span class="linenos">3935</span></a> -</span><span id="L-3936"><a href="#L-3936"><span class="linenos">3936</span></a> -</span><span id="L-3937"><a href="#L-3937"><span class="linenos">3937</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-3938"><a href="#L-3938"><span class="linenos">3938</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3939"><a href="#L-3939"><span class="linenos">3939</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> -</span><span id="L-3940"><a href="#L-3940"><span class="linenos">3940</span></a> -</span><span id="L-3941"><a href="#L-3941"><span class="linenos">3941</span></a><span class="sd"> Example:</span> -</span><span id="L-3942"><a href="#L-3942"><span class="linenos">3942</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="L-3943"><a href="#L-3943"><span class="linenos">3943</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="L-3895"><a href="#L-3895"><span class="linenos">3895</span></a> <span class="n">existing_expressions</span> <span class="o">=</span> <span class="n">inst</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> +</span><span id="L-3896"><a href="#L-3896"><span class="linenos">3896</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing_expressions</span><span class="p">:</span> +</span><span id="L-3897"><a href="#L-3897"><span class="linenos">3897</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="n">existing_expressions</span> <span class="o">+</span> <span class="n">expressions</span> +</span><span id="L-3898"><a href="#L-3898"><span class="linenos">3898</span></a> +</span><span id="L-3899"><a href="#L-3899"><span class="linenos">3899</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">expressions</span><span class="p">)</span> +</span><span id="L-3900"><a href="#L-3900"><span class="linenos">3900</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-3901"><a href="#L-3901"><span class="linenos">3901</span></a> +</span><span id="L-3902"><a href="#L-3902"><span class="linenos">3902</span></a> +</span><span id="L-3903"><a href="#L-3903"><span class="linenos">3903</span></a><span class="k">def</span> <span class="nf">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="L-3904"><a href="#L-3904"><span class="linenos">3904</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-3905"><a href="#L-3905"><span class="linenos">3905</span></a> <span class="n">instance</span><span class="p">,</span> +</span><span id="L-3906"><a href="#L-3906"><span class="linenos">3906</span></a> <span class="n">arg</span><span class="p">,</span> +</span><span id="L-3907"><a href="#L-3907"><span class="linenos">3907</span></a> <span class="n">into</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3908"><a href="#L-3908"><span class="linenos">3908</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3909"><a href="#L-3909"><span class="linenos">3909</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="L-3910"><a href="#L-3910"><span class="linenos">3910</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="L-3911"><a href="#L-3911"><span class="linenos">3911</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-3912"><a href="#L-3912"><span class="linenos">3912</span></a><span class="p">):</span> +</span><span id="L-3913"><a href="#L-3913"><span class="linenos">3913</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">exp</span> <span class="k">for</span> <span class="n">exp</span> <span class="ow">in</span> <span class="n">expressions</span> <span class="k">if</span> <span class="n">exp</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">exp</span> <span class="o">!=</span> <span class="s2">""</span><span class="p">]</span> +</span><span id="L-3914"><a href="#L-3914"><span class="linenos">3914</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> +</span><span id="L-3915"><a href="#L-3915"><span class="linenos">3915</span></a> <span class="k">return</span> <span class="n">instance</span> +</span><span id="L-3916"><a href="#L-3916"><span class="linenos">3916</span></a> +</span><span id="L-3917"><a href="#L-3917"><span class="linenos">3917</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="L-3918"><a href="#L-3918"><span class="linenos">3918</span></a> +</span><span id="L-3919"><a href="#L-3919"><span class="linenos">3919</span></a> <span class="n">existing</span> <span class="o">=</span> <span class="n">inst</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> +</span><span id="L-3920"><a href="#L-3920"><span class="linenos">3920</span></a> <span class="k">if</span> <span class="n">append</span> <span class="ow">and</span> <span class="n">existing</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-3921"><a href="#L-3921"><span class="linenos">3921</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">existing</span><span class="o">.</span><span class="n">this</span> <span class="k">if</span> <span class="n">into</span> <span class="k">else</span> <span class="n">existing</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">expressions</span><span class="p">)</span> +</span><span id="L-3922"><a href="#L-3922"><span class="linenos">3922</span></a> +</span><span id="L-3923"><a href="#L-3923"><span class="linenos">3923</span></a> <span class="n">node</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-3924"><a href="#L-3924"><span class="linenos">3924</span></a> +</span><span id="L-3925"><a href="#L-3925"><span class="linenos">3925</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">into</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">node</span><span class="p">)</span> <span class="k">if</span> <span class="n">into</span> <span class="k">else</span> <span class="n">node</span><span class="p">)</span> +</span><span id="L-3926"><a href="#L-3926"><span class="linenos">3926</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="L-3927"><a href="#L-3927"><span class="linenos">3927</span></a> +</span><span id="L-3928"><a href="#L-3928"><span class="linenos">3928</span></a> +</span><span id="L-3929"><a href="#L-3929"><span class="linenos">3929</span></a><span class="k">def</span> <span class="nf">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">operator</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-3930"><a href="#L-3930"><span class="linenos">3930</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">]</span> +</span><span id="L-3931"><a href="#L-3931"><span class="linenos">3931</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> +</span><span id="L-3932"><a href="#L-3932"><span class="linenos">3932</span></a> <span class="k">if</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span> +</span><span id="L-3933"><a href="#L-3933"><span class="linenos">3933</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">)</span> +</span><span id="L-3934"><a href="#L-3934"><span class="linenos">3934</span></a> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="n">expressions</span><span class="p">[</span><span class="mi">1</span><span class="p">:]:</span> +</span><span id="L-3935"><a href="#L-3935"><span class="linenos">3935</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">operator</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">this</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">expression</span><span class="p">))</span> +</span><span id="L-3936"><a href="#L-3936"><span class="linenos">3936</span></a> <span class="k">return</span> <span class="n">this</span> +</span><span id="L-3937"><a href="#L-3937"><span class="linenos">3937</span></a> +</span><span id="L-3938"><a href="#L-3938"><span class="linenos">3938</span></a> +</span><span id="L-3939"><a href="#L-3939"><span class="linenos">3939</span></a><span class="k">def</span> <span class="nf">_wrap_operator</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> +</span><span id="L-3940"><a href="#L-3940"><span class="linenos">3940</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="p">(</span><span class="n">And</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">Not</span><span class="p">)):</span> +</span><span id="L-3941"><a href="#L-3941"><span class="linenos">3941</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-3942"><a href="#L-3942"><span class="linenos">3942</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="L-3943"><a href="#L-3943"><span class="linenos">3943</span></a> </span><span id="L-3944"><a href="#L-3944"><span class="linenos">3944</span></a> -</span><span id="L-3945"><a href="#L-3945"><span class="linenos">3945</span></a><span class="sd"> Args:</span> -</span><span id="L-3946"><a href="#L-3946"><span class="linenos">3946</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="L-3947"><a href="#L-3947"><span class="linenos">3947</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3948"><a href="#L-3948"><span class="linenos">3948</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="L-3949"><a href="#L-3949"><span class="linenos">3949</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="L-3950"><a href="#L-3950"><span class="linenos">3950</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="L-3951"><a href="#L-3951"><span class="linenos">3951</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-3952"><a href="#L-3952"><span class="linenos">3952</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="L-3953"><a href="#L-3953"><span class="linenos">3953</span></a><span class="sd"> Returns:</span> -</span><span id="L-3954"><a href="#L-3954"><span class="linenos">3954</span></a><span class="sd"> Except: the syntax tree for the EXCEPT statement.</span> -</span><span id="L-3955"><a href="#L-3955"><span class="linenos">3955</span></a><span class="sd"> """</span> -</span><span id="L-3956"><a href="#L-3956"><span class="linenos">3956</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3957"><a href="#L-3957"><span class="linenos">3957</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3958"><a href="#L-3958"><span class="linenos">3958</span></a> -</span><span id="L-3959"><a href="#L-3959"><span class="linenos">3959</span></a> <span class="k">return</span> <span class="n">Except</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> -</span><span id="L-3960"><a href="#L-3960"><span class="linenos">3960</span></a> -</span><span id="L-3961"><a href="#L-3961"><span class="linenos">3961</span></a> -</span><span id="L-3962"><a href="#L-3962"><span class="linenos">3962</span></a><span class="k">def</span> <span class="nf">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-3963"><a href="#L-3963"><span class="linenos">3963</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3964"><a href="#L-3964"><span class="linenos">3964</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> -</span><span id="L-3965"><a href="#L-3965"><span class="linenos">3965</span></a> -</span><span id="L-3966"><a href="#L-3966"><span class="linenos">3966</span></a><span class="sd"> Example:</span> -</span><span id="L-3967"><a href="#L-3967"><span class="linenos">3967</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> -</span><span id="L-3968"><a href="#L-3968"><span class="linenos">3968</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-3945"><a href="#L-3945"><span class="linenos">3945</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-3946"><a href="#L-3946"><span class="linenos">3946</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3947"><a href="#L-3947"><span class="linenos">3947</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> +</span><span id="L-3948"><a href="#L-3948"><span class="linenos">3948</span></a> +</span><span id="L-3949"><a href="#L-3949"><span class="linenos">3949</span></a><span class="sd"> Example:</span> +</span><span id="L-3950"><a href="#L-3950"><span class="linenos">3950</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-3951"><a href="#L-3951"><span class="linenos">3951</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="L-3952"><a href="#L-3952"><span class="linenos">3952</span></a> +</span><span id="L-3953"><a href="#L-3953"><span class="linenos">3953</span></a><span class="sd"> Args:</span> +</span><span id="L-3954"><a href="#L-3954"><span class="linenos">3954</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-3955"><a href="#L-3955"><span class="linenos">3955</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3956"><a href="#L-3956"><span class="linenos">3956</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-3957"><a href="#L-3957"><span class="linenos">3957</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3958"><a href="#L-3958"><span class="linenos">3958</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-3959"><a href="#L-3959"><span class="linenos">3959</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-3960"><a href="#L-3960"><span class="linenos">3960</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-3961"><a href="#L-3961"><span class="linenos">3961</span></a><span class="sd"> Returns:</span> +</span><span id="L-3962"><a href="#L-3962"><span class="linenos">3962</span></a><span class="sd"> Union: the syntax tree for the UNION expression.</span> +</span><span id="L-3963"><a href="#L-3963"><span class="linenos">3963</span></a><span class="sd"> """</span> +</span><span id="L-3964"><a href="#L-3964"><span class="linenos">3964</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-3965"><a href="#L-3965"><span class="linenos">3965</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-3966"><a href="#L-3966"><span class="linenos">3966</span></a> +</span><span id="L-3967"><a href="#L-3967"><span class="linenos">3967</span></a> <span class="k">return</span> <span class="n">Union</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> +</span><span id="L-3968"><a href="#L-3968"><span class="linenos">3968</span></a> </span><span id="L-3969"><a href="#L-3969"><span class="linenos">3969</span></a> -</span><span id="L-3970"><a href="#L-3970"><span class="linenos">3970</span></a><span class="sd"> Args:</span> -</span><span id="L-3971"><a href="#L-3971"><span class="linenos">3971</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> -</span><span id="L-3972"><a href="#L-3972"><span class="linenos">3972</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-3973"><a href="#L-3973"><span class="linenos">3973</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="L-3974"><a href="#L-3974"><span class="linenos">3974</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-3975"><a href="#L-3975"><span class="linenos">3975</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-3976"><a href="#L-3976"><span class="linenos">3976</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-3970"><a href="#L-3970"><span class="linenos">3970</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-3971"><a href="#L-3971"><span class="linenos">3971</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3972"><a href="#L-3972"><span class="linenos">3972</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> +</span><span id="L-3973"><a href="#L-3973"><span class="linenos">3973</span></a> +</span><span id="L-3974"><a href="#L-3974"><span class="linenos">3974</span></a><span class="sd"> Example:</span> +</span><span id="L-3975"><a href="#L-3975"><span class="linenos">3975</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-3976"><a href="#L-3976"><span class="linenos">3976</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> </span><span id="L-3977"><a href="#L-3977"><span class="linenos">3977</span></a> -</span><span id="L-3978"><a href="#L-3978"><span class="linenos">3978</span></a><span class="sd"> Returns:</span> -</span><span id="L-3979"><a href="#L-3979"><span class="linenos">3979</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="L-3980"><a href="#L-3980"><span class="linenos">3980</span></a><span class="sd"> """</span> -</span><span id="L-3981"><a href="#L-3981"><span class="linenos">3981</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-3982"><a href="#L-3982"><span class="linenos">3982</span></a> -</span><span id="L-3983"><a href="#L-3983"><span class="linenos">3983</span></a> -</span><span id="L-3984"><a href="#L-3984"><span class="linenos">3984</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="L-3985"><a href="#L-3985"><span class="linenos">3985</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-3986"><a href="#L-3986"><span class="linenos">3986</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> -</span><span id="L-3987"><a href="#L-3987"><span class="linenos">3987</span></a> -</span><span id="L-3988"><a href="#L-3988"><span class="linenos">3988</span></a><span class="sd"> Example:</span> -</span><span id="L-3989"><a href="#L-3989"><span class="linenos">3989</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> -</span><span id="L-3990"><a href="#L-3990"><span class="linenos">3990</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-3978"><a href="#L-3978"><span class="linenos">3978</span></a><span class="sd"> Args:</span> +</span><span id="L-3979"><a href="#L-3979"><span class="linenos">3979</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-3980"><a href="#L-3980"><span class="linenos">3980</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3981"><a href="#L-3981"><span class="linenos">3981</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-3982"><a href="#L-3982"><span class="linenos">3982</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-3983"><a href="#L-3983"><span class="linenos">3983</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-3984"><a href="#L-3984"><span class="linenos">3984</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-3985"><a href="#L-3985"><span class="linenos">3985</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-3986"><a href="#L-3986"><span class="linenos">3986</span></a><span class="sd"> Returns:</span> +</span><span id="L-3987"><a href="#L-3987"><span class="linenos">3987</span></a><span class="sd"> Intersect: the syntax tree for the INTERSECT expression.</span> +</span><span id="L-3988"><a href="#L-3988"><span class="linenos">3988</span></a><span class="sd"> """</span> +</span><span id="L-3989"><a href="#L-3989"><span class="linenos">3989</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-3990"><a href="#L-3990"><span class="linenos">3990</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-3991"><a href="#L-3991"><span class="linenos">3991</span></a> -</span><span id="L-3992"><a href="#L-3992"><span class="linenos">3992</span></a><span class="sd"> Args:</span> -</span><span id="L-3993"><a href="#L-3993"><span class="linenos">3993</span></a><span class="sd"> *expressions (str | Expression): the SQL code string to parse as the FROM expressions of a</span> -</span><span id="L-3994"><a href="#L-3994"><span class="linenos">3994</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-3995"><a href="#L-3995"><span class="linenos">3995</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> -</span><span id="L-3996"><a href="#L-3996"><span class="linenos">3996</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-3997"><a href="#L-3997"><span class="linenos">3997</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-3998"><a href="#L-3998"><span class="linenos">3998</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="L-3999"><a href="#L-3999"><span class="linenos">3999</span></a> -</span><span id="L-4000"><a href="#L-4000"><span class="linenos">4000</span></a><span class="sd"> Returns:</span> -</span><span id="L-4001"><a href="#L-4001"><span class="linenos">4001</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="L-4002"><a href="#L-4002"><span class="linenos">4002</span></a><span class="sd"> """</span> -</span><span id="L-4003"><a href="#L-4003"><span class="linenos">4003</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4004"><a href="#L-4004"><span class="linenos">4004</span></a> -</span><span id="L-4005"><a href="#L-4005"><span class="linenos">4005</span></a> -</span><span id="L-4006"><a href="#L-4006"><span class="linenos">4006</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">from_</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> -</span><span id="L-4007"><a href="#L-4007"><span class="linenos">4007</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4008"><a href="#L-4008"><span class="linenos">4008</span></a><span class="sd"> Creates an update statement.</span> -</span><span id="L-4009"><a href="#L-4009"><span class="linenos">4009</span></a> -</span><span id="L-4010"><a href="#L-4010"><span class="linenos">4010</span></a><span class="sd"> Example:</span> -</span><span id="L-4011"><a href="#L-4011"><span class="linenos">4011</span></a><span class="sd"> >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz", where="id > 1").sql()</span> -</span><span id="L-4012"><a href="#L-4012"><span class="linenos">4012</span></a><span class="sd"> "UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz WHERE id > 1"</span> -</span><span id="L-4013"><a href="#L-4013"><span class="linenos">4013</span></a> -</span><span id="L-4014"><a href="#L-4014"><span class="linenos">4014</span></a><span class="sd"> Args:</span> -</span><span id="L-4015"><a href="#L-4015"><span class="linenos">4015</span></a><span class="sd"> *properties (Dict[str, Any]): dictionary of properties to set which are</span> -</span><span id="L-4016"><a href="#L-4016"><span class="linenos">4016</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> -</span><span id="L-4017"><a href="#L-4017"><span class="linenos">4017</span></a><span class="sd"> where (str): sql conditional parsed into a WHERE statement</span> -</span><span id="L-4018"><a href="#L-4018"><span class="linenos">4018</span></a><span class="sd"> from_ (str): sql statement parsed into a FROM statement</span> -</span><span id="L-4019"><a href="#L-4019"><span class="linenos">4019</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-4020"><a href="#L-4020"><span class="linenos">4020</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-4021"><a href="#L-4021"><span class="linenos">4021</span></a> -</span><span id="L-4022"><a href="#L-4022"><span class="linenos">4022</span></a><span class="sd"> Returns:</span> -</span><span id="L-4023"><a href="#L-4023"><span class="linenos">4023</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> -</span><span id="L-4024"><a href="#L-4024"><span class="linenos">4024</span></a><span class="sd"> """</span> -</span><span id="L-4025"><a href="#L-4025"><span class="linenos">4025</span></a> <span class="n">update</span> <span class="o">=</span> <span class="n">Update</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">))</span> -</span><span id="L-4026"><a href="#L-4026"><span class="linenos">4026</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-4027"><a href="#L-4027"><span class="linenos">4027</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-4028"><a href="#L-4028"><span class="linenos">4028</span></a> <span class="p">[</span> -</span><span id="L-4029"><a href="#L-4029"><span class="linenos">4029</span></a> <span class="n">EQ</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> -</span><span id="L-4030"><a href="#L-4030"><span class="linenos">4030</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="L-4031"><a href="#L-4031"><span class="linenos">4031</span></a> <span class="p">],</span> -</span><span id="L-4032"><a href="#L-4032"><span class="linenos">4032</span></a> <span class="p">)</span> -</span><span id="L-4033"><a href="#L-4033"><span class="linenos">4033</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> -</span><span id="L-4034"><a href="#L-4034"><span class="linenos">4034</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-4035"><a href="#L-4035"><span class="linenos">4035</span></a> <span class="s2">"from"</span><span class="p">,</span> -</span><span id="L-4036"><a href="#L-4036"><span class="linenos">4036</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">from_</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-4037"><a href="#L-4037"><span class="linenos">4037</span></a> <span class="p">)</span> -</span><span id="L-4038"><a href="#L-4038"><span class="linenos">4038</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="L-4039"><a href="#L-4039"><span class="linenos">4039</span></a> <span class="n">where</span> <span class="o">=</span> <span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> -</span><span id="L-4040"><a href="#L-4040"><span class="linenos">4040</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="L-4041"><a href="#L-4041"><span class="linenos">4041</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-4042"><a href="#L-4042"><span class="linenos">4042</span></a> <span class="s2">"where"</span><span class="p">,</span> -</span><span id="L-4043"><a href="#L-4043"><span class="linenos">4043</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-4044"><a href="#L-4044"><span class="linenos">4044</span></a> <span class="p">)</span> -</span><span id="L-4045"><a href="#L-4045"><span class="linenos">4045</span></a> <span class="k">return</span> <span class="n">update</span> -</span><span id="L-4046"><a href="#L-4046"><span class="linenos">4046</span></a> -</span><span id="L-4047"><a href="#L-4047"><span class="linenos">4047</span></a> -</span><span id="L-4048"><a href="#L-4048"><span class="linenos">4048</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="L-4049"><a href="#L-4049"><span class="linenos">4049</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4050"><a href="#L-4050"><span class="linenos">4050</span></a><span class="sd"> Builds a delete statement.</span> -</span><span id="L-4051"><a href="#L-4051"><span class="linenos">4051</span></a> -</span><span id="L-4052"><a href="#L-4052"><span class="linenos">4052</span></a><span class="sd"> Example:</span> -</span><span id="L-4053"><a href="#L-4053"><span class="linenos">4053</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> -</span><span id="L-4054"><a href="#L-4054"><span class="linenos">4054</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> -</span><span id="L-4055"><a href="#L-4055"><span class="linenos">4055</span></a> -</span><span id="L-4056"><a href="#L-4056"><span class="linenos">4056</span></a><span class="sd"> Args:</span> -</span><span id="L-4057"><a href="#L-4057"><span class="linenos">4057</span></a><span class="sd"> where (str|Condition): sql conditional parsed into a WHERE statement</span> -</span><span id="L-4058"><a href="#L-4058"><span class="linenos">4058</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="L-4059"><a href="#L-4059"><span class="linenos">4059</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-4060"><a href="#L-4060"><span class="linenos">4060</span></a> -</span><span id="L-4061"><a href="#L-4061"><span class="linenos">4061</span></a><span class="sd"> Returns:</span> -</span><span id="L-4062"><a href="#L-4062"><span class="linenos">4062</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> -</span><span id="L-4063"><a href="#L-4063"><span class="linenos">4063</span></a><span class="sd"> """</span> -</span><span id="L-4064"><a href="#L-4064"><span class="linenos">4064</span></a> <span class="k">return</span> <span class="n">Delete</span><span class="p">(</span> -</span><span id="L-4065"><a href="#L-4065"><span class="linenos">4065</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-4066"><a href="#L-4066"><span class="linenos">4066</span></a> <span class="n">where</span><span class="o">=</span><span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> -</span><span id="L-4067"><a href="#L-4067"><span class="linenos">4067</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">)</span> -</span><span id="L-4068"><a href="#L-4068"><span class="linenos">4068</span></a> <span class="k">else</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="L-4069"><a href="#L-4069"><span class="linenos">4069</span></a> <span class="p">)</span> -</span><span id="L-4070"><a href="#L-4070"><span class="linenos">4070</span></a> +</span><span id="L-3992"><a href="#L-3992"><span class="linenos">3992</span></a> <span class="k">return</span> <span class="n">Intersect</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> +</span><span id="L-3993"><a href="#L-3993"><span class="linenos">3993</span></a> +</span><span id="L-3994"><a href="#L-3994"><span class="linenos">3994</span></a> +</span><span id="L-3995"><a href="#L-3995"><span class="linenos">3995</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-3996"><a href="#L-3996"><span class="linenos">3996</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-3997"><a href="#L-3997"><span class="linenos">3997</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> +</span><span id="L-3998"><a href="#L-3998"><span class="linenos">3998</span></a> +</span><span id="L-3999"><a href="#L-3999"><span class="linenos">3999</span></a><span class="sd"> Example:</span> +</span><span id="L-4000"><a href="#L-4000"><span class="linenos">4000</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="L-4001"><a href="#L-4001"><span class="linenos">4001</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="L-4002"><a href="#L-4002"><span class="linenos">4002</span></a> +</span><span id="L-4003"><a href="#L-4003"><span class="linenos">4003</span></a><span class="sd"> Args:</span> +</span><span id="L-4004"><a href="#L-4004"><span class="linenos">4004</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="L-4005"><a href="#L-4005"><span class="linenos">4005</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4006"><a href="#L-4006"><span class="linenos">4006</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="L-4007"><a href="#L-4007"><span class="linenos">4007</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="L-4008"><a href="#L-4008"><span class="linenos">4008</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="L-4009"><a href="#L-4009"><span class="linenos">4009</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4010"><a href="#L-4010"><span class="linenos">4010</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="L-4011"><a href="#L-4011"><span class="linenos">4011</span></a><span class="sd"> Returns:</span> +</span><span id="L-4012"><a href="#L-4012"><span class="linenos">4012</span></a><span class="sd"> Except: the syntax tree for the EXCEPT statement.</span> +</span><span id="L-4013"><a href="#L-4013"><span class="linenos">4013</span></a><span class="sd"> """</span> +</span><span id="L-4014"><a href="#L-4014"><span class="linenos">4014</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4015"><a href="#L-4015"><span class="linenos">4015</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4016"><a href="#L-4016"><span class="linenos">4016</span></a> +</span><span id="L-4017"><a href="#L-4017"><span class="linenos">4017</span></a> <span class="k">return</span> <span class="n">Except</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> +</span><span id="L-4018"><a href="#L-4018"><span class="linenos">4018</span></a> +</span><span id="L-4019"><a href="#L-4019"><span class="linenos">4019</span></a> +</span><span id="L-4020"><a href="#L-4020"><span class="linenos">4020</span></a><span class="k">def</span> <span class="nf">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-4021"><a href="#L-4021"><span class="linenos">4021</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4022"><a href="#L-4022"><span class="linenos">4022</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> +</span><span id="L-4023"><a href="#L-4023"><span class="linenos">4023</span></a> +</span><span id="L-4024"><a href="#L-4024"><span class="linenos">4024</span></a><span class="sd"> Example:</span> +</span><span id="L-4025"><a href="#L-4025"><span class="linenos">4025</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> +</span><span id="L-4026"><a href="#L-4026"><span class="linenos">4026</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-4027"><a href="#L-4027"><span class="linenos">4027</span></a> +</span><span id="L-4028"><a href="#L-4028"><span class="linenos">4028</span></a><span class="sd"> Args:</span> +</span><span id="L-4029"><a href="#L-4029"><span class="linenos">4029</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> +</span><span id="L-4030"><a href="#L-4030"><span class="linenos">4030</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4031"><a href="#L-4031"><span class="linenos">4031</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="L-4032"><a href="#L-4032"><span class="linenos">4032</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-4033"><a href="#L-4033"><span class="linenos">4033</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-4034"><a href="#L-4034"><span class="linenos">4034</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="L-4035"><a href="#L-4035"><span class="linenos">4035</span></a> +</span><span id="L-4036"><a href="#L-4036"><span class="linenos">4036</span></a><span class="sd"> Returns:</span> +</span><span id="L-4037"><a href="#L-4037"><span class="linenos">4037</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="L-4038"><a href="#L-4038"><span class="linenos">4038</span></a><span class="sd"> """</span> +</span><span id="L-4039"><a href="#L-4039"><span class="linenos">4039</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4040"><a href="#L-4040"><span class="linenos">4040</span></a> +</span><span id="L-4041"><a href="#L-4041"><span class="linenos">4041</span></a> +</span><span id="L-4042"><a href="#L-4042"><span class="linenos">4042</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="L-4043"><a href="#L-4043"><span class="linenos">4043</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4044"><a href="#L-4044"><span class="linenos">4044</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> +</span><span id="L-4045"><a href="#L-4045"><span class="linenos">4045</span></a> +</span><span id="L-4046"><a href="#L-4046"><span class="linenos">4046</span></a><span class="sd"> Example:</span> +</span><span id="L-4047"><a href="#L-4047"><span class="linenos">4047</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> +</span><span id="L-4048"><a href="#L-4048"><span class="linenos">4048</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="L-4049"><a href="#L-4049"><span class="linenos">4049</span></a> +</span><span id="L-4050"><a href="#L-4050"><span class="linenos">4050</span></a><span class="sd"> Args:</span> +</span><span id="L-4051"><a href="#L-4051"><span class="linenos">4051</span></a><span class="sd"> *expressions (str | Expression): the SQL code string to parse as the FROM expressions of a</span> +</span><span id="L-4052"><a href="#L-4052"><span class="linenos">4052</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4053"><a href="#L-4053"><span class="linenos">4053</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> +</span><span id="L-4054"><a href="#L-4054"><span class="linenos">4054</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-4055"><a href="#L-4055"><span class="linenos">4055</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-4056"><a href="#L-4056"><span class="linenos">4056</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="L-4057"><a href="#L-4057"><span class="linenos">4057</span></a> +</span><span id="L-4058"><a href="#L-4058"><span class="linenos">4058</span></a><span class="sd"> Returns:</span> +</span><span id="L-4059"><a href="#L-4059"><span class="linenos">4059</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="L-4060"><a href="#L-4060"><span class="linenos">4060</span></a><span class="sd"> """</span> +</span><span id="L-4061"><a href="#L-4061"><span class="linenos">4061</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4062"><a href="#L-4062"><span class="linenos">4062</span></a> +</span><span id="L-4063"><a href="#L-4063"><span class="linenos">4063</span></a> +</span><span id="L-4064"><a href="#L-4064"><span class="linenos">4064</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">from_</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> +</span><span id="L-4065"><a href="#L-4065"><span class="linenos">4065</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4066"><a href="#L-4066"><span class="linenos">4066</span></a><span class="sd"> Creates an update statement.</span> +</span><span id="L-4067"><a href="#L-4067"><span class="linenos">4067</span></a> +</span><span id="L-4068"><a href="#L-4068"><span class="linenos">4068</span></a><span class="sd"> Example:</span> +</span><span id="L-4069"><a href="#L-4069"><span class="linenos">4069</span></a><span class="sd"> >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz", where="id > 1").sql()</span> +</span><span id="L-4070"><a href="#L-4070"><span class="linenos">4070</span></a><span class="sd"> "UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz WHERE id > 1"</span> </span><span id="L-4071"><a href="#L-4071"><span class="linenos">4071</span></a> -</span><span id="L-4072"><a href="#L-4072"><span class="linenos">4072</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="L-4073"><a href="#L-4073"><span class="linenos">4073</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4074"><a href="#L-4074"><span class="linenos">4074</span></a><span class="sd"> Initialize a logical condition expression.</span> -</span><span id="L-4075"><a href="#L-4075"><span class="linenos">4075</span></a> -</span><span id="L-4076"><a href="#L-4076"><span class="linenos">4076</span></a><span class="sd"> Example:</span> -</span><span id="L-4077"><a href="#L-4077"><span class="linenos">4077</span></a><span class="sd"> >>> condition("x=1").sql()</span> -</span><span id="L-4078"><a href="#L-4078"><span class="linenos">4078</span></a><span class="sd"> 'x = 1'</span> +</span><span id="L-4072"><a href="#L-4072"><span class="linenos">4072</span></a><span class="sd"> Args:</span> +</span><span id="L-4073"><a href="#L-4073"><span class="linenos">4073</span></a><span class="sd"> *properties (Dict[str, Any]): dictionary of properties to set which are</span> +</span><span id="L-4074"><a href="#L-4074"><span class="linenos">4074</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> +</span><span id="L-4075"><a href="#L-4075"><span class="linenos">4075</span></a><span class="sd"> where (str): sql conditional parsed into a WHERE statement</span> +</span><span id="L-4076"><a href="#L-4076"><span class="linenos">4076</span></a><span class="sd"> from_ (str): sql statement parsed into a FROM statement</span> +</span><span id="L-4077"><a href="#L-4077"><span class="linenos">4077</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="L-4078"><a href="#L-4078"><span class="linenos">4078</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> </span><span id="L-4079"><a href="#L-4079"><span class="linenos">4079</span></a> -</span><span id="L-4080"><a href="#L-4080"><span class="linenos">4080</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> -</span><span id="L-4081"><a href="#L-4081"><span class="linenos">4081</span></a><span class="sd"> >>> where = condition("x=1")</span> -</span><span id="L-4082"><a href="#L-4082"><span class="linenos">4082</span></a><span class="sd"> >>> where = where.and_("y=1")</span> -</span><span id="L-4083"><a href="#L-4083"><span class="linenos">4083</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> -</span><span id="L-4084"><a href="#L-4084"><span class="linenos">4084</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> -</span><span id="L-4085"><a href="#L-4085"><span class="linenos">4085</span></a> -</span><span id="L-4086"><a href="#L-4086"><span class="linenos">4086</span></a><span class="sd"> Args:</span> -</span><span id="L-4087"><a href="#L-4087"><span class="linenos">4087</span></a><span class="sd"> *expression (str | Expression): the SQL code string to parse.</span> -</span><span id="L-4088"><a href="#L-4088"><span class="linenos">4088</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4089"><a href="#L-4089"><span class="linenos">4089</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> -</span><span id="L-4090"><a href="#L-4090"><span class="linenos">4090</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="L-4091"><a href="#L-4091"><span class="linenos">4091</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="L-4092"><a href="#L-4092"><span class="linenos">4092</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="L-4093"><a href="#L-4093"><span class="linenos">4093</span></a> -</span><span id="L-4094"><a href="#L-4094"><span class="linenos">4094</span></a><span class="sd"> Returns:</span> -</span><span id="L-4095"><a href="#L-4095"><span class="linenos">4095</span></a><span class="sd"> Condition: the expression</span> -</span><span id="L-4096"><a href="#L-4096"><span class="linenos">4096</span></a><span class="sd"> """</span> -</span><span id="L-4097"><a href="#L-4097"><span class="linenos">4097</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> <span class="c1"># type: ignore</span> -</span><span id="L-4098"><a href="#L-4098"><span class="linenos">4098</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-4099"><a href="#L-4099"><span class="linenos">4099</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> -</span><span id="L-4100"><a href="#L-4100"><span class="linenos">4100</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-4101"><a href="#L-4101"><span class="linenos">4101</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4102"><a href="#L-4102"><span class="linenos">4102</span></a> <span class="p">)</span> -</span><span id="L-4103"><a href="#L-4103"><span class="linenos">4103</span></a> +</span><span id="L-4080"><a href="#L-4080"><span class="linenos">4080</span></a><span class="sd"> Returns:</span> +</span><span id="L-4081"><a href="#L-4081"><span class="linenos">4081</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> +</span><span id="L-4082"><a href="#L-4082"><span class="linenos">4082</span></a><span class="sd"> """</span> +</span><span id="L-4083"><a href="#L-4083"><span class="linenos">4083</span></a> <span class="n">update</span> <span class="o">=</span> <span class="n">Update</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">))</span> +</span><span id="L-4084"><a href="#L-4084"><span class="linenos">4084</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-4085"><a href="#L-4085"><span class="linenos">4085</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-4086"><a href="#L-4086"><span class="linenos">4086</span></a> <span class="p">[</span> +</span><span id="L-4087"><a href="#L-4087"><span class="linenos">4087</span></a> <span class="n">EQ</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> +</span><span id="L-4088"><a href="#L-4088"><span class="linenos">4088</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="L-4089"><a href="#L-4089"><span class="linenos">4089</span></a> <span class="p">],</span> +</span><span id="L-4090"><a href="#L-4090"><span class="linenos">4090</span></a> <span class="p">)</span> +</span><span id="L-4091"><a href="#L-4091"><span class="linenos">4091</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> +</span><span id="L-4092"><a href="#L-4092"><span class="linenos">4092</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-4093"><a href="#L-4093"><span class="linenos">4093</span></a> <span class="s2">"from"</span><span class="p">,</span> +</span><span id="L-4094"><a href="#L-4094"><span class="linenos">4094</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">from_</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-4095"><a href="#L-4095"><span class="linenos">4095</span></a> <span class="p">)</span> +</span><span id="L-4096"><a href="#L-4096"><span class="linenos">4096</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="L-4097"><a href="#L-4097"><span class="linenos">4097</span></a> <span class="n">where</span> <span class="o">=</span> <span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> +</span><span id="L-4098"><a href="#L-4098"><span class="linenos">4098</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="L-4099"><a href="#L-4099"><span class="linenos">4099</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-4100"><a href="#L-4100"><span class="linenos">4100</span></a> <span class="s2">"where"</span><span class="p">,</span> +</span><span id="L-4101"><a href="#L-4101"><span class="linenos">4101</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-4102"><a href="#L-4102"><span class="linenos">4102</span></a> <span class="p">)</span> +</span><span id="L-4103"><a href="#L-4103"><span class="linenos">4103</span></a> <span class="k">return</span> <span class="n">update</span> </span><span id="L-4104"><a href="#L-4104"><span class="linenos">4104</span></a> -</span><span id="L-4105"><a href="#L-4105"><span class="linenos">4105</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="L-4106"><a href="#L-4106"><span class="linenos">4106</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4107"><a href="#L-4107"><span class="linenos">4107</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> -</span><span id="L-4108"><a href="#L-4108"><span class="linenos">4108</span></a> -</span><span id="L-4109"><a href="#L-4109"><span class="linenos">4109</span></a><span class="sd"> Example:</span> -</span><span id="L-4110"><a href="#L-4110"><span class="linenos">4110</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> -</span><span id="L-4111"><a href="#L-4111"><span class="linenos">4111</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> -</span><span id="L-4112"><a href="#L-4112"><span class="linenos">4112</span></a> -</span><span id="L-4113"><a href="#L-4113"><span class="linenos">4113</span></a><span class="sd"> Args:</span> -</span><span id="L-4114"><a href="#L-4114"><span class="linenos">4114</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-4115"><a href="#L-4115"><span class="linenos">4115</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4116"><a href="#L-4116"><span class="linenos">4116</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4105"><a href="#L-4105"><span class="linenos">4105</span></a> +</span><span id="L-4106"><a href="#L-4106"><span class="linenos">4106</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="L-4107"><a href="#L-4107"><span class="linenos">4107</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4108"><a href="#L-4108"><span class="linenos">4108</span></a><span class="sd"> Builds a delete statement.</span> +</span><span id="L-4109"><a href="#L-4109"><span class="linenos">4109</span></a> +</span><span id="L-4110"><a href="#L-4110"><span class="linenos">4110</span></a><span class="sd"> Example:</span> +</span><span id="L-4111"><a href="#L-4111"><span class="linenos">4111</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> +</span><span id="L-4112"><a href="#L-4112"><span class="linenos">4112</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> +</span><span id="L-4113"><a href="#L-4113"><span class="linenos">4113</span></a> +</span><span id="L-4114"><a href="#L-4114"><span class="linenos">4114</span></a><span class="sd"> Args:</span> +</span><span id="L-4115"><a href="#L-4115"><span class="linenos">4115</span></a><span class="sd"> where (str|Condition): sql conditional parsed into a WHERE statement</span> +</span><span id="L-4116"><a href="#L-4116"><span class="linenos">4116</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> </span><span id="L-4117"><a href="#L-4117"><span class="linenos">4117</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> </span><span id="L-4118"><a href="#L-4118"><span class="linenos">4118</span></a> </span><span id="L-4119"><a href="#L-4119"><span class="linenos">4119</span></a><span class="sd"> Returns:</span> -</span><span id="L-4120"><a href="#L-4120"><span class="linenos">4120</span></a><span class="sd"> And: the new condition</span> +</span><span id="L-4120"><a href="#L-4120"><span class="linenos">4120</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> </span><span id="L-4121"><a href="#L-4121"><span class="linenos">4121</span></a><span class="sd"> """</span> -</span><span id="L-4122"><a href="#L-4122"><span class="linenos">4122</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">And</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4123"><a href="#L-4123"><span class="linenos">4123</span></a> -</span><span id="L-4124"><a href="#L-4124"><span class="linenos">4124</span></a> -</span><span id="L-4125"><a href="#L-4125"><span class="linenos">4125</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> -</span><span id="L-4126"><a href="#L-4126"><span class="linenos">4126</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4127"><a href="#L-4127"><span class="linenos">4127</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> +</span><span id="L-4122"><a href="#L-4122"><span class="linenos">4122</span></a> <span class="k">return</span> <span class="n">Delete</span><span class="p">(</span> +</span><span id="L-4123"><a href="#L-4123"><span class="linenos">4123</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-4124"><a href="#L-4124"><span class="linenos">4124</span></a> <span class="n">where</span><span class="o">=</span><span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> +</span><span id="L-4125"><a href="#L-4125"><span class="linenos">4125</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">)</span> +</span><span id="L-4126"><a href="#L-4126"><span class="linenos">4126</span></a> <span class="k">else</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="L-4127"><a href="#L-4127"><span class="linenos">4127</span></a> <span class="p">)</span> </span><span id="L-4128"><a href="#L-4128"><span class="linenos">4128</span></a> -</span><span id="L-4129"><a href="#L-4129"><span class="linenos">4129</span></a><span class="sd"> Example:</span> -</span><span id="L-4130"><a href="#L-4130"><span class="linenos">4130</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> -</span><span id="L-4131"><a href="#L-4131"><span class="linenos">4131</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> -</span><span id="L-4132"><a href="#L-4132"><span class="linenos">4132</span></a> -</span><span id="L-4133"><a href="#L-4133"><span class="linenos">4133</span></a><span class="sd"> Args:</span> -</span><span id="L-4134"><a href="#L-4134"><span class="linenos">4134</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-4135"><a href="#L-4135"><span class="linenos">4135</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4136"><a href="#L-4136"><span class="linenos">4136</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-4137"><a href="#L-4137"><span class="linenos">4137</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-4138"><a href="#L-4138"><span class="linenos">4138</span></a> -</span><span id="L-4139"><a href="#L-4139"><span class="linenos">4139</span></a><span class="sd"> Returns:</span> -</span><span id="L-4140"><a href="#L-4140"><span class="linenos">4140</span></a><span class="sd"> Or: the new condition</span> -</span><span id="L-4141"><a href="#L-4141"><span class="linenos">4141</span></a><span class="sd"> """</span> -</span><span id="L-4142"><a href="#L-4142"><span class="linenos">4142</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4129"><a href="#L-4129"><span class="linenos">4129</span></a> +</span><span id="L-4130"><a href="#L-4130"><span class="linenos">4130</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="L-4131"><a href="#L-4131"><span class="linenos">4131</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4132"><a href="#L-4132"><span class="linenos">4132</span></a><span class="sd"> Initialize a logical condition expression.</span> +</span><span id="L-4133"><a href="#L-4133"><span class="linenos">4133</span></a> +</span><span id="L-4134"><a href="#L-4134"><span class="linenos">4134</span></a><span class="sd"> Example:</span> +</span><span id="L-4135"><a href="#L-4135"><span class="linenos">4135</span></a><span class="sd"> >>> condition("x=1").sql()</span> +</span><span id="L-4136"><a href="#L-4136"><span class="linenos">4136</span></a><span class="sd"> 'x = 1'</span> +</span><span id="L-4137"><a href="#L-4137"><span class="linenos">4137</span></a> +</span><span id="L-4138"><a href="#L-4138"><span class="linenos">4138</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> +</span><span id="L-4139"><a href="#L-4139"><span class="linenos">4139</span></a><span class="sd"> >>> where = condition("x=1")</span> +</span><span id="L-4140"><a href="#L-4140"><span class="linenos">4140</span></a><span class="sd"> >>> where = where.and_("y=1")</span> +</span><span id="L-4141"><a href="#L-4141"><span class="linenos">4141</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> +</span><span id="L-4142"><a href="#L-4142"><span class="linenos">4142</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> </span><span id="L-4143"><a href="#L-4143"><span class="linenos">4143</span></a> -</span><span id="L-4144"><a href="#L-4144"><span class="linenos">4144</span></a> -</span><span id="L-4145"><a href="#L-4145"><span class="linenos">4145</span></a><span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="L-4146"><a href="#L-4146"><span class="linenos">4146</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4147"><a href="#L-4147"><span class="linenos">4147</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> -</span><span id="L-4148"><a href="#L-4148"><span class="linenos">4148</span></a> -</span><span id="L-4149"><a href="#L-4149"><span class="linenos">4149</span></a><span class="sd"> Example:</span> -</span><span id="L-4150"><a href="#L-4150"><span class="linenos">4150</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> -</span><span id="L-4151"><a href="#L-4151"><span class="linenos">4151</span></a><span class="sd"> "NOT this_suit = 'black'"</span> -</span><span id="L-4152"><a href="#L-4152"><span class="linenos">4152</span></a> -</span><span id="L-4153"><a href="#L-4153"><span class="linenos">4153</span></a><span class="sd"> Args:</span> -</span><span id="L-4154"><a href="#L-4154"><span class="linenos">4154</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-4155"><a href="#L-4155"><span class="linenos">4155</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4156"><a href="#L-4156"><span class="linenos">4156</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-4157"><a href="#L-4157"><span class="linenos">4157</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-4158"><a href="#L-4158"><span class="linenos">4158</span></a> -</span><span id="L-4159"><a href="#L-4159"><span class="linenos">4159</span></a><span class="sd"> Returns:</span> -</span><span id="L-4160"><a href="#L-4160"><span class="linenos">4160</span></a><span class="sd"> Not: the new condition</span> -</span><span id="L-4161"><a href="#L-4161"><span class="linenos">4161</span></a><span class="sd"> """</span> -</span><span id="L-4162"><a href="#L-4162"><span class="linenos">4162</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> -</span><span id="L-4163"><a href="#L-4163"><span class="linenos">4163</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="L-4164"><a href="#L-4164"><span class="linenos">4164</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="L-4165"><a href="#L-4165"><span class="linenos">4165</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4166"><a href="#L-4166"><span class="linenos">4166</span></a> <span class="p">)</span> -</span><span id="L-4167"><a href="#L-4167"><span class="linenos">4167</span></a> <span class="k">return</span> <span class="n">Not</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">))</span> -</span><span id="L-4168"><a href="#L-4168"><span class="linenos">4168</span></a> -</span><span id="L-4169"><a href="#L-4169"><span class="linenos">4169</span></a> -</span><span id="L-4170"><a href="#L-4170"><span class="linenos">4170</span></a><span class="k">def</span> <span class="nf">paren</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="L-4171"><a href="#L-4171"><span class="linenos">4171</span></a> <span class="k">return</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="L-4172"><a href="#L-4172"><span class="linenos">4172</span></a> -</span><span id="L-4173"><a href="#L-4173"><span class="linenos">4173</span></a> -</span><span id="L-4174"><a href="#L-4174"><span class="linenos">4174</span></a><span class="n">SAFE_IDENTIFIER_RE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">"^[_a-zA-Z][\w]*$"</span><span class="p">)</span> -</span><span id="L-4175"><a href="#L-4175"><span class="linenos">4175</span></a> +</span><span id="L-4144"><a href="#L-4144"><span class="linenos">4144</span></a><span class="sd"> Args:</span> +</span><span id="L-4145"><a href="#L-4145"><span class="linenos">4145</span></a><span class="sd"> *expression (str | Expression): the SQL code string to parse.</span> +</span><span id="L-4146"><a href="#L-4146"><span class="linenos">4146</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4147"><a href="#L-4147"><span class="linenos">4147</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> +</span><span id="L-4148"><a href="#L-4148"><span class="linenos">4148</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="L-4149"><a href="#L-4149"><span class="linenos">4149</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="L-4150"><a href="#L-4150"><span class="linenos">4150</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="L-4151"><a href="#L-4151"><span class="linenos">4151</span></a> +</span><span id="L-4152"><a href="#L-4152"><span class="linenos">4152</span></a><span class="sd"> Returns:</span> +</span><span id="L-4153"><a href="#L-4153"><span class="linenos">4153</span></a><span class="sd"> Condition: the expression</span> +</span><span id="L-4154"><a href="#L-4154"><span class="linenos">4154</span></a><span class="sd"> """</span> +</span><span id="L-4155"><a href="#L-4155"><span class="linenos">4155</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> <span class="c1"># type: ignore</span> +</span><span id="L-4156"><a href="#L-4156"><span class="linenos">4156</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-4157"><a href="#L-4157"><span class="linenos">4157</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> +</span><span id="L-4158"><a href="#L-4158"><span class="linenos">4158</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-4159"><a href="#L-4159"><span class="linenos">4159</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4160"><a href="#L-4160"><span class="linenos">4160</span></a> <span class="p">)</span> +</span><span id="L-4161"><a href="#L-4161"><span class="linenos">4161</span></a> +</span><span id="L-4162"><a href="#L-4162"><span class="linenos">4162</span></a> +</span><span id="L-4163"><a href="#L-4163"><span class="linenos">4163</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="L-4164"><a href="#L-4164"><span class="linenos">4164</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4165"><a href="#L-4165"><span class="linenos">4165</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> +</span><span id="L-4166"><a href="#L-4166"><span class="linenos">4166</span></a> +</span><span id="L-4167"><a href="#L-4167"><span class="linenos">4167</span></a><span class="sd"> Example:</span> +</span><span id="L-4168"><a href="#L-4168"><span class="linenos">4168</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> +</span><span id="L-4169"><a href="#L-4169"><span class="linenos">4169</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> +</span><span id="L-4170"><a href="#L-4170"><span class="linenos">4170</span></a> +</span><span id="L-4171"><a href="#L-4171"><span class="linenos">4171</span></a><span class="sd"> Args:</span> +</span><span id="L-4172"><a href="#L-4172"><span class="linenos">4172</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-4173"><a href="#L-4173"><span class="linenos">4173</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4174"><a href="#L-4174"><span class="linenos">4174</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4175"><a href="#L-4175"><span class="linenos">4175</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> </span><span id="L-4176"><a href="#L-4176"><span class="linenos">4176</span></a> -</span><span id="L-4177"><a href="#L-4177"><span class="linenos">4177</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4178"><a href="#L-4178"><span class="linenos">4178</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-4179"><a href="#L-4179"><span class="linenos">4179</span></a> <span class="o">...</span> -</span><span id="L-4180"><a href="#L-4180"><span class="linenos">4180</span></a> +</span><span id="L-4177"><a href="#L-4177"><span class="linenos">4177</span></a><span class="sd"> Returns:</span> +</span><span id="L-4178"><a href="#L-4178"><span class="linenos">4178</span></a><span class="sd"> And: the new condition</span> +</span><span id="L-4179"><a href="#L-4179"><span class="linenos">4179</span></a><span class="sd"> """</span> +</span><span id="L-4180"><a href="#L-4180"><span class="linenos">4180</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">And</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="L-4181"><a href="#L-4181"><span class="linenos">4181</span></a> -</span><span id="L-4182"><a href="#L-4182"><span class="linenos">4182</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4183"><a href="#L-4183"><span class="linenos">4183</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Identifier</span><span class="p">:</span> -</span><span id="L-4184"><a href="#L-4184"><span class="linenos">4184</span></a> <span class="o">...</span> -</span><span id="L-4185"><a href="#L-4185"><span class="linenos">4185</span></a> +</span><span id="L-4182"><a href="#L-4182"><span class="linenos">4182</span></a> +</span><span id="L-4183"><a href="#L-4183"><span class="linenos">4183</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="L-4184"><a href="#L-4184"><span class="linenos">4184</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4185"><a href="#L-4185"><span class="linenos">4185</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> </span><span id="L-4186"><a href="#L-4186"><span class="linenos">4186</span></a> -</span><span id="L-4187"><a href="#L-4187"><span class="linenos">4187</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="L-4188"><a href="#L-4188"><span class="linenos">4188</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> -</span><span id="L-4189"><a href="#L-4189"><span class="linenos">4189</span></a> -</span><span id="L-4190"><a href="#L-4190"><span class="linenos">4190</span></a><span class="sd"> Args:</span> -</span><span id="L-4191"><a href="#L-4191"><span class="linenos">4191</span></a><span class="sd"> name: The name to turn into an identifier.</span> -</span><span id="L-4192"><a href="#L-4192"><span class="linenos">4192</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> -</span><span id="L-4193"><a href="#L-4193"><span class="linenos">4193</span></a> -</span><span id="L-4194"><a href="#L-4194"><span class="linenos">4194</span></a><span class="sd"> Returns:</span> -</span><span id="L-4195"><a href="#L-4195"><span class="linenos">4195</span></a><span class="sd"> The identifier ast node.</span> -</span><span id="L-4196"><a href="#L-4196"><span class="linenos">4196</span></a><span class="sd"> """</span> -</span><span id="L-4197"><a href="#L-4197"><span class="linenos">4197</span></a> -</span><span id="L-4198"><a href="#L-4198"><span class="linenos">4198</span></a> <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-4199"><a href="#L-4199"><span class="linenos">4199</span></a> <span class="k">return</span> <span class="kc">None</span> -</span><span id="L-4200"><a href="#L-4200"><span class="linenos">4200</span></a> -</span><span id="L-4201"><a href="#L-4201"><span class="linenos">4201</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Identifier</span><span class="p">):</span> -</span><span id="L-4202"><a href="#L-4202"><span class="linenos">4202</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">name</span> -</span><span id="L-4203"><a href="#L-4203"><span class="linenos">4203</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-4204"><a href="#L-4204"><span class="linenos">4204</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> -</span><span id="L-4205"><a href="#L-4205"><span class="linenos">4205</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> -</span><span id="L-4206"><a href="#L-4206"><span class="linenos">4206</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">SAFE_IDENTIFIER_RE</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">quoted</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">quoted</span><span class="p">,</span> -</span><span id="L-4207"><a href="#L-4207"><span class="linenos">4207</span></a> <span class="p">)</span> -</span><span id="L-4208"><a href="#L-4208"><span class="linenos">4208</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-4209"><a href="#L-4209"><span class="linenos">4209</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Name needs to be a string or an Identifier, got: </span><span class="si">{</span><span class="n">name</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-4210"><a href="#L-4210"><span class="linenos">4210</span></a> <span class="k">return</span> <span class="n">identifier</span> -</span><span id="L-4211"><a href="#L-4211"><span class="linenos">4211</span></a> -</span><span id="L-4212"><a href="#L-4212"><span class="linenos">4212</span></a> -</span><span id="L-4213"><a href="#L-4213"><span class="linenos">4213</span></a><span class="n">INTERVAL_STRING_RE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">"\s*([0-9]+)\s*([a-zA-Z]+)\s*"</span><span class="p">)</span> -</span><span id="L-4214"><a href="#L-4214"><span class="linenos">4214</span></a> -</span><span id="L-4215"><a href="#L-4215"><span class="linenos">4215</span></a> -</span><span id="L-4216"><a href="#L-4216"><span class="linenos">4216</span></a><span class="k">def</span> <span class="nf">to_interval</span><span class="p">(</span><span class="n">interval</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Literal</span><span class="p">)</span> <span class="o">-></span> <span class="n">Interval</span><span class="p">:</span> -</span><span id="L-4217"><a href="#L-4217"><span class="linenos">4217</span></a><span class="w"> </span><span class="sd">"""Builds an interval expression from a string like '1 day' or '5 months'."""</span> -</span><span id="L-4218"><a href="#L-4218"><span class="linenos">4218</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">interval</span><span class="p">,</span> <span class="n">Literal</span><span class="p">):</span> -</span><span id="L-4219"><a href="#L-4219"><span class="linenos">4219</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval</span><span class="o">.</span><span class="n">is_string</span><span class="p">:</span> -</span><span id="L-4220"><a href="#L-4220"><span class="linenos">4220</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> -</span><span id="L-4221"><a href="#L-4221"><span class="linenos">4221</span></a> -</span><span id="L-4222"><a href="#L-4222"><span class="linenos">4222</span></a> <span class="n">interval</span> <span class="o">=</span> <span class="n">interval</span><span class="o">.</span><span class="n">this</span> -</span><span id="L-4223"><a href="#L-4223"><span class="linenos">4223</span></a> -</span><span id="L-4224"><a href="#L-4224"><span class="linenos">4224</span></a> <span class="n">interval_parts</span> <span class="o">=</span> <span class="n">INTERVAL_STRING_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span> <span class="c1"># type: ignore</span> -</span><span id="L-4225"><a href="#L-4225"><span class="linenos">4225</span></a> -</span><span id="L-4226"><a href="#L-4226"><span class="linenos">4226</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval_parts</span><span class="p">:</span> -</span><span id="L-4227"><a href="#L-4227"><span class="linenos">4227</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> -</span><span id="L-4228"><a href="#L-4228"><span class="linenos">4228</span></a> -</span><span id="L-4229"><a href="#L-4229"><span class="linenos">4229</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> -</span><span id="L-4230"><a href="#L-4230"><span class="linenos">4230</span></a> <span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span> -</span><span id="L-4231"><a href="#L-4231"><span class="linenos">4231</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> -</span><span id="L-4232"><a href="#L-4232"><span class="linenos">4232</span></a> <span class="p">)</span> +</span><span id="L-4187"><a href="#L-4187"><span class="linenos">4187</span></a><span class="sd"> Example:</span> +</span><span id="L-4188"><a href="#L-4188"><span class="linenos">4188</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> +</span><span id="L-4189"><a href="#L-4189"><span class="linenos">4189</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> +</span><span id="L-4190"><a href="#L-4190"><span class="linenos">4190</span></a> +</span><span id="L-4191"><a href="#L-4191"><span class="linenos">4191</span></a><span class="sd"> Args:</span> +</span><span id="L-4192"><a href="#L-4192"><span class="linenos">4192</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-4193"><a href="#L-4193"><span class="linenos">4193</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4194"><a href="#L-4194"><span class="linenos">4194</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4195"><a href="#L-4195"><span class="linenos">4195</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-4196"><a href="#L-4196"><span class="linenos">4196</span></a> +</span><span id="L-4197"><a href="#L-4197"><span class="linenos">4197</span></a><span class="sd"> Returns:</span> +</span><span id="L-4198"><a href="#L-4198"><span class="linenos">4198</span></a><span class="sd"> Or: the new condition</span> +</span><span id="L-4199"><a href="#L-4199"><span class="linenos">4199</span></a><span class="sd"> """</span> +</span><span id="L-4200"><a href="#L-4200"><span class="linenos">4200</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4201"><a href="#L-4201"><span class="linenos">4201</span></a> +</span><span id="L-4202"><a href="#L-4202"><span class="linenos">4202</span></a> +</span><span id="L-4203"><a href="#L-4203"><span class="linenos">4203</span></a><span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> +</span><span id="L-4204"><a href="#L-4204"><span class="linenos">4204</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4205"><a href="#L-4205"><span class="linenos">4205</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> +</span><span id="L-4206"><a href="#L-4206"><span class="linenos">4206</span></a> +</span><span id="L-4207"><a href="#L-4207"><span class="linenos">4207</span></a><span class="sd"> Example:</span> +</span><span id="L-4208"><a href="#L-4208"><span class="linenos">4208</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> +</span><span id="L-4209"><a href="#L-4209"><span class="linenos">4209</span></a><span class="sd"> "NOT this_suit = 'black'"</span> +</span><span id="L-4210"><a href="#L-4210"><span class="linenos">4210</span></a> +</span><span id="L-4211"><a href="#L-4211"><span class="linenos">4211</span></a><span class="sd"> Args:</span> +</span><span id="L-4212"><a href="#L-4212"><span class="linenos">4212</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-4213"><a href="#L-4213"><span class="linenos">4213</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4214"><a href="#L-4214"><span class="linenos">4214</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4215"><a href="#L-4215"><span class="linenos">4215</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-4216"><a href="#L-4216"><span class="linenos">4216</span></a> +</span><span id="L-4217"><a href="#L-4217"><span class="linenos">4217</span></a><span class="sd"> Returns:</span> +</span><span id="L-4218"><a href="#L-4218"><span class="linenos">4218</span></a><span class="sd"> Not: the new condition</span> +</span><span id="L-4219"><a href="#L-4219"><span class="linenos">4219</span></a><span class="sd"> """</span> +</span><span id="L-4220"><a href="#L-4220"><span class="linenos">4220</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> +</span><span id="L-4221"><a href="#L-4221"><span class="linenos">4221</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="L-4222"><a href="#L-4222"><span class="linenos">4222</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="L-4223"><a href="#L-4223"><span class="linenos">4223</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4224"><a href="#L-4224"><span class="linenos">4224</span></a> <span class="p">)</span> +</span><span id="L-4225"><a href="#L-4225"><span class="linenos">4225</span></a> <span class="k">return</span> <span class="n">Not</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">))</span> +</span><span id="L-4226"><a href="#L-4226"><span class="linenos">4226</span></a> +</span><span id="L-4227"><a href="#L-4227"><span class="linenos">4227</span></a> +</span><span id="L-4228"><a href="#L-4228"><span class="linenos">4228</span></a><span class="k">def</span> <span class="nf">paren</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="L-4229"><a href="#L-4229"><span class="linenos">4229</span></a> <span class="k">return</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="L-4230"><a href="#L-4230"><span class="linenos">4230</span></a> +</span><span id="L-4231"><a href="#L-4231"><span class="linenos">4231</span></a> +</span><span id="L-4232"><a href="#L-4232"><span class="linenos">4232</span></a><span class="n">SAFE_IDENTIFIER_RE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">"^[_a-zA-Z][\w]*$"</span><span class="p">)</span> </span><span id="L-4233"><a href="#L-4233"><span class="linenos">4233</span></a> </span><span id="L-4234"><a href="#L-4234"><span class="linenos">4234</span></a> </span><span id="L-4235"><a href="#L-4235"><span class="linenos">4235</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4236"><a href="#L-4236"><span class="linenos">4236</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="L-4236"><a href="#L-4236"><span class="linenos">4236</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> </span><span id="L-4237"><a href="#L-4237"><span class="linenos">4237</span></a> <span class="o">...</span> </span><span id="L-4238"><a href="#L-4238"><span class="linenos">4238</span></a> </span><span id="L-4239"><a href="#L-4239"><span class="linenos">4239</span></a> </span><span id="L-4240"><a href="#L-4240"><span class="linenos">4240</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> -</span><span id="L-4241"><a href="#L-4241"><span class="linenos">4241</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4241"><a href="#L-4241"><span class="linenos">4241</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Identifier</span><span class="p">:</span> </span><span id="L-4242"><a href="#L-4242"><span class="linenos">4242</span></a> <span class="o">...</span> </span><span id="L-4243"><a href="#L-4243"><span class="linenos">4243</span></a> </span><span id="L-4244"><a href="#L-4244"><span class="linenos">4244</span></a> -</span><span id="L-4245"><a href="#L-4245"><span class="linenos">4245</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Table</span><span class="p">]:</span> -</span><span id="L-4246"><a href="#L-4246"><span class="linenos">4246</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4247"><a href="#L-4247"><span class="linenos">4247</span></a><span class="sd"> Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.</span> -</span><span id="L-4248"><a href="#L-4248"><span class="linenos">4248</span></a><span class="sd"> If a table is passed in then that table is returned.</span> -</span><span id="L-4249"><a href="#L-4249"><span class="linenos">4249</span></a> -</span><span id="L-4250"><a href="#L-4250"><span class="linenos">4250</span></a><span class="sd"> Args:</span> -</span><span id="L-4251"><a href="#L-4251"><span class="linenos">4251</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> -</span><span id="L-4252"><a href="#L-4252"><span class="linenos">4252</span></a> -</span><span id="L-4253"><a href="#L-4253"><span class="linenos">4253</span></a><span class="sd"> Returns:</span> -</span><span id="L-4254"><a href="#L-4254"><span class="linenos">4254</span></a><span class="sd"> A table expression.</span> -</span><span id="L-4255"><a href="#L-4255"><span class="linenos">4255</span></a><span class="sd"> """</span> -</span><span id="L-4256"><a href="#L-4256"><span class="linenos">4256</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="L-4257"><a href="#L-4257"><span class="linenos">4257</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="L-4258"><a href="#L-4258"><span class="linenos">4258</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-4259"><a href="#L-4259"><span class="linenos">4259</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for a table: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-4260"><a href="#L-4260"><span class="linenos">4260</span></a> -</span><span id="L-4261"><a href="#L-4261"><span class="linenos">4261</span></a> <span class="n">catalog</span><span class="p">,</span> <span class="n">db</span><span class="p">,</span> <span class="n">table_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> -</span><span id="L-4262"><a href="#L-4262"><span class="linenos">4262</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="n">catalog</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="L-4263"><a href="#L-4263"><span class="linenos">4263</span></a> -</span><span id="L-4264"><a href="#L-4264"><span class="linenos">4264</span></a> -</span><span id="L-4265"><a href="#L-4265"><span class="linenos">4265</span></a><span class="k">def</span> <span class="nf">to_column</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Column</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="L-4266"><a href="#L-4266"><span class="linenos">4266</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4267"><a href="#L-4267"><span class="linenos">4267</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> -</span><span id="L-4268"><a href="#L-4268"><span class="linenos">4268</span></a> -</span><span id="L-4269"><a href="#L-4269"><span class="linenos">4269</span></a><span class="sd"> If a column is passed in then that column is returned.</span> +</span><span id="L-4245"><a href="#L-4245"><span class="linenos">4245</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="L-4246"><a href="#L-4246"><span class="linenos">4246</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> +</span><span id="L-4247"><a href="#L-4247"><span class="linenos">4247</span></a> +</span><span id="L-4248"><a href="#L-4248"><span class="linenos">4248</span></a><span class="sd"> Args:</span> +</span><span id="L-4249"><a href="#L-4249"><span class="linenos">4249</span></a><span class="sd"> name: The name to turn into an identifier.</span> +</span><span id="L-4250"><a href="#L-4250"><span class="linenos">4250</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> +</span><span id="L-4251"><a href="#L-4251"><span class="linenos">4251</span></a> +</span><span id="L-4252"><a href="#L-4252"><span class="linenos">4252</span></a><span class="sd"> Returns:</span> +</span><span id="L-4253"><a href="#L-4253"><span class="linenos">4253</span></a><span class="sd"> The identifier ast node.</span> +</span><span id="L-4254"><a href="#L-4254"><span class="linenos">4254</span></a><span class="sd"> """</span> +</span><span id="L-4255"><a href="#L-4255"><span class="linenos">4255</span></a> +</span><span id="L-4256"><a href="#L-4256"><span class="linenos">4256</span></a> <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4257"><a href="#L-4257"><span class="linenos">4257</span></a> <span class="k">return</span> <span class="kc">None</span> +</span><span id="L-4258"><a href="#L-4258"><span class="linenos">4258</span></a> +</span><span id="L-4259"><a href="#L-4259"><span class="linenos">4259</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Identifier</span><span class="p">):</span> +</span><span id="L-4260"><a href="#L-4260"><span class="linenos">4260</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">name</span> +</span><span id="L-4261"><a href="#L-4261"><span class="linenos">4261</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-4262"><a href="#L-4262"><span class="linenos">4262</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> +</span><span id="L-4263"><a href="#L-4263"><span class="linenos">4263</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> +</span><span id="L-4264"><a href="#L-4264"><span class="linenos">4264</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">SAFE_IDENTIFIER_RE</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">quoted</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">quoted</span><span class="p">,</span> +</span><span id="L-4265"><a href="#L-4265"><span class="linenos">4265</span></a> <span class="p">)</span> +</span><span id="L-4266"><a href="#L-4266"><span class="linenos">4266</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-4267"><a href="#L-4267"><span class="linenos">4267</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Name needs to be a string or an Identifier, got: </span><span class="si">{</span><span class="n">name</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-4268"><a href="#L-4268"><span class="linenos">4268</span></a> <span class="k">return</span> <span class="n">identifier</span> +</span><span id="L-4269"><a href="#L-4269"><span class="linenos">4269</span></a> </span><span id="L-4270"><a href="#L-4270"><span class="linenos">4270</span></a> -</span><span id="L-4271"><a href="#L-4271"><span class="linenos">4271</span></a><span class="sd"> Args:</span> -</span><span id="L-4272"><a href="#L-4272"><span class="linenos">4272</span></a><span class="sd"> sql_path: `[table].[column]` string</span> -</span><span id="L-4273"><a href="#L-4273"><span class="linenos">4273</span></a><span class="sd"> Returns:</span> -</span><span id="L-4274"><a href="#L-4274"><span class="linenos">4274</span></a><span class="sd"> Table: A column expression</span> -</span><span id="L-4275"><a href="#L-4275"><span class="linenos">4275</span></a><span class="sd"> """</span> -</span><span id="L-4276"><a href="#L-4276"><span class="linenos">4276</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> -</span><span id="L-4277"><a href="#L-4277"><span class="linenos">4277</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="L-4278"><a href="#L-4278"><span class="linenos">4278</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-4279"><a href="#L-4279"><span class="linenos">4279</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for column: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-4280"><a href="#L-4280"><span class="linenos">4280</span></a> <span class="n">table_name</span><span class="p">,</span> <span class="n">column_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> -</span><span id="L-4281"><a href="#L-4281"><span class="linenos">4281</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">column_name</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="L-4282"><a href="#L-4282"><span class="linenos">4282</span></a> +</span><span id="L-4271"><a href="#L-4271"><span class="linenos">4271</span></a><span class="n">INTERVAL_STRING_RE</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">"\s*([0-9]+)\s*([a-zA-Z]+)\s*"</span><span class="p">)</span> +</span><span id="L-4272"><a href="#L-4272"><span class="linenos">4272</span></a> +</span><span id="L-4273"><a href="#L-4273"><span class="linenos">4273</span></a> +</span><span id="L-4274"><a href="#L-4274"><span class="linenos">4274</span></a><span class="k">def</span> <span class="nf">to_interval</span><span class="p">(</span><span class="n">interval</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Literal</span><span class="p">)</span> <span class="o">-></span> <span class="n">Interval</span><span class="p">:</span> +</span><span id="L-4275"><a href="#L-4275"><span class="linenos">4275</span></a><span class="w"> </span><span class="sd">"""Builds an interval expression from a string like '1 day' or '5 months'."""</span> +</span><span id="L-4276"><a href="#L-4276"><span class="linenos">4276</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">interval</span><span class="p">,</span> <span class="n">Literal</span><span class="p">):</span> +</span><span id="L-4277"><a href="#L-4277"><span class="linenos">4277</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval</span><span class="o">.</span><span class="n">is_string</span><span class="p">:</span> +</span><span id="L-4278"><a href="#L-4278"><span class="linenos">4278</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> +</span><span id="L-4279"><a href="#L-4279"><span class="linenos">4279</span></a> +</span><span id="L-4280"><a href="#L-4280"><span class="linenos">4280</span></a> <span class="n">interval</span> <span class="o">=</span> <span class="n">interval</span><span class="o">.</span><span class="n">this</span> +</span><span id="L-4281"><a href="#L-4281"><span class="linenos">4281</span></a> +</span><span id="L-4282"><a href="#L-4282"><span class="linenos">4282</span></a> <span class="n">interval_parts</span> <span class="o">=</span> <span class="n">INTERVAL_STRING_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span> <span class="c1"># type: ignore</span> </span><span id="L-4283"><a href="#L-4283"><span class="linenos">4283</span></a> -</span><span id="L-4284"><a href="#L-4284"><span class="linenos">4284</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> -</span><span id="L-4285"><a href="#L-4285"><span class="linenos">4285</span></a> <span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="L-4286"><a href="#L-4286"><span class="linenos">4286</span></a> <span class="n">alias</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> -</span><span id="L-4287"><a href="#L-4287"><span class="linenos">4287</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="L-4288"><a href="#L-4288"><span class="linenos">4288</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4289"><a href="#L-4289"><span class="linenos">4289</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4290"><a href="#L-4290"><span class="linenos">4290</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="L-4291"><a href="#L-4291"><span class="linenos">4291</span></a><span class="p">):</span> -</span><span id="L-4292"><a href="#L-4292"><span class="linenos">4292</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> -</span><span id="L-4293"><a href="#L-4293"><span class="linenos">4293</span></a> -</span><span id="L-4294"><a href="#L-4294"><span class="linenos">4294</span></a><span class="sd"> Example:</span> -</span><span id="L-4295"><a href="#L-4295"><span class="linenos">4295</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> -</span><span id="L-4296"><a href="#L-4296"><span class="linenos">4296</span></a><span class="sd"> 'foo AS bar'</span> +</span><span id="L-4284"><a href="#L-4284"><span class="linenos">4284</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval_parts</span><span class="p">:</span> +</span><span id="L-4285"><a href="#L-4285"><span class="linenos">4285</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> +</span><span id="L-4286"><a href="#L-4286"><span class="linenos">4286</span></a> +</span><span id="L-4287"><a href="#L-4287"><span class="linenos">4287</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> +</span><span id="L-4288"><a href="#L-4288"><span class="linenos">4288</span></a> <span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span> +</span><span id="L-4289"><a href="#L-4289"><span class="linenos">4289</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> +</span><span id="L-4290"><a href="#L-4290"><span class="linenos">4290</span></a> <span class="p">)</span> +</span><span id="L-4291"><a href="#L-4291"><span class="linenos">4291</span></a> +</span><span id="L-4292"><a href="#L-4292"><span class="linenos">4292</span></a> +</span><span id="L-4293"><a href="#L-4293"><span class="linenos">4293</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-4294"><a href="#L-4294"><span class="linenos">4294</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="L-4295"><a href="#L-4295"><span class="linenos">4295</span></a> <span class="o">...</span> +</span><span id="L-4296"><a href="#L-4296"><span class="linenos">4296</span></a> </span><span id="L-4297"><a href="#L-4297"><span class="linenos">4297</span></a> -</span><span id="L-4298"><a href="#L-4298"><span class="linenos">4298</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> -</span><span id="L-4299"><a href="#L-4299"><span class="linenos">4299</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> -</span><span id="L-4300"><a href="#L-4300"><span class="linenos">4300</span></a> -</span><span id="L-4301"><a href="#L-4301"><span class="linenos">4301</span></a><span class="sd"> Args:</span> -</span><span id="L-4302"><a href="#L-4302"><span class="linenos">4302</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="L-4303"><a href="#L-4303"><span class="linenos">4303</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4304"><a href="#L-4304"><span class="linenos">4304</span></a><span class="sd"> alias: the alias name to use. If the name has</span> -</span><span id="L-4305"><a href="#L-4305"><span class="linenos">4305</span></a><span class="sd"> special characters it is quoted.</span> -</span><span id="L-4306"><a href="#L-4306"><span class="linenos">4306</span></a><span class="sd"> table: Whether or not to create a table alias, can also be a list of columns.</span> -</span><span id="L-4307"><a href="#L-4307"><span class="linenos">4307</span></a><span class="sd"> quoted: whether or not to quote the alias</span> -</span><span id="L-4308"><a href="#L-4308"><span class="linenos">4308</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="L-4309"><a href="#L-4309"><span class="linenos">4309</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-4298"><a href="#L-4298"><span class="linenos">4298</span></a><span class="nd">@t</span><span class="o">.</span><span class="n">overload</span> +</span><span id="L-4299"><a href="#L-4299"><span class="linenos">4299</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4300"><a href="#L-4300"><span class="linenos">4300</span></a> <span class="o">...</span> +</span><span id="L-4301"><a href="#L-4301"><span class="linenos">4301</span></a> +</span><span id="L-4302"><a href="#L-4302"><span class="linenos">4302</span></a> +</span><span id="L-4303"><a href="#L-4303"><span class="linenos">4303</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Table</span><span class="p">]:</span> +</span><span id="L-4304"><a href="#L-4304"><span class="linenos">4304</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4305"><a href="#L-4305"><span class="linenos">4305</span></a><span class="sd"> Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.</span> +</span><span id="L-4306"><a href="#L-4306"><span class="linenos">4306</span></a><span class="sd"> If a table is passed in then that table is returned.</span> +</span><span id="L-4307"><a href="#L-4307"><span class="linenos">4307</span></a> +</span><span id="L-4308"><a href="#L-4308"><span class="linenos">4308</span></a><span class="sd"> Args:</span> +</span><span id="L-4309"><a href="#L-4309"><span class="linenos">4309</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> </span><span id="L-4310"><a href="#L-4310"><span class="linenos">4310</span></a> </span><span id="L-4311"><a href="#L-4311"><span class="linenos">4311</span></a><span class="sd"> Returns:</span> -</span><span id="L-4312"><a href="#L-4312"><span class="linenos">4312</span></a><span class="sd"> Alias: the aliased expression</span> +</span><span id="L-4312"><a href="#L-4312"><span class="linenos">4312</span></a><span class="sd"> A table expression.</span> </span><span id="L-4313"><a href="#L-4313"><span class="linenos">4313</span></a><span class="sd"> """</span> -</span><span id="L-4314"><a href="#L-4314"><span class="linenos">4314</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4315"><a href="#L-4315"><span class="linenos">4315</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">)</span> -</span><span id="L-4316"><a href="#L-4316"><span class="linenos">4316</span></a> -</span><span id="L-4317"><a href="#L-4317"><span class="linenos">4317</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="L-4318"><a href="#L-4318"><span class="linenos">4318</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> -</span><span id="L-4319"><a href="#L-4319"><span class="linenos">4319</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">table_alias</span><span class="p">)</span> -</span><span id="L-4320"><a href="#L-4320"><span class="linenos">4320</span></a> -</span><span id="L-4321"><a href="#L-4321"><span class="linenos">4321</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> -</span><span id="L-4322"><a href="#L-4322"><span class="linenos">4322</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">table</span><span class="p">:</span> -</span><span id="L-4323"><a href="#L-4323"><span class="linenos">4323</span></a> <span class="n">table_alias</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">,</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">column</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">))</span> -</span><span id="L-4324"><a href="#L-4324"><span class="linenos">4324</span></a> -</span><span id="L-4325"><a href="#L-4325"><span class="linenos">4325</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="L-4314"><a href="#L-4314"><span class="linenos">4314</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="L-4315"><a href="#L-4315"><span class="linenos">4315</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="L-4316"><a href="#L-4316"><span class="linenos">4316</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-4317"><a href="#L-4317"><span class="linenos">4317</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for a table: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-4318"><a href="#L-4318"><span class="linenos">4318</span></a> +</span><span id="L-4319"><a href="#L-4319"><span class="linenos">4319</span></a> <span class="n">catalog</span><span class="p">,</span> <span class="n">db</span><span class="p">,</span> <span class="n">table_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> +</span><span id="L-4320"><a href="#L-4320"><span class="linenos">4320</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="n">catalog</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="L-4321"><a href="#L-4321"><span class="linenos">4321</span></a> +</span><span id="L-4322"><a href="#L-4322"><span class="linenos">4322</span></a> +</span><span id="L-4323"><a href="#L-4323"><span class="linenos">4323</span></a><span class="k">def</span> <span class="nf">to_column</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Column</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="L-4324"><a href="#L-4324"><span class="linenos">4324</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4325"><a href="#L-4325"><span class="linenos">4325</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> </span><span id="L-4326"><a href="#L-4326"><span class="linenos">4326</span></a> -</span><span id="L-4327"><a href="#L-4327"><span class="linenos">4327</span></a> <span class="c1"># We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in</span> -</span><span id="L-4328"><a href="#L-4328"><span class="linenos">4328</span></a> <span class="c1"># the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node</span> -</span><span id="L-4329"><a href="#L-4329"><span class="linenos">4329</span></a> <span class="c1"># for the complete Window expression.</span> -</span><span id="L-4330"><a href="#L-4330"><span class="linenos">4330</span></a> <span class="c1">#</span> -</span><span id="L-4331"><a href="#L-4331"><span class="linenos">4331</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> -</span><span id="L-4332"><a href="#L-4332"><span class="linenos">4332</span></a> -</span><span id="L-4333"><a href="#L-4333"><span class="linenos">4333</span></a> <span class="k">if</span> <span class="s2">"alias"</span> <span class="ow">in</span> <span class="n">exp</span><span class="o">.</span><span class="n">arg_types</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">exp</span><span class="p">,</span> <span class="n">Window</span><span class="p">):</span> -</span><span id="L-4334"><a href="#L-4334"><span class="linenos">4334</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">exp</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="L-4335"><a href="#L-4335"><span class="linenos">4335</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">alias</span><span class="p">)</span> -</span><span id="L-4336"><a href="#L-4336"><span class="linenos">4336</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="L-4337"><a href="#L-4337"><span class="linenos">4337</span></a> <span class="k">return</span> <span class="n">Alias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> -</span><span id="L-4338"><a href="#L-4338"><span class="linenos">4338</span></a> -</span><span id="L-4339"><a href="#L-4339"><span class="linenos">4339</span></a> -</span><span id="L-4340"><a href="#L-4340"><span class="linenos">4340</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="L-4341"><a href="#L-4341"><span class="linenos">4341</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4342"><a href="#L-4342"><span class="linenos">4342</span></a><span class="sd"> Build a subquery expression.</span> -</span><span id="L-4343"><a href="#L-4343"><span class="linenos">4343</span></a> -</span><span id="L-4344"><a href="#L-4344"><span class="linenos">4344</span></a><span class="sd"> Example:</span> -</span><span id="L-4345"><a href="#L-4345"><span class="linenos">4345</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> -</span><span id="L-4346"><a href="#L-4346"><span class="linenos">4346</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> -</span><span id="L-4347"><a href="#L-4347"><span class="linenos">4347</span></a> -</span><span id="L-4348"><a href="#L-4348"><span class="linenos">4348</span></a><span class="sd"> Args:</span> -</span><span id="L-4349"><a href="#L-4349"><span class="linenos">4349</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> -</span><span id="L-4350"><a href="#L-4350"><span class="linenos">4350</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="L-4351"><a href="#L-4351"><span class="linenos">4351</span></a><span class="sd"> alias (str | Expression): the alias name to use.</span> -</span><span id="L-4352"><a href="#L-4352"><span class="linenos">4352</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="L-4353"><a href="#L-4353"><span class="linenos">4353</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="L-4354"><a href="#L-4354"><span class="linenos">4354</span></a> -</span><span id="L-4355"><a href="#L-4355"><span class="linenos">4355</span></a><span class="sd"> Returns:</span> -</span><span id="L-4356"><a href="#L-4356"><span class="linenos">4356</span></a><span class="sd"> Select: a new select with the subquery expression included</span> -</span><span id="L-4357"><a href="#L-4357"><span class="linenos">4357</span></a><span class="sd"> """</span> +</span><span id="L-4327"><a href="#L-4327"><span class="linenos">4327</span></a><span class="sd"> If a column is passed in then that column is returned.</span> +</span><span id="L-4328"><a href="#L-4328"><span class="linenos">4328</span></a> +</span><span id="L-4329"><a href="#L-4329"><span class="linenos">4329</span></a><span class="sd"> Args:</span> +</span><span id="L-4330"><a href="#L-4330"><span class="linenos">4330</span></a><span class="sd"> sql_path: `[table].[column]` string</span> +</span><span id="L-4331"><a href="#L-4331"><span class="linenos">4331</span></a><span class="sd"> Returns:</span> +</span><span id="L-4332"><a href="#L-4332"><span class="linenos">4332</span></a><span class="sd"> Table: A column expression</span> +</span><span id="L-4333"><a href="#L-4333"><span class="linenos">4333</span></a><span class="sd"> """</span> +</span><span id="L-4334"><a href="#L-4334"><span class="linenos">4334</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> +</span><span id="L-4335"><a href="#L-4335"><span class="linenos">4335</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="L-4336"><a href="#L-4336"><span class="linenos">4336</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-4337"><a href="#L-4337"><span class="linenos">4337</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for column: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-4338"><a href="#L-4338"><span class="linenos">4338</span></a> <span class="n">table_name</span><span class="p">,</span> <span class="n">column_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> +</span><span id="L-4339"><a href="#L-4339"><span class="linenos">4339</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">column_name</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="L-4340"><a href="#L-4340"><span class="linenos">4340</span></a> +</span><span id="L-4341"><a href="#L-4341"><span class="linenos">4341</span></a> +</span><span id="L-4342"><a href="#L-4342"><span class="linenos">4342</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> +</span><span id="L-4343"><a href="#L-4343"><span class="linenos">4343</span></a> <span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="L-4344"><a href="#L-4344"><span class="linenos">4344</span></a> <span class="n">alias</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> +</span><span id="L-4345"><a href="#L-4345"><span class="linenos">4345</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="L-4346"><a href="#L-4346"><span class="linenos">4346</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4347"><a href="#L-4347"><span class="linenos">4347</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4348"><a href="#L-4348"><span class="linenos">4348</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="L-4349"><a href="#L-4349"><span class="linenos">4349</span></a><span class="p">):</span> +</span><span id="L-4350"><a href="#L-4350"><span class="linenos">4350</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> +</span><span id="L-4351"><a href="#L-4351"><span class="linenos">4351</span></a> +</span><span id="L-4352"><a href="#L-4352"><span class="linenos">4352</span></a><span class="sd"> Example:</span> +</span><span id="L-4353"><a href="#L-4353"><span class="linenos">4353</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> +</span><span id="L-4354"><a href="#L-4354"><span class="linenos">4354</span></a><span class="sd"> 'foo AS bar'</span> +</span><span id="L-4355"><a href="#L-4355"><span class="linenos">4355</span></a> +</span><span id="L-4356"><a href="#L-4356"><span class="linenos">4356</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> +</span><span id="L-4357"><a href="#L-4357"><span class="linenos">4357</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> </span><span id="L-4358"><a href="#L-4358"><span class="linenos">4358</span></a> -</span><span id="L-4359"><a href="#L-4359"><span class="linenos">4359</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> -</span><span id="L-4360"><a href="#L-4360"><span class="linenos">4360</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4361"><a href="#L-4361"><span class="linenos">4361</span></a> -</span><span id="L-4362"><a href="#L-4362"><span class="linenos">4362</span></a> -</span><span id="L-4363"><a href="#L-4363"><span class="linenos">4363</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> -</span><span id="L-4364"><a href="#L-4364"><span class="linenos">4364</span></a> <span class="n">col</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> -</span><span id="L-4365"><a href="#L-4365"><span class="linenos">4365</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4366"><a href="#L-4366"><span class="linenos">4366</span></a> <span class="n">schema</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4367"><a href="#L-4367"><span class="linenos">4367</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4368"><a href="#L-4368"><span class="linenos">4368</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="L-4369"><a href="#L-4369"><span class="linenos">4369</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4370"><a href="#L-4370"><span class="linenos">4370</span></a><span class="sd"> Build a Column.</span> -</span><span id="L-4371"><a href="#L-4371"><span class="linenos">4371</span></a> -</span><span id="L-4372"><a href="#L-4372"><span class="linenos">4372</span></a><span class="sd"> Args:</span> -</span><span id="L-4373"><a href="#L-4373"><span class="linenos">4373</span></a><span class="sd"> col: column name</span> -</span><span id="L-4374"><a href="#L-4374"><span class="linenos">4374</span></a><span class="sd"> table: table name</span> -</span><span id="L-4375"><a href="#L-4375"><span class="linenos">4375</span></a><span class="sd"> schema: schema name</span> -</span><span id="L-4376"><a href="#L-4376"><span class="linenos">4376</span></a><span class="sd"> quoted: whether or not to force quote each part</span> -</span><span id="L-4377"><a href="#L-4377"><span class="linenos">4377</span></a><span class="sd"> Returns:</span> -</span><span id="L-4378"><a href="#L-4378"><span class="linenos">4378</span></a><span class="sd"> Column: column instance</span> -</span><span id="L-4379"><a href="#L-4379"><span class="linenos">4379</span></a><span class="sd"> """</span> -</span><span id="L-4380"><a href="#L-4380"><span class="linenos">4380</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> -</span><span id="L-4381"><a href="#L-4381"><span class="linenos">4381</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">col</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4382"><a href="#L-4382"><span class="linenos">4382</span></a> <span class="n">table</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4383"><a href="#L-4383"><span class="linenos">4383</span></a> <span class="n">schema</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4384"><a href="#L-4384"><span class="linenos">4384</span></a> <span class="p">)</span> -</span><span id="L-4385"><a href="#L-4385"><span class="linenos">4385</span></a> -</span><span id="L-4386"><a href="#L-4386"><span class="linenos">4386</span></a> -</span><span id="L-4387"><a href="#L-4387"><span class="linenos">4387</span></a><span class="k">def</span> <span class="nf">cast</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">to</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Cast</span><span class="p">:</span> -</span><span id="L-4388"><a href="#L-4388"><span class="linenos">4388</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> -</span><span id="L-4389"><a href="#L-4389"><span class="linenos">4389</span></a> -</span><span id="L-4390"><a href="#L-4390"><span class="linenos">4390</span></a><span class="sd"> Example:</span> -</span><span id="L-4391"><a href="#L-4391"><span class="linenos">4391</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> -</span><span id="L-4392"><a href="#L-4392"><span class="linenos">4392</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> -</span><span id="L-4393"><a href="#L-4393"><span class="linenos">4393</span></a> -</span><span id="L-4394"><a href="#L-4394"><span class="linenos">4394</span></a><span class="sd"> Args:</span> -</span><span id="L-4395"><a href="#L-4395"><span class="linenos">4395</span></a><span class="sd"> expression: The expression to cast.</span> -</span><span id="L-4396"><a href="#L-4396"><span class="linenos">4396</span></a><span class="sd"> to: The datatype to cast to.</span> +</span><span id="L-4359"><a href="#L-4359"><span class="linenos">4359</span></a><span class="sd"> Args:</span> +</span><span id="L-4360"><a href="#L-4360"><span class="linenos">4360</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="L-4361"><a href="#L-4361"><span class="linenos">4361</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4362"><a href="#L-4362"><span class="linenos">4362</span></a><span class="sd"> alias: the alias name to use. If the name has</span> +</span><span id="L-4363"><a href="#L-4363"><span class="linenos">4363</span></a><span class="sd"> special characters it is quoted.</span> +</span><span id="L-4364"><a href="#L-4364"><span class="linenos">4364</span></a><span class="sd"> table: Whether or not to create a table alias, can also be a list of columns.</span> +</span><span id="L-4365"><a href="#L-4365"><span class="linenos">4365</span></a><span class="sd"> quoted: whether or not to quote the alias</span> +</span><span id="L-4366"><a href="#L-4366"><span class="linenos">4366</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="L-4367"><a href="#L-4367"><span class="linenos">4367</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="L-4368"><a href="#L-4368"><span class="linenos">4368</span></a> +</span><span id="L-4369"><a href="#L-4369"><span class="linenos">4369</span></a><span class="sd"> Returns:</span> +</span><span id="L-4370"><a href="#L-4370"><span class="linenos">4370</span></a><span class="sd"> Alias: the aliased expression</span> +</span><span id="L-4371"><a href="#L-4371"><span class="linenos">4371</span></a><span class="sd"> """</span> +</span><span id="L-4372"><a href="#L-4372"><span class="linenos">4372</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4373"><a href="#L-4373"><span class="linenos">4373</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">)</span> +</span><span id="L-4374"><a href="#L-4374"><span class="linenos">4374</span></a> +</span><span id="L-4375"><a href="#L-4375"><span class="linenos">4375</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="L-4376"><a href="#L-4376"><span class="linenos">4376</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> +</span><span id="L-4377"><a href="#L-4377"><span class="linenos">4377</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">table_alias</span><span class="p">)</span> +</span><span id="L-4378"><a href="#L-4378"><span class="linenos">4378</span></a> +</span><span id="L-4379"><a href="#L-4379"><span class="linenos">4379</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> +</span><span id="L-4380"><a href="#L-4380"><span class="linenos">4380</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">table</span><span class="p">:</span> +</span><span id="L-4381"><a href="#L-4381"><span class="linenos">4381</span></a> <span class="n">table_alias</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">,</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">column</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">))</span> +</span><span id="L-4382"><a href="#L-4382"><span class="linenos">4382</span></a> +</span><span id="L-4383"><a href="#L-4383"><span class="linenos">4383</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="L-4384"><a href="#L-4384"><span class="linenos">4384</span></a> +</span><span id="L-4385"><a href="#L-4385"><span class="linenos">4385</span></a> <span class="c1"># We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in</span> +</span><span id="L-4386"><a href="#L-4386"><span class="linenos">4386</span></a> <span class="c1"># the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node</span> +</span><span id="L-4387"><a href="#L-4387"><span class="linenos">4387</span></a> <span class="c1"># for the complete Window expression.</span> +</span><span id="L-4388"><a href="#L-4388"><span class="linenos">4388</span></a> <span class="c1">#</span> +</span><span id="L-4389"><a href="#L-4389"><span class="linenos">4389</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> +</span><span id="L-4390"><a href="#L-4390"><span class="linenos">4390</span></a> +</span><span id="L-4391"><a href="#L-4391"><span class="linenos">4391</span></a> <span class="k">if</span> <span class="s2">"alias"</span> <span class="ow">in</span> <span class="n">exp</span><span class="o">.</span><span class="n">arg_types</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">exp</span><span class="p">,</span> <span class="n">Window</span><span class="p">):</span> +</span><span id="L-4392"><a href="#L-4392"><span class="linenos">4392</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">exp</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="L-4393"><a href="#L-4393"><span class="linenos">4393</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">alias</span><span class="p">)</span> +</span><span id="L-4394"><a href="#L-4394"><span class="linenos">4394</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="L-4395"><a href="#L-4395"><span class="linenos">4395</span></a> <span class="k">return</span> <span class="n">Alias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> +</span><span id="L-4396"><a href="#L-4396"><span class="linenos">4396</span></a> </span><span id="L-4397"><a href="#L-4397"><span class="linenos">4397</span></a> -</span><span id="L-4398"><a href="#L-4398"><span class="linenos">4398</span></a><span class="sd"> Returns:</span> -</span><span id="L-4399"><a href="#L-4399"><span class="linenos">4399</span></a><span class="sd"> A cast node.</span> -</span><span id="L-4400"><a href="#L-4400"><span class="linenos">4400</span></a><span class="sd"> """</span> -</span><span id="L-4401"><a href="#L-4401"><span class="linenos">4401</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="L-4402"><a href="#L-4402"><span class="linenos">4402</span></a> <span class="k">return</span> <span class="n">Cast</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">to</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> -</span><span id="L-4403"><a href="#L-4403"><span class="linenos">4403</span></a> -</span><span id="L-4404"><a href="#L-4404"><span class="linenos">4404</span></a> -</span><span id="L-4405"><a href="#L-4405"><span class="linenos">4405</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> -</span><span id="L-4406"><a href="#L-4406"><span class="linenos">4406</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> -</span><span id="L-4407"><a href="#L-4407"><span class="linenos">4407</span></a> -</span><span id="L-4408"><a href="#L-4408"><span class="linenos">4408</span></a><span class="sd"> Args:</span> -</span><span id="L-4409"><a href="#L-4409"><span class="linenos">4409</span></a><span class="sd"> table (str | Expression): column name</span> -</span><span id="L-4410"><a href="#L-4410"><span class="linenos">4410</span></a><span class="sd"> db (str | Expression): db name</span> -</span><span id="L-4411"><a href="#L-4411"><span class="linenos">4411</span></a><span class="sd"> catalog (str | Expression): catalog name</span> +</span><span id="L-4398"><a href="#L-4398"><span class="linenos">4398</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="L-4399"><a href="#L-4399"><span class="linenos">4399</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4400"><a href="#L-4400"><span class="linenos">4400</span></a><span class="sd"> Build a subquery expression.</span> +</span><span id="L-4401"><a href="#L-4401"><span class="linenos">4401</span></a> +</span><span id="L-4402"><a href="#L-4402"><span class="linenos">4402</span></a><span class="sd"> Example:</span> +</span><span id="L-4403"><a href="#L-4403"><span class="linenos">4403</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> +</span><span id="L-4404"><a href="#L-4404"><span class="linenos">4404</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> +</span><span id="L-4405"><a href="#L-4405"><span class="linenos">4405</span></a> +</span><span id="L-4406"><a href="#L-4406"><span class="linenos">4406</span></a><span class="sd"> Args:</span> +</span><span id="L-4407"><a href="#L-4407"><span class="linenos">4407</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> +</span><span id="L-4408"><a href="#L-4408"><span class="linenos">4408</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="L-4409"><a href="#L-4409"><span class="linenos">4409</span></a><span class="sd"> alias (str | Expression): the alias name to use.</span> +</span><span id="L-4410"><a href="#L-4410"><span class="linenos">4410</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="L-4411"><a href="#L-4411"><span class="linenos">4411</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> </span><span id="L-4412"><a href="#L-4412"><span class="linenos">4412</span></a> </span><span id="L-4413"><a href="#L-4413"><span class="linenos">4413</span></a><span class="sd"> Returns:</span> -</span><span id="L-4414"><a href="#L-4414"><span class="linenos">4414</span></a><span class="sd"> Table: table instance</span> +</span><span id="L-4414"><a href="#L-4414"><span class="linenos">4414</span></a><span class="sd"> Select: a new select with the subquery expression included</span> </span><span id="L-4415"><a href="#L-4415"><span class="linenos">4415</span></a><span class="sd"> """</span> -</span><span id="L-4416"><a href="#L-4416"><span class="linenos">4416</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> -</span><span id="L-4417"><a href="#L-4417"><span class="linenos">4417</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4418"><a href="#L-4418"><span class="linenos">4418</span></a> <span class="n">db</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4419"><a href="#L-4419"><span class="linenos">4419</span></a> <span class="n">catalog</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">catalog</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="L-4420"><a href="#L-4420"><span class="linenos">4420</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">))</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4421"><a href="#L-4421"><span class="linenos">4421</span></a> <span class="p">)</span> -</span><span id="L-4422"><a href="#L-4422"><span class="linenos">4422</span></a> -</span><span id="L-4423"><a href="#L-4423"><span class="linenos">4423</span></a> -</span><span id="L-4424"><a href="#L-4424"><span class="linenos">4424</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> -</span><span id="L-4425"><a href="#L-4425"><span class="linenos">4425</span></a> <span class="n">values</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="o">...</span><span class="p">]],</span> -</span><span id="L-4426"><a href="#L-4426"><span class="linenos">4426</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4427"><a href="#L-4427"><span class="linenos">4427</span></a> <span class="n">columns</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">DataType</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="L-4428"><a href="#L-4428"><span class="linenos">4428</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> -</span><span id="L-4429"><a href="#L-4429"><span class="linenos">4429</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> -</span><span id="L-4430"><a href="#L-4430"><span class="linenos">4430</span></a> -</span><span id="L-4431"><a href="#L-4431"><span class="linenos">4431</span></a><span class="sd"> Example:</span> -</span><span id="L-4432"><a href="#L-4432"><span class="linenos">4432</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> -</span><span id="L-4433"><a href="#L-4433"><span class="linenos">4433</span></a><span class="sd"> "VALUES (1, '2')"</span> -</span><span id="L-4434"><a href="#L-4434"><span class="linenos">4434</span></a> -</span><span id="L-4435"><a href="#L-4435"><span class="linenos">4435</span></a><span class="sd"> Args:</span> -</span><span id="L-4436"><a href="#L-4436"><span class="linenos">4436</span></a><span class="sd"> values: values statements that will be converted to SQL</span> -</span><span id="L-4437"><a href="#L-4437"><span class="linenos">4437</span></a><span class="sd"> alias: optional alias</span> -</span><span id="L-4438"><a href="#L-4438"><span class="linenos">4438</span></a><span class="sd"> columns: Optional list of ordered column names or ordered dictionary of column names to types.</span> -</span><span id="L-4439"><a href="#L-4439"><span class="linenos">4439</span></a><span class="sd"> If either are provided then an alias is also required.</span> -</span><span id="L-4440"><a href="#L-4440"><span class="linenos">4440</span></a><span class="sd"> If a dictionary is provided then the first column of the values will be casted to the expected type</span> -</span><span id="L-4441"><a href="#L-4441"><span class="linenos">4441</span></a><span class="sd"> in order to help with type inference.</span> -</span><span id="L-4442"><a href="#L-4442"><span class="linenos">4442</span></a> -</span><span id="L-4443"><a href="#L-4443"><span class="linenos">4443</span></a><span class="sd"> Returns:</span> -</span><span id="L-4444"><a href="#L-4444"><span class="linenos">4444</span></a><span class="sd"> Values: the Values expression object</span> -</span><span id="L-4445"><a href="#L-4445"><span class="linenos">4445</span></a><span class="sd"> """</span> -</span><span id="L-4446"><a href="#L-4446"><span class="linenos">4446</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">alias</span><span class="p">:</span> -</span><span id="L-4447"><a href="#L-4447"><span class="linenos">4447</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Alias is required when providing columns"</span><span class="p">)</span> -</span><span id="L-4448"><a href="#L-4448"><span class="linenos">4448</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="p">(</span> -</span><span id="L-4449"><a href="#L-4449"><span class="linenos">4449</span></a> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">),</span> <span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">columns</span><span class="p">])</span> -</span><span id="L-4450"><a href="#L-4450"><span class="linenos">4450</span></a> <span class="k">if</span> <span class="n">columns</span> -</span><span id="L-4451"><a href="#L-4451"><span class="linenos">4451</span></a> <span class="k">else</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="L-4452"><a href="#L-4452"><span class="linenos">4452</span></a> <span class="p">)</span> -</span><span id="L-4453"><a href="#L-4453"><span class="linenos">4453</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">tup</span><span class="p">)</span> <span class="k">for</span> <span class="n">tup</span> <span class="ow">in</span> <span class="n">values</span><span class="p">]</span> -</span><span id="L-4454"><a href="#L-4454"><span class="linenos">4454</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">columns</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> -</span><span id="L-4455"><a href="#L-4455"><span class="linenos">4455</span></a> <span class="n">types</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">columns</span><span class="o">.</span><span class="n">values</span><span class="p">())</span> -</span><span id="L-4456"><a href="#L-4456"><span class="linenos">4456</span></a> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="L-4457"><a href="#L-4457"><span class="linenos">4457</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="L-4458"><a href="#L-4458"><span class="linenos">4458</span></a> <span class="p">[</span><span class="n">cast</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">types</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span><span class="p">)],</span> -</span><span id="L-4459"><a href="#L-4459"><span class="linenos">4459</span></a> <span class="p">)</span> -</span><span id="L-4460"><a href="#L-4460"><span class="linenos">4460</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> -</span><span id="L-4461"><a href="#L-4461"><span class="linenos">4461</span></a> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="L-4462"><a href="#L-4462"><span class="linenos">4462</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">table_alias</span><span class="p">,</span> -</span><span id="L-4463"><a href="#L-4463"><span class="linenos">4463</span></a> <span class="p">)</span> -</span><span id="L-4464"><a href="#L-4464"><span class="linenos">4464</span></a> +</span><span id="L-4416"><a href="#L-4416"><span class="linenos">4416</span></a> +</span><span id="L-4417"><a href="#L-4417"><span class="linenos">4417</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> +</span><span id="L-4418"><a href="#L-4418"><span class="linenos">4418</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4419"><a href="#L-4419"><span class="linenos">4419</span></a> +</span><span id="L-4420"><a href="#L-4420"><span class="linenos">4420</span></a> +</span><span id="L-4421"><a href="#L-4421"><span class="linenos">4421</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> +</span><span id="L-4422"><a href="#L-4422"><span class="linenos">4422</span></a> <span class="n">col</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> +</span><span id="L-4423"><a href="#L-4423"><span class="linenos">4423</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4424"><a href="#L-4424"><span class="linenos">4424</span></a> <span class="n">schema</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4425"><a href="#L-4425"><span class="linenos">4425</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4426"><a href="#L-4426"><span class="linenos">4426</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="L-4427"><a href="#L-4427"><span class="linenos">4427</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4428"><a href="#L-4428"><span class="linenos">4428</span></a><span class="sd"> Build a Column.</span> +</span><span id="L-4429"><a href="#L-4429"><span class="linenos">4429</span></a> +</span><span id="L-4430"><a href="#L-4430"><span class="linenos">4430</span></a><span class="sd"> Args:</span> +</span><span id="L-4431"><a href="#L-4431"><span class="linenos">4431</span></a><span class="sd"> col: column name</span> +</span><span id="L-4432"><a href="#L-4432"><span class="linenos">4432</span></a><span class="sd"> table: table name</span> +</span><span id="L-4433"><a href="#L-4433"><span class="linenos">4433</span></a><span class="sd"> schema: schema name</span> +</span><span id="L-4434"><a href="#L-4434"><span class="linenos">4434</span></a><span class="sd"> quoted: whether or not to force quote each part</span> +</span><span id="L-4435"><a href="#L-4435"><span class="linenos">4435</span></a><span class="sd"> Returns:</span> +</span><span id="L-4436"><a href="#L-4436"><span class="linenos">4436</span></a><span class="sd"> Column: column instance</span> +</span><span id="L-4437"><a href="#L-4437"><span class="linenos">4437</span></a><span class="sd"> """</span> +</span><span id="L-4438"><a href="#L-4438"><span class="linenos">4438</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> +</span><span id="L-4439"><a href="#L-4439"><span class="linenos">4439</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">col</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4440"><a href="#L-4440"><span class="linenos">4440</span></a> <span class="n">table</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4441"><a href="#L-4441"><span class="linenos">4441</span></a> <span class="n">schema</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4442"><a href="#L-4442"><span class="linenos">4442</span></a> <span class="p">)</span> +</span><span id="L-4443"><a href="#L-4443"><span class="linenos">4443</span></a> +</span><span id="L-4444"><a href="#L-4444"><span class="linenos">4444</span></a> +</span><span id="L-4445"><a href="#L-4445"><span class="linenos">4445</span></a><span class="k">def</span> <span class="nf">cast</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">to</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Cast</span><span class="p">:</span> +</span><span id="L-4446"><a href="#L-4446"><span class="linenos">4446</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> +</span><span id="L-4447"><a href="#L-4447"><span class="linenos">4447</span></a> +</span><span id="L-4448"><a href="#L-4448"><span class="linenos">4448</span></a><span class="sd"> Example:</span> +</span><span id="L-4449"><a href="#L-4449"><span class="linenos">4449</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> +</span><span id="L-4450"><a href="#L-4450"><span class="linenos">4450</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> +</span><span id="L-4451"><a href="#L-4451"><span class="linenos">4451</span></a> +</span><span id="L-4452"><a href="#L-4452"><span class="linenos">4452</span></a><span class="sd"> Args:</span> +</span><span id="L-4453"><a href="#L-4453"><span class="linenos">4453</span></a><span class="sd"> expression: The expression to cast.</span> +</span><span id="L-4454"><a href="#L-4454"><span class="linenos">4454</span></a><span class="sd"> to: The datatype to cast to.</span> +</span><span id="L-4455"><a href="#L-4455"><span class="linenos">4455</span></a> +</span><span id="L-4456"><a href="#L-4456"><span class="linenos">4456</span></a><span class="sd"> Returns:</span> +</span><span id="L-4457"><a href="#L-4457"><span class="linenos">4457</span></a><span class="sd"> A cast node.</span> +</span><span id="L-4458"><a href="#L-4458"><span class="linenos">4458</span></a><span class="sd"> """</span> +</span><span id="L-4459"><a href="#L-4459"><span class="linenos">4459</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="L-4460"><a href="#L-4460"><span class="linenos">4460</span></a> <span class="k">return</span> <span class="n">Cast</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">to</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> +</span><span id="L-4461"><a href="#L-4461"><span class="linenos">4461</span></a> +</span><span id="L-4462"><a href="#L-4462"><span class="linenos">4462</span></a> +</span><span id="L-4463"><a href="#L-4463"><span class="linenos">4463</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="L-4464"><a href="#L-4464"><span class="linenos">4464</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> </span><span id="L-4465"><a href="#L-4465"><span class="linenos">4465</span></a> -</span><span id="L-4466"><a href="#L-4466"><span class="linenos">4466</span></a><span class="k">def</span> <span class="nf">var</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> -</span><span id="L-4467"><a href="#L-4467"><span class="linenos">4467</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> -</span><span id="L-4468"><a href="#L-4468"><span class="linenos">4468</span></a> -</span><span id="L-4469"><a href="#L-4469"><span class="linenos">4469</span></a><span class="sd"> Example:</span> -</span><span id="L-4470"><a href="#L-4470"><span class="linenos">4470</span></a><span class="sd"> >>> repr(var('x'))</span> -</span><span id="L-4471"><a href="#L-4471"><span class="linenos">4471</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="L-4472"><a href="#L-4472"><span class="linenos">4472</span></a> -</span><span id="L-4473"><a href="#L-4473"><span class="linenos">4473</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> -</span><span id="L-4474"><a href="#L-4474"><span class="linenos">4474</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="L-4475"><a href="#L-4475"><span class="linenos">4475</span></a> -</span><span id="L-4476"><a href="#L-4476"><span class="linenos">4476</span></a><span class="sd"> Args:</span> -</span><span id="L-4477"><a href="#L-4477"><span class="linenos">4477</span></a><span class="sd"> name: The name of the var or an expression who's name will become the var.</span> -</span><span id="L-4478"><a href="#L-4478"><span class="linenos">4478</span></a> -</span><span id="L-4479"><a href="#L-4479"><span class="linenos">4479</span></a><span class="sd"> Returns:</span> -</span><span id="L-4480"><a href="#L-4480"><span class="linenos">4480</span></a><span class="sd"> The new variable node.</span> -</span><span id="L-4481"><a href="#L-4481"><span class="linenos">4481</span></a><span class="sd"> """</span> -</span><span id="L-4482"><a href="#L-4482"><span class="linenos">4482</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">name</span><span class="p">:</span> -</span><span id="L-4483"><a href="#L-4483"><span class="linenos">4483</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> -</span><span id="L-4484"><a href="#L-4484"><span class="linenos">4484</span></a> -</span><span id="L-4485"><a href="#L-4485"><span class="linenos">4485</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4486"><a href="#L-4486"><span class="linenos">4486</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">name</span> -</span><span id="L-4487"><a href="#L-4487"><span class="linenos">4487</span></a> <span class="k">return</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-4466"><a href="#L-4466"><span class="linenos">4466</span></a><span class="sd"> Args:</span> +</span><span id="L-4467"><a href="#L-4467"><span class="linenos">4467</span></a><span class="sd"> table (str | Expression): column name</span> +</span><span id="L-4468"><a href="#L-4468"><span class="linenos">4468</span></a><span class="sd"> db (str | Expression): db name</span> +</span><span id="L-4469"><a href="#L-4469"><span class="linenos">4469</span></a><span class="sd"> catalog (str | Expression): catalog name</span> +</span><span id="L-4470"><a href="#L-4470"><span class="linenos">4470</span></a> +</span><span id="L-4471"><a href="#L-4471"><span class="linenos">4471</span></a><span class="sd"> Returns:</span> +</span><span id="L-4472"><a href="#L-4472"><span class="linenos">4472</span></a><span class="sd"> Table: table instance</span> +</span><span id="L-4473"><a href="#L-4473"><span class="linenos">4473</span></a><span class="sd"> """</span> +</span><span id="L-4474"><a href="#L-4474"><span class="linenos">4474</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> +</span><span id="L-4475"><a href="#L-4475"><span class="linenos">4475</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4476"><a href="#L-4476"><span class="linenos">4476</span></a> <span class="n">db</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4477"><a href="#L-4477"><span class="linenos">4477</span></a> <span class="n">catalog</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">catalog</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="L-4478"><a href="#L-4478"><span class="linenos">4478</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">))</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4479"><a href="#L-4479"><span class="linenos">4479</span></a> <span class="p">)</span> +</span><span id="L-4480"><a href="#L-4480"><span class="linenos">4480</span></a> +</span><span id="L-4481"><a href="#L-4481"><span class="linenos">4481</span></a> +</span><span id="L-4482"><a href="#L-4482"><span class="linenos">4482</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> +</span><span id="L-4483"><a href="#L-4483"><span class="linenos">4483</span></a> <span class="n">values</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="o">...</span><span class="p">]],</span> +</span><span id="L-4484"><a href="#L-4484"><span class="linenos">4484</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4485"><a href="#L-4485"><span class="linenos">4485</span></a> <span class="n">columns</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">DataType</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="L-4486"><a href="#L-4486"><span class="linenos">4486</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> +</span><span id="L-4487"><a href="#L-4487"><span class="linenos">4487</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> </span><span id="L-4488"><a href="#L-4488"><span class="linenos">4488</span></a> -</span><span id="L-4489"><a href="#L-4489"><span class="linenos">4489</span></a> -</span><span id="L-4490"><a href="#L-4490"><span class="linenos">4490</span></a><span class="k">def</span> <span class="nf">rename_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="n">new_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">)</span> <span class="o">-></span> <span class="n">AlterTable</span><span class="p">:</span> -</span><span id="L-4491"><a href="#L-4491"><span class="linenos">4491</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="L-4489"><a href="#L-4489"><span class="linenos">4489</span></a><span class="sd"> Example:</span> +</span><span id="L-4490"><a href="#L-4490"><span class="linenos">4490</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> +</span><span id="L-4491"><a href="#L-4491"><span class="linenos">4491</span></a><span class="sd"> "VALUES (1, '2')"</span> </span><span id="L-4492"><a href="#L-4492"><span class="linenos">4492</span></a> </span><span id="L-4493"><a href="#L-4493"><span class="linenos">4493</span></a><span class="sd"> Args:</span> -</span><span id="L-4494"><a href="#L-4494"><span class="linenos">4494</span></a><span class="sd"> old_name: The old name of the table</span> -</span><span id="L-4495"><a href="#L-4495"><span class="linenos">4495</span></a><span class="sd"> new_name: The new name of the table</span> -</span><span id="L-4496"><a href="#L-4496"><span class="linenos">4496</span></a> -</span><span id="L-4497"><a href="#L-4497"><span class="linenos">4497</span></a><span class="sd"> Returns:</span> -</span><span id="L-4498"><a href="#L-4498"><span class="linenos">4498</span></a><span class="sd"> Alter table expression</span> -</span><span id="L-4499"><a href="#L-4499"><span class="linenos">4499</span></a><span class="sd"> """</span> -</span><span id="L-4500"><a href="#L-4500"><span class="linenos">4500</span></a> <span class="n">old_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">)</span> -</span><span id="L-4501"><a href="#L-4501"><span class="linenos">4501</span></a> <span class="n">new_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="L-4502"><a href="#L-4502"><span class="linenos">4502</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> -</span><span id="L-4503"><a href="#L-4503"><span class="linenos">4503</span></a> <span class="n">this</span><span class="o">=</span><span class="n">old_table</span><span class="p">,</span> -</span><span id="L-4504"><a href="#L-4504"><span class="linenos">4504</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> -</span><span id="L-4505"><a href="#L-4505"><span class="linenos">4505</span></a> <span class="n">RenameTable</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">new_table</span><span class="p">),</span> -</span><span id="L-4506"><a href="#L-4506"><span class="linenos">4506</span></a> <span class="p">],</span> -</span><span id="L-4507"><a href="#L-4507"><span class="linenos">4507</span></a> <span class="p">)</span> -</span><span id="L-4508"><a href="#L-4508"><span class="linenos">4508</span></a> -</span><span id="L-4509"><a href="#L-4509"><span class="linenos">4509</span></a> -</span><span id="L-4510"><a href="#L-4510"><span class="linenos">4510</span></a><span class="k">def</span> <span class="nf">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-4511"><a href="#L-4511"><span class="linenos">4511</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> -</span><span id="L-4512"><a href="#L-4512"><span class="linenos">4512</span></a> -</span><span id="L-4513"><a href="#L-4513"><span class="linenos">4513</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> -</span><span id="L-4514"><a href="#L-4514"><span class="linenos">4514</span></a> -</span><span id="L-4515"><a href="#L-4515"><span class="linenos">4515</span></a><span class="sd"> Args:</span> -</span><span id="L-4516"><a href="#L-4516"><span class="linenos">4516</span></a><span class="sd"> value (Any): a python object</span> -</span><span id="L-4517"><a href="#L-4517"><span class="linenos">4517</span></a> -</span><span id="L-4518"><a href="#L-4518"><span class="linenos">4518</span></a><span class="sd"> Returns:</span> -</span><span id="L-4519"><a href="#L-4519"><span class="linenos">4519</span></a><span class="sd"> Expression: the equivalent expression object</span> -</span><span id="L-4520"><a href="#L-4520"><span class="linenos">4520</span></a><span class="sd"> """</span> -</span><span id="L-4521"><a href="#L-4521"><span class="linenos">4521</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4522"><a href="#L-4522"><span class="linenos">4522</span></a> <span class="k">return</span> <span class="n">value</span> -</span><span id="L-4523"><a href="#L-4523"><span class="linenos">4523</span></a> <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="L-4524"><a href="#L-4524"><span class="linenos">4524</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="L-4525"><a href="#L-4525"><span class="linenos">4525</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> -</span><span id="L-4526"><a href="#L-4526"><span class="linenos">4526</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">value</span><span class="p">)</span> -</span><span id="L-4527"><a href="#L-4527"><span class="linenos">4527</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="L-4528"><a href="#L-4528"><span class="linenos">4528</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="L-4529"><a href="#L-4529"><span class="linenos">4529</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">float</span><span class="p">)</span> <span class="ow">and</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">value</span><span class="p">):</span> -</span><span id="L-4530"><a href="#L-4530"><span class="linenos">4530</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="L-4531"><a href="#L-4531"><span class="linenos">4531</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">numbers</span><span class="o">.</span><span class="n">Number</span><span class="p">):</span> -</span><span id="L-4532"><a href="#L-4532"><span class="linenos">4532</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="L-4533"><a href="#L-4533"><span class="linenos">4533</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span> -</span><span id="L-4534"><a href="#L-4534"><span class="linenos">4534</span></a> <span class="k">return</span> <span class="n">Tuple</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> -</span><span id="L-4535"><a href="#L-4535"><span class="linenos">4535</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="L-4536"><a href="#L-4536"><span class="linenos">4536</span></a> <span class="k">return</span> <span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> -</span><span id="L-4537"><a href="#L-4537"><span class="linenos">4537</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> -</span><span id="L-4538"><a href="#L-4538"><span class="linenos">4538</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> -</span><span id="L-4539"><a href="#L-4539"><span class="linenos">4539</span></a> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">value</span><span class="p">],</span> -</span><span id="L-4540"><a href="#L-4540"><span class="linenos">4540</span></a> <span class="n">values</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">values</span><span class="p">()],</span> -</span><span id="L-4541"><a href="#L-4541"><span class="linenos">4541</span></a> <span class="p">)</span> -</span><span id="L-4542"><a href="#L-4542"><span class="linenos">4542</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">):</span> -</span><span id="L-4543"><a href="#L-4543"><span class="linenos">4543</span></a> <span class="n">datetime_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span> -</span><span id="L-4544"><a href="#L-4544"><span class="linenos">4544</span></a> <span class="p">(</span><span class="n">value</span> <span class="k">if</span> <span class="n">value</span><span class="o">.</span><span class="n">tzinfo</span> <span class="k">else</span> <span class="n">value</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">tzinfo</span><span class="o">=</span><span class="n">datetime</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()</span> -</span><span id="L-4545"><a href="#L-4545"><span class="linenos">4545</span></a> <span class="p">)</span> -</span><span id="L-4546"><a href="#L-4546"><span class="linenos">4546</span></a> <span class="k">return</span> <span class="n">TimeStrToTime</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">datetime_literal</span><span class="p">)</span> -</span><span id="L-4547"><a href="#L-4547"><span class="linenos">4547</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="p">):</span> -</span><span id="L-4548"><a href="#L-4548"><span class="linenos">4548</span></a> <span class="n">date_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">))</span> -</span><span id="L-4549"><a href="#L-4549"><span class="linenos">4549</span></a> <span class="k">return</span> <span class="n">DateStrToDate</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">date_literal</span><span class="p">)</span> -</span><span id="L-4550"><a href="#L-4550"><span class="linenos">4550</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-4551"><a href="#L-4551"><span class="linenos">4551</span></a> -</span><span id="L-4552"><a href="#L-4552"><span class="linenos">4552</span></a> -</span><span id="L-4553"><a href="#L-4553"><span class="linenos">4553</span></a><span class="k">def</span> <span class="nf">replace_children</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">):</span> -</span><span id="L-4554"><a href="#L-4554"><span class="linenos">4554</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4555"><a href="#L-4555"><span class="linenos">4555</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> -</span><span id="L-4556"><a href="#L-4556"><span class="linenos">4556</span></a><span class="sd"> """</span> -</span><span id="L-4557"><a href="#L-4557"><span class="linenos">4557</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="L-4558"><a href="#L-4558"><span class="linenos">4558</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> -</span><span id="L-4559"><a href="#L-4559"><span class="linenos">4559</span></a> -</span><span id="L-4560"><a href="#L-4560"><span class="linenos">4560</span></a> <span class="n">child_nodes</span> <span class="o">=</span> <span class="n">v</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="p">[</span><span class="n">v</span><span class="p">]</span> -</span><span id="L-4561"><a href="#L-4561"><span class="linenos">4561</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="L-4562"><a href="#L-4562"><span class="linenos">4562</span></a> -</span><span id="L-4563"><a href="#L-4563"><span class="linenos">4563</span></a> <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="n">child_nodes</span><span class="p">:</span> -</span><span id="L-4564"><a href="#L-4564"><span class="linenos">4564</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4565"><a href="#L-4565"><span class="linenos">4565</span></a> <span class="k">for</span> <span class="n">child_node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">fun</span><span class="p">(</span><span class="n">cn</span><span class="p">)):</span> -</span><span id="L-4566"><a href="#L-4566"><span class="linenos">4566</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">child_node</span><span class="p">)</span> -</span><span id="L-4567"><a href="#L-4567"><span class="linenos">4567</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">expression</span> -</span><span id="L-4568"><a href="#L-4568"><span class="linenos">4568</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">k</span> -</span><span id="L-4569"><a href="#L-4569"><span class="linenos">4569</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-4570"><a href="#L-4570"><span class="linenos">4570</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cn</span><span class="p">)</span> -</span><span id="L-4571"><a href="#L-4571"><span class="linenos">4571</span></a> -</span><span id="L-4572"><a href="#L-4572"><span class="linenos">4572</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_child_nodes</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">new_child_nodes</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> -</span><span id="L-4573"><a href="#L-4573"><span class="linenos">4573</span></a> -</span><span id="L-4574"><a href="#L-4574"><span class="linenos">4574</span></a> -</span><span id="L-4575"><a href="#L-4575"><span class="linenos">4575</span></a><span class="k">def</span> <span class="nf">column_table_names</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> -</span><span id="L-4576"><a href="#L-4576"><span class="linenos">4576</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4577"><a href="#L-4577"><span class="linenos">4577</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> -</span><span id="L-4578"><a href="#L-4578"><span class="linenos">4578</span></a> -</span><span id="L-4579"><a href="#L-4579"><span class="linenos">4579</span></a><span class="sd"> Example:</span> -</span><span id="L-4580"><a href="#L-4580"><span class="linenos">4580</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="L-4581"><a href="#L-4581"><span class="linenos">4581</span></a><span class="sd"> >>> column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e"))</span> -</span><span id="L-4582"><a href="#L-4582"><span class="linenos">4582</span></a><span class="sd"> ['c', 'a']</span> -</span><span id="L-4583"><a href="#L-4583"><span class="linenos">4583</span></a> -</span><span id="L-4584"><a href="#L-4584"><span class="linenos">4584</span></a><span class="sd"> Args:</span> -</span><span id="L-4585"><a href="#L-4585"><span class="linenos">4585</span></a><span class="sd"> expression (sqlglot.Expression): expression to find table names</span> -</span><span id="L-4586"><a href="#L-4586"><span class="linenos">4586</span></a> -</span><span id="L-4587"><a href="#L-4587"><span class="linenos">4587</span></a><span class="sd"> Returns:</span> -</span><span id="L-4588"><a href="#L-4588"><span class="linenos">4588</span></a><span class="sd"> list: A list of unique names</span> -</span><span id="L-4589"><a href="#L-4589"><span class="linenos">4589</span></a><span class="sd"> """</span> -</span><span id="L-4590"><a href="#L-4590"><span class="linenos">4590</span></a> <span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">dict</span><span class="o">.</span><span class="n">fromkeys</span><span class="p">(</span><span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">Column</span><span class="p">)))</span> -</span><span id="L-4591"><a href="#L-4591"><span class="linenos">4591</span></a> -</span><span id="L-4592"><a href="#L-4592"><span class="linenos">4592</span></a> -</span><span id="L-4593"><a href="#L-4593"><span class="linenos">4593</span></a><span class="k">def</span> <span class="nf">table_name</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="L-4594"><a href="#L-4594"><span class="linenos">4594</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> -</span><span id="L-4595"><a href="#L-4595"><span class="linenos">4595</span></a> -</span><span id="L-4596"><a href="#L-4596"><span class="linenos">4596</span></a><span class="sd"> Args:</span> -</span><span id="L-4597"><a href="#L-4597"><span class="linenos">4597</span></a><span class="sd"> table (exp.Table | str): table expression node or string.</span> -</span><span id="L-4598"><a href="#L-4598"><span class="linenos">4598</span></a> -</span><span id="L-4599"><a href="#L-4599"><span class="linenos">4599</span></a><span class="sd"> Examples:</span> -</span><span id="L-4600"><a href="#L-4600"><span class="linenos">4600</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-4601"><a href="#L-4601"><span class="linenos">4601</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> -</span><span id="L-4602"><a href="#L-4602"><span class="linenos">4602</span></a><span class="sd"> 'a.b.c'</span> -</span><span id="L-4603"><a href="#L-4603"><span class="linenos">4603</span></a> -</span><span id="L-4604"><a href="#L-4604"><span class="linenos">4604</span></a><span class="sd"> Returns:</span> -</span><span id="L-4605"><a href="#L-4605"><span class="linenos">4605</span></a><span class="sd"> The table name.</span> -</span><span id="L-4606"><a href="#L-4606"><span class="linenos">4606</span></a><span class="sd"> """</span> -</span><span id="L-4607"><a href="#L-4607"><span class="linenos">4607</span></a> -</span><span id="L-4608"><a href="#L-4608"><span class="linenos">4608</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">)</span> +</span><span id="L-4494"><a href="#L-4494"><span class="linenos">4494</span></a><span class="sd"> values: values statements that will be converted to SQL</span> +</span><span id="L-4495"><a href="#L-4495"><span class="linenos">4495</span></a><span class="sd"> alias: optional alias</span> +</span><span id="L-4496"><a href="#L-4496"><span class="linenos">4496</span></a><span class="sd"> columns: Optional list of ordered column names or ordered dictionary of column names to types.</span> +</span><span id="L-4497"><a href="#L-4497"><span class="linenos">4497</span></a><span class="sd"> If either are provided then an alias is also required.</span> +</span><span id="L-4498"><a href="#L-4498"><span class="linenos">4498</span></a><span class="sd"> If a dictionary is provided then the first column of the values will be casted to the expected type</span> +</span><span id="L-4499"><a href="#L-4499"><span class="linenos">4499</span></a><span class="sd"> in order to help with type inference.</span> +</span><span id="L-4500"><a href="#L-4500"><span class="linenos">4500</span></a> +</span><span id="L-4501"><a href="#L-4501"><span class="linenos">4501</span></a><span class="sd"> Returns:</span> +</span><span id="L-4502"><a href="#L-4502"><span class="linenos">4502</span></a><span class="sd"> Values: the Values expression object</span> +</span><span id="L-4503"><a href="#L-4503"><span class="linenos">4503</span></a><span class="sd"> """</span> +</span><span id="L-4504"><a href="#L-4504"><span class="linenos">4504</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">alias</span><span class="p">:</span> +</span><span id="L-4505"><a href="#L-4505"><span class="linenos">4505</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Alias is required when providing columns"</span><span class="p">)</span> +</span><span id="L-4506"><a href="#L-4506"><span class="linenos">4506</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="p">(</span> +</span><span id="L-4507"><a href="#L-4507"><span class="linenos">4507</span></a> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">),</span> <span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">columns</span><span class="p">])</span> +</span><span id="L-4508"><a href="#L-4508"><span class="linenos">4508</span></a> <span class="k">if</span> <span class="n">columns</span> +</span><span id="L-4509"><a href="#L-4509"><span class="linenos">4509</span></a> <span class="k">else</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="L-4510"><a href="#L-4510"><span class="linenos">4510</span></a> <span class="p">)</span> +</span><span id="L-4511"><a href="#L-4511"><span class="linenos">4511</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">tup</span><span class="p">)</span> <span class="k">for</span> <span class="n">tup</span> <span class="ow">in</span> <span class="n">values</span><span class="p">]</span> +</span><span id="L-4512"><a href="#L-4512"><span class="linenos">4512</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">columns</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> +</span><span id="L-4513"><a href="#L-4513"><span class="linenos">4513</span></a> <span class="n">types</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">columns</span><span class="o">.</span><span class="n">values</span><span class="p">())</span> +</span><span id="L-4514"><a href="#L-4514"><span class="linenos">4514</span></a> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="L-4515"><a href="#L-4515"><span class="linenos">4515</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="L-4516"><a href="#L-4516"><span class="linenos">4516</span></a> <span class="p">[</span><span class="n">cast</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">types</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span><span class="p">)],</span> +</span><span id="L-4517"><a href="#L-4517"><span class="linenos">4517</span></a> <span class="p">)</span> +</span><span id="L-4518"><a href="#L-4518"><span class="linenos">4518</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> +</span><span id="L-4519"><a href="#L-4519"><span class="linenos">4519</span></a> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="L-4520"><a href="#L-4520"><span class="linenos">4520</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">table_alias</span><span class="p">,</span> +</span><span id="L-4521"><a href="#L-4521"><span class="linenos">4521</span></a> <span class="p">)</span> +</span><span id="L-4522"><a href="#L-4522"><span class="linenos">4522</span></a> +</span><span id="L-4523"><a href="#L-4523"><span class="linenos">4523</span></a> +</span><span id="L-4524"><a href="#L-4524"><span class="linenos">4524</span></a><span class="k">def</span> <span class="nf">var</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> +</span><span id="L-4525"><a href="#L-4525"><span class="linenos">4525</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> +</span><span id="L-4526"><a href="#L-4526"><span class="linenos">4526</span></a> +</span><span id="L-4527"><a href="#L-4527"><span class="linenos">4527</span></a><span class="sd"> Example:</span> +</span><span id="L-4528"><a href="#L-4528"><span class="linenos">4528</span></a><span class="sd"> >>> repr(var('x'))</span> +</span><span id="L-4529"><a href="#L-4529"><span class="linenos">4529</span></a><span class="sd"> '(VAR this: x)'</span> +</span><span id="L-4530"><a href="#L-4530"><span class="linenos">4530</span></a> +</span><span id="L-4531"><a href="#L-4531"><span class="linenos">4531</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> +</span><span id="L-4532"><a href="#L-4532"><span class="linenos">4532</span></a><span class="sd"> '(VAR this: x)'</span> +</span><span id="L-4533"><a href="#L-4533"><span class="linenos">4533</span></a> +</span><span id="L-4534"><a href="#L-4534"><span class="linenos">4534</span></a><span class="sd"> Args:</span> +</span><span id="L-4535"><a href="#L-4535"><span class="linenos">4535</span></a><span class="sd"> name: The name of the var or an expression who's name will become the var.</span> +</span><span id="L-4536"><a href="#L-4536"><span class="linenos">4536</span></a> +</span><span id="L-4537"><a href="#L-4537"><span class="linenos">4537</span></a><span class="sd"> Returns:</span> +</span><span id="L-4538"><a href="#L-4538"><span class="linenos">4538</span></a><span class="sd"> The new variable node.</span> +</span><span id="L-4539"><a href="#L-4539"><span class="linenos">4539</span></a><span class="sd"> """</span> +</span><span id="L-4540"><a href="#L-4540"><span class="linenos">4540</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">name</span><span class="p">:</span> +</span><span id="L-4541"><a href="#L-4541"><span class="linenos">4541</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> +</span><span id="L-4542"><a href="#L-4542"><span class="linenos">4542</span></a> +</span><span id="L-4543"><a href="#L-4543"><span class="linenos">4543</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4544"><a href="#L-4544"><span class="linenos">4544</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">name</span> +</span><span id="L-4545"><a href="#L-4545"><span class="linenos">4545</span></a> <span class="k">return</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-4546"><a href="#L-4546"><span class="linenos">4546</span></a> +</span><span id="L-4547"><a href="#L-4547"><span class="linenos">4547</span></a> +</span><span id="L-4548"><a href="#L-4548"><span class="linenos">4548</span></a><span class="k">def</span> <span class="nf">rename_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="n">new_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">)</span> <span class="o">-></span> <span class="n">AlterTable</span><span class="p">:</span> +</span><span id="L-4549"><a href="#L-4549"><span class="linenos">4549</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="L-4550"><a href="#L-4550"><span class="linenos">4550</span></a> +</span><span id="L-4551"><a href="#L-4551"><span class="linenos">4551</span></a><span class="sd"> Args:</span> +</span><span id="L-4552"><a href="#L-4552"><span class="linenos">4552</span></a><span class="sd"> old_name: The old name of the table</span> +</span><span id="L-4553"><a href="#L-4553"><span class="linenos">4553</span></a><span class="sd"> new_name: The new name of the table</span> +</span><span id="L-4554"><a href="#L-4554"><span class="linenos">4554</span></a> +</span><span id="L-4555"><a href="#L-4555"><span class="linenos">4555</span></a><span class="sd"> Returns:</span> +</span><span id="L-4556"><a href="#L-4556"><span class="linenos">4556</span></a><span class="sd"> Alter table expression</span> +</span><span id="L-4557"><a href="#L-4557"><span class="linenos">4557</span></a><span class="sd"> """</span> +</span><span id="L-4558"><a href="#L-4558"><span class="linenos">4558</span></a> <span class="n">old_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">)</span> +</span><span id="L-4559"><a href="#L-4559"><span class="linenos">4559</span></a> <span class="n">new_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="L-4560"><a href="#L-4560"><span class="linenos">4560</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> +</span><span id="L-4561"><a href="#L-4561"><span class="linenos">4561</span></a> <span class="n">this</span><span class="o">=</span><span class="n">old_table</span><span class="p">,</span> +</span><span id="L-4562"><a href="#L-4562"><span class="linenos">4562</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> +</span><span id="L-4563"><a href="#L-4563"><span class="linenos">4563</span></a> <span class="n">RenameTable</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">new_table</span><span class="p">),</span> +</span><span id="L-4564"><a href="#L-4564"><span class="linenos">4564</span></a> <span class="p">],</span> +</span><span id="L-4565"><a href="#L-4565"><span class="linenos">4565</span></a> <span class="p">)</span> +</span><span id="L-4566"><a href="#L-4566"><span class="linenos">4566</span></a> +</span><span id="L-4567"><a href="#L-4567"><span class="linenos">4567</span></a> +</span><span id="L-4568"><a href="#L-4568"><span class="linenos">4568</span></a><span class="k">def</span> <span class="nf">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-4569"><a href="#L-4569"><span class="linenos">4569</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> +</span><span id="L-4570"><a href="#L-4570"><span class="linenos">4570</span></a> +</span><span id="L-4571"><a href="#L-4571"><span class="linenos">4571</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> +</span><span id="L-4572"><a href="#L-4572"><span class="linenos">4572</span></a> +</span><span id="L-4573"><a href="#L-4573"><span class="linenos">4573</span></a><span class="sd"> Args:</span> +</span><span id="L-4574"><a href="#L-4574"><span class="linenos">4574</span></a><span class="sd"> value (Any): a python object</span> +</span><span id="L-4575"><a href="#L-4575"><span class="linenos">4575</span></a> +</span><span id="L-4576"><a href="#L-4576"><span class="linenos">4576</span></a><span class="sd"> Returns:</span> +</span><span id="L-4577"><a href="#L-4577"><span class="linenos">4577</span></a><span class="sd"> Expression: the equivalent expression object</span> +</span><span id="L-4578"><a href="#L-4578"><span class="linenos">4578</span></a><span class="sd"> """</span> +</span><span id="L-4579"><a href="#L-4579"><span class="linenos">4579</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4580"><a href="#L-4580"><span class="linenos">4580</span></a> <span class="k">return</span> <span class="n">value</span> +</span><span id="L-4581"><a href="#L-4581"><span class="linenos">4581</span></a> <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="L-4582"><a href="#L-4582"><span class="linenos">4582</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="L-4583"><a href="#L-4583"><span class="linenos">4583</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> +</span><span id="L-4584"><a href="#L-4584"><span class="linenos">4584</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">value</span><span class="p">)</span> +</span><span id="L-4585"><a href="#L-4585"><span class="linenos">4585</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="L-4586"><a href="#L-4586"><span class="linenos">4586</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="L-4587"><a href="#L-4587"><span class="linenos">4587</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">float</span><span class="p">)</span> <span class="ow">and</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">value</span><span class="p">):</span> +</span><span id="L-4588"><a href="#L-4588"><span class="linenos">4588</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="L-4589"><a href="#L-4589"><span class="linenos">4589</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">numbers</span><span class="o">.</span><span class="n">Number</span><span class="p">):</span> +</span><span id="L-4590"><a href="#L-4590"><span class="linenos">4590</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="L-4591"><a href="#L-4591"><span class="linenos">4591</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span> +</span><span id="L-4592"><a href="#L-4592"><span class="linenos">4592</span></a> <span class="k">return</span> <span class="n">Tuple</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> +</span><span id="L-4593"><a href="#L-4593"><span class="linenos">4593</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="L-4594"><a href="#L-4594"><span class="linenos">4594</span></a> <span class="k">return</span> <span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> +</span><span id="L-4595"><a href="#L-4595"><span class="linenos">4595</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> +</span><span id="L-4596"><a href="#L-4596"><span class="linenos">4596</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> +</span><span id="L-4597"><a href="#L-4597"><span class="linenos">4597</span></a> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">value</span><span class="p">],</span> +</span><span id="L-4598"><a href="#L-4598"><span class="linenos">4598</span></a> <span class="n">values</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">values</span><span class="p">()],</span> +</span><span id="L-4599"><a href="#L-4599"><span class="linenos">4599</span></a> <span class="p">)</span> +</span><span id="L-4600"><a href="#L-4600"><span class="linenos">4600</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">):</span> +</span><span id="L-4601"><a href="#L-4601"><span class="linenos">4601</span></a> <span class="n">datetime_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span> +</span><span id="L-4602"><a href="#L-4602"><span class="linenos">4602</span></a> <span class="p">(</span><span class="n">value</span> <span class="k">if</span> <span class="n">value</span><span class="o">.</span><span class="n">tzinfo</span> <span class="k">else</span> <span class="n">value</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">tzinfo</span><span class="o">=</span><span class="n">datetime</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()</span> +</span><span id="L-4603"><a href="#L-4603"><span class="linenos">4603</span></a> <span class="p">)</span> +</span><span id="L-4604"><a href="#L-4604"><span class="linenos">4604</span></a> <span class="k">return</span> <span class="n">TimeStrToTime</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">datetime_literal</span><span class="p">)</span> +</span><span id="L-4605"><a href="#L-4605"><span class="linenos">4605</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="p">):</span> +</span><span id="L-4606"><a href="#L-4606"><span class="linenos">4606</span></a> <span class="n">date_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">))</span> +</span><span id="L-4607"><a href="#L-4607"><span class="linenos">4607</span></a> <span class="k">return</span> <span class="n">DateStrToDate</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">date_literal</span><span class="p">)</span> +</span><span id="L-4608"><a href="#L-4608"><span class="linenos">4608</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> </span><span id="L-4609"><a href="#L-4609"><span class="linenos">4609</span></a> -</span><span id="L-4610"><a href="#L-4610"><span class="linenos">4610</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table</span><span class="p">:</span> -</span><span id="L-4611"><a href="#L-4611"><span class="linenos">4611</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot parse </span><span class="si">{</span><span class="n">table</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="L-4612"><a href="#L-4612"><span class="linenos">4612</span></a> -</span><span id="L-4613"><a href="#L-4613"><span class="linenos">4613</span></a> <span class="k">return</span> <span class="s2">"."</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> -</span><span id="L-4614"><a href="#L-4614"><span class="linenos">4614</span></a> <span class="n">part</span> -</span><span id="L-4615"><a href="#L-4615"><span class="linenos">4615</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span> -</span><span id="L-4616"><a href="#L-4616"><span class="linenos">4616</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">),</span> -</span><span id="L-4617"><a href="#L-4617"><span class="linenos">4617</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">),</span> -</span><span id="L-4618"><a href="#L-4618"><span class="linenos">4618</span></a> <span class="n">table</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> -</span><span id="L-4619"><a href="#L-4619"><span class="linenos">4619</span></a> <span class="p">)</span> -</span><span id="L-4620"><a href="#L-4620"><span class="linenos">4620</span></a> <span class="k">if</span> <span class="n">part</span> -</span><span id="L-4621"><a href="#L-4621"><span class="linenos">4621</span></a> <span class="p">)</span> -</span><span id="L-4622"><a href="#L-4622"><span class="linenos">4622</span></a> -</span><span id="L-4623"><a href="#L-4623"><span class="linenos">4623</span></a> -</span><span id="L-4624"><a href="#L-4624"><span class="linenos">4624</span></a><span class="k">def</span> <span class="nf">replace_tables</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">mapping</span><span class="p">):</span> -</span><span id="L-4625"><a href="#L-4625"><span class="linenos">4625</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> -</span><span id="L-4626"><a href="#L-4626"><span class="linenos">4626</span></a> -</span><span id="L-4627"><a href="#L-4627"><span class="linenos">4627</span></a><span class="sd"> Args:</span> -</span><span id="L-4628"><a href="#L-4628"><span class="linenos">4628</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> -</span><span id="L-4629"><a href="#L-4629"><span class="linenos">4629</span></a><span class="sd"> mapping (Dict[str, str]): mapping of table names.</span> -</span><span id="L-4630"><a href="#L-4630"><span class="linenos">4630</span></a> -</span><span id="L-4631"><a href="#L-4631"><span class="linenos">4631</span></a><span class="sd"> Examples:</span> -</span><span id="L-4632"><a href="#L-4632"><span class="linenos">4632</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-4633"><a href="#L-4633"><span class="linenos">4633</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> -</span><span id="L-4634"><a href="#L-4634"><span class="linenos">4634</span></a><span class="sd"> 'SELECT * FROM c'</span> -</span><span id="L-4635"><a href="#L-4635"><span class="linenos">4635</span></a> -</span><span id="L-4636"><a href="#L-4636"><span class="linenos">4636</span></a><span class="sd"> Returns:</span> -</span><span id="L-4637"><a href="#L-4637"><span class="linenos">4637</span></a><span class="sd"> The mapped expression.</span> -</span><span id="L-4638"><a href="#L-4638"><span class="linenos">4638</span></a><span class="sd"> """</span> -</span><span id="L-4639"><a href="#L-4639"><span class="linenos">4639</span></a> -</span><span id="L-4640"><a href="#L-4640"><span class="linenos">4640</span></a> <span class="k">def</span> <span class="nf">_replace_tables</span><span class="p">(</span><span class="n">node</span><span class="p">):</span> -</span><span id="L-4641"><a href="#L-4641"><span class="linenos">4641</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="L-4642"><a href="#L-4642"><span class="linenos">4642</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">mapping</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">))</span> -</span><span id="L-4643"><a href="#L-4643"><span class="linenos">4643</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="L-4644"><a href="#L-4644"><span class="linenos">4644</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> -</span><span id="L-4645"><a href="#L-4645"><span class="linenos">4645</span></a> <span class="n">new_name</span><span class="p">,</span> -</span><span id="L-4646"><a href="#L-4646"><span class="linenos">4646</span></a> <span class="o">**</span><span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">node</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">)},</span> -</span><span id="L-4647"><a href="#L-4647"><span class="linenos">4647</span></a> <span class="p">)</span> -</span><span id="L-4648"><a href="#L-4648"><span class="linenos">4648</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="L-4610"><a href="#L-4610"><span class="linenos">4610</span></a> +</span><span id="L-4611"><a href="#L-4611"><span class="linenos">4611</span></a><span class="k">def</span> <span class="nf">replace_children</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">):</span> +</span><span id="L-4612"><a href="#L-4612"><span class="linenos">4612</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4613"><a href="#L-4613"><span class="linenos">4613</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> +</span><span id="L-4614"><a href="#L-4614"><span class="linenos">4614</span></a><span class="sd"> """</span> +</span><span id="L-4615"><a href="#L-4615"><span class="linenos">4615</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="L-4616"><a href="#L-4616"><span class="linenos">4616</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> +</span><span id="L-4617"><a href="#L-4617"><span class="linenos">4617</span></a> +</span><span id="L-4618"><a href="#L-4618"><span class="linenos">4618</span></a> <span class="n">child_nodes</span> <span class="o">=</span> <span class="n">v</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="p">[</span><span class="n">v</span><span class="p">]</span> +</span><span id="L-4619"><a href="#L-4619"><span class="linenos">4619</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="L-4620"><a href="#L-4620"><span class="linenos">4620</span></a> +</span><span id="L-4621"><a href="#L-4621"><span class="linenos">4621</span></a> <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="n">child_nodes</span><span class="p">:</span> +</span><span id="L-4622"><a href="#L-4622"><span class="linenos">4622</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4623"><a href="#L-4623"><span class="linenos">4623</span></a> <span class="k">for</span> <span class="n">child_node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">fun</span><span class="p">(</span><span class="n">cn</span><span class="p">)):</span> +</span><span id="L-4624"><a href="#L-4624"><span class="linenos">4624</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">child_node</span><span class="p">)</span> +</span><span id="L-4625"><a href="#L-4625"><span class="linenos">4625</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">expression</span> +</span><span id="L-4626"><a href="#L-4626"><span class="linenos">4626</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">k</span> +</span><span id="L-4627"><a href="#L-4627"><span class="linenos">4627</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-4628"><a href="#L-4628"><span class="linenos">4628</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cn</span><span class="p">)</span> +</span><span id="L-4629"><a href="#L-4629"><span class="linenos">4629</span></a> +</span><span id="L-4630"><a href="#L-4630"><span class="linenos">4630</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_child_nodes</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">new_child_nodes</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> +</span><span id="L-4631"><a href="#L-4631"><span class="linenos">4631</span></a> +</span><span id="L-4632"><a href="#L-4632"><span class="linenos">4632</span></a> +</span><span id="L-4633"><a href="#L-4633"><span class="linenos">4633</span></a><span class="k">def</span> <span class="nf">column_table_names</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> +</span><span id="L-4634"><a href="#L-4634"><span class="linenos">4634</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4635"><a href="#L-4635"><span class="linenos">4635</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> +</span><span id="L-4636"><a href="#L-4636"><span class="linenos">4636</span></a> +</span><span id="L-4637"><a href="#L-4637"><span class="linenos">4637</span></a><span class="sd"> Example:</span> +</span><span id="L-4638"><a href="#L-4638"><span class="linenos">4638</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="L-4639"><a href="#L-4639"><span class="linenos">4639</span></a><span class="sd"> >>> column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e"))</span> +</span><span id="L-4640"><a href="#L-4640"><span class="linenos">4640</span></a><span class="sd"> ['c', 'a']</span> +</span><span id="L-4641"><a href="#L-4641"><span class="linenos">4641</span></a> +</span><span id="L-4642"><a href="#L-4642"><span class="linenos">4642</span></a><span class="sd"> Args:</span> +</span><span id="L-4643"><a href="#L-4643"><span class="linenos">4643</span></a><span class="sd"> expression (sqlglot.Expression): expression to find table names</span> +</span><span id="L-4644"><a href="#L-4644"><span class="linenos">4644</span></a> +</span><span id="L-4645"><a href="#L-4645"><span class="linenos">4645</span></a><span class="sd"> Returns:</span> +</span><span id="L-4646"><a href="#L-4646"><span class="linenos">4646</span></a><span class="sd"> list: A list of unique names</span> +</span><span id="L-4647"><a href="#L-4647"><span class="linenos">4647</span></a><span class="sd"> """</span> +</span><span id="L-4648"><a href="#L-4648"><span class="linenos">4648</span></a> <span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">dict</span><span class="o">.</span><span class="n">fromkeys</span><span class="p">(</span><span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">Column</span><span class="p">)))</span> </span><span id="L-4649"><a href="#L-4649"><span class="linenos">4649</span></a> -</span><span id="L-4650"><a href="#L-4650"><span class="linenos">4650</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_tables</span><span class="p">)</span> -</span><span id="L-4651"><a href="#L-4651"><span class="linenos">4651</span></a> -</span><span id="L-4652"><a href="#L-4652"><span class="linenos">4652</span></a> -</span><span id="L-4653"><a href="#L-4653"><span class="linenos">4653</span></a><span class="k">def</span> <span class="nf">replace_placeholders</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="L-4654"><a href="#L-4654"><span class="linenos">4654</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> -</span><span id="L-4655"><a href="#L-4655"><span class="linenos">4655</span></a> -</span><span id="L-4656"><a href="#L-4656"><span class="linenos">4656</span></a><span class="sd"> Args:</span> -</span><span id="L-4657"><a href="#L-4657"><span class="linenos">4657</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> -</span><span id="L-4658"><a href="#L-4658"><span class="linenos">4658</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> -</span><span id="L-4659"><a href="#L-4659"><span class="linenos">4659</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> -</span><span id="L-4660"><a href="#L-4660"><span class="linenos">4660</span></a> -</span><span id="L-4661"><a href="#L-4661"><span class="linenos">4661</span></a><span class="sd"> Examples:</span> -</span><span id="L-4662"><a href="#L-4662"><span class="linenos">4662</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="L-4663"><a href="#L-4663"><span class="linenos">4663</span></a><span class="sd"> >>> replace_placeholders(</span> -</span><span id="L-4664"><a href="#L-4664"><span class="linenos">4664</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"), "a", "b", tbl="foo"</span> -</span><span id="L-4665"><a href="#L-4665"><span class="linenos">4665</span></a><span class="sd"> ... ).sql()</span> -</span><span id="L-4666"><a href="#L-4666"><span class="linenos">4666</span></a><span class="sd"> 'SELECT * FROM foo WHERE a = b'</span> +</span><span id="L-4650"><a href="#L-4650"><span class="linenos">4650</span></a> +</span><span id="L-4651"><a href="#L-4651"><span class="linenos">4651</span></a><span class="k">def</span> <span class="nf">table_name</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="L-4652"><a href="#L-4652"><span class="linenos">4652</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> +</span><span id="L-4653"><a href="#L-4653"><span class="linenos">4653</span></a> +</span><span id="L-4654"><a href="#L-4654"><span class="linenos">4654</span></a><span class="sd"> Args:</span> +</span><span id="L-4655"><a href="#L-4655"><span class="linenos">4655</span></a><span class="sd"> table (exp.Table | str): table expression node or string.</span> +</span><span id="L-4656"><a href="#L-4656"><span class="linenos">4656</span></a> +</span><span id="L-4657"><a href="#L-4657"><span class="linenos">4657</span></a><span class="sd"> Examples:</span> +</span><span id="L-4658"><a href="#L-4658"><span class="linenos">4658</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-4659"><a href="#L-4659"><span class="linenos">4659</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> +</span><span id="L-4660"><a href="#L-4660"><span class="linenos">4660</span></a><span class="sd"> 'a.b.c'</span> +</span><span id="L-4661"><a href="#L-4661"><span class="linenos">4661</span></a> +</span><span id="L-4662"><a href="#L-4662"><span class="linenos">4662</span></a><span class="sd"> Returns:</span> +</span><span id="L-4663"><a href="#L-4663"><span class="linenos">4663</span></a><span class="sd"> The table name.</span> +</span><span id="L-4664"><a href="#L-4664"><span class="linenos">4664</span></a><span class="sd"> """</span> +</span><span id="L-4665"><a href="#L-4665"><span class="linenos">4665</span></a> +</span><span id="L-4666"><a href="#L-4666"><span class="linenos">4666</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">)</span> </span><span id="L-4667"><a href="#L-4667"><span class="linenos">4667</span></a> -</span><span id="L-4668"><a href="#L-4668"><span class="linenos">4668</span></a><span class="sd"> Returns:</span> -</span><span id="L-4669"><a href="#L-4669"><span class="linenos">4669</span></a><span class="sd"> The mapped expression.</span> -</span><span id="L-4670"><a href="#L-4670"><span class="linenos">4670</span></a><span class="sd"> """</span> -</span><span id="L-4671"><a href="#L-4671"><span class="linenos">4671</span></a> -</span><span id="L-4672"><a href="#L-4672"><span class="linenos">4672</span></a> <span class="k">def</span> <span class="nf">_replace_placeholders</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="L-4673"><a href="#L-4673"><span class="linenos">4673</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Placeholder</span><span class="p">):</span> -</span><span id="L-4674"><a href="#L-4674"><span class="linenos">4674</span></a> <span class="k">if</span> <span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">:</span> -</span><span id="L-4675"><a href="#L-4675"><span class="linenos">4675</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="L-4676"><a href="#L-4676"><span class="linenos">4676</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="L-4677"><a href="#L-4677"><span class="linenos">4677</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="L-4678"><a href="#L-4678"><span class="linenos">4678</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-4679"><a href="#L-4679"><span class="linenos">4679</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="L-4680"><a href="#L-4680"><span class="linenos">4680</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="nb">next</span><span class="p">(</span><span class="n">args</span><span class="p">))</span> -</span><span id="L-4681"><a href="#L-4681"><span class="linenos">4681</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> -</span><span id="L-4682"><a href="#L-4682"><span class="linenos">4682</span></a> <span class="k">pass</span> -</span><span id="L-4683"><a href="#L-4683"><span class="linenos">4683</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="L-4668"><a href="#L-4668"><span class="linenos">4668</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table</span><span class="p">:</span> +</span><span id="L-4669"><a href="#L-4669"><span class="linenos">4669</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot parse </span><span class="si">{</span><span class="n">table</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="L-4670"><a href="#L-4670"><span class="linenos">4670</span></a> +</span><span id="L-4671"><a href="#L-4671"><span class="linenos">4671</span></a> <span class="k">return</span> <span class="s2">"."</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> +</span><span id="L-4672"><a href="#L-4672"><span class="linenos">4672</span></a> <span class="n">part</span> +</span><span id="L-4673"><a href="#L-4673"><span class="linenos">4673</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span> +</span><span id="L-4674"><a href="#L-4674"><span class="linenos">4674</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">),</span> +</span><span id="L-4675"><a href="#L-4675"><span class="linenos">4675</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">),</span> +</span><span id="L-4676"><a href="#L-4676"><span class="linenos">4676</span></a> <span class="n">table</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> +</span><span id="L-4677"><a href="#L-4677"><span class="linenos">4677</span></a> <span class="p">)</span> +</span><span id="L-4678"><a href="#L-4678"><span class="linenos">4678</span></a> <span class="k">if</span> <span class="n">part</span> +</span><span id="L-4679"><a href="#L-4679"><span class="linenos">4679</span></a> <span class="p">)</span> +</span><span id="L-4680"><a href="#L-4680"><span class="linenos">4680</span></a> +</span><span id="L-4681"><a href="#L-4681"><span class="linenos">4681</span></a> +</span><span id="L-4682"><a href="#L-4682"><span class="linenos">4682</span></a><span class="k">def</span> <span class="nf">replace_tables</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">mapping</span><span class="p">):</span> +</span><span id="L-4683"><a href="#L-4683"><span class="linenos">4683</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> </span><span id="L-4684"><a href="#L-4684"><span class="linenos">4684</span></a> -</span><span id="L-4685"><a href="#L-4685"><span class="linenos">4685</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_placeholders</span><span class="p">,</span> <span class="nb">iter</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="L-4686"><a href="#L-4686"><span class="linenos">4686</span></a> -</span><span id="L-4687"><a href="#L-4687"><span class="linenos">4687</span></a> -</span><span id="L-4688"><a href="#L-4688"><span class="linenos">4688</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">sources</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">],</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="L-4689"><a href="#L-4689"><span class="linenos">4689</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> -</span><span id="L-4690"><a href="#L-4690"><span class="linenos">4690</span></a> -</span><span id="L-4691"><a href="#L-4691"><span class="linenos">4691</span></a><span class="sd"> Examples:</span> -</span><span id="L-4692"><a href="#L-4692"><span class="linenos">4692</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="L-4693"><a href="#L-4693"><span class="linenos">4693</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()</span> -</span><span id="L-4694"><a href="#L-4694"><span class="linenos">4694</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> -</span><span id="L-4695"><a href="#L-4695"><span class="linenos">4695</span></a> -</span><span id="L-4696"><a href="#L-4696"><span class="linenos">4696</span></a><span class="sd"> Args:</span> -</span><span id="L-4697"><a href="#L-4697"><span class="linenos">4697</span></a><span class="sd"> expression: The expression to expand.</span> -</span><span id="L-4698"><a href="#L-4698"><span class="linenos">4698</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> -</span><span id="L-4699"><a href="#L-4699"><span class="linenos">4699</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> -</span><span id="L-4700"><a href="#L-4700"><span class="linenos">4700</span></a> -</span><span id="L-4701"><a href="#L-4701"><span class="linenos">4701</span></a><span class="sd"> Returns:</span> -</span><span id="L-4702"><a href="#L-4702"><span class="linenos">4702</span></a><span class="sd"> The transformed expression.</span> -</span><span id="L-4703"><a href="#L-4703"><span class="linenos">4703</span></a><span class="sd"> """</span> -</span><span id="L-4704"><a href="#L-4704"><span class="linenos">4704</span></a> -</span><span id="L-4705"><a href="#L-4705"><span class="linenos">4705</span></a> <span class="k">def</span> <span class="nf">_expand</span><span class="p">(</span><span class="n">node</span><span class="p">:</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="L-4706"><a href="#L-4706"><span class="linenos">4706</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="L-4707"><a href="#L-4707"><span class="linenos">4707</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> -</span><span id="L-4708"><a href="#L-4708"><span class="linenos">4708</span></a> <span class="n">source</span> <span class="o">=</span> <span class="n">sources</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> -</span><span id="L-4709"><a href="#L-4709"><span class="linenos">4709</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> -</span><span id="L-4710"><a href="#L-4710"><span class="linenos">4710</span></a> <span class="n">subquery</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="n">name</span><span class="p">)</span> -</span><span id="L-4711"><a href="#L-4711"><span class="linenos">4711</span></a> <span class="n">subquery</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[</span><span class="sa">f</span><span class="s2">"source: </span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">"</span><span class="p">]</span> -</span><span id="L-4712"><a href="#L-4712"><span class="linenos">4712</span></a> <span class="k">return</span> <span class="n">subquery</span> -</span><span id="L-4713"><a href="#L-4713"><span class="linenos">4713</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="L-4714"><a href="#L-4714"><span class="linenos">4714</span></a> -</span><span id="L-4715"><a href="#L-4715"><span class="linenos">4715</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_expand</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> -</span><span id="L-4716"><a href="#L-4716"><span class="linenos">4716</span></a> -</span><span id="L-4717"><a href="#L-4717"><span class="linenos">4717</span></a> -</span><span id="L-4718"><a href="#L-4718"><span class="linenos">4718</span></a><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Func</span><span class="p">:</span> -</span><span id="L-4719"><a href="#L-4719"><span class="linenos">4719</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4720"><a href="#L-4720"><span class="linenos">4720</span></a><span class="sd"> Returns a Func expression.</span> -</span><span id="L-4721"><a href="#L-4721"><span class="linenos">4721</span></a> -</span><span id="L-4722"><a href="#L-4722"><span class="linenos">4722</span></a><span class="sd"> Examples:</span> -</span><span id="L-4723"><a href="#L-4723"><span class="linenos">4723</span></a><span class="sd"> >>> func("abs", 5).sql()</span> -</span><span id="L-4724"><a href="#L-4724"><span class="linenos">4724</span></a><span class="sd"> 'ABS(5)'</span> +</span><span id="L-4685"><a href="#L-4685"><span class="linenos">4685</span></a><span class="sd"> Args:</span> +</span><span id="L-4686"><a href="#L-4686"><span class="linenos">4686</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> +</span><span id="L-4687"><a href="#L-4687"><span class="linenos">4687</span></a><span class="sd"> mapping (Dict[str, str]): mapping of table names.</span> +</span><span id="L-4688"><a href="#L-4688"><span class="linenos">4688</span></a> +</span><span id="L-4689"><a href="#L-4689"><span class="linenos">4689</span></a><span class="sd"> Examples:</span> +</span><span id="L-4690"><a href="#L-4690"><span class="linenos">4690</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-4691"><a href="#L-4691"><span class="linenos">4691</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> +</span><span id="L-4692"><a href="#L-4692"><span class="linenos">4692</span></a><span class="sd"> 'SELECT * FROM c'</span> +</span><span id="L-4693"><a href="#L-4693"><span class="linenos">4693</span></a> +</span><span id="L-4694"><a href="#L-4694"><span class="linenos">4694</span></a><span class="sd"> Returns:</span> +</span><span id="L-4695"><a href="#L-4695"><span class="linenos">4695</span></a><span class="sd"> The mapped expression.</span> +</span><span id="L-4696"><a href="#L-4696"><span class="linenos">4696</span></a><span class="sd"> """</span> +</span><span id="L-4697"><a href="#L-4697"><span class="linenos">4697</span></a> +</span><span id="L-4698"><a href="#L-4698"><span class="linenos">4698</span></a> <span class="k">def</span> <span class="nf">_replace_tables</span><span class="p">(</span><span class="n">node</span><span class="p">):</span> +</span><span id="L-4699"><a href="#L-4699"><span class="linenos">4699</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="L-4700"><a href="#L-4700"><span class="linenos">4700</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">mapping</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">))</span> +</span><span id="L-4701"><a href="#L-4701"><span class="linenos">4701</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="L-4702"><a href="#L-4702"><span class="linenos">4702</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> +</span><span id="L-4703"><a href="#L-4703"><span class="linenos">4703</span></a> <span class="n">new_name</span><span class="p">,</span> +</span><span id="L-4704"><a href="#L-4704"><span class="linenos">4704</span></a> <span class="o">**</span><span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">node</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">)},</span> +</span><span id="L-4705"><a href="#L-4705"><span class="linenos">4705</span></a> <span class="p">)</span> +</span><span id="L-4706"><a href="#L-4706"><span class="linenos">4706</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="L-4707"><a href="#L-4707"><span class="linenos">4707</span></a> +</span><span id="L-4708"><a href="#L-4708"><span class="linenos">4708</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_tables</span><span class="p">)</span> +</span><span id="L-4709"><a href="#L-4709"><span class="linenos">4709</span></a> +</span><span id="L-4710"><a href="#L-4710"><span class="linenos">4710</span></a> +</span><span id="L-4711"><a href="#L-4711"><span class="linenos">4711</span></a><span class="k">def</span> <span class="nf">replace_placeholders</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="L-4712"><a href="#L-4712"><span class="linenos">4712</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> +</span><span id="L-4713"><a href="#L-4713"><span class="linenos">4713</span></a> +</span><span id="L-4714"><a href="#L-4714"><span class="linenos">4714</span></a><span class="sd"> Args:</span> +</span><span id="L-4715"><a href="#L-4715"><span class="linenos">4715</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> +</span><span id="L-4716"><a href="#L-4716"><span class="linenos">4716</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> +</span><span id="L-4717"><a href="#L-4717"><span class="linenos">4717</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> +</span><span id="L-4718"><a href="#L-4718"><span class="linenos">4718</span></a> +</span><span id="L-4719"><a href="#L-4719"><span class="linenos">4719</span></a><span class="sd"> Examples:</span> +</span><span id="L-4720"><a href="#L-4720"><span class="linenos">4720</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="L-4721"><a href="#L-4721"><span class="linenos">4721</span></a><span class="sd"> >>> replace_placeholders(</span> +</span><span id="L-4722"><a href="#L-4722"><span class="linenos">4722</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"), "a", "b", tbl="foo"</span> +</span><span id="L-4723"><a href="#L-4723"><span class="linenos">4723</span></a><span class="sd"> ... ).sql()</span> +</span><span id="L-4724"><a href="#L-4724"><span class="linenos">4724</span></a><span class="sd"> 'SELECT * FROM foo WHERE a = b'</span> </span><span id="L-4725"><a href="#L-4725"><span class="linenos">4725</span></a> -</span><span id="L-4726"><a href="#L-4726"><span class="linenos">4726</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> -</span><span id="L-4727"><a href="#L-4727"><span class="linenos">4727</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> -</span><span id="L-4728"><a href="#L-4728"><span class="linenos">4728</span></a> -</span><span id="L-4729"><a href="#L-4729"><span class="linenos">4729</span></a><span class="sd"> Args:</span> -</span><span id="L-4730"><a href="#L-4730"><span class="linenos">4730</span></a><span class="sd"> name: the name of the function to build.</span> -</span><span id="L-4731"><a href="#L-4731"><span class="linenos">4731</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> -</span><span id="L-4732"><a href="#L-4732"><span class="linenos">4732</span></a><span class="sd"> dialect: the source dialect.</span> -</span><span id="L-4733"><a href="#L-4733"><span class="linenos">4733</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> -</span><span id="L-4734"><a href="#L-4734"><span class="linenos">4734</span></a> -</span><span id="L-4735"><a href="#L-4735"><span class="linenos">4735</span></a><span class="sd"> Note:</span> -</span><span id="L-4736"><a href="#L-4736"><span class="linenos">4736</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> -</span><span id="L-4737"><a href="#L-4737"><span class="linenos">4737</span></a> -</span><span id="L-4738"><a href="#L-4738"><span class="linenos">4738</span></a><span class="sd"> Returns:</span> -</span><span id="L-4739"><a href="#L-4739"><span class="linenos">4739</span></a><span class="sd"> An instance of the function of interest, or an anonymous function, if `name` doesn't</span> -</span><span id="L-4740"><a href="#L-4740"><span class="linenos">4740</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> -</span><span id="L-4741"><a href="#L-4741"><span class="linenos">4741</span></a><span class="sd"> """</span> -</span><span id="L-4742"><a href="#L-4742"><span class="linenos">4742</span></a> <span class="k">if</span> <span class="n">args</span> <span class="ow">and</span> <span class="n">kwargs</span><span class="p">:</span> -</span><span id="L-4743"><a href="#L-4743"><span class="linenos">4743</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Can't use both args and kwargs to instantiate a function."</span><span class="p">)</span> +</span><span id="L-4726"><a href="#L-4726"><span class="linenos">4726</span></a><span class="sd"> Returns:</span> +</span><span id="L-4727"><a href="#L-4727"><span class="linenos">4727</span></a><span class="sd"> The mapped expression.</span> +</span><span id="L-4728"><a href="#L-4728"><span class="linenos">4728</span></a><span class="sd"> """</span> +</span><span id="L-4729"><a href="#L-4729"><span class="linenos">4729</span></a> +</span><span id="L-4730"><a href="#L-4730"><span class="linenos">4730</span></a> <span class="k">def</span> <span class="nf">_replace_placeholders</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="L-4731"><a href="#L-4731"><span class="linenos">4731</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Placeholder</span><span class="p">):</span> +</span><span id="L-4732"><a href="#L-4732"><span class="linenos">4732</span></a> <span class="k">if</span> <span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">:</span> +</span><span id="L-4733"><a href="#L-4733"><span class="linenos">4733</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-4734"><a href="#L-4734"><span class="linenos">4734</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="L-4735"><a href="#L-4735"><span class="linenos">4735</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="L-4736"><a href="#L-4736"><span class="linenos">4736</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-4737"><a href="#L-4737"><span class="linenos">4737</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="L-4738"><a href="#L-4738"><span class="linenos">4738</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="nb">next</span><span class="p">(</span><span class="n">args</span><span class="p">))</span> +</span><span id="L-4739"><a href="#L-4739"><span class="linenos">4739</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> +</span><span id="L-4740"><a href="#L-4740"><span class="linenos">4740</span></a> <span class="k">pass</span> +</span><span id="L-4741"><a href="#L-4741"><span class="linenos">4741</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="L-4742"><a href="#L-4742"><span class="linenos">4742</span></a> +</span><span id="L-4743"><a href="#L-4743"><span class="linenos">4743</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_placeholders</span><span class="p">,</span> <span class="nb">iter</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> </span><span id="L-4744"><a href="#L-4744"><span class="linenos">4744</span></a> -</span><span id="L-4745"><a href="#L-4745"><span class="linenos">4745</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects.dialect</span> <span class="kn">import</span> <span class="n">Dialect</span> -</span><span id="L-4746"><a href="#L-4746"><span class="linenos">4746</span></a> -</span><span id="L-4747"><a href="#L-4747"><span class="linenos">4747</span></a> <span class="n">args</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">convert</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">)</span> -</span><span id="L-4748"><a href="#L-4748"><span class="linenos">4748</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> -</span><span id="L-4749"><a href="#L-4749"><span class="linenos">4749</span></a> -</span><span id="L-4750"><a href="#L-4750"><span class="linenos">4750</span></a> <span class="n">parser</span> <span class="o">=</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">parser</span><span class="p">()</span> -</span><span id="L-4751"><a href="#L-4751"><span class="linenos">4751</span></a> <span class="n">from_args_list</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> -</span><span id="L-4752"><a href="#L-4752"><span class="linenos">4752</span></a> -</span><span id="L-4753"><a href="#L-4753"><span class="linenos">4753</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> -</span><span id="L-4754"><a href="#L-4754"><span class="linenos">4754</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">from_args_list</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="n">from_args_list</span><span class="o">.</span><span class="vm">__self__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="c1"># type: ignore</span> -</span><span id="L-4755"><a href="#L-4755"><span class="linenos">4755</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="L-4756"><a href="#L-4756"><span class="linenos">4756</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">kwargs</span> <span class="ow">or</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="n">args</span><span class="p">}</span> -</span><span id="L-4757"><a href="#L-4757"><span class="linenos">4757</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">Anonymous</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="L-4745"><a href="#L-4745"><span class="linenos">4745</span></a> +</span><span id="L-4746"><a href="#L-4746"><span class="linenos">4746</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">sources</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">],</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="L-4747"><a href="#L-4747"><span class="linenos">4747</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> +</span><span id="L-4748"><a href="#L-4748"><span class="linenos">4748</span></a> +</span><span id="L-4749"><a href="#L-4749"><span class="linenos">4749</span></a><span class="sd"> Examples:</span> +</span><span id="L-4750"><a href="#L-4750"><span class="linenos">4750</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="L-4751"><a href="#L-4751"><span class="linenos">4751</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()</span> +</span><span id="L-4752"><a href="#L-4752"><span class="linenos">4752</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> +</span><span id="L-4753"><a href="#L-4753"><span class="linenos">4753</span></a> +</span><span id="L-4754"><a href="#L-4754"><span class="linenos">4754</span></a><span class="sd"> Args:</span> +</span><span id="L-4755"><a href="#L-4755"><span class="linenos">4755</span></a><span class="sd"> expression: The expression to expand.</span> +</span><span id="L-4756"><a href="#L-4756"><span class="linenos">4756</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> +</span><span id="L-4757"><a href="#L-4757"><span class="linenos">4757</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> </span><span id="L-4758"><a href="#L-4758"><span class="linenos">4758</span></a> -</span><span id="L-4759"><a href="#L-4759"><span class="linenos">4759</span></a> <span class="k">for</span> <span class="n">error_message</span> <span class="ow">in</span> <span class="n">function</span><span class="o">.</span><span class="n">error_messages</span><span class="p">(</span><span class="n">args</span><span class="p">):</span> -</span><span id="L-4760"><a href="#L-4760"><span class="linenos">4760</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_message</span><span class="p">)</span> -</span><span id="L-4761"><a href="#L-4761"><span class="linenos">4761</span></a> -</span><span id="L-4762"><a href="#L-4762"><span class="linenos">4762</span></a> <span class="k">return</span> <span class="n">function</span> -</span><span id="L-4763"><a href="#L-4763"><span class="linenos">4763</span></a> -</span><span id="L-4764"><a href="#L-4764"><span class="linenos">4764</span></a> -</span><span id="L-4765"><a href="#L-4765"><span class="linenos">4765</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">():</span> -</span><span id="L-4766"><a href="#L-4766"><span class="linenos">4766</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4767"><a href="#L-4767"><span class="linenos">4767</span></a><span class="sd"> Returns a true Boolean expression.</span> -</span><span id="L-4768"><a href="#L-4768"><span class="linenos">4768</span></a><span class="sd"> """</span> -</span><span id="L-4769"><a href="#L-4769"><span class="linenos">4769</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="L-4770"><a href="#L-4770"><span class="linenos">4770</span></a> -</span><span id="L-4771"><a href="#L-4771"><span class="linenos">4771</span></a> -</span><span id="L-4772"><a href="#L-4772"><span class="linenos">4772</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">():</span> -</span><span id="L-4773"><a href="#L-4773"><span class="linenos">4773</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4774"><a href="#L-4774"><span class="linenos">4774</span></a><span class="sd"> Returns a false Boolean expression.</span> -</span><span id="L-4775"><a href="#L-4775"><span class="linenos">4775</span></a><span class="sd"> """</span> -</span><span id="L-4776"><a href="#L-4776"><span class="linenos">4776</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="L-4777"><a href="#L-4777"><span class="linenos">4777</span></a> -</span><span id="L-4778"><a href="#L-4778"><span class="linenos">4778</span></a> -</span><span id="L-4779"><a href="#L-4779"><span class="linenos">4779</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">():</span> -</span><span id="L-4780"><a href="#L-4780"><span class="linenos">4780</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="L-4781"><a href="#L-4781"><span class="linenos">4781</span></a><span class="sd"> Returns a Null expression.</span> -</span><span id="L-4782"><a href="#L-4782"><span class="linenos">4782</span></a><span class="sd"> """</span> -</span><span id="L-4783"><a href="#L-4783"><span class="linenos">4783</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> -</span><span id="L-4784"><a href="#L-4784"><span class="linenos">4784</span></a> -</span><span id="L-4785"><a href="#L-4785"><span class="linenos">4785</span></a> -</span><span id="L-4786"><a href="#L-4786"><span class="linenos">4786</span></a><span class="c1"># TODO: deprecate this</span> -</span><span id="L-4787"><a href="#L-4787"><span class="linenos">4787</span></a><span class="n">TRUE</span> <span class="o">=</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> -</span><span id="L-4788"><a href="#L-4788"><span class="linenos">4788</span></a><span class="n">FALSE</span> <span class="o">=</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="L-4789"><a href="#L-4789"><span class="linenos">4789</span></a><span class="n">NULL</span> <span class="o">=</span> <span class="n">Null</span><span class="p">()</span> +</span><span id="L-4759"><a href="#L-4759"><span class="linenos">4759</span></a><span class="sd"> Returns:</span> +</span><span id="L-4760"><a href="#L-4760"><span class="linenos">4760</span></a><span class="sd"> The transformed expression.</span> +</span><span id="L-4761"><a href="#L-4761"><span class="linenos">4761</span></a><span class="sd"> """</span> +</span><span id="L-4762"><a href="#L-4762"><span class="linenos">4762</span></a> +</span><span id="L-4763"><a href="#L-4763"><span class="linenos">4763</span></a> <span class="k">def</span> <span class="nf">_expand</span><span class="p">(</span><span class="n">node</span><span class="p">:</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="L-4764"><a href="#L-4764"><span class="linenos">4764</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="L-4765"><a href="#L-4765"><span class="linenos">4765</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> +</span><span id="L-4766"><a href="#L-4766"><span class="linenos">4766</span></a> <span class="n">source</span> <span class="o">=</span> <span class="n">sources</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> +</span><span id="L-4767"><a href="#L-4767"><span class="linenos">4767</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> +</span><span id="L-4768"><a href="#L-4768"><span class="linenos">4768</span></a> <span class="n">subquery</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="n">name</span><span class="p">)</span> +</span><span id="L-4769"><a href="#L-4769"><span class="linenos">4769</span></a> <span class="n">subquery</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[</span><span class="sa">f</span><span class="s2">"source: </span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">"</span><span class="p">]</span> +</span><span id="L-4770"><a href="#L-4770"><span class="linenos">4770</span></a> <span class="k">return</span> <span class="n">subquery</span> +</span><span id="L-4771"><a href="#L-4771"><span class="linenos">4771</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="L-4772"><a href="#L-4772"><span class="linenos">4772</span></a> +</span><span id="L-4773"><a href="#L-4773"><span class="linenos">4773</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_expand</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> +</span><span id="L-4774"><a href="#L-4774"><span class="linenos">4774</span></a> +</span><span id="L-4775"><a href="#L-4775"><span class="linenos">4775</span></a> +</span><span id="L-4776"><a href="#L-4776"><span class="linenos">4776</span></a><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Func</span><span class="p">:</span> +</span><span id="L-4777"><a href="#L-4777"><span class="linenos">4777</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4778"><a href="#L-4778"><span class="linenos">4778</span></a><span class="sd"> Returns a Func expression.</span> +</span><span id="L-4779"><a href="#L-4779"><span class="linenos">4779</span></a> +</span><span id="L-4780"><a href="#L-4780"><span class="linenos">4780</span></a><span class="sd"> Examples:</span> +</span><span id="L-4781"><a href="#L-4781"><span class="linenos">4781</span></a><span class="sd"> >>> func("abs", 5).sql()</span> +</span><span id="L-4782"><a href="#L-4782"><span class="linenos">4782</span></a><span class="sd"> 'ABS(5)'</span> +</span><span id="L-4783"><a href="#L-4783"><span class="linenos">4783</span></a> +</span><span id="L-4784"><a href="#L-4784"><span class="linenos">4784</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> +</span><span id="L-4785"><a href="#L-4785"><span class="linenos">4785</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> +</span><span id="L-4786"><a href="#L-4786"><span class="linenos">4786</span></a> +</span><span id="L-4787"><a href="#L-4787"><span class="linenos">4787</span></a><span class="sd"> Args:</span> +</span><span id="L-4788"><a href="#L-4788"><span class="linenos">4788</span></a><span class="sd"> name: the name of the function to build.</span> +</span><span id="L-4789"><a href="#L-4789"><span class="linenos">4789</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> +</span><span id="L-4790"><a href="#L-4790"><span class="linenos">4790</span></a><span class="sd"> dialect: the source dialect.</span> +</span><span id="L-4791"><a href="#L-4791"><span class="linenos">4791</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> +</span><span id="L-4792"><a href="#L-4792"><span class="linenos">4792</span></a> +</span><span id="L-4793"><a href="#L-4793"><span class="linenos">4793</span></a><span class="sd"> Note:</span> +</span><span id="L-4794"><a href="#L-4794"><span class="linenos">4794</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="L-4795"><a href="#L-4795"><span class="linenos">4795</span></a> +</span><span id="L-4796"><a href="#L-4796"><span class="linenos">4796</span></a><span class="sd"> Returns:</span> +</span><span id="L-4797"><a href="#L-4797"><span class="linenos">4797</span></a><span class="sd"> An instance of the function of interest, or an anonymous function, if `name` doesn't</span> +</span><span id="L-4798"><a href="#L-4798"><span class="linenos">4798</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> +</span><span id="L-4799"><a href="#L-4799"><span class="linenos">4799</span></a><span class="sd"> """</span> +</span><span id="L-4800"><a href="#L-4800"><span class="linenos">4800</span></a> <span class="k">if</span> <span class="n">args</span> <span class="ow">and</span> <span class="n">kwargs</span><span class="p">:</span> +</span><span id="L-4801"><a href="#L-4801"><span class="linenos">4801</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Can't use both args and kwargs to instantiate a function."</span><span class="p">)</span> +</span><span id="L-4802"><a href="#L-4802"><span class="linenos">4802</span></a> +</span><span id="L-4803"><a href="#L-4803"><span class="linenos">4803</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects.dialect</span> <span class="kn">import</span> <span class="n">Dialect</span> +</span><span id="L-4804"><a href="#L-4804"><span class="linenos">4804</span></a> +</span><span id="L-4805"><a href="#L-4805"><span class="linenos">4805</span></a> <span class="n">args</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">convert</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">)</span> +</span><span id="L-4806"><a href="#L-4806"><span class="linenos">4806</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> +</span><span id="L-4807"><a href="#L-4807"><span class="linenos">4807</span></a> +</span><span id="L-4808"><a href="#L-4808"><span class="linenos">4808</span></a> <span class="n">parser</span> <span class="o">=</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">parser</span><span class="p">()</span> +</span><span id="L-4809"><a href="#L-4809"><span class="linenos">4809</span></a> <span class="n">from_args_list</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> +</span><span id="L-4810"><a href="#L-4810"><span class="linenos">4810</span></a> +</span><span id="L-4811"><a href="#L-4811"><span class="linenos">4811</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> +</span><span id="L-4812"><a href="#L-4812"><span class="linenos">4812</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">from_args_list</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="n">from_args_list</span><span class="o">.</span><span class="vm">__self__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="L-4813"><a href="#L-4813"><span class="linenos">4813</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="L-4814"><a href="#L-4814"><span class="linenos">4814</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">kwargs</span> <span class="ow">or</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="n">args</span><span class="p">}</span> +</span><span id="L-4815"><a href="#L-4815"><span class="linenos">4815</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">Anonymous</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="L-4816"><a href="#L-4816"><span class="linenos">4816</span></a> +</span><span id="L-4817"><a href="#L-4817"><span class="linenos">4817</span></a> <span class="k">for</span> <span class="n">error_message</span> <span class="ow">in</span> <span class="n">function</span><span class="o">.</span><span class="n">error_messages</span><span class="p">(</span><span class="n">args</span><span class="p">):</span> +</span><span id="L-4818"><a href="#L-4818"><span class="linenos">4818</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_message</span><span class="p">)</span> +</span><span id="L-4819"><a href="#L-4819"><span class="linenos">4819</span></a> +</span><span id="L-4820"><a href="#L-4820"><span class="linenos">4820</span></a> <span class="k">return</span> <span class="n">function</span> +</span><span id="L-4821"><a href="#L-4821"><span class="linenos">4821</span></a> +</span><span id="L-4822"><a href="#L-4822"><span class="linenos">4822</span></a> +</span><span id="L-4823"><a href="#L-4823"><span class="linenos">4823</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">():</span> +</span><span id="L-4824"><a href="#L-4824"><span class="linenos">4824</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4825"><a href="#L-4825"><span class="linenos">4825</span></a><span class="sd"> Returns a true Boolean expression.</span> +</span><span id="L-4826"><a href="#L-4826"><span class="linenos">4826</span></a><span class="sd"> """</span> +</span><span id="L-4827"><a href="#L-4827"><span class="linenos">4827</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-4828"><a href="#L-4828"><span class="linenos">4828</span></a> +</span><span id="L-4829"><a href="#L-4829"><span class="linenos">4829</span></a> +</span><span id="L-4830"><a href="#L-4830"><span class="linenos">4830</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">():</span> +</span><span id="L-4831"><a href="#L-4831"><span class="linenos">4831</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4832"><a href="#L-4832"><span class="linenos">4832</span></a><span class="sd"> Returns a false Boolean expression.</span> +</span><span id="L-4833"><a href="#L-4833"><span class="linenos">4833</span></a><span class="sd"> """</span> +</span><span id="L-4834"><a href="#L-4834"><span class="linenos">4834</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="L-4835"><a href="#L-4835"><span class="linenos">4835</span></a> +</span><span id="L-4836"><a href="#L-4836"><span class="linenos">4836</span></a> +</span><span id="L-4837"><a href="#L-4837"><span class="linenos">4837</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">():</span> +</span><span id="L-4838"><a href="#L-4838"><span class="linenos">4838</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="L-4839"><a href="#L-4839"><span class="linenos">4839</span></a><span class="sd"> Returns a Null expression.</span> +</span><span id="L-4840"><a href="#L-4840"><span class="linenos">4840</span></a><span class="sd"> """</span> +</span><span id="L-4841"><a href="#L-4841"><span class="linenos">4841</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> +</span><span id="L-4842"><a href="#L-4842"><span class="linenos">4842</span></a> +</span><span id="L-4843"><a href="#L-4843"><span class="linenos">4843</span></a> +</span><span id="L-4844"><a href="#L-4844"><span class="linenos">4844</span></a><span class="c1"># TODO: deprecate this</span> +</span><span id="L-4845"><a href="#L-4845"><span class="linenos">4845</span></a><span class="n">TRUE</span> <span class="o">=</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="L-4846"><a href="#L-4846"><span class="linenos">4846</span></a><span class="n">FALSE</span> <span class="o">=</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="L-4847"><a href="#L-4847"><span class="linenos">4847</span></a><span class="n">NULL</span> <span class="o">=</span> <span class="n">Null</span><span class="p">()</span> </span></pre></div> @@ -7620,7 +7753,7 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="Expression-83"><a href="#Expression-83"><span class="linenos"> 83</span></a> </span><span id="Expression-84"><a href="#Expression-84"><span class="linenos"> 84</span></a> <span class="n">key</span> <span class="o">=</span> <span class="s2">"expression"</span> </span><span id="Expression-85"><a href="#Expression-85"><span class="linenos"> 85</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Expression-86"><a href="#Expression-86"><span class="linenos"> 86</span></a> <span class="vm">__slots__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"args"</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">,</span> <span class="s2">"arg_key"</span><span class="p">,</span> <span class="s2">"comments"</span><span class="p">,</span> <span class="s2">"_type"</span><span class="p">)</span> +</span><span id="Expression-86"><a href="#Expression-86"><span class="linenos"> 86</span></a> <span class="vm">__slots__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">"args"</span><span class="p">,</span> <span class="s2">"parent"</span><span class="p">,</span> <span class="s2">"arg_key"</span><span class="p">,</span> <span class="s2">"comments"</span><span class="p">,</span> <span class="s2">"_type"</span><span class="p">,</span> <span class="s2">"_meta"</span><span class="p">)</span> </span><span id="Expression-87"><a href="#Expression-87"><span class="linenos"> 87</span></a> </span><span id="Expression-88"><a href="#Expression-88"><span class="linenos"> 88</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">):</span> </span><span id="Expression-89"><a href="#Expression-89"><span class="linenos"> 89</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="n">args</span> @@ -7628,509 +7761,523 @@ SQL expressions, such as <code><a href="#select">sqlglot.expressions.select</a>< </span><span id="Expression-91"><a href="#Expression-91"><span class="linenos"> 91</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="Expression-92"><a href="#Expression-92"><span class="linenos"> 92</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="Expression-93"><a href="#Expression-93"><span class="linenos"> 93</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Expression-94"><a href="#Expression-94"><span class="linenos"> 94</span></a> -</span><span id="Expression-95"><a href="#Expression-95"><span class="linenos"> 95</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression-96"><a href="#Expression-96"><span class="linenos"> 96</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="Expression-97"><a href="#Expression-97"><span class="linenos"> 97</span></a> -</span><span id="Expression-98"><a href="#Expression-98"><span class="linenos"> 98</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Expression-99"><a href="#Expression-99"><span class="linenos"> 99</span></a> <span class="k">return</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_args</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> -</span><span id="Expression-100"><a href="#Expression-100"><span class="linenos">100</span></a> -</span><span id="Expression-101"><a href="#Expression-101"><span class="linenos">101</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span> -</span><span id="Expression-102"><a href="#Expression-102"><span class="linenos">102</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">(</span> -</span><span id="Expression-103"><a href="#Expression-103"><span class="linenos">103</span></a> <span class="p">(</span> -</span><span id="Expression-104"><a href="#Expression-104"><span class="linenos">104</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> -</span><span id="Expression-105"><a href="#Expression-105"><span class="linenos">105</span></a> <span class="nb">tuple</span><span class="p">(</span> -</span><span id="Expression-106"><a href="#Expression-106"><span class="linenos">106</span></a> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="k">else</span> <span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="Expression-107"><a href="#Expression-107"><span class="linenos">107</span></a> <span class="p">),</span> -</span><span id="Expression-108"><a href="#Expression-108"><span class="linenos">108</span></a> <span class="p">)</span> -</span><span id="Expression-109"><a href="#Expression-109"><span class="linenos">109</span></a> <span class="p">)</span> -</span><span id="Expression-110"><a href="#Expression-110"><span class="linenos">110</span></a> -</span><span id="Expression-111"><a href="#Expression-111"><span class="linenos">111</span></a> <span class="nd">@property</span> -</span><span id="Expression-112"><a href="#Expression-112"><span class="linenos">112</span></a> <span class="k">def</span> <span class="nf">this</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-113"><a href="#Expression-113"><span class="linenos">113</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-114"><a href="#Expression-114"><span class="linenos">114</span></a><span class="sd"> Retrieves the argument with key "this".</span> -</span><span id="Expression-115"><a href="#Expression-115"><span class="linenos">115</span></a><span class="sd"> """</span> -</span><span id="Expression-116"><a href="#Expression-116"><span class="linenos">116</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> -</span><span id="Expression-117"><a href="#Expression-117"><span class="linenos">117</span></a> -</span><span id="Expression-118"><a href="#Expression-118"><span class="linenos">118</span></a> <span class="nd">@property</span> -</span><span id="Expression-119"><a href="#Expression-119"><span class="linenos">119</span></a> <span class="k">def</span> <span class="nf">expression</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-120"><a href="#Expression-120"><span class="linenos">120</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-121"><a href="#Expression-121"><span class="linenos">121</span></a><span class="sd"> Retrieves the argument with key "expression".</span> -</span><span id="Expression-122"><a href="#Expression-122"><span class="linenos">122</span></a><span class="sd"> """</span> -</span><span id="Expression-123"><a href="#Expression-123"><span class="linenos">123</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expression"</span><span class="p">)</span> -</span><span id="Expression-124"><a href="#Expression-124"><span class="linenos">124</span></a> -</span><span id="Expression-125"><a href="#Expression-125"><span class="linenos">125</span></a> <span class="nd">@property</span> -</span><span id="Expression-126"><a href="#Expression-126"><span class="linenos">126</span></a> <span class="k">def</span> <span class="nf">expressions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-127"><a href="#Expression-127"><span class="linenos">127</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-128"><a href="#Expression-128"><span class="linenos">128</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> -</span><span id="Expression-129"><a href="#Expression-129"><span class="linenos">129</span></a><span class="sd"> """</span> -</span><span id="Expression-130"><a href="#Expression-130"><span class="linenos">130</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expressions"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="Expression-131"><a href="#Expression-131"><span class="linenos">131</span></a> -</span><span id="Expression-132"><a href="#Expression-132"><span class="linenos">132</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-133"><a href="#Expression-133"><span class="linenos">133</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-134"><a href="#Expression-134"><span class="linenos">134</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> -</span><span id="Expression-135"><a href="#Expression-135"><span class="linenos">135</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> -</span><span id="Expression-136"><a href="#Expression-136"><span class="linenos">136</span></a><span class="sd"> """</span> -</span><span id="Expression-137"><a href="#Expression-137"><span class="linenos">137</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> -</span><span id="Expression-138"><a href="#Expression-138"><span class="linenos">138</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="Expression-139"><a href="#Expression-139"><span class="linenos">139</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="Expression-140"><a href="#Expression-140"><span class="linenos">140</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> -</span><span id="Expression-141"><a href="#Expression-141"><span class="linenos">141</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression-142"><a href="#Expression-142"><span class="linenos">142</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> -</span><span id="Expression-143"><a href="#Expression-143"><span class="linenos">143</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> -</span><span id="Expression-144"><a href="#Expression-144"><span class="linenos">144</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="Expression-145"><a href="#Expression-145"><span class="linenos">145</span></a> -</span><span id="Expression-146"><a href="#Expression-146"><span class="linenos">146</span></a> <span class="nd">@property</span> -</span><span id="Expression-147"><a href="#Expression-147"><span class="linenos">147</span></a> <span class="k">def</span> <span class="nf">is_string</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Expression-148"><a href="#Expression-148"><span class="linenos">148</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-149"><a href="#Expression-149"><span class="linenos">149</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> -</span><span id="Expression-150"><a href="#Expression-150"><span class="linenos">150</span></a><span class="sd"> """</span> -</span><span id="Expression-151"><a href="#Expression-151"><span class="linenos">151</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="Expression-152"><a href="#Expression-152"><span class="linenos">152</span></a> -</span><span id="Expression-153"><a href="#Expression-153"><span class="linenos">153</span></a> <span class="nd">@property</span> -</span><span id="Expression-154"><a href="#Expression-154"><span class="linenos">154</span></a> <span class="k">def</span> <span class="nf">is_number</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Expression-155"><a href="#Expression-155"><span class="linenos">155</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-156"><a href="#Expression-156"><span class="linenos">156</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> -</span><span id="Expression-157"><a href="#Expression-157"><span class="linenos">157</span></a><span class="sd"> """</span> -</span><span id="Expression-158"><a href="#Expression-158"><span class="linenos">158</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="Expression-159"><a href="#Expression-159"><span class="linenos">159</span></a> -</span><span id="Expression-160"><a href="#Expression-160"><span class="linenos">160</span></a> <span class="nd">@property</span> -</span><span id="Expression-161"><a href="#Expression-161"><span class="linenos">161</span></a> <span class="k">def</span> <span class="nf">is_int</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Expression-162"><a href="#Expression-162"><span class="linenos">162</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-163"><a href="#Expression-163"><span class="linenos">163</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> -</span><span id="Expression-164"><a href="#Expression-164"><span class="linenos">164</span></a><span class="sd"> """</span> -</span><span id="Expression-165"><a href="#Expression-165"><span class="linenos">165</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_number</span><span class="p">:</span> -</span><span id="Expression-166"><a href="#Expression-166"><span class="linenos">166</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Expression-167"><a href="#Expression-167"><span class="linenos">167</span></a> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="Expression-168"><a href="#Expression-168"><span class="linenos">168</span></a> <span class="k">return</span> <span class="kc">True</span> -</span><span id="Expression-169"><a href="#Expression-169"><span class="linenos">169</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> -</span><span id="Expression-170"><a href="#Expression-170"><span class="linenos">170</span></a> <span class="k">pass</span> -</span><span id="Expression-171"><a href="#Expression-171"><span class="linenos">171</span></a> <span class="k">return</span> <span class="kc">False</span> -</span><span id="Expression-172"><a href="#Expression-172"><span class="linenos">172</span></a> -</span><span id="Expression-173"><a href="#Expression-173"><span class="linenos">173</span></a> <span class="nd">@property</span> -</span><span id="Expression-174"><a href="#Expression-174"><span class="linenos">174</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Expression-175"><a href="#Expression-175"><span class="linenos">175</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> -</span><span id="Expression-176"><a href="#Expression-176"><span class="linenos">176</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Star</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Column</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Star</span><span class="p">))</span> -</span><span id="Expression-177"><a href="#Expression-177"><span class="linenos">177</span></a> -</span><span id="Expression-178"><a href="#Expression-178"><span class="linenos">178</span></a> <span class="nd">@property</span> -</span><span id="Expression-179"><a href="#Expression-179"><span class="linenos">179</span></a> <span class="k">def</span> <span class="nf">alias</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-180"><a href="#Expression-180"><span class="linenos">180</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-181"><a href="#Expression-181"><span class="linenos">181</span></a><span class="sd"> Returns the alias of the expression, or an empty string if it's not aliased.</span> -</span><span id="Expression-182"><a href="#Expression-182"><span class="linenos">182</span></a><span class="sd"> """</span> -</span><span id="Expression-183"><a href="#Expression-183"><span class="linenos">183</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">),</span> <span class="n">TableAlias</span><span class="p">):</span> -</span><span id="Expression-184"><a href="#Expression-184"><span class="linenos">184</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"alias"</span><span class="p">]</span><span class="o">.</span><span class="n">name</span> -</span><span id="Expression-185"><a href="#Expression-185"><span class="linenos">185</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> -</span><span id="Expression-186"><a href="#Expression-186"><span class="linenos">186</span></a> -</span><span id="Expression-187"><a href="#Expression-187"><span class="linenos">187</span></a> <span class="nd">@property</span> -</span><span id="Expression-188"><a href="#Expression-188"><span class="linenos">188</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-189"><a href="#Expression-189"><span class="linenos">189</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> -</span><span id="Expression-190"><a href="#Expression-190"><span class="linenos">190</span></a> -</span><span id="Expression-191"><a href="#Expression-191"><span class="linenos">191</span></a> <span class="nd">@property</span> -</span><span id="Expression-192"><a href="#Expression-192"><span class="linenos">192</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-193"><a href="#Expression-193"><span class="linenos">193</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="Expression-194"><a href="#Expression-194"><span class="linenos">194</span></a> -</span><span id="Expression-195"><a href="#Expression-195"><span class="linenos">195</span></a> <span class="nd">@property</span> -</span><span id="Expression-196"><a href="#Expression-196"><span class="linenos">196</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-197"><a href="#Expression-197"><span class="linenos">197</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-198"><a href="#Expression-198"><span class="linenos">198</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> -</span><span id="Expression-199"><a href="#Expression-199"><span class="linenos">199</span></a> -</span><span id="Expression-200"><a href="#Expression-200"><span class="linenos">200</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> -</span><span id="Expression-201"><a href="#Expression-201"><span class="linenos">201</span></a> -</span><span id="Expression-202"><a href="#Expression-202"><span class="linenos">202</span></a><span class="sd"> Example:</span> -</span><span id="Expression-203"><a href="#Expression-203"><span class="linenos">203</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Expression-204"><a href="#Expression-204"><span class="linenos">204</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> -</span><span id="Expression-205"><a href="#Expression-205"><span class="linenos">205</span></a><span class="sd"> 'a'</span> -</span><span id="Expression-206"><a href="#Expression-206"><span class="linenos">206</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> -</span><span id="Expression-207"><a href="#Expression-207"><span class="linenos">207</span></a><span class="sd"> 'c'</span> -</span><span id="Expression-208"><a href="#Expression-208"><span class="linenos">208</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> -</span><span id="Expression-209"><a href="#Expression-209"><span class="linenos">209</span></a><span class="sd"> ''</span> -</span><span id="Expression-210"><a href="#Expression-210"><span class="linenos">210</span></a><span class="sd"> """</span> -</span><span id="Expression-211"><a href="#Expression-211"><span class="linenos">211</span></a> <span class="k">return</span> <span class="s2">""</span> -</span><span id="Expression-212"><a href="#Expression-212"><span class="linenos">212</span></a> -</span><span id="Expression-213"><a href="#Expression-213"><span class="linenos">213</span></a> <span class="nd">@property</span> -</span><span id="Expression-214"><a href="#Expression-214"><span class="linenos">214</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]:</span> -</span><span id="Expression-215"><a href="#Expression-215"><span class="linenos">215</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> -</span><span id="Expression-216"><a href="#Expression-216"><span class="linenos">216</span></a> -</span><span id="Expression-217"><a href="#Expression-217"><span class="linenos">217</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> -</span><span id="Expression-218"><a href="#Expression-218"><span class="linenos">218</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span> <span class="o">|</span> <span class="nb">str</span><span class="p">])</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> -</span><span id="Expression-219"><a href="#Expression-219"><span class="linenos">219</span></a> <span class="k">if</span> <span class="n">dtype</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> -</span><span id="Expression-220"><a href="#Expression-220"><span class="linenos">220</span></a> <span class="n">dtype</span> <span class="o">=</span> <span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="Expression-221"><a href="#Expression-221"><span class="linenos">221</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="n">dtype</span> <span class="c1"># type: ignore</span> -</span><span id="Expression-222"><a href="#Expression-222"><span class="linenos">222</span></a> -</span><span id="Expression-223"><a href="#Expression-223"><span class="linenos">223</span></a> <span class="k">def</span> <span class="nf">__deepcopy__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">memo</span><span class="p">):</span> -</span><span id="Expression-224"><a href="#Expression-224"><span class="linenos">224</span></a> <span class="n">copy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="o">**</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">))</span> -</span><span id="Expression-225"><a href="#Expression-225"><span class="linenos">225</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> -</span><span id="Expression-226"><a href="#Expression-226"><span class="linenos">226</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> -</span><span id="Expression-227"><a href="#Expression-227"><span class="linenos">227</span></a> <span class="k">return</span> <span class="n">copy</span> -</span><span id="Expression-228"><a href="#Expression-228"><span class="linenos">228</span></a> -</span><span id="Expression-229"><a href="#Expression-229"><span class="linenos">229</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-230"><a href="#Expression-230"><span class="linenos">230</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-231"><a href="#Expression-231"><span class="linenos">231</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="Expression-232"><a href="#Expression-232"><span class="linenos">232</span></a><span class="sd"> """</span> -</span><span id="Expression-233"><a href="#Expression-233"><span class="linenos">233</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="Expression-234"><a href="#Expression-234"><span class="linenos">234</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-235"><a href="#Expression-235"><span class="linenos">235</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> -</span><span id="Expression-236"><a href="#Expression-236"><span class="linenos">236</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="Expression-237"><a href="#Expression-237"><span class="linenos">237</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> -</span><span id="Expression-238"><a href="#Expression-238"><span class="linenos">238</span></a> <span class="k">return</span> <span class="n">new</span> -</span><span id="Expression-239"><a href="#Expression-239"><span class="linenos">239</span></a> -</span><span id="Expression-240"><a href="#Expression-240"><span class="linenos">240</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="Expression-241"><a href="#Expression-241"><span class="linenos">241</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-242"><a href="#Expression-242"><span class="linenos">242</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> -</span><span id="Expression-243"><a href="#Expression-243"><span class="linenos">243</span></a> -</span><span id="Expression-244"><a href="#Expression-244"><span class="linenos">244</span></a><span class="sd"> Args:</span> -</span><span id="Expression-245"><a href="#Expression-245"><span class="linenos">245</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="Expression-246"><a href="#Expression-246"><span class="linenos">246</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="Expression-247"><a href="#Expression-247"><span class="linenos">247</span></a><span class="sd"> """</span> -</span><span id="Expression-248"><a href="#Expression-248"><span class="linenos">248</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="Expression-249"><a href="#Expression-249"><span class="linenos">249</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression-250"><a href="#Expression-250"><span class="linenos">250</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="Expression-251"><a href="#Expression-251"><span class="linenos">251</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="Expression-252"><a href="#Expression-252"><span class="linenos">252</span></a> -</span><span id="Expression-253"><a href="#Expression-253"><span class="linenos">253</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="Expression-254"><a href="#Expression-254"><span class="linenos">254</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-255"><a href="#Expression-255"><span class="linenos">255</span></a><span class="sd"> Sets `arg_key` to `value`.</span> -</span><span id="Expression-256"><a href="#Expression-256"><span class="linenos">256</span></a> -</span><span id="Expression-257"><a href="#Expression-257"><span class="linenos">257</span></a><span class="sd"> Args:</span> -</span><span id="Expression-258"><a href="#Expression-258"><span class="linenos">258</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="Expression-259"><a href="#Expression-259"><span class="linenos">259</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="Expression-260"><a href="#Expression-260"><span class="linenos">260</span></a><span class="sd"> """</span> -</span><span id="Expression-261"><a href="#Expression-261"><span class="linenos">261</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> -</span><span id="Expression-262"><a href="#Expression-262"><span class="linenos">262</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> -</span><span id="Expression-263"><a href="#Expression-263"><span class="linenos">263</span></a> -</span><span id="Expression-264"><a href="#Expression-264"><span class="linenos">264</span></a> <span class="k">def</span> <span class="nf">_set_parent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="Expression-265"><a href="#Expression-265"><span class="linenos">265</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-266"><a href="#Expression-266"><span class="linenos">266</span></a> <span class="n">value</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression-267"><a href="#Expression-267"><span class="linenos">267</span></a> <span class="n">value</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> -</span><span id="Expression-268"><a href="#Expression-268"><span class="linenos">268</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="Expression-269"><a href="#Expression-269"><span class="linenos">269</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">:</span> -</span><span id="Expression-270"><a href="#Expression-270"><span class="linenos">270</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-271"><a href="#Expression-271"><span class="linenos">271</span></a> <span class="n">v</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression-272"><a href="#Expression-272"><span class="linenos">272</span></a> <span class="n">v</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> -</span><span id="Expression-273"><a href="#Expression-273"><span class="linenos">273</span></a> -</span><span id="Expression-274"><a href="#Expression-274"><span class="linenos">274</span></a> <span class="nd">@property</span> -</span><span id="Expression-275"><a href="#Expression-275"><span class="linenos">275</span></a> <span class="k">def</span> <span class="nf">depth</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-276"><a href="#Expression-276"><span class="linenos">276</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-277"><a href="#Expression-277"><span class="linenos">277</span></a><span class="sd"> Returns the depth of this tree.</span> -</span><span id="Expression-278"><a href="#Expression-278"><span class="linenos">278</span></a><span class="sd"> """</span> -</span><span id="Expression-279"><a href="#Expression-279"><span class="linenos">279</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="Expression-280"><a href="#Expression-280"><span class="linenos">280</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span> -</span><span id="Expression-281"><a href="#Expression-281"><span class="linenos">281</span></a> <span class="k">return</span> <span class="mi">0</span> -</span><span id="Expression-282"><a href="#Expression-282"><span class="linenos">282</span></a> -</span><span id="Expression-283"><a href="#Expression-283"><span class="linenos">283</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="Expression-284"><a href="#Expression-284"><span class="linenos">284</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-285"><a href="#Expression-285"><span class="linenos">285</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="Expression-286"><a href="#Expression-286"><span class="linenos">286</span></a><span class="sd"> the specified types.</span> +</span><span id="Expression-94"><a href="#Expression-94"><span class="linenos"> 94</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Expression-95"><a href="#Expression-95"><span class="linenos"> 95</span></a> +</span><span id="Expression-96"><a href="#Expression-96"><span class="linenos"> 96</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression-97"><a href="#Expression-97"><span class="linenos"> 97</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="Expression-98"><a href="#Expression-98"><span class="linenos"> 98</span></a> +</span><span id="Expression-99"><a href="#Expression-99"><span class="linenos"> 99</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Expression-100"><a href="#Expression-100"><span class="linenos">100</span></a> <span class="k">return</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="ow">is</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_args</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> +</span><span id="Expression-101"><a href="#Expression-101"><span class="linenos">101</span></a> +</span><span id="Expression-102"><a href="#Expression-102"><span class="linenos">102</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span> +</span><span id="Expression-103"><a href="#Expression-103"><span class="linenos">103</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">(</span> +</span><span id="Expression-104"><a href="#Expression-104"><span class="linenos">104</span></a> <span class="p">(</span> +</span><span id="Expression-105"><a href="#Expression-105"><span class="linenos">105</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> +</span><span id="Expression-106"><a href="#Expression-106"><span class="linenos">106</span></a> <span class="nb">tuple</span><span class="p">(</span> +</span><span id="Expression-107"><a href="#Expression-107"><span class="linenos">107</span></a> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="k">else</span> <span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">_norm_args</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="Expression-108"><a href="#Expression-108"><span class="linenos">108</span></a> <span class="p">),</span> +</span><span id="Expression-109"><a href="#Expression-109"><span class="linenos">109</span></a> <span class="p">)</span> +</span><span id="Expression-110"><a href="#Expression-110"><span class="linenos">110</span></a> <span class="p">)</span> +</span><span id="Expression-111"><a href="#Expression-111"><span class="linenos">111</span></a> +</span><span id="Expression-112"><a href="#Expression-112"><span class="linenos">112</span></a> <span class="nd">@property</span> +</span><span id="Expression-113"><a href="#Expression-113"><span class="linenos">113</span></a> <span class="k">def</span> <span class="nf">this</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-114"><a href="#Expression-114"><span class="linenos">114</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-115"><a href="#Expression-115"><span class="linenos">115</span></a><span class="sd"> Retrieves the argument with key "this".</span> +</span><span id="Expression-116"><a href="#Expression-116"><span class="linenos">116</span></a><span class="sd"> """</span> +</span><span id="Expression-117"><a href="#Expression-117"><span class="linenos">117</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> +</span><span id="Expression-118"><a href="#Expression-118"><span class="linenos">118</span></a> +</span><span id="Expression-119"><a href="#Expression-119"><span class="linenos">119</span></a> <span class="nd">@property</span> +</span><span id="Expression-120"><a href="#Expression-120"><span class="linenos">120</span></a> <span class="k">def</span> <span class="nf">expression</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-121"><a href="#Expression-121"><span class="linenos">121</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-122"><a href="#Expression-122"><span class="linenos">122</span></a><span class="sd"> Retrieves the argument with key "expression".</span> +</span><span id="Expression-123"><a href="#Expression-123"><span class="linenos">123</span></a><span class="sd"> """</span> +</span><span id="Expression-124"><a href="#Expression-124"><span class="linenos">124</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expression"</span><span class="p">)</span> +</span><span id="Expression-125"><a href="#Expression-125"><span class="linenos">125</span></a> +</span><span id="Expression-126"><a href="#Expression-126"><span class="linenos">126</span></a> <span class="nd">@property</span> +</span><span id="Expression-127"><a href="#Expression-127"><span class="linenos">127</span></a> <span class="k">def</span> <span class="nf">expressions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-128"><a href="#Expression-128"><span class="linenos">128</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-129"><a href="#Expression-129"><span class="linenos">129</span></a><span class="sd"> Retrieves the argument with key "expressions".</span> +</span><span id="Expression-130"><a href="#Expression-130"><span class="linenos">130</span></a><span class="sd"> """</span> +</span><span id="Expression-131"><a href="#Expression-131"><span class="linenos">131</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"expressions"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> +</span><span id="Expression-132"><a href="#Expression-132"><span class="linenos">132</span></a> +</span><span id="Expression-133"><a href="#Expression-133"><span class="linenos">133</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-134"><a href="#Expression-134"><span class="linenos">134</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-135"><a href="#Expression-135"><span class="linenos">135</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> +</span><span id="Expression-136"><a href="#Expression-136"><span class="linenos">136</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> +</span><span id="Expression-137"><a href="#Expression-137"><span class="linenos">137</span></a><span class="sd"> """</span> +</span><span id="Expression-138"><a href="#Expression-138"><span class="linenos">138</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> +</span><span id="Expression-139"><a href="#Expression-139"><span class="linenos">139</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="Expression-140"><a href="#Expression-140"><span class="linenos">140</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="Expression-141"><a href="#Expression-141"><span class="linenos">141</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> +</span><span id="Expression-142"><a href="#Expression-142"><span class="linenos">142</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression-143"><a href="#Expression-143"><span class="linenos">143</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> +</span><span id="Expression-144"><a href="#Expression-144"><span class="linenos">144</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> +</span><span id="Expression-145"><a href="#Expression-145"><span class="linenos">145</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="Expression-146"><a href="#Expression-146"><span class="linenos">146</span></a> +</span><span id="Expression-147"><a href="#Expression-147"><span class="linenos">147</span></a> <span class="nd">@property</span> +</span><span id="Expression-148"><a href="#Expression-148"><span class="linenos">148</span></a> <span class="k">def</span> <span class="nf">is_string</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Expression-149"><a href="#Expression-149"><span class="linenos">149</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-150"><a href="#Expression-150"><span class="linenos">150</span></a><span class="sd"> Checks whether a Literal expression is a string.</span> +</span><span id="Expression-151"><a href="#Expression-151"><span class="linenos">151</span></a><span class="sd"> """</span> +</span><span id="Expression-152"><a href="#Expression-152"><span class="linenos">152</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="Expression-153"><a href="#Expression-153"><span class="linenos">153</span></a> +</span><span id="Expression-154"><a href="#Expression-154"><span class="linenos">154</span></a> <span class="nd">@property</span> +</span><span id="Expression-155"><a href="#Expression-155"><span class="linenos">155</span></a> <span class="k">def</span> <span class="nf">is_number</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Expression-156"><a href="#Expression-156"><span class="linenos">156</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-157"><a href="#Expression-157"><span class="linenos">157</span></a><span class="sd"> Checks whether a Literal expression is a number.</span> +</span><span id="Expression-158"><a href="#Expression-158"><span class="linenos">158</span></a><span class="sd"> """</span> +</span><span id="Expression-159"><a href="#Expression-159"><span class="linenos">159</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="Expression-160"><a href="#Expression-160"><span class="linenos">160</span></a> +</span><span id="Expression-161"><a href="#Expression-161"><span class="linenos">161</span></a> <span class="nd">@property</span> +</span><span id="Expression-162"><a href="#Expression-162"><span class="linenos">162</span></a> <span class="k">def</span> <span class="nf">is_int</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Expression-163"><a href="#Expression-163"><span class="linenos">163</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-164"><a href="#Expression-164"><span class="linenos">164</span></a><span class="sd"> Checks whether a Literal expression is an integer.</span> +</span><span id="Expression-165"><a href="#Expression-165"><span class="linenos">165</span></a><span class="sd"> """</span> +</span><span id="Expression-166"><a href="#Expression-166"><span class="linenos">166</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_number</span><span class="p">:</span> +</span><span id="Expression-167"><a href="#Expression-167"><span class="linenos">167</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Expression-168"><a href="#Expression-168"><span class="linenos">168</span></a> <span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="Expression-169"><a href="#Expression-169"><span class="linenos">169</span></a> <span class="k">return</span> <span class="kc">True</span> +</span><span id="Expression-170"><a href="#Expression-170"><span class="linenos">170</span></a> <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span> +</span><span id="Expression-171"><a href="#Expression-171"><span class="linenos">171</span></a> <span class="k">pass</span> +</span><span id="Expression-172"><a href="#Expression-172"><span class="linenos">172</span></a> <span class="k">return</span> <span class="kc">False</span> +</span><span id="Expression-173"><a href="#Expression-173"><span class="linenos">173</span></a> +</span><span id="Expression-174"><a href="#Expression-174"><span class="linenos">174</span></a> <span class="nd">@property</span> +</span><span id="Expression-175"><a href="#Expression-175"><span class="linenos">175</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Expression-176"><a href="#Expression-176"><span class="linenos">176</span></a><span class="w"> </span><span class="sd">"""Checks whether an expression is a star."""</span> +</span><span id="Expression-177"><a href="#Expression-177"><span class="linenos">177</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Star</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Column</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Star</span><span class="p">))</span> +</span><span id="Expression-178"><a href="#Expression-178"><span class="linenos">178</span></a> +</span><span id="Expression-179"><a href="#Expression-179"><span class="linenos">179</span></a> <span class="nd">@property</span> +</span><span id="Expression-180"><a href="#Expression-180"><span class="linenos">180</span></a> <span class="k">def</span> <span class="nf">alias</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-181"><a href="#Expression-181"><span class="linenos">181</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-182"><a href="#Expression-182"><span class="linenos">182</span></a><span class="sd"> Returns the alias of the expression, or an empty string if it's not aliased.</span> +</span><span id="Expression-183"><a href="#Expression-183"><span class="linenos">183</span></a><span class="sd"> """</span> +</span><span id="Expression-184"><a href="#Expression-184"><span class="linenos">184</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">),</span> <span class="n">TableAlias</span><span class="p">):</span> +</span><span id="Expression-185"><a href="#Expression-185"><span class="linenos">185</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"alias"</span><span class="p">]</span><span class="o">.</span><span class="n">name</span> +</span><span id="Expression-186"><a href="#Expression-186"><span class="linenos">186</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="Expression-187"><a href="#Expression-187"><span class="linenos">187</span></a> +</span><span id="Expression-188"><a href="#Expression-188"><span class="linenos">188</span></a> <span class="nd">@property</span> +</span><span id="Expression-189"><a href="#Expression-189"><span class="linenos">189</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-190"><a href="#Expression-190"><span class="linenos">190</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"this"</span><span class="p">)</span> +</span><span id="Expression-191"><a href="#Expression-191"><span class="linenos">191</span></a> +</span><span id="Expression-192"><a href="#Expression-192"><span class="linenos">192</span></a> <span class="nd">@property</span> +</span><span id="Expression-193"><a href="#Expression-193"><span class="linenos">193</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-194"><a href="#Expression-194"><span class="linenos">194</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="Expression-195"><a href="#Expression-195"><span class="linenos">195</span></a> +</span><span id="Expression-196"><a href="#Expression-196"><span class="linenos">196</span></a> <span class="nd">@property</span> +</span><span id="Expression-197"><a href="#Expression-197"><span class="linenos">197</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-198"><a href="#Expression-198"><span class="linenos">198</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-199"><a href="#Expression-199"><span class="linenos">199</span></a><span class="sd"> Name of the output column if this expression is a selection.</span> +</span><span id="Expression-200"><a href="#Expression-200"><span class="linenos">200</span></a> +</span><span id="Expression-201"><a href="#Expression-201"><span class="linenos">201</span></a><span class="sd"> If the Expression has no output name, an empty string is returned.</span> +</span><span id="Expression-202"><a href="#Expression-202"><span class="linenos">202</span></a> +</span><span id="Expression-203"><a href="#Expression-203"><span class="linenos">203</span></a><span class="sd"> Example:</span> +</span><span id="Expression-204"><a href="#Expression-204"><span class="linenos">204</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Expression-205"><a href="#Expression-205"><span class="linenos">205</span></a><span class="sd"> >>> parse_one("SELECT a").expressions[0].output_name</span> +</span><span id="Expression-206"><a href="#Expression-206"><span class="linenos">206</span></a><span class="sd"> 'a'</span> +</span><span id="Expression-207"><a href="#Expression-207"><span class="linenos">207</span></a><span class="sd"> >>> parse_one("SELECT b AS c").expressions[0].output_name</span> +</span><span id="Expression-208"><a href="#Expression-208"><span class="linenos">208</span></a><span class="sd"> 'c'</span> +</span><span id="Expression-209"><a href="#Expression-209"><span class="linenos">209</span></a><span class="sd"> >>> parse_one("SELECT 1 + 2").expressions[0].output_name</span> +</span><span id="Expression-210"><a href="#Expression-210"><span class="linenos">210</span></a><span class="sd"> ''</span> +</span><span id="Expression-211"><a href="#Expression-211"><span class="linenos">211</span></a><span class="sd"> """</span> +</span><span id="Expression-212"><a href="#Expression-212"><span class="linenos">212</span></a> <span class="k">return</span> <span class="s2">""</span> +</span><span id="Expression-213"><a href="#Expression-213"><span class="linenos">213</span></a> +</span><span id="Expression-214"><a href="#Expression-214"><span class="linenos">214</span></a> <span class="nd">@property</span> +</span><span id="Expression-215"><a href="#Expression-215"><span class="linenos">215</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]:</span> +</span><span id="Expression-216"><a href="#Expression-216"><span class="linenos">216</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> +</span><span id="Expression-217"><a href="#Expression-217"><span class="linenos">217</span></a> +</span><span id="Expression-218"><a href="#Expression-218"><span class="linenos">218</span></a> <span class="nd">@type</span><span class="o">.</span><span class="n">setter</span> +</span><span id="Expression-219"><a href="#Expression-219"><span class="linenos">219</span></a> <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span> <span class="o">|</span> <span class="nb">str</span><span class="p">])</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-220"><a href="#Expression-220"><span class="linenos">220</span></a> <span class="k">if</span> <span class="n">dtype</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> +</span><span id="Expression-221"><a href="#Expression-221"><span class="linenos">221</span></a> <span class="n">dtype</span> <span class="o">=</span> <span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="Expression-222"><a href="#Expression-222"><span class="linenos">222</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="n">dtype</span> <span class="c1"># type: ignore</span> +</span><span id="Expression-223"><a href="#Expression-223"><span class="linenos">223</span></a> +</span><span id="Expression-224"><a href="#Expression-224"><span class="linenos">224</span></a> <span class="nd">@property</span> +</span><span id="Expression-225"><a href="#Expression-225"><span class="linenos">225</span></a> <span class="k">def</span> <span class="nf">meta</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]:</span> +</span><span id="Expression-226"><a href="#Expression-226"><span class="linenos">226</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-227"><a href="#Expression-227"><span class="linenos">227</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="Expression-228"><a href="#Expression-228"><span class="linenos">228</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> +</span><span id="Expression-229"><a href="#Expression-229"><span class="linenos">229</span></a> +</span><span id="Expression-230"><a href="#Expression-230"><span class="linenos">230</span></a> <span class="k">def</span> <span class="nf">__deepcopy__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">memo</span><span class="p">):</span> +</span><span id="Expression-231"><a href="#Expression-231"><span class="linenos">231</span></a> <span class="n">copy</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="o">**</span><span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">))</span> +</span><span id="Expression-232"><a href="#Expression-232"><span class="linenos">232</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-233"><a href="#Expression-233"><span class="linenos">233</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="p">)</span> +</span><span id="Expression-234"><a href="#Expression-234"><span class="linenos">234</span></a> +</span><span id="Expression-235"><a href="#Expression-235"><span class="linenos">235</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-236"><a href="#Expression-236"><span class="linenos">236</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">_type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="Expression-237"><a href="#Expression-237"><span class="linenos">237</span></a> +</span><span id="Expression-238"><a href="#Expression-238"><span class="linenos">238</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="Expression-239"><a href="#Expression-239"><span class="linenos">239</span></a> <span class="n">copy</span><span class="o">.</span><span class="n">_meta</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_meta</span><span class="p">)</span> +</span><span id="Expression-240"><a href="#Expression-240"><span class="linenos">240</span></a> +</span><span id="Expression-241"><a href="#Expression-241"><span class="linenos">241</span></a> <span class="k">return</span> <span class="n">copy</span> +</span><span id="Expression-242"><a href="#Expression-242"><span class="linenos">242</span></a> +</span><span id="Expression-243"><a href="#Expression-243"><span class="linenos">243</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-244"><a href="#Expression-244"><span class="linenos">244</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-245"><a href="#Expression-245"><span class="linenos">245</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="Expression-246"><a href="#Expression-246"><span class="linenos">246</span></a><span class="sd"> """</span> +</span><span id="Expression-247"><a href="#Expression-247"><span class="linenos">247</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="Expression-248"><a href="#Expression-248"><span class="linenos">248</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-249"><a href="#Expression-249"><span class="linenos">249</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> +</span><span id="Expression-250"><a href="#Expression-250"><span class="linenos">250</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="Expression-251"><a href="#Expression-251"><span class="linenos">251</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> +</span><span id="Expression-252"><a href="#Expression-252"><span class="linenos">252</span></a> <span class="k">return</span> <span class="n">new</span> +</span><span id="Expression-253"><a href="#Expression-253"><span class="linenos">253</span></a> +</span><span id="Expression-254"><a href="#Expression-254"><span class="linenos">254</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="Expression-255"><a href="#Expression-255"><span class="linenos">255</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-256"><a href="#Expression-256"><span class="linenos">256</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> +</span><span id="Expression-257"><a href="#Expression-257"><span class="linenos">257</span></a> +</span><span id="Expression-258"><a href="#Expression-258"><span class="linenos">258</span></a><span class="sd"> Args:</span> +</span><span id="Expression-259"><a href="#Expression-259"><span class="linenos">259</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="Expression-260"><a href="#Expression-260"><span class="linenos">260</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="Expression-261"><a href="#Expression-261"><span class="linenos">261</span></a><span class="sd"> """</span> +</span><span id="Expression-262"><a href="#Expression-262"><span class="linenos">262</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="Expression-263"><a href="#Expression-263"><span class="linenos">263</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression-264"><a href="#Expression-264"><span class="linenos">264</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="Expression-265"><a href="#Expression-265"><span class="linenos">265</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="Expression-266"><a href="#Expression-266"><span class="linenos">266</span></a> +</span><span id="Expression-267"><a href="#Expression-267"><span class="linenos">267</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="Expression-268"><a href="#Expression-268"><span class="linenos">268</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-269"><a href="#Expression-269"><span class="linenos">269</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="Expression-270"><a href="#Expression-270"><span class="linenos">270</span></a> +</span><span id="Expression-271"><a href="#Expression-271"><span class="linenos">271</span></a><span class="sd"> Args:</span> +</span><span id="Expression-272"><a href="#Expression-272"><span class="linenos">272</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="Expression-273"><a href="#Expression-273"><span class="linenos">273</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="Expression-274"><a href="#Expression-274"><span class="linenos">274</span></a><span class="sd"> """</span> +</span><span id="Expression-275"><a href="#Expression-275"><span class="linenos">275</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> +</span><span id="Expression-276"><a href="#Expression-276"><span class="linenos">276</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="Expression-277"><a href="#Expression-277"><span class="linenos">277</span></a> +</span><span id="Expression-278"><a href="#Expression-278"><span class="linenos">278</span></a> <span class="k">def</span> <span class="nf">_set_parent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="Expression-279"><a href="#Expression-279"><span class="linenos">279</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-280"><a href="#Expression-280"><span class="linenos">280</span></a> <span class="n">value</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression-281"><a href="#Expression-281"><span class="linenos">281</span></a> <span class="n">value</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> +</span><span id="Expression-282"><a href="#Expression-282"><span class="linenos">282</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="Expression-283"><a href="#Expression-283"><span class="linenos">283</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">:</span> +</span><span id="Expression-284"><a href="#Expression-284"><span class="linenos">284</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-285"><a href="#Expression-285"><span class="linenos">285</span></a> <span class="n">v</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression-286"><a href="#Expression-286"><span class="linenos">286</span></a> <span class="n">v</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">arg_key</span> </span><span id="Expression-287"><a href="#Expression-287"><span class="linenos">287</span></a> -</span><span id="Expression-288"><a href="#Expression-288"><span class="linenos">288</span></a><span class="sd"> Args:</span> -</span><span id="Expression-289"><a href="#Expression-289"><span class="linenos">289</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="Expression-290"><a href="#Expression-290"><span class="linenos">290</span></a> -</span><span id="Expression-291"><a href="#Expression-291"><span class="linenos">291</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-292"><a href="#Expression-292"><span class="linenos">292</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> -</span><span id="Expression-293"><a href="#Expression-293"><span class="linenos">293</span></a><span class="sd"> """</span> -</span><span id="Expression-294"><a href="#Expression-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Expression-295"><a href="#Expression-295"><span class="linenos">295</span></a> -</span><span id="Expression-296"><a href="#Expression-296"><span class="linenos">296</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="Expression-297"><a href="#Expression-297"><span class="linenos">297</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-298"><a href="#Expression-298"><span class="linenos">298</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> -</span><span id="Expression-299"><a href="#Expression-299"><span class="linenos">299</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="Expression-300"><a href="#Expression-300"><span class="linenos">300</span></a> -</span><span id="Expression-301"><a href="#Expression-301"><span class="linenos">301</span></a><span class="sd"> Args:</span> -</span><span id="Expression-302"><a href="#Expression-302"><span class="linenos">302</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="Expression-303"><a href="#Expression-303"><span class="linenos">303</span></a> -</span><span id="Expression-304"><a href="#Expression-304"><span class="linenos">304</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-305"><a href="#Expression-305"><span class="linenos">305</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression-306"><a href="#Expression-306"><span class="linenos">306</span></a><span class="sd"> """</span> -</span><span id="Expression-307"><a href="#Expression-307"><span class="linenos">307</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> -</span><span id="Expression-308"><a href="#Expression-308"><span class="linenos">308</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression-309"><a href="#Expression-309"><span class="linenos">309</span></a> <span class="k">yield</span> <span class="n">expression</span> -</span><span id="Expression-310"><a href="#Expression-310"><span class="linenos">310</span></a> -</span><span id="Expression-311"><a href="#Expression-311"><span class="linenos">311</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression-312"><a href="#Expression-312"><span class="linenos">312</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-313"><a href="#Expression-313"><span class="linenos">313</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="Expression-288"><a href="#Expression-288"><span class="linenos">288</span></a> <span class="nd">@property</span> +</span><span id="Expression-289"><a href="#Expression-289"><span class="linenos">289</span></a> <span class="k">def</span> <span class="nf">depth</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-290"><a href="#Expression-290"><span class="linenos">290</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-291"><a href="#Expression-291"><span class="linenos">291</span></a><span class="sd"> Returns the depth of this tree.</span> +</span><span id="Expression-292"><a href="#Expression-292"><span class="linenos">292</span></a><span class="sd"> """</span> +</span><span id="Expression-293"><a href="#Expression-293"><span class="linenos">293</span></a> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="Expression-294"><a href="#Expression-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="o">.</span><span class="n">depth</span> <span class="o">+</span> <span class="mi">1</span> +</span><span id="Expression-295"><a href="#Expression-295"><span class="linenos">295</span></a> <span class="k">return</span> <span class="mi">0</span> +</span><span id="Expression-296"><a href="#Expression-296"><span class="linenos">296</span></a> +</span><span id="Expression-297"><a href="#Expression-297"><span class="linenos">297</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression-298"><a href="#Expression-298"><span class="linenos">298</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-299"><a href="#Expression-299"><span class="linenos">299</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="Expression-300"><a href="#Expression-300"><span class="linenos">300</span></a><span class="sd"> the specified types.</span> +</span><span id="Expression-301"><a href="#Expression-301"><span class="linenos">301</span></a> +</span><span id="Expression-302"><a href="#Expression-302"><span class="linenos">302</span></a><span class="sd"> Args:</span> +</span><span id="Expression-303"><a href="#Expression-303"><span class="linenos">303</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="Expression-304"><a href="#Expression-304"><span class="linenos">304</span></a> +</span><span id="Expression-305"><a href="#Expression-305"><span class="linenos">305</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-306"><a href="#Expression-306"><span class="linenos">306</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> +</span><span id="Expression-307"><a href="#Expression-307"><span class="linenos">307</span></a><span class="sd"> """</span> +</span><span id="Expression-308"><a href="#Expression-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Expression-309"><a href="#Expression-309"><span class="linenos">309</span></a> +</span><span id="Expression-310"><a href="#Expression-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression-311"><a href="#Expression-311"><span class="linenos">311</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-312"><a href="#Expression-312"><span class="linenos">312</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> +</span><span id="Expression-313"><a href="#Expression-313"><span class="linenos">313</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> </span><span id="Expression-314"><a href="#Expression-314"><span class="linenos">314</span></a> </span><span id="Expression-315"><a href="#Expression-315"><span class="linenos">315</span></a><span class="sd"> Args:</span> </span><span id="Expression-316"><a href="#Expression-316"><span class="linenos">316</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> </span><span id="Expression-317"><a href="#Expression-317"><span class="linenos">317</span></a> </span><span id="Expression-318"><a href="#Expression-318"><span class="linenos">318</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-319"><a href="#Expression-319"><span class="linenos">319</span></a><span class="sd"> The parent node.</span> +</span><span id="Expression-319"><a href="#Expression-319"><span class="linenos">319</span></a><span class="sd"> The generator object.</span> </span><span id="Expression-320"><a href="#Expression-320"><span class="linenos">320</span></a><span class="sd"> """</span> -</span><span id="Expression-321"><a href="#Expression-321"><span class="linenos">321</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-322"><a href="#Expression-322"><span class="linenos">322</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression-323"><a href="#Expression-323"><span class="linenos">323</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-324"><a href="#Expression-324"><span class="linenos">324</span></a> <span class="k">return</span> <span class="n">ancestor</span> -</span><span id="Expression-325"><a href="#Expression-325"><span class="linenos">325</span></a> -</span><span id="Expression-326"><a href="#Expression-326"><span class="linenos">326</span></a> <span class="nd">@property</span> -</span><span id="Expression-327"><a href="#Expression-327"><span class="linenos">327</span></a> <span class="k">def</span> <span class="nf">parent_select</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-328"><a href="#Expression-328"><span class="linenos">328</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-329"><a href="#Expression-329"><span class="linenos">329</span></a><span class="sd"> Returns the parent select statement.</span> -</span><span id="Expression-330"><a href="#Expression-330"><span class="linenos">330</span></a><span class="sd"> """</span> -</span><span id="Expression-331"><a href="#Expression-331"><span class="linenos">331</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_ancestor</span><span class="p">(</span><span class="n">Select</span><span class="p">)</span> -</span><span id="Expression-332"><a href="#Expression-332"><span class="linenos">332</span></a> -</span><span id="Expression-333"><a href="#Expression-333"><span class="linenos">333</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression-334"><a href="#Expression-334"><span class="linenos">334</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-335"><a href="#Expression-335"><span class="linenos">335</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="Expression-336"><a href="#Expression-336"><span class="linenos">336</span></a> -</span><span id="Expression-337"><a href="#Expression-337"><span class="linenos">337</span></a><span class="sd"> Args:</span> -</span><span id="Expression-338"><a href="#Expression-338"><span class="linenos">338</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="Expression-339"><a href="#Expression-339"><span class="linenos">339</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="Expression-340"><a href="#Expression-340"><span class="linenos">340</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="Expression-341"><a href="#Expression-341"><span class="linenos">341</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> -</span><span id="Expression-342"><a href="#Expression-342"><span class="linenos">342</span></a> -</span><span id="Expression-343"><a href="#Expression-343"><span class="linenos">343</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-344"><a href="#Expression-344"><span class="linenos">344</span></a><span class="sd"> the generator object.</span> -</span><span id="Expression-345"><a href="#Expression-345"><span class="linenos">345</span></a><span class="sd"> """</span> -</span><span id="Expression-346"><a href="#Expression-346"><span class="linenos">346</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="Expression-347"><a href="#Expression-347"><span class="linenos">347</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> -</span><span id="Expression-348"><a href="#Expression-348"><span class="linenos">348</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression-349"><a href="#Expression-349"><span class="linenos">349</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="Expression-321"><a href="#Expression-321"><span class="linenos">321</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> +</span><span id="Expression-322"><a href="#Expression-322"><span class="linenos">322</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression-323"><a href="#Expression-323"><span class="linenos">323</span></a> <span class="k">yield</span> <span class="n">expression</span> +</span><span id="Expression-324"><a href="#Expression-324"><span class="linenos">324</span></a> +</span><span id="Expression-325"><a href="#Expression-325"><span class="linenos">325</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression-326"><a href="#Expression-326"><span class="linenos">326</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-327"><a href="#Expression-327"><span class="linenos">327</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="Expression-328"><a href="#Expression-328"><span class="linenos">328</span></a> +</span><span id="Expression-329"><a href="#Expression-329"><span class="linenos">329</span></a><span class="sd"> Args:</span> +</span><span id="Expression-330"><a href="#Expression-330"><span class="linenos">330</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="Expression-331"><a href="#Expression-331"><span class="linenos">331</span></a> +</span><span id="Expression-332"><a href="#Expression-332"><span class="linenos">332</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-333"><a href="#Expression-333"><span class="linenos">333</span></a><span class="sd"> The parent node.</span> +</span><span id="Expression-334"><a href="#Expression-334"><span class="linenos">334</span></a><span class="sd"> """</span> +</span><span id="Expression-335"><a href="#Expression-335"><span class="linenos">335</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-336"><a href="#Expression-336"><span class="linenos">336</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression-337"><a href="#Expression-337"><span class="linenos">337</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-338"><a href="#Expression-338"><span class="linenos">338</span></a> <span class="k">return</span> <span class="n">ancestor</span> +</span><span id="Expression-339"><a href="#Expression-339"><span class="linenos">339</span></a> +</span><span id="Expression-340"><a href="#Expression-340"><span class="linenos">340</span></a> <span class="nd">@property</span> +</span><span id="Expression-341"><a href="#Expression-341"><span class="linenos">341</span></a> <span class="k">def</span> <span class="nf">parent_select</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-342"><a href="#Expression-342"><span class="linenos">342</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-343"><a href="#Expression-343"><span class="linenos">343</span></a><span class="sd"> Returns the parent select statement.</span> +</span><span id="Expression-344"><a href="#Expression-344"><span class="linenos">344</span></a><span class="sd"> """</span> +</span><span id="Expression-345"><a href="#Expression-345"><span class="linenos">345</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">find_ancestor</span><span class="p">(</span><span class="n">Select</span><span class="p">)</span> +</span><span id="Expression-346"><a href="#Expression-346"><span class="linenos">346</span></a> +</span><span id="Expression-347"><a href="#Expression-347"><span class="linenos">347</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression-348"><a href="#Expression-348"><span class="linenos">348</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-349"><a href="#Expression-349"><span class="linenos">349</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> </span><span id="Expression-350"><a href="#Expression-350"><span class="linenos">350</span></a> -</span><span id="Expression-351"><a href="#Expression-351"><span class="linenos">351</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression-352"><a href="#Expression-352"><span class="linenos">352</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-353"><a href="#Expression-353"><span class="linenos">353</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression-354"><a href="#Expression-354"><span class="linenos">354</span></a><span class="sd"> the DFS (Depth-first) order.</span> -</span><span id="Expression-355"><a href="#Expression-355"><span class="linenos">355</span></a> -</span><span id="Expression-356"><a href="#Expression-356"><span class="linenos">356</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-357"><a href="#Expression-357"><span class="linenos">357</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression-358"><a href="#Expression-358"><span class="linenos">358</span></a><span class="sd"> """</span> -</span><span id="Expression-359"><a href="#Expression-359"><span class="linenos">359</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-360"><a href="#Expression-360"><span class="linenos">360</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="Expression-361"><a href="#Expression-361"><span class="linenos">361</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="Expression-362"><a href="#Expression-362"><span class="linenos">362</span></a> <span class="k">return</span> -</span><span id="Expression-363"><a href="#Expression-363"><span class="linenos">363</span></a> -</span><span id="Expression-364"><a href="#Expression-364"><span class="linenos">364</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression-365"><a href="#Expression-365"><span class="linenos">365</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="Expression-366"><a href="#Expression-366"><span class="linenos">366</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-367"><a href="#Expression-367"><span class="linenos">367</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> -</span><span id="Expression-368"><a href="#Expression-368"><span class="linenos">368</span></a> -</span><span id="Expression-369"><a href="#Expression-369"><span class="linenos">369</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression-370"><a href="#Expression-370"><span class="linenos">370</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-371"><a href="#Expression-371"><span class="linenos">371</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression-372"><a href="#Expression-372"><span class="linenos">372</span></a><span class="sd"> the BFS (Breadth-first) order.</span> -</span><span id="Expression-373"><a href="#Expression-373"><span class="linenos">373</span></a> -</span><span id="Expression-374"><a href="#Expression-374"><span class="linenos">374</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-375"><a href="#Expression-375"><span class="linenos">375</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression-376"><a href="#Expression-376"><span class="linenos">376</span></a><span class="sd"> """</span> -</span><span id="Expression-377"><a href="#Expression-377"><span class="linenos">377</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> -</span><span id="Expression-378"><a href="#Expression-378"><span class="linenos">378</span></a> -</span><span id="Expression-379"><a href="#Expression-379"><span class="linenos">379</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="Expression-380"><a href="#Expression-380"><span class="linenos">380</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> -</span><span id="Expression-381"><a href="#Expression-381"><span class="linenos">381</span></a> -</span><span id="Expression-382"><a href="#Expression-382"><span class="linenos">382</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="Expression-383"><a href="#Expression-383"><span class="linenos">383</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="Expression-384"><a href="#Expression-384"><span class="linenos">384</span></a> <span class="k">continue</span> -</span><span id="Expression-385"><a href="#Expression-385"><span class="linenos">385</span></a> -</span><span id="Expression-386"><a href="#Expression-386"><span class="linenos">386</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-387"><a href="#Expression-387"><span class="linenos">387</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression-388"><a href="#Expression-388"><span class="linenos">388</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="Expression-389"><a href="#Expression-389"><span class="linenos">389</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-390"><a href="#Expression-390"><span class="linenos">390</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> -</span><span id="Expression-391"><a href="#Expression-391"><span class="linenos">391</span></a> -</span><span id="Expression-392"><a href="#Expression-392"><span class="linenos">392</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-393"><a href="#Expression-393"><span class="linenos">393</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-394"><a href="#Expression-394"><span class="linenos">394</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="Expression-395"><a href="#Expression-395"><span class="linenos">395</span></a><span class="sd"> """</span> -</span><span id="Expression-396"><a href="#Expression-396"><span class="linenos">396</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression-397"><a href="#Expression-397"><span class="linenos">397</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> -</span><span id="Expression-398"><a href="#Expression-398"><span class="linenos">398</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression-399"><a href="#Expression-399"><span class="linenos">399</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Expression-400"><a href="#Expression-400"><span class="linenos">400</span></a> -</span><span id="Expression-401"><a href="#Expression-401"><span class="linenos">401</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-402"><a href="#Expression-402"><span class="linenos">402</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-403"><a href="#Expression-403"><span class="linenos">403</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="Expression-404"><a href="#Expression-404"><span class="linenos">404</span></a><span class="sd"> """</span> -</span><span id="Expression-405"><a href="#Expression-405"><span class="linenos">405</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> -</span><span id="Expression-406"><a href="#Expression-406"><span class="linenos">406</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression-407"><a href="#Expression-407"><span class="linenos">407</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="Expression-408"><a href="#Expression-408"><span class="linenos">408</span></a> -</span><span id="Expression-409"><a href="#Expression-409"><span class="linenos">409</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-410"><a href="#Expression-410"><span class="linenos">410</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-411"><a href="#Expression-411"><span class="linenos">411</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="Expression-412"><a href="#Expression-412"><span class="linenos">412</span></a><span class="sd"> """</span> -</span><span id="Expression-413"><a href="#Expression-413"><span class="linenos">413</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> +</span><span id="Expression-351"><a href="#Expression-351"><span class="linenos">351</span></a><span class="sd"> Args:</span> +</span><span id="Expression-352"><a href="#Expression-352"><span class="linenos">352</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="Expression-353"><a href="#Expression-353"><span class="linenos">353</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="Expression-354"><a href="#Expression-354"><span class="linenos">354</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="Expression-355"><a href="#Expression-355"><span class="linenos">355</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> +</span><span id="Expression-356"><a href="#Expression-356"><span class="linenos">356</span></a> +</span><span id="Expression-357"><a href="#Expression-357"><span class="linenos">357</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-358"><a href="#Expression-358"><span class="linenos">358</span></a><span class="sd"> the generator object.</span> +</span><span id="Expression-359"><a href="#Expression-359"><span class="linenos">359</span></a><span class="sd"> """</span> +</span><span id="Expression-360"><a href="#Expression-360"><span class="linenos">360</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="Expression-361"><a href="#Expression-361"><span class="linenos">361</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="Expression-362"><a href="#Expression-362"><span class="linenos">362</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression-363"><a href="#Expression-363"><span class="linenos">363</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="Expression-364"><a href="#Expression-364"><span class="linenos">364</span></a> +</span><span id="Expression-365"><a href="#Expression-365"><span class="linenos">365</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression-366"><a href="#Expression-366"><span class="linenos">366</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-367"><a href="#Expression-367"><span class="linenos">367</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression-368"><a href="#Expression-368"><span class="linenos">368</span></a><span class="sd"> the DFS (Depth-first) order.</span> +</span><span id="Expression-369"><a href="#Expression-369"><span class="linenos">369</span></a> +</span><span id="Expression-370"><a href="#Expression-370"><span class="linenos">370</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-371"><a href="#Expression-371"><span class="linenos">371</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression-372"><a href="#Expression-372"><span class="linenos">372</span></a><span class="sd"> """</span> +</span><span id="Expression-373"><a href="#Expression-373"><span class="linenos">373</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-374"><a href="#Expression-374"><span class="linenos">374</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="Expression-375"><a href="#Expression-375"><span class="linenos">375</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="Expression-376"><a href="#Expression-376"><span class="linenos">376</span></a> <span class="k">return</span> +</span><span id="Expression-377"><a href="#Expression-377"><span class="linenos">377</span></a> +</span><span id="Expression-378"><a href="#Expression-378"><span class="linenos">378</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression-379"><a href="#Expression-379"><span class="linenos">379</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="Expression-380"><a href="#Expression-380"><span class="linenos">380</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-381"><a href="#Expression-381"><span class="linenos">381</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> +</span><span id="Expression-382"><a href="#Expression-382"><span class="linenos">382</span></a> +</span><span id="Expression-383"><a href="#Expression-383"><span class="linenos">383</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression-384"><a href="#Expression-384"><span class="linenos">384</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-385"><a href="#Expression-385"><span class="linenos">385</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression-386"><a href="#Expression-386"><span class="linenos">386</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="Expression-387"><a href="#Expression-387"><span class="linenos">387</span></a> +</span><span id="Expression-388"><a href="#Expression-388"><span class="linenos">388</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-389"><a href="#Expression-389"><span class="linenos">389</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression-390"><a href="#Expression-390"><span class="linenos">390</span></a><span class="sd"> """</span> +</span><span id="Expression-391"><a href="#Expression-391"><span class="linenos">391</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> +</span><span id="Expression-392"><a href="#Expression-392"><span class="linenos">392</span></a> +</span><span id="Expression-393"><a href="#Expression-393"><span class="linenos">393</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="Expression-394"><a href="#Expression-394"><span class="linenos">394</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> +</span><span id="Expression-395"><a href="#Expression-395"><span class="linenos">395</span></a> +</span><span id="Expression-396"><a href="#Expression-396"><span class="linenos">396</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="Expression-397"><a href="#Expression-397"><span class="linenos">397</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="Expression-398"><a href="#Expression-398"><span class="linenos">398</span></a> <span class="k">continue</span> +</span><span id="Expression-399"><a href="#Expression-399"><span class="linenos">399</span></a> +</span><span id="Expression-400"><a href="#Expression-400"><span class="linenos">400</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-401"><a href="#Expression-401"><span class="linenos">401</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression-402"><a href="#Expression-402"><span class="linenos">402</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="Expression-403"><a href="#Expression-403"><span class="linenos">403</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-404"><a href="#Expression-404"><span class="linenos">404</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> +</span><span id="Expression-405"><a href="#Expression-405"><span class="linenos">405</span></a> +</span><span id="Expression-406"><a href="#Expression-406"><span class="linenos">406</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-407"><a href="#Expression-407"><span class="linenos">407</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-408"><a href="#Expression-408"><span class="linenos">408</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="Expression-409"><a href="#Expression-409"><span class="linenos">409</span></a><span class="sd"> """</span> +</span><span id="Expression-410"><a href="#Expression-410"><span class="linenos">410</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression-411"><a href="#Expression-411"><span class="linenos">411</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> +</span><span id="Expression-412"><a href="#Expression-412"><span class="linenos">412</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression-413"><a href="#Expression-413"><span class="linenos">413</span></a> <span class="k">return</span> <span class="n">expression</span> </span><span id="Expression-414"><a href="#Expression-414"><span class="linenos">414</span></a> -</span><span id="Expression-415"><a href="#Expression-415"><span class="linenos">415</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression-415"><a href="#Expression-415"><span class="linenos">415</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> </span><span id="Expression-416"><a href="#Expression-416"><span class="linenos">416</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-417"><a href="#Expression-417"><span class="linenos">417</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> -</span><span id="Expression-418"><a href="#Expression-418"><span class="linenos">418</span></a> -</span><span id="Expression-419"><a href="#Expression-419"><span class="linenos">419</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="Expression-420"><a href="#Expression-420"><span class="linenos">420</span></a><span class="sd"> """</span> -</span><span id="Expression-421"><a href="#Expression-421"><span class="linenos">421</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> -</span><span id="Expression-422"><a href="#Expression-422"><span class="linenos">422</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="Expression-423"><a href="#Expression-423"><span class="linenos">423</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> -</span><span id="Expression-424"><a href="#Expression-424"><span class="linenos">424</span></a> -</span><span id="Expression-425"><a href="#Expression-425"><span class="linenos">425</span></a> <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-426"><a href="#Expression-426"><span class="linenos">426</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">()</span> -</span><span id="Expression-427"><a href="#Expression-427"><span class="linenos">427</span></a> -</span><span id="Expression-428"><a href="#Expression-428"><span class="linenos">428</span></a> <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-429"><a href="#Expression-429"><span class="linenos">429</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_to_s</span><span class="p">()</span> -</span><span id="Expression-430"><a href="#Expression-430"><span class="linenos">430</span></a> -</span><span id="Expression-431"><a href="#Expression-431"><span class="linenos">431</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-432"><a href="#Expression-432"><span class="linenos">432</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-433"><a href="#Expression-433"><span class="linenos">433</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="Expression-434"><a href="#Expression-434"><span class="linenos">434</span></a> -</span><span id="Expression-435"><a href="#Expression-435"><span class="linenos">435</span></a><span class="sd"> Args:</span> -</span><span id="Expression-436"><a href="#Expression-436"><span class="linenos">436</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="Expression-437"><a href="#Expression-437"><span class="linenos">437</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="Expression-417"><a href="#Expression-417"><span class="linenos">417</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="Expression-418"><a href="#Expression-418"><span class="linenos">418</span></a><span class="sd"> """</span> +</span><span id="Expression-419"><a href="#Expression-419"><span class="linenos">419</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> +</span><span id="Expression-420"><a href="#Expression-420"><span class="linenos">420</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression-421"><a href="#Expression-421"><span class="linenos">421</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="Expression-422"><a href="#Expression-422"><span class="linenos">422</span></a> +</span><span id="Expression-423"><a href="#Expression-423"><span class="linenos">423</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-424"><a href="#Expression-424"><span class="linenos">424</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-425"><a href="#Expression-425"><span class="linenos">425</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="Expression-426"><a href="#Expression-426"><span class="linenos">426</span></a><span class="sd"> """</span> +</span><span id="Expression-427"><a href="#Expression-427"><span class="linenos">427</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> +</span><span id="Expression-428"><a href="#Expression-428"><span class="linenos">428</span></a> +</span><span id="Expression-429"><a href="#Expression-429"><span class="linenos">429</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression-430"><a href="#Expression-430"><span class="linenos">430</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-431"><a href="#Expression-431"><span class="linenos">431</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> +</span><span id="Expression-432"><a href="#Expression-432"><span class="linenos">432</span></a> +</span><span id="Expression-433"><a href="#Expression-433"><span class="linenos">433</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="Expression-434"><a href="#Expression-434"><span class="linenos">434</span></a><span class="sd"> """</span> +</span><span id="Expression-435"><a href="#Expression-435"><span class="linenos">435</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> +</span><span id="Expression-436"><a href="#Expression-436"><span class="linenos">436</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="Expression-437"><a href="#Expression-437"><span class="linenos">437</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> </span><span id="Expression-438"><a href="#Expression-438"><span class="linenos">438</span></a> -</span><span id="Expression-439"><a href="#Expression-439"><span class="linenos">439</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-440"><a href="#Expression-440"><span class="linenos">440</span></a><span class="sd"> The SQL string.</span> -</span><span id="Expression-441"><a href="#Expression-441"><span class="linenos">441</span></a><span class="sd"> """</span> -</span><span id="Expression-442"><a href="#Expression-442"><span class="linenos">442</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> -</span><span id="Expression-443"><a href="#Expression-443"><span class="linenos">443</span></a> -</span><span id="Expression-444"><a href="#Expression-444"><span class="linenos">444</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Expression-445"><a href="#Expression-445"><span class="linenos">445</span></a> -</span><span id="Expression-446"><a href="#Expression-446"><span class="linenos">446</span></a> <span class="k">def</span> <span class="nf">_to_s</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hide_missing</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression-447"><a href="#Expression-447"><span class="linenos">447</span></a> <span class="n">indent</span> <span class="o">=</span> <span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">level</span> <span class="k">else</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> -</span><span id="Expression-448"><a href="#Expression-448"><span class="linenos">448</span></a> <span class="n">indent</span> <span class="o">+=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span><span class="p">]</span> <span class="o">*</span> <span class="n">level</span><span class="p">)</span> -</span><span id="Expression-449"><a href="#Expression-449"><span class="linenos">449</span></a> <span class="n">left</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="si">}</span><span class="s2"> "</span> -</span><span id="Expression-450"><a href="#Expression-450"><span class="linenos">450</span></a> -</span><span id="Expression-451"><a href="#Expression-451"><span class="linenos">451</span></a> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Expression-452"><a href="#Expression-452"><span class="linenos">452</span></a> <span class="n">k</span><span class="p">:</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> -</span><span id="Expression-453"><a href="#Expression-453"><span class="linenos">453</span></a> <span class="n">v</span><span class="o">.</span><span class="n">_to_s</span><span class="p">(</span><span class="n">hide_missing</span><span class="o">=</span><span class="n">hide_missing</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="n">level</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> -</span><span id="Expression-454"><a href="#Expression-454"><span class="linenos">454</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="s2">"_to_s"</span><span class="p">)</span> -</span><span id="Expression-455"><a href="#Expression-455"><span class="linenos">455</span></a> <span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> -</span><span id="Expression-456"><a href="#Expression-456"><span class="linenos">456</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> -</span><span id="Expression-457"><a href="#Expression-457"><span class="linenos">457</span></a> <span class="k">if</span> <span class="n">v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> -</span><span id="Expression-458"><a href="#Expression-458"><span class="linenos">458</span></a> <span class="p">)</span> -</span><span id="Expression-459"><a href="#Expression-459"><span class="linenos">459</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="Expression-460"><a href="#Expression-460"><span class="linenos">460</span></a> <span class="p">}</span> -</span><span id="Expression-461"><a href="#Expression-461"><span class="linenos">461</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"comments"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> -</span><span id="Expression-462"><a href="#Expression-462"><span class="linenos">462</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> -</span><span id="Expression-463"><a href="#Expression-463"><span class="linenos">463</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">hide_missing</span><span class="p">}</span> +</span><span id="Expression-439"><a href="#Expression-439"><span class="linenos">439</span></a> <span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-440"><a href="#Expression-440"><span class="linenos">440</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sql</span><span class="p">()</span> +</span><span id="Expression-441"><a href="#Expression-441"><span class="linenos">441</span></a> +</span><span id="Expression-442"><a href="#Expression-442"><span class="linenos">442</span></a> <span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-443"><a href="#Expression-443"><span class="linenos">443</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_to_s</span><span class="p">()</span> +</span><span id="Expression-444"><a href="#Expression-444"><span class="linenos">444</span></a> +</span><span id="Expression-445"><a href="#Expression-445"><span class="linenos">445</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-446"><a href="#Expression-446"><span class="linenos">446</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-447"><a href="#Expression-447"><span class="linenos">447</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="Expression-448"><a href="#Expression-448"><span class="linenos">448</span></a> +</span><span id="Expression-449"><a href="#Expression-449"><span class="linenos">449</span></a><span class="sd"> Args:</span> +</span><span id="Expression-450"><a href="#Expression-450"><span class="linenos">450</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="Expression-451"><a href="#Expression-451"><span class="linenos">451</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="Expression-452"><a href="#Expression-452"><span class="linenos">452</span></a> +</span><span id="Expression-453"><a href="#Expression-453"><span class="linenos">453</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-454"><a href="#Expression-454"><span class="linenos">454</span></a><span class="sd"> The SQL string.</span> +</span><span id="Expression-455"><a href="#Expression-455"><span class="linenos">455</span></a><span class="sd"> """</span> +</span><span id="Expression-456"><a href="#Expression-456"><span class="linenos">456</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> +</span><span id="Expression-457"><a href="#Expression-457"><span class="linenos">457</span></a> +</span><span id="Expression-458"><a href="#Expression-458"><span class="linenos">458</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Expression-459"><a href="#Expression-459"><span class="linenos">459</span></a> +</span><span id="Expression-460"><a href="#Expression-460"><span class="linenos">460</span></a> <span class="k">def</span> <span class="nf">_to_s</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hide_missing</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">level</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression-461"><a href="#Expression-461"><span class="linenos">461</span></a> <span class="n">indent</span> <span class="o">=</span> <span class="s2">""</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">level</span> <span class="k">else</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> +</span><span id="Expression-462"><a href="#Expression-462"><span class="linenos">462</span></a> <span class="n">indent</span> <span class="o">+=</span> <span class="s2">""</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="s2">" "</span><span class="p">]</span> <span class="o">*</span> <span class="n">level</span><span class="p">)</span> +</span><span id="Expression-463"><a href="#Expression-463"><span class="linenos">463</span></a> <span class="n">left</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"(</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="si">}</span><span class="s2"> "</span> </span><span id="Expression-464"><a href="#Expression-464"><span class="linenos">464</span></a> -</span><span id="Expression-465"><a href="#Expression-465"><span class="linenos">465</span></a> <span class="n">right</span> <span class="o">=</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s2">"</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> -</span><span id="Expression-466"><a href="#Expression-466"><span class="linenos">466</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> -</span><span id="Expression-467"><a href="#Expression-467"><span class="linenos">467</span></a> -</span><span id="Expression-468"><a href="#Expression-468"><span class="linenos">468</span></a> <span class="k">return</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">left</span> <span class="o">+</span> <span class="n">right</span> -</span><span id="Expression-469"><a href="#Expression-469"><span class="linenos">469</span></a> -</span><span id="Expression-470"><a href="#Expression-470"><span class="linenos">470</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="Expression-471"><a href="#Expression-471"><span class="linenos">471</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-472"><a href="#Expression-472"><span class="linenos">472</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="Expression-473"><a href="#Expression-473"><span class="linenos">473</span></a><span class="sd"> and applies the given transformation function to each node.</span> -</span><span id="Expression-474"><a href="#Expression-474"><span class="linenos">474</span></a> -</span><span id="Expression-475"><a href="#Expression-475"><span class="linenos">475</span></a><span class="sd"> Args:</span> -</span><span id="Expression-476"><a href="#Expression-476"><span class="linenos">476</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> -</span><span id="Expression-477"><a href="#Expression-477"><span class="linenos">477</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="Expression-478"><a href="#Expression-478"><span class="linenos">478</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="Expression-479"><a href="#Expression-479"><span class="linenos">479</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> -</span><span id="Expression-480"><a href="#Expression-480"><span class="linenos">480</span></a><span class="sd"> modified in place.</span> +</span><span id="Expression-465"><a href="#Expression-465"><span class="linenos">465</span></a> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Expression-466"><a href="#Expression-466"><span class="linenos">466</span></a> <span class="n">k</span><span class="p">:</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> +</span><span id="Expression-467"><a href="#Expression-467"><span class="linenos">467</span></a> <span class="n">v</span><span class="o">.</span><span class="n">_to_s</span><span class="p">(</span><span class="n">hide_missing</span><span class="o">=</span><span class="n">hide_missing</span><span class="p">,</span> <span class="n">level</span><span class="o">=</span><span class="n">level</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> +</span><span id="Expression-468"><a href="#Expression-468"><span class="linenos">468</span></a> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="s2">"_to_s"</span><span class="p">)</span> +</span><span id="Expression-469"><a href="#Expression-469"><span class="linenos">469</span></a> <span class="k">else</span> <span class="nb">str</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> +</span><span id="Expression-470"><a href="#Expression-470"><span class="linenos">470</span></a> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">vs</span><span class="p">)</span> +</span><span id="Expression-471"><a href="#Expression-471"><span class="linenos">471</span></a> <span class="k">if</span> <span class="n">v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> +</span><span id="Expression-472"><a href="#Expression-472"><span class="linenos">472</span></a> <span class="p">)</span> +</span><span id="Expression-473"><a href="#Expression-473"><span class="linenos">473</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">vs</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="Expression-474"><a href="#Expression-474"><span class="linenos">474</span></a> <span class="p">}</span> +</span><span id="Expression-475"><a href="#Expression-475"><span class="linenos">475</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"comments"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span> +</span><span id="Expression-476"><a href="#Expression-476"><span class="linenos">476</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"type"</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> +</span><span id="Expression-477"><a href="#Expression-477"><span class="linenos">477</span></a> <span class="n">args</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="ow">or</span> <span class="ow">not</span> <span class="n">hide_missing</span><span class="p">}</span> +</span><span id="Expression-478"><a href="#Expression-478"><span class="linenos">478</span></a> +</span><span id="Expression-479"><a href="#Expression-479"><span class="linenos">479</span></a> <span class="n">right</span> <span class="o">=</span> <span class="s2">", "</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s2">"</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">())</span> +</span><span id="Expression-480"><a href="#Expression-480"><span class="linenos">480</span></a> <span class="n">right</span> <span class="o">+=</span> <span class="s2">")"</span> </span><span id="Expression-481"><a href="#Expression-481"><span class="linenos">481</span></a> -</span><span id="Expression-482"><a href="#Expression-482"><span class="linenos">482</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-483"><a href="#Expression-483"><span class="linenos">483</span></a><span class="sd"> The transformed tree.</span> -</span><span id="Expression-484"><a href="#Expression-484"><span class="linenos">484</span></a><span class="sd"> """</span> -</span><span id="Expression-485"><a href="#Expression-485"><span class="linenos">485</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="Expression-486"><a href="#Expression-486"><span class="linenos">486</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="Expression-487"><a href="#Expression-487"><span class="linenos">487</span></a> -</span><span id="Expression-488"><a href="#Expression-488"><span class="linenos">488</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression-489"><a href="#Expression-489"><span class="linenos">489</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression-490"><a href="#Expression-490"><span class="linenos">490</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> -</span><span id="Expression-491"><a href="#Expression-491"><span class="linenos">491</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-492"><a href="#Expression-492"><span class="linenos">492</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression-493"><a href="#Expression-493"><span class="linenos">493</span></a> -</span><span id="Expression-494"><a href="#Expression-494"><span class="linenos">494</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> -</span><span id="Expression-495"><a href="#Expression-495"><span class="linenos">495</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression-496"><a href="#Expression-496"><span class="linenos">496</span></a> -</span><span id="Expression-497"><a href="#Expression-497"><span class="linenos">497</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> -</span><span id="Expression-498"><a href="#Expression-498"><span class="linenos">498</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-499"><a href="#Expression-499"><span class="linenos">499</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="Expression-500"><a href="#Expression-500"><span class="linenos">500</span></a> -</span><span id="Expression-501"><a href="#Expression-501"><span class="linenos">501</span></a><span class="sd"> For example::</span> -</span><span id="Expression-502"><a href="#Expression-502"><span class="linenos">502</span></a> -</span><span id="Expression-503"><a href="#Expression-503"><span class="linenos">503</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="Expression-504"><a href="#Expression-504"><span class="linenos">504</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="Expression-505"><a href="#Expression-505"><span class="linenos">505</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="Expression-506"><a href="#Expression-506"><span class="linenos">506</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="Expression-507"><a href="#Expression-507"><span class="linenos">507</span></a><span class="sd"> 'SELECT y FROM tbl'</span> -</span><span id="Expression-508"><a href="#Expression-508"><span class="linenos">508</span></a> -</span><span id="Expression-509"><a href="#Expression-509"><span class="linenos">509</span></a><span class="sd"> Args:</span> -</span><span id="Expression-510"><a href="#Expression-510"><span class="linenos">510</span></a><span class="sd"> expression (Expression|None): new node</span> -</span><span id="Expression-511"><a href="#Expression-511"><span class="linenos">511</span></a> -</span><span id="Expression-512"><a href="#Expression-512"><span class="linenos">512</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-513"><a href="#Expression-513"><span class="linenos">513</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="Expression-514"><a href="#Expression-514"><span class="linenos">514</span></a><span class="sd"> """</span> -</span><span id="Expression-515"><a href="#Expression-515"><span class="linenos">515</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="Expression-516"><a href="#Expression-516"><span class="linenos">516</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Expression-517"><a href="#Expression-517"><span class="linenos">517</span></a> -</span><span id="Expression-518"><a href="#Expression-518"><span class="linenos">518</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression-519"><a href="#Expression-519"><span class="linenos">519</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Expression-520"><a href="#Expression-520"><span class="linenos">520</span></a> -</span><span id="Expression-521"><a href="#Expression-521"><span class="linenos">521</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> -</span><span id="Expression-522"><a href="#Expression-522"><span class="linenos">522</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Expression-523"><a href="#Expression-523"><span class="linenos">523</span></a> -</span><span id="Expression-524"><a href="#Expression-524"><span class="linenos">524</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-525"><a href="#Expression-525"><span class="linenos">525</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-526"><a href="#Expression-526"><span class="linenos">526</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="Expression-527"><a href="#Expression-527"><span class="linenos">527</span></a><span class="sd"> """</span> -</span><span id="Expression-528"><a href="#Expression-528"><span class="linenos">528</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> -</span><span id="Expression-529"><a href="#Expression-529"><span class="linenos">529</span></a> -</span><span id="Expression-530"><a href="#Expression-530"><span class="linenos">530</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> -</span><span id="Expression-531"><a href="#Expression-531"><span class="linenos">531</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-532"><a href="#Expression-532"><span class="linenos">532</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> -</span><span id="Expression-533"><a href="#Expression-533"><span class="linenos">533</span></a> -</span><span id="Expression-534"><a href="#Expression-534"><span class="linenos">534</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> -</span><span id="Expression-535"><a href="#Expression-535"><span class="linenos">535</span></a><span class="sd"> Otherwise, this returns this expression.</span> -</span><span id="Expression-536"><a href="#Expression-536"><span class="linenos">536</span></a> -</span><span id="Expression-537"><a href="#Expression-537"><span class="linenos">537</span></a><span class="sd"> Examples:</span> -</span><span id="Expression-538"><a href="#Expression-538"><span class="linenos">538</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="Expression-539"><a href="#Expression-539"><span class="linenos">539</span></a> -</span><span id="Expression-540"><a href="#Expression-540"><span class="linenos">540</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Expression-541"><a href="#Expression-541"><span class="linenos">541</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> -</span><span id="Expression-542"><a href="#Expression-542"><span class="linenos">542</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="Expression-543"><a href="#Expression-543"><span class="linenos">543</span></a><span class="sd"> """</span> -</span><span id="Expression-544"><a href="#Expression-544"><span class="linenos">544</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> -</span><span id="Expression-545"><a href="#Expression-545"><span class="linenos">545</span></a> <span class="k">return</span> <span class="bp">self</span> -</span><span id="Expression-546"><a href="#Expression-546"><span class="linenos">546</span></a> -</span><span id="Expression-547"><a href="#Expression-547"><span class="linenos">547</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="Expression-548"><a href="#Expression-548"><span class="linenos">548</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-549"><a href="#Expression-549"><span class="linenos">549</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="Expression-482"><a href="#Expression-482"><span class="linenos">482</span></a> <span class="k">return</span> <span class="n">indent</span> <span class="o">+</span> <span class="n">left</span> <span class="o">+</span> <span class="n">right</span> +</span><span id="Expression-483"><a href="#Expression-483"><span class="linenos">483</span></a> +</span><span id="Expression-484"><a href="#Expression-484"><span class="linenos">484</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="Expression-485"><a href="#Expression-485"><span class="linenos">485</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-486"><a href="#Expression-486"><span class="linenos">486</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="Expression-487"><a href="#Expression-487"><span class="linenos">487</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="Expression-488"><a href="#Expression-488"><span class="linenos">488</span></a> +</span><span id="Expression-489"><a href="#Expression-489"><span class="linenos">489</span></a><span class="sd"> Args:</span> +</span><span id="Expression-490"><a href="#Expression-490"><span class="linenos">490</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> +</span><span id="Expression-491"><a href="#Expression-491"><span class="linenos">491</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="Expression-492"><a href="#Expression-492"><span class="linenos">492</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="Expression-493"><a href="#Expression-493"><span class="linenos">493</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> +</span><span id="Expression-494"><a href="#Expression-494"><span class="linenos">494</span></a><span class="sd"> modified in place.</span> +</span><span id="Expression-495"><a href="#Expression-495"><span class="linenos">495</span></a> +</span><span id="Expression-496"><a href="#Expression-496"><span class="linenos">496</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-497"><a href="#Expression-497"><span class="linenos">497</span></a><span class="sd"> The transformed tree.</span> +</span><span id="Expression-498"><a href="#Expression-498"><span class="linenos">498</span></a><span class="sd"> """</span> +</span><span id="Expression-499"><a href="#Expression-499"><span class="linenos">499</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="Expression-500"><a href="#Expression-500"><span class="linenos">500</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="Expression-501"><a href="#Expression-501"><span class="linenos">501</span></a> +</span><span id="Expression-502"><a href="#Expression-502"><span class="linenos">502</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression-503"><a href="#Expression-503"><span class="linenos">503</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression-504"><a href="#Expression-504"><span class="linenos">504</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> +</span><span id="Expression-505"><a href="#Expression-505"><span class="linenos">505</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-506"><a href="#Expression-506"><span class="linenos">506</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression-507"><a href="#Expression-507"><span class="linenos">507</span></a> +</span><span id="Expression-508"><a href="#Expression-508"><span class="linenos">508</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> +</span><span id="Expression-509"><a href="#Expression-509"><span class="linenos">509</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression-510"><a href="#Expression-510"><span class="linenos">510</span></a> +</span><span id="Expression-511"><a href="#Expression-511"><span class="linenos">511</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> +</span><span id="Expression-512"><a href="#Expression-512"><span class="linenos">512</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-513"><a href="#Expression-513"><span class="linenos">513</span></a><span class="sd"> Swap out this expression with a new expression.</span> +</span><span id="Expression-514"><a href="#Expression-514"><span class="linenos">514</span></a> +</span><span id="Expression-515"><a href="#Expression-515"><span class="linenos">515</span></a><span class="sd"> For example::</span> +</span><span id="Expression-516"><a href="#Expression-516"><span class="linenos">516</span></a> +</span><span id="Expression-517"><a href="#Expression-517"><span class="linenos">517</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="Expression-518"><a href="#Expression-518"><span class="linenos">518</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="Expression-519"><a href="#Expression-519"><span class="linenos">519</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="Expression-520"><a href="#Expression-520"><span class="linenos">520</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="Expression-521"><a href="#Expression-521"><span class="linenos">521</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="Expression-522"><a href="#Expression-522"><span class="linenos">522</span></a> +</span><span id="Expression-523"><a href="#Expression-523"><span class="linenos">523</span></a><span class="sd"> Args:</span> +</span><span id="Expression-524"><a href="#Expression-524"><span class="linenos">524</span></a><span class="sd"> expression (Expression|None): new node</span> +</span><span id="Expression-525"><a href="#Expression-525"><span class="linenos">525</span></a> +</span><span id="Expression-526"><a href="#Expression-526"><span class="linenos">526</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-527"><a href="#Expression-527"><span class="linenos">527</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="Expression-528"><a href="#Expression-528"><span class="linenos">528</span></a><span class="sd"> """</span> +</span><span id="Expression-529"><a href="#Expression-529"><span class="linenos">529</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="Expression-530"><a href="#Expression-530"><span class="linenos">530</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression-531"><a href="#Expression-531"><span class="linenos">531</span></a> +</span><span id="Expression-532"><a href="#Expression-532"><span class="linenos">532</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression-533"><a href="#Expression-533"><span class="linenos">533</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Expression-534"><a href="#Expression-534"><span class="linenos">534</span></a> +</span><span id="Expression-535"><a href="#Expression-535"><span class="linenos">535</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> +</span><span id="Expression-536"><a href="#Expression-536"><span class="linenos">536</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression-537"><a href="#Expression-537"><span class="linenos">537</span></a> +</span><span id="Expression-538"><a href="#Expression-538"><span class="linenos">538</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-539"><a href="#Expression-539"><span class="linenos">539</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-540"><a href="#Expression-540"><span class="linenos">540</span></a><span class="sd"> Remove this expression from its AST.</span> +</span><span id="Expression-541"><a href="#Expression-541"><span class="linenos">541</span></a><span class="sd"> """</span> +</span><span id="Expression-542"><a href="#Expression-542"><span class="linenos">542</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> +</span><span id="Expression-543"><a href="#Expression-543"><span class="linenos">543</span></a> +</span><span id="Expression-544"><a href="#Expression-544"><span class="linenos">544</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> +</span><span id="Expression-545"><a href="#Expression-545"><span class="linenos">545</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-546"><a href="#Expression-546"><span class="linenos">546</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="Expression-547"><a href="#Expression-547"><span class="linenos">547</span></a> +</span><span id="Expression-548"><a href="#Expression-548"><span class="linenos">548</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> +</span><span id="Expression-549"><a href="#Expression-549"><span class="linenos">549</span></a><span class="sd"> Otherwise, this returns this expression.</span> </span><span id="Expression-550"><a href="#Expression-550"><span class="linenos">550</span></a> -</span><span id="Expression-551"><a href="#Expression-551"><span class="linenos">551</span></a><span class="sd"> Args:</span> -</span><span id="Expression-552"><a href="#Expression-552"><span class="linenos">552</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> -</span><span id="Expression-553"><a href="#Expression-553"><span class="linenos">553</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> -</span><span id="Expression-554"><a href="#Expression-554"><span class="linenos">554</span></a> -</span><span id="Expression-555"><a href="#Expression-555"><span class="linenos">555</span></a><span class="sd"> Returns:</span> -</span><span id="Expression-556"><a href="#Expression-556"><span class="linenos">556</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="Expression-551"><a href="#Expression-551"><span class="linenos">551</span></a><span class="sd"> Examples:</span> +</span><span id="Expression-552"><a href="#Expression-552"><span class="linenos">552</span></a><span class="sd"> This is useful for type security in chained expressions:</span> +</span><span id="Expression-553"><a href="#Expression-553"><span class="linenos">553</span></a> +</span><span id="Expression-554"><a href="#Expression-554"><span class="linenos">554</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Expression-555"><a href="#Expression-555"><span class="linenos">555</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> +</span><span id="Expression-556"><a href="#Expression-556"><span class="linenos">556</span></a><span class="sd"> 'SELECT x, z FROM y'</span> </span><span id="Expression-557"><a href="#Expression-557"><span class="linenos">557</span></a><span class="sd"> """</span> -</span><span id="Expression-558"><a href="#Expression-558"><span class="linenos">558</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression-559"><a href="#Expression-559"><span class="linenos">559</span></a> -</span><span id="Expression-560"><a href="#Expression-560"><span class="linenos">560</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> -</span><span id="Expression-561"><a href="#Expression-561"><span class="linenos">561</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> -</span><span id="Expression-562"><a href="#Expression-562"><span class="linenos">562</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="Expression-563"><a href="#Expression-563"><span class="linenos">563</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression-564"><a href="#Expression-564"><span class="linenos">564</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> -</span><span id="Expression-565"><a href="#Expression-565"><span class="linenos">565</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> -</span><span id="Expression-566"><a href="#Expression-566"><span class="linenos">566</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="Expression-567"><a href="#Expression-567"><span class="linenos">567</span></a> -</span><span id="Expression-568"><a href="#Expression-568"><span class="linenos">568</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="Expression-569"><a href="#Expression-569"><span class="linenos">569</span></a> <span class="n">args</span> -</span><span id="Expression-570"><a href="#Expression-570"><span class="linenos">570</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> -</span><span id="Expression-571"><a href="#Expression-571"><span class="linenos">571</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="Expression-572"><a href="#Expression-572"><span class="linenos">572</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> -</span><span id="Expression-573"><a href="#Expression-573"><span class="linenos">573</span></a> <span class="p">):</span> -</span><span id="Expression-574"><a href="#Expression-574"><span class="linenos">574</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="Expression-575"><a href="#Expression-575"><span class="linenos">575</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> -</span><span id="Expression-576"><a href="#Expression-576"><span class="linenos">576</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> -</span><span id="Expression-577"><a href="#Expression-577"><span class="linenos">577</span></a> <span class="p">)</span> -</span><span id="Expression-578"><a href="#Expression-578"><span class="linenos">578</span></a> -</span><span id="Expression-579"><a href="#Expression-579"><span class="linenos">579</span></a> <span class="k">return</span> <span class="n">errors</span> -</span><span id="Expression-580"><a href="#Expression-580"><span class="linenos">580</span></a> -</span><span id="Expression-581"><a href="#Expression-581"><span class="linenos">581</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression-582"><a href="#Expression-582"><span class="linenos">582</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-583"><a href="#Expression-583"><span class="linenos">583</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="Expression-584"><a href="#Expression-584"><span class="linenos">584</span></a><span class="sd"> """</span> -</span><span id="Expression-585"><a href="#Expression-585"><span class="linenos">585</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> -</span><span id="Expression-586"><a href="#Expression-586"><span class="linenos">586</span></a> -</span><span id="Expression-587"><a href="#Expression-587"><span class="linenos">587</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="Expression-588"><a href="#Expression-588"><span class="linenos">588</span></a> -</span><span id="Expression-589"><a href="#Expression-589"><span class="linenos">589</span></a> <span class="nd">@classmethod</span> -</span><span id="Expression-590"><a href="#Expression-590"><span class="linenos">590</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> -</span><span id="Expression-591"><a href="#Expression-591"><span class="linenos">591</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression-592"><a href="#Expression-592"><span class="linenos">592</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="Expression-593"><a href="#Expression-593"><span class="linenos">593</span></a><span class="sd"> """</span> -</span><span id="Expression-594"><a href="#Expression-594"><span class="linenos">594</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> -</span><span id="Expression-595"><a href="#Expression-595"><span class="linenos">595</span></a> -</span><span id="Expression-596"><a href="#Expression-596"><span class="linenos">596</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> +</span><span id="Expression-558"><a href="#Expression-558"><span class="linenos">558</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> +</span><span id="Expression-559"><a href="#Expression-559"><span class="linenos">559</span></a> <span class="k">return</span> <span class="bp">self</span> +</span><span id="Expression-560"><a href="#Expression-560"><span class="linenos">560</span></a> +</span><span id="Expression-561"><a href="#Expression-561"><span class="linenos">561</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="Expression-562"><a href="#Expression-562"><span class="linenos">562</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-563"><a href="#Expression-563"><span class="linenos">563</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="Expression-564"><a href="#Expression-564"><span class="linenos">564</span></a> +</span><span id="Expression-565"><a href="#Expression-565"><span class="linenos">565</span></a><span class="sd"> Args:</span> +</span><span id="Expression-566"><a href="#Expression-566"><span class="linenos">566</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> +</span><span id="Expression-567"><a href="#Expression-567"><span class="linenos">567</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> +</span><span id="Expression-568"><a href="#Expression-568"><span class="linenos">568</span></a> +</span><span id="Expression-569"><a href="#Expression-569"><span class="linenos">569</span></a><span class="sd"> Returns:</span> +</span><span id="Expression-570"><a href="#Expression-570"><span class="linenos">570</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="Expression-571"><a href="#Expression-571"><span class="linenos">571</span></a><span class="sd"> """</span> +</span><span id="Expression-572"><a href="#Expression-572"><span class="linenos">572</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression-573"><a href="#Expression-573"><span class="linenos">573</span></a> +</span><span id="Expression-574"><a href="#Expression-574"><span class="linenos">574</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> +</span><span id="Expression-575"><a href="#Expression-575"><span class="linenos">575</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> +</span><span id="Expression-576"><a href="#Expression-576"><span class="linenos">576</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="Expression-577"><a href="#Expression-577"><span class="linenos">577</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression-578"><a href="#Expression-578"><span class="linenos">578</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> +</span><span id="Expression-579"><a href="#Expression-579"><span class="linenos">579</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> +</span><span id="Expression-580"><a href="#Expression-580"><span class="linenos">580</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="Expression-581"><a href="#Expression-581"><span class="linenos">581</span></a> +</span><span id="Expression-582"><a href="#Expression-582"><span class="linenos">582</span></a> <span class="k">if</span> <span class="p">(</span> +</span><span id="Expression-583"><a href="#Expression-583"><span class="linenos">583</span></a> <span class="n">args</span> +</span><span id="Expression-584"><a href="#Expression-584"><span class="linenos">584</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> +</span><span id="Expression-585"><a href="#Expression-585"><span class="linenos">585</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="Expression-586"><a href="#Expression-586"><span class="linenos">586</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> +</span><span id="Expression-587"><a href="#Expression-587"><span class="linenos">587</span></a> <span class="p">):</span> +</span><span id="Expression-588"><a href="#Expression-588"><span class="linenos">588</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="Expression-589"><a href="#Expression-589"><span class="linenos">589</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> +</span><span id="Expression-590"><a href="#Expression-590"><span class="linenos">590</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Expression-591"><a href="#Expression-591"><span class="linenos">591</span></a> <span class="p">)</span> +</span><span id="Expression-592"><a href="#Expression-592"><span class="linenos">592</span></a> +</span><span id="Expression-593"><a href="#Expression-593"><span class="linenos">593</span></a> <span class="k">return</span> <span class="n">errors</span> +</span><span id="Expression-594"><a href="#Expression-594"><span class="linenos">594</span></a> +</span><span id="Expression-595"><a href="#Expression-595"><span class="linenos">595</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression-596"><a href="#Expression-596"><span class="linenos">596</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-597"><a href="#Expression-597"><span class="linenos">597</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="Expression-598"><a href="#Expression-598"><span class="linenos">598</span></a><span class="sd"> """</span> +</span><span id="Expression-599"><a href="#Expression-599"><span class="linenos">599</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> +</span><span id="Expression-600"><a href="#Expression-600"><span class="linenos">600</span></a> +</span><span id="Expression-601"><a href="#Expression-601"><span class="linenos">601</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="Expression-602"><a href="#Expression-602"><span class="linenos">602</span></a> +</span><span id="Expression-603"><a href="#Expression-603"><span class="linenos">603</span></a> <span class="nd">@classmethod</span> +</span><span id="Expression-604"><a href="#Expression-604"><span class="linenos">604</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> +</span><span id="Expression-605"><a href="#Expression-605"><span class="linenos">605</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression-606"><a href="#Expression-606"><span class="linenos">606</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="Expression-607"><a href="#Expression-607"><span class="linenos">607</span></a><span class="sd"> """</span> +</span><span id="Expression-608"><a href="#Expression-608"><span class="linenos">608</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> +</span><span id="Expression-609"><a href="#Expression-609"><span class="linenos">609</span></a> +</span><span id="Expression-610"><a href="#Expression-610"><span class="linenos">610</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> </span></pre></div> @@ -8191,9 +8338,10 @@ optimizer, in order to enable some transformations that require type information </span><span id="Expression.__init__-91"><a href="#Expression.__init__-91"><span class="linenos">91</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="Expression.__init__-92"><a href="#Expression.__init__-92"><span class="linenos">92</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">comments</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> </span><span id="Expression.__init__-93"><a href="#Expression.__init__-93"><span class="linenos">93</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_type</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">DataType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Expression.__init__-94"><a href="#Expression.__init__-94"><span class="linenos">94</span></a> -</span><span id="Expression.__init__-95"><a href="#Expression.__init__-95"><span class="linenos">95</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression.__init__-96"><a href="#Expression.__init__-96"><span class="linenos">96</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> +</span><span id="Expression.__init__-94"><a href="#Expression.__init__-94"><span class="linenos">94</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_meta</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Expression.__init__-95"><a href="#Expression.__init__-95"><span class="linenos">95</span></a> +</span><span id="Expression.__init__-96"><a href="#Expression.__init__-96"><span class="linenos">96</span></a> <span class="k">for</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression.__init__-97"><a href="#Expression.__init__-97"><span class="linenos">97</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> </span></pre></div> @@ -8250,19 +8398,19 @@ optimizer, in order to enable some transformations that require type information </div> <a class="headerlink" href="#Expression.text"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.text-132"><a href="#Expression.text-132"><span class="linenos">132</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression.text-133"><a href="#Expression.text-133"><span class="linenos">133</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.text-134"><a href="#Expression.text-134"><span class="linenos">134</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> -</span><span id="Expression.text-135"><a href="#Expression.text-135"><span class="linenos">135</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> -</span><span id="Expression.text-136"><a href="#Expression.text-136"><span class="linenos">136</span></a><span class="sd"> """</span> -</span><span id="Expression.text-137"><a href="#Expression.text-137"><span class="linenos">137</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> -</span><span id="Expression.text-138"><a href="#Expression.text-138"><span class="linenos">138</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="Expression.text-139"><a href="#Expression.text-139"><span class="linenos">139</span></a> <span class="k">return</span> <span class="n">field</span> -</span><span id="Expression.text-140"><a href="#Expression.text-140"><span class="linenos">140</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> -</span><span id="Expression.text-141"><a href="#Expression.text-141"><span class="linenos">141</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression.text-142"><a href="#Expression.text-142"><span class="linenos">142</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> -</span><span id="Expression.text-143"><a href="#Expression.text-143"><span class="linenos">143</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> -</span><span id="Expression.text-144"><a href="#Expression.text-144"><span class="linenos">144</span></a> <span class="k">return</span> <span class="s2">""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.text-133"><a href="#Expression.text-133"><span class="linenos">133</span></a> <span class="k">def</span> <span class="nf">text</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression.text-134"><a href="#Expression.text-134"><span class="linenos">134</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.text-135"><a href="#Expression.text-135"><span class="linenos">135</span></a><span class="sd"> Returns a textual representation of the argument corresponding to "key". This can only be used</span> +</span><span id="Expression.text-136"><a href="#Expression.text-136"><span class="linenos">136</span></a><span class="sd"> for args that are strings or leaf Expression instances, such as identifiers and literals.</span> +</span><span id="Expression.text-137"><a href="#Expression.text-137"><span class="linenos">137</span></a><span class="sd"> """</span> +</span><span id="Expression.text-138"><a href="#Expression.text-138"><span class="linenos">138</span></a> <span class="n">field</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">)</span> +</span><span id="Expression.text-139"><a href="#Expression.text-139"><span class="linenos">139</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="Expression.text-140"><a href="#Expression.text-140"><span class="linenos">140</span></a> <span class="k">return</span> <span class="n">field</span> +</span><span id="Expression.text-141"><a href="#Expression.text-141"><span class="linenos">141</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Identifier</span><span class="p">,</span> <span class="n">Literal</span><span class="p">,</span> <span class="n">Var</span><span class="p">)):</span> +</span><span id="Expression.text-142"><a href="#Expression.text-142"><span class="linenos">142</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression.text-143"><a href="#Expression.text-143"><span class="linenos">143</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">field</span><span class="p">,</span> <span class="p">(</span><span class="n">Star</span><span class="p">,</span> <span class="n">Null</span><span class="p">)):</span> +</span><span id="Expression.text-144"><a href="#Expression.text-144"><span class="linenos">144</span></a> <span class="k">return</span> <span class="n">field</span><span class="o">.</span><span class="n">name</span> +</span><span id="Expression.text-145"><a href="#Expression.text-145"><span class="linenos">145</span></a> <span class="k">return</span> <span class="s2">""</span> </span></pre></div> @@ -8378,16 +8526,16 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.copy"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.copy-229"><a href="#Expression.copy-229"><span class="linenos">229</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.copy-230"><a href="#Expression.copy-230"><span class="linenos">230</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.copy-231"><a href="#Expression.copy-231"><span class="linenos">231</span></a><span class="sd"> Returns a deep copy of the expression.</span> -</span><span id="Expression.copy-232"><a href="#Expression.copy-232"><span class="linenos">232</span></a><span class="sd"> """</span> -</span><span id="Expression.copy-233"><a href="#Expression.copy-233"><span class="linenos">233</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> -</span><span id="Expression.copy-234"><a href="#Expression.copy-234"><span class="linenos">234</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.copy-235"><a href="#Expression.copy-235"><span class="linenos">235</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> -</span><span id="Expression.copy-236"><a href="#Expression.copy-236"><span class="linenos">236</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> -</span><span id="Expression.copy-237"><a href="#Expression.copy-237"><span class="linenos">237</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> -</span><span id="Expression.copy-238"><a href="#Expression.copy-238"><span class="linenos">238</span></a> <span class="k">return</span> <span class="n">new</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.copy-243"><a href="#Expression.copy-243"><span class="linenos">243</span></a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.copy-244"><a href="#Expression.copy-244"><span class="linenos">244</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.copy-245"><a href="#Expression.copy-245"><span class="linenos">245</span></a><span class="sd"> Returns a deep copy of the expression.</span> +</span><span id="Expression.copy-246"><a href="#Expression.copy-246"><span class="linenos">246</span></a><span class="sd"> """</span> +</span><span id="Expression.copy-247"><a href="#Expression.copy-247"><span class="linenos">247</span></a> <span class="n">new</span> <span class="o">=</span> <span class="n">deepcopy</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="Expression.copy-248"><a href="#Expression.copy-248"><span class="linenos">248</span></a> <span class="n">new</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.copy-249"><a href="#Expression.copy-249"><span class="linenos">249</span></a> <span class="k">for</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">new</span><span class="o">.</span><span class="n">bfs</span><span class="p">():</span> +</span><span id="Expression.copy-250"><a href="#Expression.copy-250"><span class="linenos">250</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">)</span> <span class="ow">and</span> <span class="n">parent</span><span class="p">:</span> +</span><span id="Expression.copy-251"><a href="#Expression.copy-251"><span class="linenos">251</span></a> <span class="n">item</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> +</span><span id="Expression.copy-252"><a href="#Expression.copy-252"><span class="linenos">252</span></a> <span class="k">return</span> <span class="n">new</span> </span></pre></div> @@ -8407,18 +8555,18 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.append"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.append-240"><a href="#Expression.append-240"><span class="linenos">240</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="Expression.append-241"><a href="#Expression.append-241"><span class="linenos">241</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.append-242"><a href="#Expression.append-242"><span class="linenos">242</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> -</span><span id="Expression.append-243"><a href="#Expression.append-243"><span class="linenos">243</span></a> -</span><span id="Expression.append-244"><a href="#Expression.append-244"><span class="linenos">244</span></a><span class="sd"> Args:</span> -</span><span id="Expression.append-245"><a href="#Expression.append-245"><span class="linenos">245</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> -</span><span id="Expression.append-246"><a href="#Expression.append-246"><span class="linenos">246</span></a><span class="sd"> value (Any): value to append to the list</span> -</span><span id="Expression.append-247"><a href="#Expression.append-247"><span class="linenos">247</span></a><span class="sd"> """</span> -</span><span id="Expression.append-248"><a href="#Expression.append-248"><span class="linenos">248</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="Expression.append-249"><a href="#Expression.append-249"><span class="linenos">249</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression.append-250"><a href="#Expression.append-250"><span class="linenos">250</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="Expression.append-251"><a href="#Expression.append-251"><span class="linenos">251</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.append-254"><a href="#Expression.append-254"><span class="linenos">254</span></a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="Expression.append-255"><a href="#Expression.append-255"><span class="linenos">255</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.append-256"><a href="#Expression.append-256"><span class="linenos">256</span></a><span class="sd"> Appends value to arg_key if it's a list or sets it as a new list.</span> +</span><span id="Expression.append-257"><a href="#Expression.append-257"><span class="linenos">257</span></a> +</span><span id="Expression.append-258"><a href="#Expression.append-258"><span class="linenos">258</span></a><span class="sd"> Args:</span> +</span><span id="Expression.append-259"><a href="#Expression.append-259"><span class="linenos">259</span></a><span class="sd"> arg_key (str): name of the list expression arg</span> +</span><span id="Expression.append-260"><a href="#Expression.append-260"><span class="linenos">260</span></a><span class="sd"> value (Any): value to append to the list</span> +</span><span id="Expression.append-261"><a href="#Expression.append-261"><span class="linenos">261</span></a><span class="sd"> """</span> +</span><span id="Expression.append-262"><a href="#Expression.append-262"><span class="linenos">262</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">arg_key</span><span class="p">),</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="Expression.append-263"><a href="#Expression.append-263"><span class="linenos">263</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression.append-264"><a href="#Expression.append-264"><span class="linenos">264</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="Expression.append-265"><a href="#Expression.append-265"><span class="linenos">265</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> </span></pre></div> @@ -8445,16 +8593,16 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.set"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.set-253"><a href="#Expression.set-253"><span class="linenos">253</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> -</span><span id="Expression.set-254"><a href="#Expression.set-254"><span class="linenos">254</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.set-255"><a href="#Expression.set-255"><span class="linenos">255</span></a><span class="sd"> Sets `arg_key` to `value`.</span> -</span><span id="Expression.set-256"><a href="#Expression.set-256"><span class="linenos">256</span></a> -</span><span id="Expression.set-257"><a href="#Expression.set-257"><span class="linenos">257</span></a><span class="sd"> Args:</span> -</span><span id="Expression.set-258"><a href="#Expression.set-258"><span class="linenos">258</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> -</span><span id="Expression.set-259"><a href="#Expression.set-259"><span class="linenos">259</span></a><span class="sd"> value: value to set the arg to.</span> -</span><span id="Expression.set-260"><a href="#Expression.set-260"><span class="linenos">260</span></a><span class="sd"> """</span> -</span><span id="Expression.set-261"><a href="#Expression.set-261"><span class="linenos">261</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> -</span><span id="Expression.set-262"><a href="#Expression.set-262"><span class="linenos">262</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.set-267"><a href="#Expression.set-267"><span class="linenos">267</span></a> <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span> +</span><span id="Expression.set-268"><a href="#Expression.set-268"><span class="linenos">268</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.set-269"><a href="#Expression.set-269"><span class="linenos">269</span></a><span class="sd"> Sets `arg_key` to `value`.</span> +</span><span id="Expression.set-270"><a href="#Expression.set-270"><span class="linenos">270</span></a> +</span><span id="Expression.set-271"><a href="#Expression.set-271"><span class="linenos">271</span></a><span class="sd"> Args:</span> +</span><span id="Expression.set-272"><a href="#Expression.set-272"><span class="linenos">272</span></a><span class="sd"> arg_key (str): name of the expression arg.</span> +</span><span id="Expression.set-273"><a href="#Expression.set-273"><span class="linenos">273</span></a><span class="sd"> value: value to set the arg to.</span> +</span><span id="Expression.set-274"><a href="#Expression.set-274"><span class="linenos">274</span></a><span class="sd"> """</span> +</span><span id="Expression.set-275"><a href="#Expression.set-275"><span class="linenos">275</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">arg_key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span> +</span><span id="Expression.set-276"><a href="#Expression.set-276"><span class="linenos">276</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">_set_parent</span><span class="p">(</span><span class="n">arg_key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> </span></pre></div> @@ -8494,18 +8642,18 @@ for args that are strings or leaf Expression instances, such as identifiers and </div> <a class="headerlink" href="#Expression.find"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find-283"><a href="#Expression.find-283"><span class="linenos">283</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="Expression.find-284"><a href="#Expression.find-284"><span class="linenos">284</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find-285"><a href="#Expression.find-285"><span class="linenos">285</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> -</span><span id="Expression.find-286"><a href="#Expression.find-286"><span class="linenos">286</span></a><span class="sd"> the specified types.</span> -</span><span id="Expression.find-287"><a href="#Expression.find-287"><span class="linenos">287</span></a> -</span><span id="Expression.find-288"><a href="#Expression.find-288"><span class="linenos">288</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find-289"><a href="#Expression.find-289"><span class="linenos">289</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="Expression.find-290"><a href="#Expression.find-290"><span class="linenos">290</span></a> -</span><span id="Expression.find-291"><a href="#Expression.find-291"><span class="linenos">291</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find-292"><a href="#Expression.find-292"><span class="linenos">292</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> -</span><span id="Expression.find-293"><a href="#Expression.find-293"><span class="linenos">293</span></a><span class="sd"> """</span> -</span><span id="Expression.find-294"><a href="#Expression.find-294"><span class="linenos">294</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find-297"><a href="#Expression.find-297"><span class="linenos">297</span></a> <span class="k">def</span> <span class="nf">find</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression.find-298"><a href="#Expression.find-298"><span class="linenos">298</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find-299"><a href="#Expression.find-299"><span class="linenos">299</span></a><span class="sd"> Returns the first node in this tree which matches at least one of</span> +</span><span id="Expression.find-300"><a href="#Expression.find-300"><span class="linenos">300</span></a><span class="sd"> the specified types.</span> +</span><span id="Expression.find-301"><a href="#Expression.find-301"><span class="linenos">301</span></a> +</span><span id="Expression.find-302"><a href="#Expression.find-302"><span class="linenos">302</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find-303"><a href="#Expression.find-303"><span class="linenos">303</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="Expression.find-304"><a href="#Expression.find-304"><span class="linenos">304</span></a> +</span><span id="Expression.find-305"><a href="#Expression.find-305"><span class="linenos">305</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find-306"><a href="#Expression.find-306"><span class="linenos">306</span></a><span class="sd"> The node which matches the criteria or None if no such node was found.</span> +</span><span id="Expression.find-307"><a href="#Expression.find-307"><span class="linenos">307</span></a><span class="sd"> """</span> +</span><span id="Expression.find-308"><a href="#Expression.find-308"><span class="linenos">308</span></a> <span class="k">return</span> <span class="nb">next</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">),</span> <span class="kc">None</span><span class="p">)</span> </span></pre></div> @@ -8538,20 +8686,20 @@ the specified types.</p> </div> <a class="headerlink" href="#Expression.find_all"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find_all-296"><a href="#Expression.find_all-296"><span class="linenos">296</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="Expression.find_all-297"><a href="#Expression.find_all-297"><span class="linenos">297</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find_all-298"><a href="#Expression.find_all-298"><span class="linenos">298</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> -</span><span id="Expression.find_all-299"><a href="#Expression.find_all-299"><span class="linenos">299</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> -</span><span id="Expression.find_all-300"><a href="#Expression.find_all-300"><span class="linenos">300</span></a> -</span><span id="Expression.find_all-301"><a href="#Expression.find_all-301"><span class="linenos">301</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find_all-302"><a href="#Expression.find_all-302"><span class="linenos">302</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="Expression.find_all-303"><a href="#Expression.find_all-303"><span class="linenos">303</span></a> -</span><span id="Expression.find_all-304"><a href="#Expression.find_all-304"><span class="linenos">304</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find_all-305"><a href="#Expression.find_all-305"><span class="linenos">305</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.find_all-306"><a href="#Expression.find_all-306"><span class="linenos">306</span></a><span class="sd"> """</span> -</span><span id="Expression.find_all-307"><a href="#Expression.find_all-307"><span class="linenos">307</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> -</span><span id="Expression.find_all-308"><a href="#Expression.find_all-308"><span class="linenos">308</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression.find_all-309"><a href="#Expression.find_all-309"><span class="linenos">309</span></a> <span class="k">yield</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find_all-310"><a href="#Expression.find_all-310"><span class="linenos">310</span></a> <span class="k">def</span> <span class="nf">find_all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression.find_all-311"><a href="#Expression.find_all-311"><span class="linenos">311</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find_all-312"><a href="#Expression.find_all-312"><span class="linenos">312</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree and only</span> +</span><span id="Expression.find_all-313"><a href="#Expression.find_all-313"><span class="linenos">313</span></a><span class="sd"> yields those that match at least one of the specified expression types.</span> +</span><span id="Expression.find_all-314"><a href="#Expression.find_all-314"><span class="linenos">314</span></a> +</span><span id="Expression.find_all-315"><a href="#Expression.find_all-315"><span class="linenos">315</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find_all-316"><a href="#Expression.find_all-316"><span class="linenos">316</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="Expression.find_all-317"><a href="#Expression.find_all-317"><span class="linenos">317</span></a> +</span><span id="Expression.find_all-318"><a href="#Expression.find_all-318"><span class="linenos">318</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find_all-319"><a href="#Expression.find_all-319"><span class="linenos">319</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.find_all-320"><a href="#Expression.find_all-320"><span class="linenos">320</span></a><span class="sd"> """</span> +</span><span id="Expression.find_all-321"><a href="#Expression.find_all-321"><span class="linenos">321</span></a> <span class="k">for</span> <span class="n">expression</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">bfs</span><span class="o">=</span><span class="n">bfs</span><span class="p">):</span> +</span><span id="Expression.find_all-322"><a href="#Expression.find_all-322"><span class="linenos">322</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression.find_all-323"><a href="#Expression.find_all-323"><span class="linenos">323</span></a> <span class="k">yield</span> <span class="n">expression</span> </span></pre></div> @@ -8584,20 +8732,20 @@ yields those that match at least one of the specified expression types.</p> </div> <a class="headerlink" href="#Expression.find_ancestor"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find_ancestor-311"><a href="#Expression.find_ancestor-311"><span class="linenos">311</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression.find_ancestor-312"><a href="#Expression.find_ancestor-312"><span class="linenos">312</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.find_ancestor-313"><a href="#Expression.find_ancestor-313"><span class="linenos">313</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> -</span><span id="Expression.find_ancestor-314"><a href="#Expression.find_ancestor-314"><span class="linenos">314</span></a> -</span><span id="Expression.find_ancestor-315"><a href="#Expression.find_ancestor-315"><span class="linenos">315</span></a><span class="sd"> Args:</span> -</span><span id="Expression.find_ancestor-316"><a href="#Expression.find_ancestor-316"><span class="linenos">316</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> -</span><span id="Expression.find_ancestor-317"><a href="#Expression.find_ancestor-317"><span class="linenos">317</span></a> -</span><span id="Expression.find_ancestor-318"><a href="#Expression.find_ancestor-318"><span class="linenos">318</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.find_ancestor-319"><a href="#Expression.find_ancestor-319"><span class="linenos">319</span></a><span class="sd"> The parent node.</span> -</span><span id="Expression.find_ancestor-320"><a href="#Expression.find_ancestor-320"><span class="linenos">320</span></a><span class="sd"> """</span> -</span><span id="Expression.find_ancestor-321"><a href="#Expression.find_ancestor-321"><span class="linenos">321</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.find_ancestor-322"><a href="#Expression.find_ancestor-322"><span class="linenos">322</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> -</span><span id="Expression.find_ancestor-323"><a href="#Expression.find_ancestor-323"><span class="linenos">323</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.find_ancestor-324"><a href="#Expression.find_ancestor-324"><span class="linenos">324</span></a> <span class="k">return</span> <span class="n">ancestor</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.find_ancestor-325"><a href="#Expression.find_ancestor-325"><span class="linenos">325</span></a> <span class="k">def</span> <span class="nf">find_ancestor</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression.find_ancestor-326"><a href="#Expression.find_ancestor-326"><span class="linenos">326</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.find_ancestor-327"><a href="#Expression.find_ancestor-327"><span class="linenos">327</span></a><span class="sd"> Returns a nearest parent matching expression_types.</span> +</span><span id="Expression.find_ancestor-328"><a href="#Expression.find_ancestor-328"><span class="linenos">328</span></a> +</span><span id="Expression.find_ancestor-329"><a href="#Expression.find_ancestor-329"><span class="linenos">329</span></a><span class="sd"> Args:</span> +</span><span id="Expression.find_ancestor-330"><a href="#Expression.find_ancestor-330"><span class="linenos">330</span></a><span class="sd"> expression_types (type): the expression type(s) to match.</span> +</span><span id="Expression.find_ancestor-331"><a href="#Expression.find_ancestor-331"><span class="linenos">331</span></a> +</span><span id="Expression.find_ancestor-332"><a href="#Expression.find_ancestor-332"><span class="linenos">332</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.find_ancestor-333"><a href="#Expression.find_ancestor-333"><span class="linenos">333</span></a><span class="sd"> The parent node.</span> +</span><span id="Expression.find_ancestor-334"><a href="#Expression.find_ancestor-334"><span class="linenos">334</span></a><span class="sd"> """</span> +</span><span id="Expression.find_ancestor-335"><a href="#Expression.find_ancestor-335"><span class="linenos">335</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.find_ancestor-336"><a href="#Expression.find_ancestor-336"><span class="linenos">336</span></a> <span class="k">while</span> <span class="n">ancestor</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">ancestor</span><span class="p">,</span> <span class="n">expression_types</span><span class="p">):</span> +</span><span id="Expression.find_ancestor-337"><a href="#Expression.find_ancestor-337"><span class="linenos">337</span></a> <span class="n">ancestor</span> <span class="o">=</span> <span class="n">ancestor</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.find_ancestor-338"><a href="#Expression.find_ancestor-338"><span class="linenos">338</span></a> <span class="k">return</span> <span class="n">ancestor</span> </span></pre></div> @@ -8642,23 +8790,23 @@ yields those that match at least one of the specified expression types.</p> </div> <a class="headerlink" href="#Expression.walk"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.walk-333"><a href="#Expression.walk-333"><span class="linenos">333</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression.walk-334"><a href="#Expression.walk-334"><span class="linenos">334</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.walk-335"><a href="#Expression.walk-335"><span class="linenos">335</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> -</span><span id="Expression.walk-336"><a href="#Expression.walk-336"><span class="linenos">336</span></a> -</span><span id="Expression.walk-337"><a href="#Expression.walk-337"><span class="linenos">337</span></a><span class="sd"> Args:</span> -</span><span id="Expression.walk-338"><a href="#Expression.walk-338"><span class="linenos">338</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> -</span><span id="Expression.walk-339"><a href="#Expression.walk-339"><span class="linenos">339</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> -</span><span id="Expression.walk-340"><a href="#Expression.walk-340"><span class="linenos">340</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> -</span><span id="Expression.walk-341"><a href="#Expression.walk-341"><span class="linenos">341</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> -</span><span id="Expression.walk-342"><a href="#Expression.walk-342"><span class="linenos">342</span></a> -</span><span id="Expression.walk-343"><a href="#Expression.walk-343"><span class="linenos">343</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.walk-344"><a href="#Expression.walk-344"><span class="linenos">344</span></a><span class="sd"> the generator object.</span> -</span><span id="Expression.walk-345"><a href="#Expression.walk-345"><span class="linenos">345</span></a><span class="sd"> """</span> -</span><span id="Expression.walk-346"><a href="#Expression.walk-346"><span class="linenos">346</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> -</span><span id="Expression.walk-347"><a href="#Expression.walk-347"><span class="linenos">347</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> -</span><span id="Expression.walk-348"><a href="#Expression.walk-348"><span class="linenos">348</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Expression.walk-349"><a href="#Expression.walk-349"><span class="linenos">349</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.walk-347"><a href="#Expression.walk-347"><span class="linenos">347</span></a> <span class="k">def</span> <span class="nf">walk</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bfs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression.walk-348"><a href="#Expression.walk-348"><span class="linenos">348</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.walk-349"><a href="#Expression.walk-349"><span class="linenos">349</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree.</span> +</span><span id="Expression.walk-350"><a href="#Expression.walk-350"><span class="linenos">350</span></a> +</span><span id="Expression.walk-351"><a href="#Expression.walk-351"><span class="linenos">351</span></a><span class="sd"> Args:</span> +</span><span id="Expression.walk-352"><a href="#Expression.walk-352"><span class="linenos">352</span></a><span class="sd"> bfs (bool): if set to True the BFS traversal order will be applied,</span> +</span><span id="Expression.walk-353"><a href="#Expression.walk-353"><span class="linenos">353</span></a><span class="sd"> otherwise the DFS traversal will be used instead.</span> +</span><span id="Expression.walk-354"><a href="#Expression.walk-354"><span class="linenos">354</span></a><span class="sd"> prune ((node, parent, arg_key) -> bool): callable that returns True if</span> +</span><span id="Expression.walk-355"><a href="#Expression.walk-355"><span class="linenos">355</span></a><span class="sd"> the generator should stop traversing this branch of the tree.</span> +</span><span id="Expression.walk-356"><a href="#Expression.walk-356"><span class="linenos">356</span></a> +</span><span id="Expression.walk-357"><a href="#Expression.walk-357"><span class="linenos">357</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.walk-358"><a href="#Expression.walk-358"><span class="linenos">358</span></a><span class="sd"> the generator object.</span> +</span><span id="Expression.walk-359"><a href="#Expression.walk-359"><span class="linenos">359</span></a><span class="sd"> """</span> +</span><span id="Expression.walk-360"><a href="#Expression.walk-360"><span class="linenos">360</span></a> <span class="k">if</span> <span class="n">bfs</span><span class="p">:</span> +</span><span id="Expression.walk-361"><a href="#Expression.walk-361"><span class="linenos">361</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">bfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> +</span><span id="Expression.walk-362"><a href="#Expression.walk-362"><span class="linenos">362</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Expression.walk-363"><a href="#Expression.walk-363"><span class="linenos">363</span></a> <span class="k">yield from</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="n">prune</span><span class="p">)</span> </span></pre></div> @@ -8693,23 +8841,23 @@ the generator should stop traversing this branch of the tree.</li> </div> <a class="headerlink" href="#Expression.dfs"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.dfs-351"><a href="#Expression.dfs-351"><span class="linenos">351</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression.dfs-352"><a href="#Expression.dfs-352"><span class="linenos">352</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.dfs-353"><a href="#Expression.dfs-353"><span class="linenos">353</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression.dfs-354"><a href="#Expression.dfs-354"><span class="linenos">354</span></a><span class="sd"> the DFS (Depth-first) order.</span> -</span><span id="Expression.dfs-355"><a href="#Expression.dfs-355"><span class="linenos">355</span></a> -</span><span id="Expression.dfs-356"><a href="#Expression.dfs-356"><span class="linenos">356</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.dfs-357"><a href="#Expression.dfs-357"><span class="linenos">357</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.dfs-358"><a href="#Expression.dfs-358"><span class="linenos">358</span></a><span class="sd"> """</span> -</span><span id="Expression.dfs-359"><a href="#Expression.dfs-359"><span class="linenos">359</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.dfs-360"><a href="#Expression.dfs-360"><span class="linenos">360</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="Expression.dfs-361"><a href="#Expression.dfs-361"><span class="linenos">361</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="Expression.dfs-362"><a href="#Expression.dfs-362"><span class="linenos">362</span></a> <span class="k">return</span> -</span><span id="Expression.dfs-363"><a href="#Expression.dfs-363"><span class="linenos">363</span></a> -</span><span id="Expression.dfs-364"><a href="#Expression.dfs-364"><span class="linenos">364</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression.dfs-365"><a href="#Expression.dfs-365"><span class="linenos">365</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="Expression.dfs-366"><a href="#Expression.dfs-366"><span class="linenos">366</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression.dfs-367"><a href="#Expression.dfs-367"><span class="linenos">367</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.dfs-365"><a href="#Expression.dfs-365"><span class="linenos">365</span></a> <span class="k">def</span> <span class="nf">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression.dfs-366"><a href="#Expression.dfs-366"><span class="linenos">366</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.dfs-367"><a href="#Expression.dfs-367"><span class="linenos">367</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression.dfs-368"><a href="#Expression.dfs-368"><span class="linenos">368</span></a><span class="sd"> the DFS (Depth-first) order.</span> +</span><span id="Expression.dfs-369"><a href="#Expression.dfs-369"><span class="linenos">369</span></a> +</span><span id="Expression.dfs-370"><a href="#Expression.dfs-370"><span class="linenos">370</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.dfs-371"><a href="#Expression.dfs-371"><span class="linenos">371</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.dfs-372"><a href="#Expression.dfs-372"><span class="linenos">372</span></a><span class="sd"> """</span> +</span><span id="Expression.dfs-373"><a href="#Expression.dfs-373"><span class="linenos">373</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="n">parent</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.dfs-374"><a href="#Expression.dfs-374"><span class="linenos">374</span></a> <span class="k">yield</span> <span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="Expression.dfs-375"><a href="#Expression.dfs-375"><span class="linenos">375</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="Expression.dfs-376"><a href="#Expression.dfs-376"><span class="linenos">376</span></a> <span class="k">return</span> +</span><span id="Expression.dfs-377"><a href="#Expression.dfs-377"><span class="linenos">377</span></a> +</span><span id="Expression.dfs-378"><a href="#Expression.dfs-378"><span class="linenos">378</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression.dfs-379"><a href="#Expression.dfs-379"><span class="linenos">379</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="Expression.dfs-380"><a href="#Expression.dfs-380"><span class="linenos">380</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression.dfs-381"><a href="#Expression.dfs-381"><span class="linenos">381</span></a> <span class="k">yield from</span> <span class="n">node</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">k</span><span class="p">,</span> <span class="n">prune</span><span class="p">)</span> </span></pre></div> @@ -8736,28 +8884,28 @@ the DFS (Depth-first) order.</p> </div> <a class="headerlink" href="#Expression.bfs"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.bfs-369"><a href="#Expression.bfs-369"><span class="linenos">369</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="Expression.bfs-370"><a href="#Expression.bfs-370"><span class="linenos">370</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.bfs-371"><a href="#Expression.bfs-371"><span class="linenos">371</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> -</span><span id="Expression.bfs-372"><a href="#Expression.bfs-372"><span class="linenos">372</span></a><span class="sd"> the BFS (Breadth-first) order.</span> -</span><span id="Expression.bfs-373"><a href="#Expression.bfs-373"><span class="linenos">373</span></a> -</span><span id="Expression.bfs-374"><a href="#Expression.bfs-374"><span class="linenos">374</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.bfs-375"><a href="#Expression.bfs-375"><span class="linenos">375</span></a><span class="sd"> The generator object.</span> -</span><span id="Expression.bfs-376"><a href="#Expression.bfs-376"><span class="linenos">376</span></a><span class="sd"> """</span> -</span><span id="Expression.bfs-377"><a href="#Expression.bfs-377"><span class="linenos">377</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> -</span><span id="Expression.bfs-378"><a href="#Expression.bfs-378"><span class="linenos">378</span></a> -</span><span id="Expression.bfs-379"><a href="#Expression.bfs-379"><span class="linenos">379</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> -</span><span id="Expression.bfs-380"><a href="#Expression.bfs-380"><span class="linenos">380</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> -</span><span id="Expression.bfs-381"><a href="#Expression.bfs-381"><span class="linenos">381</span></a> -</span><span id="Expression.bfs-382"><a href="#Expression.bfs-382"><span class="linenos">382</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> -</span><span id="Expression.bfs-383"><a href="#Expression.bfs-383"><span class="linenos">383</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> -</span><span id="Expression.bfs-384"><a href="#Expression.bfs-384"><span class="linenos">384</span></a> <span class="k">continue</span> -</span><span id="Expression.bfs-385"><a href="#Expression.bfs-385"><span class="linenos">385</span></a> -</span><span id="Expression.bfs-386"><a href="#Expression.bfs-386"><span class="linenos">386</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression.bfs-387"><a href="#Expression.bfs-387"><span class="linenos">387</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression.bfs-388"><a href="#Expression.bfs-388"><span class="linenos">388</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> -</span><span id="Expression.bfs-389"><a href="#Expression.bfs-389"><span class="linenos">389</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression.bfs-390"><a href="#Expression.bfs-390"><span class="linenos">390</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.bfs-383"><a href="#Expression.bfs-383"><span class="linenos">383</span></a> <span class="k">def</span> <span class="nf">bfs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prune</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="Expression.bfs-384"><a href="#Expression.bfs-384"><span class="linenos">384</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.bfs-385"><a href="#Expression.bfs-385"><span class="linenos">385</span></a><span class="sd"> Returns a generator object which visits all nodes in this tree in</span> +</span><span id="Expression.bfs-386"><a href="#Expression.bfs-386"><span class="linenos">386</span></a><span class="sd"> the BFS (Breadth-first) order.</span> +</span><span id="Expression.bfs-387"><a href="#Expression.bfs-387"><span class="linenos">387</span></a> +</span><span id="Expression.bfs-388"><a href="#Expression.bfs-388"><span class="linenos">388</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.bfs-389"><a href="#Expression.bfs-389"><span class="linenos">389</span></a><span class="sd"> The generator object.</span> +</span><span id="Expression.bfs-390"><a href="#Expression.bfs-390"><span class="linenos">390</span></a><span class="sd"> """</span> +</span><span id="Expression.bfs-391"><a href="#Expression.bfs-391"><span class="linenos">391</span></a> <span class="n">queue</span> <span class="o">=</span> <span class="n">deque</span><span class="p">([(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">,</span> <span class="kc">None</span><span class="p">)])</span> +</span><span id="Expression.bfs-392"><a href="#Expression.bfs-392"><span class="linenos">392</span></a> +</span><span id="Expression.bfs-393"><a href="#Expression.bfs-393"><span class="linenos">393</span></a> <span class="k">while</span> <span class="n">queue</span><span class="p">:</span> +</span><span id="Expression.bfs-394"><a href="#Expression.bfs-394"><span class="linenos">394</span></a> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> <span class="o">=</span> <span class="n">queue</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span> +</span><span id="Expression.bfs-395"><a href="#Expression.bfs-395"><span class="linenos">395</span></a> +</span><span id="Expression.bfs-396"><a href="#Expression.bfs-396"><span class="linenos">396</span></a> <span class="k">yield</span> <span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span> +</span><span id="Expression.bfs-397"><a href="#Expression.bfs-397"><span class="linenos">397</span></a> <span class="k">if</span> <span class="n">prune</span> <span class="ow">and</span> <span class="n">prune</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">parent</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span> +</span><span id="Expression.bfs-398"><a href="#Expression.bfs-398"><span class="linenos">398</span></a> <span class="k">continue</span> +</span><span id="Expression.bfs-399"><a href="#Expression.bfs-399"><span class="linenos">399</span></a> +</span><span id="Expression.bfs-400"><a href="#Expression.bfs-400"><span class="linenos">400</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression.bfs-401"><a href="#Expression.bfs-401"><span class="linenos">401</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">item</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression.bfs-402"><a href="#Expression.bfs-402"><span class="linenos">402</span></a> <span class="k">for</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> +</span><span id="Expression.bfs-403"><a href="#Expression.bfs-403"><span class="linenos">403</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression.bfs-404"><a href="#Expression.bfs-404"><span class="linenos">404</span></a> <span class="n">queue</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">node</span><span class="p">,</span> <span class="n">item</span><span class="p">,</span> <span class="n">k</span><span class="p">))</span> </span></pre></div> @@ -8784,14 +8932,14 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.unnest"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest-392"><a href="#Expression.unnest-392"><span class="linenos">392</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.unnest-393"><a href="#Expression.unnest-393"><span class="linenos">393</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unnest-394"><a href="#Expression.unnest-394"><span class="linenos">394</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> -</span><span id="Expression.unnest-395"><a href="#Expression.unnest-395"><span class="linenos">395</span></a><span class="sd"> """</span> -</span><span id="Expression.unnest-396"><a href="#Expression.unnest-396"><span class="linenos">396</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Expression.unnest-397"><a href="#Expression.unnest-397"><span class="linenos">397</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> -</span><span id="Expression.unnest-398"><a href="#Expression.unnest-398"><span class="linenos">398</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression.unnest-399"><a href="#Expression.unnest-399"><span class="linenos">399</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest-406"><a href="#Expression.unnest-406"><span class="linenos">406</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.unnest-407"><a href="#Expression.unnest-407"><span class="linenos">407</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unnest-408"><a href="#Expression.unnest-408"><span class="linenos">408</span></a><span class="sd"> Returns the first non parenthesis child or self.</span> +</span><span id="Expression.unnest-409"><a href="#Expression.unnest-409"><span class="linenos">409</span></a><span class="sd"> """</span> +</span><span id="Expression.unnest-410"><a href="#Expression.unnest-410"><span class="linenos">410</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Expression.unnest-411"><a href="#Expression.unnest-411"><span class="linenos">411</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Paren</span><span class="p">):</span> +</span><span id="Expression.unnest-412"><a href="#Expression.unnest-412"><span class="linenos">412</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression.unnest-413"><a href="#Expression.unnest-413"><span class="linenos">413</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -8811,13 +8959,13 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.unalias"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unalias-401"><a href="#Expression.unalias-401"><span class="linenos">401</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.unalias-402"><a href="#Expression.unalias-402"><span class="linenos">402</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unalias-403"><a href="#Expression.unalias-403"><span class="linenos">403</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> -</span><span id="Expression.unalias-404"><a href="#Expression.unalias-404"><span class="linenos">404</span></a><span class="sd"> """</span> -</span><span id="Expression.unalias-405"><a href="#Expression.unalias-405"><span class="linenos">405</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> -</span><span id="Expression.unalias-406"><a href="#Expression.unalias-406"><span class="linenos">406</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="Expression.unalias-407"><a href="#Expression.unalias-407"><span class="linenos">407</span></a> <span class="k">return</span> <span class="bp">self</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unalias-415"><a href="#Expression.unalias-415"><span class="linenos">415</span></a> <span class="k">def</span> <span class="nf">unalias</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.unalias-416"><a href="#Expression.unalias-416"><span class="linenos">416</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unalias-417"><a href="#Expression.unalias-417"><span class="linenos">417</span></a><span class="sd"> Returns the inner expression if this is an Alias.</span> +</span><span id="Expression.unalias-418"><a href="#Expression.unalias-418"><span class="linenos">418</span></a><span class="sd"> """</span> +</span><span id="Expression.unalias-419"><a href="#Expression.unalias-419"><span class="linenos">419</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Alias</span><span class="p">):</span> +</span><span id="Expression.unalias-420"><a href="#Expression.unalias-420"><span class="linenos">420</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> +</span><span id="Expression.unalias-421"><a href="#Expression.unalias-421"><span class="linenos">421</span></a> <span class="k">return</span> <span class="bp">self</span> </span></pre></div> @@ -8837,11 +8985,11 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.unnest_operands"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest_operands-409"><a href="#Expression.unnest_operands-409"><span class="linenos">409</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.unnest_operands-410"><a href="#Expression.unnest_operands-410"><span class="linenos">410</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.unnest_operands-411"><a href="#Expression.unnest_operands-411"><span class="linenos">411</span></a><span class="sd"> Returns unnested operands as a tuple.</span> -</span><span id="Expression.unnest_operands-412"><a href="#Expression.unnest_operands-412"><span class="linenos">412</span></a><span class="sd"> """</span> -</span><span id="Expression.unnest_operands-413"><a href="#Expression.unnest_operands-413"><span class="linenos">413</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.unnest_operands-423"><a href="#Expression.unnest_operands-423"><span class="linenos">423</span></a> <span class="k">def</span> <span class="nf">unnest_operands</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.unnest_operands-424"><a href="#Expression.unnest_operands-424"><span class="linenos">424</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.unnest_operands-425"><a href="#Expression.unnest_operands-425"><span class="linenos">425</span></a><span class="sd"> Returns unnested operands as a tuple.</span> +</span><span id="Expression.unnest_operands-426"><a href="#Expression.unnest_operands-426"><span class="linenos">426</span></a><span class="sd"> """</span> +</span><span id="Expression.unnest_operands-427"><a href="#Expression.unnest_operands-427"><span class="linenos">427</span></a> <span class="k">return</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">arg</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">values</span><span class="p">()</span> <span class="k">if</span> <span class="n">arg</span><span class="p">)</span> </span></pre></div> @@ -8861,15 +9009,15 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.flatten"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.flatten-415"><a href="#Expression.flatten-415"><span class="linenos">415</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> -</span><span id="Expression.flatten-416"><a href="#Expression.flatten-416"><span class="linenos">416</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.flatten-417"><a href="#Expression.flatten-417"><span class="linenos">417</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> -</span><span id="Expression.flatten-418"><a href="#Expression.flatten-418"><span class="linenos">418</span></a> -</span><span id="Expression.flatten-419"><a href="#Expression.flatten-419"><span class="linenos">419</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> -</span><span id="Expression.flatten-420"><a href="#Expression.flatten-420"><span class="linenos">420</span></a><span class="sd"> """</span> -</span><span id="Expression.flatten-421"><a href="#Expression.flatten-421"><span class="linenos">421</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> -</span><span id="Expression.flatten-422"><a href="#Expression.flatten-422"><span class="linenos">422</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> -</span><span id="Expression.flatten-423"><a href="#Expression.flatten-423"><span class="linenos">423</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.flatten-429"><a href="#Expression.flatten-429"><span class="linenos">429</span></a> <span class="k">def</span> <span class="nf">flatten</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">unnest</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span> +</span><span id="Expression.flatten-430"><a href="#Expression.flatten-430"><span class="linenos">430</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.flatten-431"><a href="#Expression.flatten-431"><span class="linenos">431</span></a><span class="sd"> Returns a generator which yields child nodes who's parents are the same class.</span> +</span><span id="Expression.flatten-432"><a href="#Expression.flatten-432"><span class="linenos">432</span></a> +</span><span id="Expression.flatten-433"><a href="#Expression.flatten-433"><span class="linenos">433</span></a><span class="sd"> A AND B AND C -> [A, B, C]</span> +</span><span id="Expression.flatten-434"><a href="#Expression.flatten-434"><span class="linenos">434</span></a><span class="sd"> """</span> +</span><span id="Expression.flatten-435"><a href="#Expression.flatten-435"><span class="linenos">435</span></a> <span class="k">for</span> <span class="n">node</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dfs</span><span class="p">(</span><span class="n">prune</span><span class="o">=</span><span class="k">lambda</span> <span class="n">n</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">_</span><span class="p">:</span> <span class="n">p</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)):</span> +</span><span id="Expression.flatten-436"><a href="#Expression.flatten-436"><span class="linenos">436</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">):</span> +</span><span id="Expression.flatten-437"><a href="#Expression.flatten-437"><span class="linenos">437</span></a> <span class="k">yield</span> <span class="n">node</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span> <span class="k">if</span> <span class="n">unnest</span> <span class="k">else</span> <span class="n">node</span> </span></pre></div> @@ -8891,20 +9039,20 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.sql"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.sql-431"><a href="#Expression.sql-431"><span class="linenos">431</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Expression.sql-432"><a href="#Expression.sql-432"><span class="linenos">432</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.sql-433"><a href="#Expression.sql-433"><span class="linenos">433</span></a><span class="sd"> Returns SQL string representation of this tree.</span> -</span><span id="Expression.sql-434"><a href="#Expression.sql-434"><span class="linenos">434</span></a> -</span><span id="Expression.sql-435"><a href="#Expression.sql-435"><span class="linenos">435</span></a><span class="sd"> Args:</span> -</span><span id="Expression.sql-436"><a href="#Expression.sql-436"><span class="linenos">436</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> -</span><span id="Expression.sql-437"><a href="#Expression.sql-437"><span class="linenos">437</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> -</span><span id="Expression.sql-438"><a href="#Expression.sql-438"><span class="linenos">438</span></a> -</span><span id="Expression.sql-439"><a href="#Expression.sql-439"><span class="linenos">439</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.sql-440"><a href="#Expression.sql-440"><span class="linenos">440</span></a><span class="sd"> The SQL string.</span> -</span><span id="Expression.sql-441"><a href="#Expression.sql-441"><span class="linenos">441</span></a><span class="sd"> """</span> -</span><span id="Expression.sql-442"><a href="#Expression.sql-442"><span class="linenos">442</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> -</span><span id="Expression.sql-443"><a href="#Expression.sql-443"><span class="linenos">443</span></a> -</span><span id="Expression.sql-444"><a href="#Expression.sql-444"><span class="linenos">444</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.sql-445"><a href="#Expression.sql-445"><span class="linenos">445</span></a> <span class="k">def</span> <span class="nf">sql</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Expression.sql-446"><a href="#Expression.sql-446"><span class="linenos">446</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.sql-447"><a href="#Expression.sql-447"><span class="linenos">447</span></a><span class="sd"> Returns SQL string representation of this tree.</span> +</span><span id="Expression.sql-448"><a href="#Expression.sql-448"><span class="linenos">448</span></a> +</span><span id="Expression.sql-449"><a href="#Expression.sql-449"><span class="linenos">449</span></a><span class="sd"> Args:</span> +</span><span id="Expression.sql-450"><a href="#Expression.sql-450"><span class="linenos">450</span></a><span class="sd"> dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").</span> +</span><span id="Expression.sql-451"><a href="#Expression.sql-451"><span class="linenos">451</span></a><span class="sd"> opts: other `sqlglot.generator.Generator` options.</span> +</span><span id="Expression.sql-452"><a href="#Expression.sql-452"><span class="linenos">452</span></a> +</span><span id="Expression.sql-453"><a href="#Expression.sql-453"><span class="linenos">453</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.sql-454"><a href="#Expression.sql-454"><span class="linenos">454</span></a><span class="sd"> The SQL string.</span> +</span><span id="Expression.sql-455"><a href="#Expression.sql-455"><span class="linenos">455</span></a><span class="sd"> """</span> +</span><span id="Expression.sql-456"><a href="#Expression.sql-456"><span class="linenos">456</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects</span> <span class="kn">import</span> <span class="n">Dialect</span> +</span><span id="Expression.sql-457"><a href="#Expression.sql-457"><span class="linenos">457</span></a> +</span><span id="Expression.sql-458"><a href="#Expression.sql-458"><span class="linenos">458</span></a> <span class="k">return</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -8937,32 +9085,32 @@ the BFS (Breadth-first) order.</p> </div> <a class="headerlink" href="#Expression.transform"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.transform-470"><a href="#Expression.transform-470"><span class="linenos">470</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="Expression.transform-471"><a href="#Expression.transform-471"><span class="linenos">471</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.transform-472"><a href="#Expression.transform-472"><span class="linenos">472</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> -</span><span id="Expression.transform-473"><a href="#Expression.transform-473"><span class="linenos">473</span></a><span class="sd"> and applies the given transformation function to each node.</span> -</span><span id="Expression.transform-474"><a href="#Expression.transform-474"><span class="linenos">474</span></a> -</span><span id="Expression.transform-475"><a href="#Expression.transform-475"><span class="linenos">475</span></a><span class="sd"> Args:</span> -</span><span id="Expression.transform-476"><a href="#Expression.transform-476"><span class="linenos">476</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> -</span><span id="Expression.transform-477"><a href="#Expression.transform-477"><span class="linenos">477</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> -</span><span id="Expression.transform-478"><a href="#Expression.transform-478"><span class="linenos">478</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> -</span><span id="Expression.transform-479"><a href="#Expression.transform-479"><span class="linenos">479</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> -</span><span id="Expression.transform-480"><a href="#Expression.transform-480"><span class="linenos">480</span></a><span class="sd"> modified in place.</span> -</span><span id="Expression.transform-481"><a href="#Expression.transform-481"><span class="linenos">481</span></a> -</span><span id="Expression.transform-482"><a href="#Expression.transform-482"><span class="linenos">482</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.transform-483"><a href="#Expression.transform-483"><span class="linenos">483</span></a><span class="sd"> The transformed tree.</span> -</span><span id="Expression.transform-484"><a href="#Expression.transform-484"><span class="linenos">484</span></a><span class="sd"> """</span> -</span><span id="Expression.transform-485"><a href="#Expression.transform-485"><span class="linenos">485</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="Expression.transform-486"><a href="#Expression.transform-486"><span class="linenos">486</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="Expression.transform-487"><a href="#Expression.transform-487"><span class="linenos">487</span></a> -</span><span id="Expression.transform-488"><a href="#Expression.transform-488"><span class="linenos">488</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="Expression.transform-489"><a href="#Expression.transform-489"><span class="linenos">489</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression.transform-490"><a href="#Expression.transform-490"><span class="linenos">490</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> -</span><span id="Expression.transform-491"><a href="#Expression.transform-491"><span class="linenos">491</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.transform-492"><a href="#Expression.transform-492"><span class="linenos">492</span></a> <span class="k">return</span> <span class="n">new_node</span> -</span><span id="Expression.transform-493"><a href="#Expression.transform-493"><span class="linenos">493</span></a> -</span><span id="Expression.transform-494"><a href="#Expression.transform-494"><span class="linenos">494</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> -</span><span id="Expression.transform-495"><a href="#Expression.transform-495"><span class="linenos">495</span></a> <span class="k">return</span> <span class="n">new_node</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.transform-484"><a href="#Expression.transform-484"><span class="linenos">484</span></a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="Expression.transform-485"><a href="#Expression.transform-485"><span class="linenos">485</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.transform-486"><a href="#Expression.transform-486"><span class="linenos">486</span></a><span class="sd"> Recursively visits all tree nodes (excluding already transformed ones)</span> +</span><span id="Expression.transform-487"><a href="#Expression.transform-487"><span class="linenos">487</span></a><span class="sd"> and applies the given transformation function to each node.</span> +</span><span id="Expression.transform-488"><a href="#Expression.transform-488"><span class="linenos">488</span></a> +</span><span id="Expression.transform-489"><a href="#Expression.transform-489"><span class="linenos">489</span></a><span class="sd"> Args:</span> +</span><span id="Expression.transform-490"><a href="#Expression.transform-490"><span class="linenos">490</span></a><span class="sd"> fun (function): a function which takes a node as an argument and returns a</span> +</span><span id="Expression.transform-491"><a href="#Expression.transform-491"><span class="linenos">491</span></a><span class="sd"> new transformed node or the same node without modifications. If the function</span> +</span><span id="Expression.transform-492"><a href="#Expression.transform-492"><span class="linenos">492</span></a><span class="sd"> returns None, then the corresponding node will be removed from the syntax tree.</span> +</span><span id="Expression.transform-493"><a href="#Expression.transform-493"><span class="linenos">493</span></a><span class="sd"> copy (bool): if set to True a new tree instance is constructed, otherwise the tree is</span> +</span><span id="Expression.transform-494"><a href="#Expression.transform-494"><span class="linenos">494</span></a><span class="sd"> modified in place.</span> +</span><span id="Expression.transform-495"><a href="#Expression.transform-495"><span class="linenos">495</span></a> +</span><span id="Expression.transform-496"><a href="#Expression.transform-496"><span class="linenos">496</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.transform-497"><a href="#Expression.transform-497"><span class="linenos">497</span></a><span class="sd"> The transformed tree.</span> +</span><span id="Expression.transform-498"><a href="#Expression.transform-498"><span class="linenos">498</span></a><span class="sd"> """</span> +</span><span id="Expression.transform-499"><a href="#Expression.transform-499"><span class="linenos">499</span></a> <span class="n">node</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="Expression.transform-500"><a href="#Expression.transform-500"><span class="linenos">500</span></a> <span class="n">new_node</span> <span class="o">=</span> <span class="n">fun</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="Expression.transform-501"><a href="#Expression.transform-501"><span class="linenos">501</span></a> +</span><span id="Expression.transform-502"><a href="#Expression.transform-502"><span class="linenos">502</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="Expression.transform-503"><a href="#Expression.transform-503"><span class="linenos">503</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression.transform-504"><a href="#Expression.transform-504"><span class="linenos">504</span></a> <span class="k">if</span> <span class="n">new_node</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">node</span><span class="p">:</span> +</span><span id="Expression.transform-505"><a href="#Expression.transform-505"><span class="linenos">505</span></a> <span class="n">new_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">node</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.transform-506"><a href="#Expression.transform-506"><span class="linenos">506</span></a> <span class="k">return</span> <span class="n">new_node</span> +</span><span id="Expression.transform-507"><a href="#Expression.transform-507"><span class="linenos">507</span></a> +</span><span id="Expression.transform-508"><a href="#Expression.transform-508"><span class="linenos">508</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">new_node</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">child</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">fun</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">))</span> +</span><span id="Expression.transform-509"><a href="#Expression.transform-509"><span class="linenos">509</span></a> <span class="k">return</span> <span class="n">new_node</span> </span></pre></div> @@ -8999,32 +9147,32 @@ modified in place.</li> </div> <a class="headerlink" href="#Expression.replace"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.replace-497"><a href="#Expression.replace-497"><span class="linenos">497</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> -</span><span id="Expression.replace-498"><a href="#Expression.replace-498"><span class="linenos">498</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.replace-499"><a href="#Expression.replace-499"><span class="linenos">499</span></a><span class="sd"> Swap out this expression with a new expression.</span> -</span><span id="Expression.replace-500"><a href="#Expression.replace-500"><span class="linenos">500</span></a> -</span><span id="Expression.replace-501"><a href="#Expression.replace-501"><span class="linenos">501</span></a><span class="sd"> For example::</span> -</span><span id="Expression.replace-502"><a href="#Expression.replace-502"><span class="linenos">502</span></a> -</span><span id="Expression.replace-503"><a href="#Expression.replace-503"><span class="linenos">503</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> -</span><span id="Expression.replace-504"><a href="#Expression.replace-504"><span class="linenos">504</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> -</span><span id="Expression.replace-505"><a href="#Expression.replace-505"><span class="linenos">505</span></a><span class="sd"> (COLUMN this: y)</span> -</span><span id="Expression.replace-506"><a href="#Expression.replace-506"><span class="linenos">506</span></a><span class="sd"> >>> tree.sql()</span> -</span><span id="Expression.replace-507"><a href="#Expression.replace-507"><span class="linenos">507</span></a><span class="sd"> 'SELECT y FROM tbl'</span> -</span><span id="Expression.replace-508"><a href="#Expression.replace-508"><span class="linenos">508</span></a> -</span><span id="Expression.replace-509"><a href="#Expression.replace-509"><span class="linenos">509</span></a><span class="sd"> Args:</span> -</span><span id="Expression.replace-510"><a href="#Expression.replace-510"><span class="linenos">510</span></a><span class="sd"> expression (Expression|None): new node</span> -</span><span id="Expression.replace-511"><a href="#Expression.replace-511"><span class="linenos">511</span></a> -</span><span id="Expression.replace-512"><a href="#Expression.replace-512"><span class="linenos">512</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.replace-513"><a href="#Expression.replace-513"><span class="linenos">513</span></a><span class="sd"> The new expression or expressions.</span> -</span><span id="Expression.replace-514"><a href="#Expression.replace-514"><span class="linenos">514</span></a><span class="sd"> """</span> -</span><span id="Expression.replace-515"><a href="#Expression.replace-515"><span class="linenos">515</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> -</span><span id="Expression.replace-516"><a href="#Expression.replace-516"><span class="linenos">516</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Expression.replace-517"><a href="#Expression.replace-517"><span class="linenos">517</span></a> -</span><span id="Expression.replace-518"><a href="#Expression.replace-518"><span class="linenos">518</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> -</span><span id="Expression.replace-519"><a href="#Expression.replace-519"><span class="linenos">519</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Expression.replace-520"><a href="#Expression.replace-520"><span class="linenos">520</span></a> -</span><span id="Expression.replace-521"><a href="#Expression.replace-521"><span class="linenos">521</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> -</span><span id="Expression.replace-522"><a href="#Expression.replace-522"><span class="linenos">522</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.replace-511"><a href="#Expression.replace-511"><span class="linenos">511</span></a> <span class="k">def</span> <span class="nf">replace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">):</span> +</span><span id="Expression.replace-512"><a href="#Expression.replace-512"><span class="linenos">512</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.replace-513"><a href="#Expression.replace-513"><span class="linenos">513</span></a><span class="sd"> Swap out this expression with a new expression.</span> +</span><span id="Expression.replace-514"><a href="#Expression.replace-514"><span class="linenos">514</span></a> +</span><span id="Expression.replace-515"><a href="#Expression.replace-515"><span class="linenos">515</span></a><span class="sd"> For example::</span> +</span><span id="Expression.replace-516"><a href="#Expression.replace-516"><span class="linenos">516</span></a> +</span><span id="Expression.replace-517"><a href="#Expression.replace-517"><span class="linenos">517</span></a><span class="sd"> >>> tree = Select().select("x").from_("tbl")</span> +</span><span id="Expression.replace-518"><a href="#Expression.replace-518"><span class="linenos">518</span></a><span class="sd"> >>> tree.find(Column).replace(Column(this="y"))</span> +</span><span id="Expression.replace-519"><a href="#Expression.replace-519"><span class="linenos">519</span></a><span class="sd"> (COLUMN this: y)</span> +</span><span id="Expression.replace-520"><a href="#Expression.replace-520"><span class="linenos">520</span></a><span class="sd"> >>> tree.sql()</span> +</span><span id="Expression.replace-521"><a href="#Expression.replace-521"><span class="linenos">521</span></a><span class="sd"> 'SELECT y FROM tbl'</span> +</span><span id="Expression.replace-522"><a href="#Expression.replace-522"><span class="linenos">522</span></a> +</span><span id="Expression.replace-523"><a href="#Expression.replace-523"><span class="linenos">523</span></a><span class="sd"> Args:</span> +</span><span id="Expression.replace-524"><a href="#Expression.replace-524"><span class="linenos">524</span></a><span class="sd"> expression (Expression|None): new node</span> +</span><span id="Expression.replace-525"><a href="#Expression.replace-525"><span class="linenos">525</span></a> +</span><span id="Expression.replace-526"><a href="#Expression.replace-526"><span class="linenos">526</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.replace-527"><a href="#Expression.replace-527"><span class="linenos">527</span></a><span class="sd"> The new expression or expressions.</span> +</span><span id="Expression.replace-528"><a href="#Expression.replace-528"><span class="linenos">528</span></a><span class="sd"> """</span> +</span><span id="Expression.replace-529"><a href="#Expression.replace-529"><span class="linenos">529</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">:</span> +</span><span id="Expression.replace-530"><a href="#Expression.replace-530"><span class="linenos">530</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Expression.replace-531"><a href="#Expression.replace-531"><span class="linenos">531</span></a> +</span><span id="Expression.replace-532"><a href="#Expression.replace-532"><span class="linenos">532</span></a> <span class="n">parent</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> +</span><span id="Expression.replace-533"><a href="#Expression.replace-533"><span class="linenos">533</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Expression.replace-534"><a href="#Expression.replace-534"><span class="linenos">534</span></a> +</span><span id="Expression.replace-535"><a href="#Expression.replace-535"><span class="linenos">535</span></a> <span class="n">replace_children</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="k">lambda</span> <span class="n">child</span><span class="p">:</span> <span class="n">expression</span> <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="bp">self</span> <span class="k">else</span> <span class="n">child</span><span class="p">)</span> +</span><span id="Expression.replace-536"><a href="#Expression.replace-536"><span class="linenos">536</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -9065,11 +9213,11 @@ modified in place.</li> </div> <a class="headerlink" href="#Expression.pop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.pop-524"><a href="#Expression.pop-524"><span class="linenos">524</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.pop-525"><a href="#Expression.pop-525"><span class="linenos">525</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.pop-526"><a href="#Expression.pop-526"><span class="linenos">526</span></a><span class="sd"> Remove this expression from its AST.</span> -</span><span id="Expression.pop-527"><a href="#Expression.pop-527"><span class="linenos">527</span></a><span class="sd"> """</span> -</span><span id="Expression.pop-528"><a href="#Expression.pop-528"><span class="linenos">528</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.pop-538"><a href="#Expression.pop-538"><span class="linenos">538</span></a> <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.pop-539"><a href="#Expression.pop-539"><span class="linenos">539</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.pop-540"><a href="#Expression.pop-540"><span class="linenos">540</span></a><span class="sd"> Remove this expression from its AST.</span> +</span><span id="Expression.pop-541"><a href="#Expression.pop-541"><span class="linenos">541</span></a><span class="sd"> """</span> +</span><span id="Expression.pop-542"><a href="#Expression.pop-542"><span class="linenos">542</span></a> <span class="bp">self</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span> </span></pre></div> @@ -9089,22 +9237,22 @@ modified in place.</li> </div> <a class="headerlink" href="#Expression.assert_is"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.assert_is-530"><a href="#Expression.assert_is-530"><span class="linenos">530</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> -</span><span id="Expression.assert_is-531"><a href="#Expression.assert_is-531"><span class="linenos">531</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.assert_is-532"><a href="#Expression.assert_is-532"><span class="linenos">532</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> -</span><span id="Expression.assert_is-533"><a href="#Expression.assert_is-533"><span class="linenos">533</span></a> -</span><span id="Expression.assert_is-534"><a href="#Expression.assert_is-534"><span class="linenos">534</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> -</span><span id="Expression.assert_is-535"><a href="#Expression.assert_is-535"><span class="linenos">535</span></a><span class="sd"> Otherwise, this returns this expression.</span> -</span><span id="Expression.assert_is-536"><a href="#Expression.assert_is-536"><span class="linenos">536</span></a> -</span><span id="Expression.assert_is-537"><a href="#Expression.assert_is-537"><span class="linenos">537</span></a><span class="sd"> Examples:</span> -</span><span id="Expression.assert_is-538"><a href="#Expression.assert_is-538"><span class="linenos">538</span></a><span class="sd"> This is useful for type security in chained expressions:</span> -</span><span id="Expression.assert_is-539"><a href="#Expression.assert_is-539"><span class="linenos">539</span></a> -</span><span id="Expression.assert_is-540"><a href="#Expression.assert_is-540"><span class="linenos">540</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Expression.assert_is-541"><a href="#Expression.assert_is-541"><span class="linenos">541</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> -</span><span id="Expression.assert_is-542"><a href="#Expression.assert_is-542"><span class="linenos">542</span></a><span class="sd"> 'SELECT x, z FROM y'</span> -</span><span id="Expression.assert_is-543"><a href="#Expression.assert_is-543"><span class="linenos">543</span></a><span class="sd"> """</span> -</span><span id="Expression.assert_is-544"><a href="#Expression.assert_is-544"><span class="linenos">544</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> -</span><span id="Expression.assert_is-545"><a href="#Expression.assert_is-545"><span class="linenos">545</span></a> <span class="k">return</span> <span class="bp">self</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.assert_is-544"><a href="#Expression.assert_is-544"><span class="linenos">544</span></a> <span class="k">def</span> <span class="nf">assert_is</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">):</span> +</span><span id="Expression.assert_is-545"><a href="#Expression.assert_is-545"><span class="linenos">545</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.assert_is-546"><a href="#Expression.assert_is-546"><span class="linenos">546</span></a><span class="sd"> Assert that this `Expression` is an instance of `type_`.</span> +</span><span id="Expression.assert_is-547"><a href="#Expression.assert_is-547"><span class="linenos">547</span></a> +</span><span id="Expression.assert_is-548"><a href="#Expression.assert_is-548"><span class="linenos">548</span></a><span class="sd"> If it is NOT an instance of `type_`, this raises an assertion error.</span> +</span><span id="Expression.assert_is-549"><a href="#Expression.assert_is-549"><span class="linenos">549</span></a><span class="sd"> Otherwise, this returns this expression.</span> +</span><span id="Expression.assert_is-550"><a href="#Expression.assert_is-550"><span class="linenos">550</span></a> +</span><span id="Expression.assert_is-551"><a href="#Expression.assert_is-551"><span class="linenos">551</span></a><span class="sd"> Examples:</span> +</span><span id="Expression.assert_is-552"><a href="#Expression.assert_is-552"><span class="linenos">552</span></a><span class="sd"> This is useful for type security in chained expressions:</span> +</span><span id="Expression.assert_is-553"><a href="#Expression.assert_is-553"><span class="linenos">553</span></a> +</span><span id="Expression.assert_is-554"><a href="#Expression.assert_is-554"><span class="linenos">554</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Expression.assert_is-555"><a href="#Expression.assert_is-555"><span class="linenos">555</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()</span> +</span><span id="Expression.assert_is-556"><a href="#Expression.assert_is-556"><span class="linenos">556</span></a><span class="sd"> 'SELECT x, z FROM y'</span> +</span><span id="Expression.assert_is-557"><a href="#Expression.assert_is-557"><span class="linenos">557</span></a><span class="sd"> """</span> +</span><span id="Expression.assert_is-558"><a href="#Expression.assert_is-558"><span class="linenos">558</span></a> <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">type_</span><span class="p">)</span> +</span><span id="Expression.assert_is-559"><a href="#Expression.assert_is-559"><span class="linenos">559</span></a> <span class="k">return</span> <span class="bp">self</span> </span></pre></div> @@ -9140,39 +9288,39 @@ Otherwise, this returns this expression.</p> </div> <a class="headerlink" href="#Expression.error_messages"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.error_messages-547"><a href="#Expression.error_messages-547"><span class="linenos">547</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="Expression.error_messages-548"><a href="#Expression.error_messages-548"><span class="linenos">548</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.error_messages-549"><a href="#Expression.error_messages-549"><span class="linenos">549</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> -</span><span id="Expression.error_messages-550"><a href="#Expression.error_messages-550"><span class="linenos">550</span></a> -</span><span id="Expression.error_messages-551"><a href="#Expression.error_messages-551"><span class="linenos">551</span></a><span class="sd"> Args:</span> -</span><span id="Expression.error_messages-552"><a href="#Expression.error_messages-552"><span class="linenos">552</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> -</span><span id="Expression.error_messages-553"><a href="#Expression.error_messages-553"><span class="linenos">553</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> -</span><span id="Expression.error_messages-554"><a href="#Expression.error_messages-554"><span class="linenos">554</span></a> -</span><span id="Expression.error_messages-555"><a href="#Expression.error_messages-555"><span class="linenos">555</span></a><span class="sd"> Returns:</span> -</span><span id="Expression.error_messages-556"><a href="#Expression.error_messages-556"><span class="linenos">556</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> -</span><span id="Expression.error_messages-557"><a href="#Expression.error_messages-557"><span class="linenos">557</span></a><span class="sd"> """</span> -</span><span id="Expression.error_messages-558"><a href="#Expression.error_messages-558"><span class="linenos">558</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Expression.error_messages-559"><a href="#Expression.error_messages-559"><span class="linenos">559</span></a> -</span><span id="Expression.error_messages-560"><a href="#Expression.error_messages-560"><span class="linenos">560</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> -</span><span id="Expression.error_messages-561"><a href="#Expression.error_messages-561"><span class="linenos">561</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> -</span><span id="Expression.error_messages-562"><a href="#Expression.error_messages-562"><span class="linenos">562</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="Expression.error_messages-563"><a href="#Expression.error_messages-563"><span class="linenos">563</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Expression.error_messages-564"><a href="#Expression.error_messages-564"><span class="linenos">564</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> -</span><span id="Expression.error_messages-565"><a href="#Expression.error_messages-565"><span class="linenos">565</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> -</span><span id="Expression.error_messages-566"><a href="#Expression.error_messages-566"><span class="linenos">566</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="Expression.error_messages-567"><a href="#Expression.error_messages-567"><span class="linenos">567</span></a> -</span><span id="Expression.error_messages-568"><a href="#Expression.error_messages-568"><span class="linenos">568</span></a> <span class="k">if</span> <span class="p">(</span> -</span><span id="Expression.error_messages-569"><a href="#Expression.error_messages-569"><span class="linenos">569</span></a> <span class="n">args</span> -</span><span id="Expression.error_messages-570"><a href="#Expression.error_messages-570"><span class="linenos">570</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> -</span><span id="Expression.error_messages-571"><a href="#Expression.error_messages-571"><span class="linenos">571</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="Expression.error_messages-572"><a href="#Expression.error_messages-572"><span class="linenos">572</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> -</span><span id="Expression.error_messages-573"><a href="#Expression.error_messages-573"><span class="linenos">573</span></a> <span class="p">):</span> -</span><span id="Expression.error_messages-574"><a href="#Expression.error_messages-574"><span class="linenos">574</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> -</span><span id="Expression.error_messages-575"><a href="#Expression.error_messages-575"><span class="linenos">575</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> -</span><span id="Expression.error_messages-576"><a href="#Expression.error_messages-576"><span class="linenos">576</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> -</span><span id="Expression.error_messages-577"><a href="#Expression.error_messages-577"><span class="linenos">577</span></a> <span class="p">)</span> -</span><span id="Expression.error_messages-578"><a href="#Expression.error_messages-578"><span class="linenos">578</span></a> -</span><span id="Expression.error_messages-579"><a href="#Expression.error_messages-579"><span class="linenos">579</span></a> <span class="k">return</span> <span class="n">errors</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.error_messages-561"><a href="#Expression.error_messages-561"><span class="linenos">561</span></a> <span class="k">def</span> <span class="nf">error_messages</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="Expression.error_messages-562"><a href="#Expression.error_messages-562"><span class="linenos">562</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.error_messages-563"><a href="#Expression.error_messages-563"><span class="linenos">563</span></a><span class="sd"> Checks if this expression is valid (e.g. all mandatory args are set).</span> +</span><span id="Expression.error_messages-564"><a href="#Expression.error_messages-564"><span class="linenos">564</span></a> +</span><span id="Expression.error_messages-565"><a href="#Expression.error_messages-565"><span class="linenos">565</span></a><span class="sd"> Args:</span> +</span><span id="Expression.error_messages-566"><a href="#Expression.error_messages-566"><span class="linenos">566</span></a><span class="sd"> args: a sequence of values that were used to instantiate a Func expression. This is used</span> +</span><span id="Expression.error_messages-567"><a href="#Expression.error_messages-567"><span class="linenos">567</span></a><span class="sd"> to check that the provided arguments don't exceed the function argument limit.</span> +</span><span id="Expression.error_messages-568"><a href="#Expression.error_messages-568"><span class="linenos">568</span></a> +</span><span id="Expression.error_messages-569"><a href="#Expression.error_messages-569"><span class="linenos">569</span></a><span class="sd"> Returns:</span> +</span><span id="Expression.error_messages-570"><a href="#Expression.error_messages-570"><span class="linenos">570</span></a><span class="sd"> A list of error messages for all possible errors that were found.</span> +</span><span id="Expression.error_messages-571"><a href="#Expression.error_messages-571"><span class="linenos">571</span></a><span class="sd"> """</span> +</span><span id="Expression.error_messages-572"><a href="#Expression.error_messages-572"><span class="linenos">572</span></a> <span class="n">errors</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Expression.error_messages-573"><a href="#Expression.error_messages-573"><span class="linenos">573</span></a> +</span><span id="Expression.error_messages-574"><a href="#Expression.error_messages-574"><span class="linenos">574</span></a> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">:</span> +</span><span id="Expression.error_messages-575"><a href="#Expression.error_messages-575"><span class="linenos">575</span></a> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">:</span> +</span><span id="Expression.error_messages-576"><a href="#Expression.error_messages-576"><span class="linenos">576</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unexpected keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="Expression.error_messages-577"><a href="#Expression.error_messages-577"><span class="linenos">577</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">mandatory</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Expression.error_messages-578"><a href="#Expression.error_messages-578"><span class="linenos">578</span></a> <span class="n">v</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> +</span><span id="Expression.error_messages-579"><a href="#Expression.error_messages-579"><span class="linenos">579</span></a> <span class="k">if</span> <span class="n">mandatory</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">v</span><span class="p">)):</span> +</span><span id="Expression.error_messages-580"><a href="#Expression.error_messages-580"><span class="linenos">580</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Required keyword: '</span><span class="si">{</span><span class="n">k</span><span class="si">}</span><span class="s2">' missing for </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="Expression.error_messages-581"><a href="#Expression.error_messages-581"><span class="linenos">581</span></a> +</span><span id="Expression.error_messages-582"><a href="#Expression.error_messages-582"><span class="linenos">582</span></a> <span class="k">if</span> <span class="p">(</span> +</span><span id="Expression.error_messages-583"><a href="#Expression.error_messages-583"><span class="linenos">583</span></a> <span class="n">args</span> +</span><span id="Expression.error_messages-584"><a href="#Expression.error_messages-584"><span class="linenos">584</span></a> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">Func</span><span class="p">)</span> +</span><span id="Expression.error_messages-585"><a href="#Expression.error_messages-585"><span class="linenos">585</span></a> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">></span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="Expression.error_messages-586"><a href="#Expression.error_messages-586"><span class="linenos">586</span></a> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_var_len_args</span> +</span><span id="Expression.error_messages-587"><a href="#Expression.error_messages-587"><span class="linenos">587</span></a> <span class="p">):</span> +</span><span id="Expression.error_messages-588"><a href="#Expression.error_messages-588"><span class="linenos">588</span></a> <span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span> +</span><span id="Expression.error_messages-589"><a href="#Expression.error_messages-589"><span class="linenos">589</span></a> <span class="sa">f</span><span class="s2">"The number of provided arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="si">}</span><span class="s2">) is greater than "</span> +</span><span id="Expression.error_messages-590"><a href="#Expression.error_messages-590"><span class="linenos">590</span></a> <span class="sa">f</span><span class="s2">"the maximum number of supported arguments (</span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span><span class="si">}</span><span class="s2">)"</span> +</span><span id="Expression.error_messages-591"><a href="#Expression.error_messages-591"><span class="linenos">591</span></a> <span class="p">)</span> +</span><span id="Expression.error_messages-592"><a href="#Expression.error_messages-592"><span class="linenos">592</span></a> +</span><span id="Expression.error_messages-593"><a href="#Expression.error_messages-593"><span class="linenos">593</span></a> <span class="k">return</span> <span class="n">errors</span> </span></pre></div> @@ -9205,13 +9353,13 @@ to check that the provided arguments don't exceed the function argument limit.</ </div> <a class="headerlink" href="#Expression.dump"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.dump-581"><a href="#Expression.dump-581"><span class="linenos">581</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Expression.dump-582"><a href="#Expression.dump-582"><span class="linenos">582</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.dump-583"><a href="#Expression.dump-583"><span class="linenos">583</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> -</span><span id="Expression.dump-584"><a href="#Expression.dump-584"><span class="linenos">584</span></a><span class="sd"> """</span> -</span><span id="Expression.dump-585"><a href="#Expression.dump-585"><span class="linenos">585</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> -</span><span id="Expression.dump-586"><a href="#Expression.dump-586"><span class="linenos">586</span></a> -</span><span id="Expression.dump-587"><a href="#Expression.dump-587"><span class="linenos">587</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.dump-595"><a href="#Expression.dump-595"><span class="linenos">595</span></a> <span class="k">def</span> <span class="nf">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Expression.dump-596"><a href="#Expression.dump-596"><span class="linenos">596</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.dump-597"><a href="#Expression.dump-597"><span class="linenos">597</span></a><span class="sd"> Dump this Expression to a JSON-serializable dict.</span> +</span><span id="Expression.dump-598"><a href="#Expression.dump-598"><span class="linenos">598</span></a><span class="sd"> """</span> +</span><span id="Expression.dump-599"><a href="#Expression.dump-599"><span class="linenos">599</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">dump</span> +</span><span id="Expression.dump-600"><a href="#Expression.dump-600"><span class="linenos">600</span></a> +</span><span id="Expression.dump-601"><a href="#Expression.dump-601"><span class="linenos">601</span></a> <span class="k">return</span> <span class="n">dump</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> </span></pre></div> @@ -9232,14 +9380,14 @@ to check that the provided arguments don't exceed the function argument limit.</ </div> <a class="headerlink" href="#Expression.load"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.load-589"><a href="#Expression.load-589"><span class="linenos">589</span></a> <span class="nd">@classmethod</span> -</span><span id="Expression.load-590"><a href="#Expression.load-590"><span class="linenos">590</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> -</span><span id="Expression.load-591"><a href="#Expression.load-591"><span class="linenos">591</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Expression.load-592"><a href="#Expression.load-592"><span class="linenos">592</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> -</span><span id="Expression.load-593"><a href="#Expression.load-593"><span class="linenos">593</span></a><span class="sd"> """</span> -</span><span id="Expression.load-594"><a href="#Expression.load-594"><span class="linenos">594</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> -</span><span id="Expression.load-595"><a href="#Expression.load-595"><span class="linenos">595</span></a> -</span><span id="Expression.load-596"><a href="#Expression.load-596"><span class="linenos">596</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Expression.load-603"><a href="#Expression.load-603"><span class="linenos">603</span></a> <span class="nd">@classmethod</span> +</span><span id="Expression.load-604"><a href="#Expression.load-604"><span class="linenos">604</span></a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span> +</span><span id="Expression.load-605"><a href="#Expression.load-605"><span class="linenos">605</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Expression.load-606"><a href="#Expression.load-606"><span class="linenos">606</span></a><span class="sd"> Load a dict (as returned by `Expression.dump`) into an Expression instance.</span> +</span><span id="Expression.load-607"><a href="#Expression.load-607"><span class="linenos">607</span></a><span class="sd"> """</span> +</span><span id="Expression.load-608"><a href="#Expression.load-608"><span class="linenos">608</span></a> <span class="kn">from</span> <span class="nn">sqlglot.serde</span> <span class="kn">import</span> <span class="n">load</span> +</span><span id="Expression.load-609"><a href="#Expression.load-609"><span class="linenos">609</span></a> +</span><span id="Expression.load-610"><a href="#Expression.load-610"><span class="linenos">610</span></a> <span class="k">return</span> <span class="n">load</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span> </span></pre></div> @@ -9260,57 +9408,57 @@ to check that the provided arguments don't exceed the function argument limit.</ </div> <a class="headerlink" href="#Condition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition-606"><a href="#Condition-606"><span class="linenos">606</span></a><span class="k">class</span> <span class="nc">Condition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Condition-607"><a href="#Condition-607"><span class="linenos">607</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Condition-608"><a href="#Condition-608"><span class="linenos">608</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-609"><a href="#Condition-609"><span class="linenos">609</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="Condition-610"><a href="#Condition-610"><span class="linenos">610</span></a> -</span><span id="Condition-611"><a href="#Condition-611"><span class="linenos">611</span></a><span class="sd"> Example:</span> -</span><span id="Condition-612"><a href="#Condition-612"><span class="linenos">612</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="Condition-613"><a href="#Condition-613"><span class="linenos">613</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="Condition-614"><a href="#Condition-614"><span class="linenos">614</span></a> -</span><span id="Condition-615"><a href="#Condition-615"><span class="linenos">615</span></a><span class="sd"> Args:</span> -</span><span id="Condition-616"><a href="#Condition-616"><span class="linenos">616</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Condition-617"><a href="#Condition-617"><span class="linenos">617</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition-618"><a href="#Condition-618"><span class="linenos">618</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Condition-619"><a href="#Condition-619"><span class="linenos">619</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Condition-620"><a href="#Condition-620"><span class="linenos">620</span></a> -</span><span id="Condition-621"><a href="#Condition-621"><span class="linenos">621</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-622"><a href="#Condition-622"><span class="linenos">622</span></a><span class="sd"> And: the new condition.</span> -</span><span id="Condition-623"><a href="#Condition-623"><span class="linenos">623</span></a><span class="sd"> """</span> -</span><span id="Condition-624"><a href="#Condition-624"><span class="linenos">624</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Condition-625"><a href="#Condition-625"><span class="linenos">625</span></a> -</span><span id="Condition-626"><a href="#Condition-626"><span class="linenos">626</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Condition-627"><a href="#Condition-627"><span class="linenos">627</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-628"><a href="#Condition-628"><span class="linenos">628</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> -</span><span id="Condition-629"><a href="#Condition-629"><span class="linenos">629</span></a> -</span><span id="Condition-630"><a href="#Condition-630"><span class="linenos">630</span></a><span class="sd"> Example:</span> -</span><span id="Condition-631"><a href="#Condition-631"><span class="linenos">631</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="Condition-632"><a href="#Condition-632"><span class="linenos">632</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="Condition-633"><a href="#Condition-633"><span class="linenos">633</span></a> -</span><span id="Condition-634"><a href="#Condition-634"><span class="linenos">634</span></a><span class="sd"> Args:</span> -</span><span id="Condition-635"><a href="#Condition-635"><span class="linenos">635</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Condition-636"><a href="#Condition-636"><span class="linenos">636</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition-637"><a href="#Condition-637"><span class="linenos">637</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Condition-638"><a href="#Condition-638"><span class="linenos">638</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition-620"><a href="#Condition-620"><span class="linenos">620</span></a><span class="k">class</span> <span class="nc">Condition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Condition-621"><a href="#Condition-621"><span class="linenos">621</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Condition-622"><a href="#Condition-622"><span class="linenos">622</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-623"><a href="#Condition-623"><span class="linenos">623</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="Condition-624"><a href="#Condition-624"><span class="linenos">624</span></a> +</span><span id="Condition-625"><a href="#Condition-625"><span class="linenos">625</span></a><span class="sd"> Example:</span> +</span><span id="Condition-626"><a href="#Condition-626"><span class="linenos">626</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="Condition-627"><a href="#Condition-627"><span class="linenos">627</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="Condition-628"><a href="#Condition-628"><span class="linenos">628</span></a> +</span><span id="Condition-629"><a href="#Condition-629"><span class="linenos">629</span></a><span class="sd"> Args:</span> +</span><span id="Condition-630"><a href="#Condition-630"><span class="linenos">630</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Condition-631"><a href="#Condition-631"><span class="linenos">631</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition-632"><a href="#Condition-632"><span class="linenos">632</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Condition-633"><a href="#Condition-633"><span class="linenos">633</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Condition-634"><a href="#Condition-634"><span class="linenos">634</span></a> +</span><span id="Condition-635"><a href="#Condition-635"><span class="linenos">635</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-636"><a href="#Condition-636"><span class="linenos">636</span></a><span class="sd"> And: the new condition.</span> +</span><span id="Condition-637"><a href="#Condition-637"><span class="linenos">637</span></a><span class="sd"> """</span> +</span><span id="Condition-638"><a href="#Condition-638"><span class="linenos">638</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span><span id="Condition-639"><a href="#Condition-639"><span class="linenos">639</span></a> -</span><span id="Condition-640"><a href="#Condition-640"><span class="linenos">640</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-641"><a href="#Condition-641"><span class="linenos">641</span></a><span class="sd"> Or: the new condition.</span> -</span><span id="Condition-642"><a href="#Condition-642"><span class="linenos">642</span></a><span class="sd"> """</span> -</span><span id="Condition-643"><a href="#Condition-643"><span class="linenos">643</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Condition-644"><a href="#Condition-644"><span class="linenos">644</span></a> -</span><span id="Condition-645"><a href="#Condition-645"><span class="linenos">645</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Condition-646"><a href="#Condition-646"><span class="linenos">646</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition-647"><a href="#Condition-647"><span class="linenos">647</span></a><span class="sd"> Wrap this condition with NOT.</span> -</span><span id="Condition-648"><a href="#Condition-648"><span class="linenos">648</span></a> -</span><span id="Condition-649"><a href="#Condition-649"><span class="linenos">649</span></a><span class="sd"> Example:</span> -</span><span id="Condition-650"><a href="#Condition-650"><span class="linenos">650</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> -</span><span id="Condition-651"><a href="#Condition-651"><span class="linenos">651</span></a><span class="sd"> 'NOT x = 1'</span> -</span><span id="Condition-652"><a href="#Condition-652"><span class="linenos">652</span></a> -</span><span id="Condition-653"><a href="#Condition-653"><span class="linenos">653</span></a><span class="sd"> Returns:</span> -</span><span id="Condition-654"><a href="#Condition-654"><span class="linenos">654</span></a><span class="sd"> Not: the new condition.</span> -</span><span id="Condition-655"><a href="#Condition-655"><span class="linenos">655</span></a><span class="sd"> """</span> -</span><span id="Condition-656"><a href="#Condition-656"><span class="linenos">656</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> +</span><span id="Condition-640"><a href="#Condition-640"><span class="linenos">640</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Condition-641"><a href="#Condition-641"><span class="linenos">641</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-642"><a href="#Condition-642"><span class="linenos">642</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="Condition-643"><a href="#Condition-643"><span class="linenos">643</span></a> +</span><span id="Condition-644"><a href="#Condition-644"><span class="linenos">644</span></a><span class="sd"> Example:</span> +</span><span id="Condition-645"><a href="#Condition-645"><span class="linenos">645</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="Condition-646"><a href="#Condition-646"><span class="linenos">646</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="Condition-647"><a href="#Condition-647"><span class="linenos">647</span></a> +</span><span id="Condition-648"><a href="#Condition-648"><span class="linenos">648</span></a><span class="sd"> Args:</span> +</span><span id="Condition-649"><a href="#Condition-649"><span class="linenos">649</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Condition-650"><a href="#Condition-650"><span class="linenos">650</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition-651"><a href="#Condition-651"><span class="linenos">651</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Condition-652"><a href="#Condition-652"><span class="linenos">652</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Condition-653"><a href="#Condition-653"><span class="linenos">653</span></a> +</span><span id="Condition-654"><a href="#Condition-654"><span class="linenos">654</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-655"><a href="#Condition-655"><span class="linenos">655</span></a><span class="sd"> Or: the new condition.</span> +</span><span id="Condition-656"><a href="#Condition-656"><span class="linenos">656</span></a><span class="sd"> """</span> +</span><span id="Condition-657"><a href="#Condition-657"><span class="linenos">657</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Condition-658"><a href="#Condition-658"><span class="linenos">658</span></a> +</span><span id="Condition-659"><a href="#Condition-659"><span class="linenos">659</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Condition-660"><a href="#Condition-660"><span class="linenos">660</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition-661"><a href="#Condition-661"><span class="linenos">661</span></a><span class="sd"> Wrap this condition with NOT.</span> +</span><span id="Condition-662"><a href="#Condition-662"><span class="linenos">662</span></a> +</span><span id="Condition-663"><a href="#Condition-663"><span class="linenos">663</span></a><span class="sd"> Example:</span> +</span><span id="Condition-664"><a href="#Condition-664"><span class="linenos">664</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="Condition-665"><a href="#Condition-665"><span class="linenos">665</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="Condition-666"><a href="#Condition-666"><span class="linenos">666</span></a> +</span><span id="Condition-667"><a href="#Condition-667"><span class="linenos">667</span></a><span class="sd"> Returns:</span> +</span><span id="Condition-668"><a href="#Condition-668"><span class="linenos">668</span></a><span class="sd"> Not: the new condition.</span> +</span><span id="Condition-669"><a href="#Condition-669"><span class="linenos">669</span></a><span class="sd"> """</span> +</span><span id="Condition-670"><a href="#Condition-670"><span class="linenos">670</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> </span></pre></div> @@ -9327,24 +9475,24 @@ to check that the provided arguments don't exceed the function argument limit.</ </div> <a class="headerlink" href="#Condition.and_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.and_-607"><a href="#Condition.and_-607"><span class="linenos">607</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Condition.and_-608"><a href="#Condition.and_-608"><span class="linenos">608</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.and_-609"><a href="#Condition.and_-609"><span class="linenos">609</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> -</span><span id="Condition.and_-610"><a href="#Condition.and_-610"><span class="linenos">610</span></a> -</span><span id="Condition.and_-611"><a href="#Condition.and_-611"><span class="linenos">611</span></a><span class="sd"> Example:</span> -</span><span id="Condition.and_-612"><a href="#Condition.and_-612"><span class="linenos">612</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> -</span><span id="Condition.and_-613"><a href="#Condition.and_-613"><span class="linenos">613</span></a><span class="sd"> 'x = 1 AND y = 1'</span> -</span><span id="Condition.and_-614"><a href="#Condition.and_-614"><span class="linenos">614</span></a> -</span><span id="Condition.and_-615"><a href="#Condition.and_-615"><span class="linenos">615</span></a><span class="sd"> Args:</span> -</span><span id="Condition.and_-616"><a href="#Condition.and_-616"><span class="linenos">616</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Condition.and_-617"><a href="#Condition.and_-617"><span class="linenos">617</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition.and_-618"><a href="#Condition.and_-618"><span class="linenos">618</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Condition.and_-619"><a href="#Condition.and_-619"><span class="linenos">619</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Condition.and_-620"><a href="#Condition.and_-620"><span class="linenos">620</span></a> -</span><span id="Condition.and_-621"><a href="#Condition.and_-621"><span class="linenos">621</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.and_-622"><a href="#Condition.and_-622"><span class="linenos">622</span></a><span class="sd"> And: the new condition.</span> -</span><span id="Condition.and_-623"><a href="#Condition.and_-623"><span class="linenos">623</span></a><span class="sd"> """</span> -</span><span id="Condition.and_-624"><a href="#Condition.and_-624"><span class="linenos">624</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.and_-621"><a href="#Condition.and_-621"><span class="linenos">621</span></a> <span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Condition.and_-622"><a href="#Condition.and_-622"><span class="linenos">622</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.and_-623"><a href="#Condition.and_-623"><span class="linenos">623</span></a><span class="sd"> AND this condition with one or multiple expressions.</span> +</span><span id="Condition.and_-624"><a href="#Condition.and_-624"><span class="linenos">624</span></a> +</span><span id="Condition.and_-625"><a href="#Condition.and_-625"><span class="linenos">625</span></a><span class="sd"> Example:</span> +</span><span id="Condition.and_-626"><a href="#Condition.and_-626"><span class="linenos">626</span></a><span class="sd"> >>> condition("x=1").and_("y=1").sql()</span> +</span><span id="Condition.and_-627"><a href="#Condition.and_-627"><span class="linenos">627</span></a><span class="sd"> 'x = 1 AND y = 1'</span> +</span><span id="Condition.and_-628"><a href="#Condition.and_-628"><span class="linenos">628</span></a> +</span><span id="Condition.and_-629"><a href="#Condition.and_-629"><span class="linenos">629</span></a><span class="sd"> Args:</span> +</span><span id="Condition.and_-630"><a href="#Condition.and_-630"><span class="linenos">630</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Condition.and_-631"><a href="#Condition.and_-631"><span class="linenos">631</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition.and_-632"><a href="#Condition.and_-632"><span class="linenos">632</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Condition.and_-633"><a href="#Condition.and_-633"><span class="linenos">633</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Condition.and_-634"><a href="#Condition.and_-634"><span class="linenos">634</span></a> +</span><span id="Condition.and_-635"><a href="#Condition.and_-635"><span class="linenos">635</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.and_-636"><a href="#Condition.and_-636"><span class="linenos">636</span></a><span class="sd"> And: the new condition.</span> +</span><span id="Condition.and_-637"><a href="#Condition.and_-637"><span class="linenos">637</span></a><span class="sd"> """</span> +</span><span id="Condition.and_-638"><a href="#Condition.and_-638"><span class="linenos">638</span></a> <span class="k">return</span> <span class="n">and_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -9389,24 +9537,24 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.or_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.or_-626"><a href="#Condition.or_-626"><span class="linenos">626</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Condition.or_-627"><a href="#Condition.or_-627"><span class="linenos">627</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.or_-628"><a href="#Condition.or_-628"><span class="linenos">628</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> -</span><span id="Condition.or_-629"><a href="#Condition.or_-629"><span class="linenos">629</span></a> -</span><span id="Condition.or_-630"><a href="#Condition.or_-630"><span class="linenos">630</span></a><span class="sd"> Example:</span> -</span><span id="Condition.or_-631"><a href="#Condition.or_-631"><span class="linenos">631</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> -</span><span id="Condition.or_-632"><a href="#Condition.or_-632"><span class="linenos">632</span></a><span class="sd"> 'x = 1 OR y = 1'</span> -</span><span id="Condition.or_-633"><a href="#Condition.or_-633"><span class="linenos">633</span></a> -</span><span id="Condition.or_-634"><a href="#Condition.or_-634"><span class="linenos">634</span></a><span class="sd"> Args:</span> -</span><span id="Condition.or_-635"><a href="#Condition.or_-635"><span class="linenos">635</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Condition.or_-636"><a href="#Condition.or_-636"><span class="linenos">636</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Condition.or_-637"><a href="#Condition.or_-637"><span class="linenos">637</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Condition.or_-638"><a href="#Condition.or_-638"><span class="linenos">638</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Condition.or_-639"><a href="#Condition.or_-639"><span class="linenos">639</span></a> -</span><span id="Condition.or_-640"><a href="#Condition.or_-640"><span class="linenos">640</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.or_-641"><a href="#Condition.or_-641"><span class="linenos">641</span></a><span class="sd"> Or: the new condition.</span> -</span><span id="Condition.or_-642"><a href="#Condition.or_-642"><span class="linenos">642</span></a><span class="sd"> """</span> -</span><span id="Condition.or_-643"><a href="#Condition.or_-643"><span class="linenos">643</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.or_-640"><a href="#Condition.or_-640"><span class="linenos">640</span></a> <span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Condition.or_-641"><a href="#Condition.or_-641"><span class="linenos">641</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.or_-642"><a href="#Condition.or_-642"><span class="linenos">642</span></a><span class="sd"> OR this condition with one or multiple expressions.</span> +</span><span id="Condition.or_-643"><a href="#Condition.or_-643"><span class="linenos">643</span></a> +</span><span id="Condition.or_-644"><a href="#Condition.or_-644"><span class="linenos">644</span></a><span class="sd"> Example:</span> +</span><span id="Condition.or_-645"><a href="#Condition.or_-645"><span class="linenos">645</span></a><span class="sd"> >>> condition("x=1").or_("y=1").sql()</span> +</span><span id="Condition.or_-646"><a href="#Condition.or_-646"><span class="linenos">646</span></a><span class="sd"> 'x = 1 OR y = 1'</span> +</span><span id="Condition.or_-647"><a href="#Condition.or_-647"><span class="linenos">647</span></a> +</span><span id="Condition.or_-648"><a href="#Condition.or_-648"><span class="linenos">648</span></a><span class="sd"> Args:</span> +</span><span id="Condition.or_-649"><a href="#Condition.or_-649"><span class="linenos">649</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Condition.or_-650"><a href="#Condition.or_-650"><span class="linenos">650</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Condition.or_-651"><a href="#Condition.or_-651"><span class="linenos">651</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Condition.or_-652"><a href="#Condition.or_-652"><span class="linenos">652</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Condition.or_-653"><a href="#Condition.or_-653"><span class="linenos">653</span></a> +</span><span id="Condition.or_-654"><a href="#Condition.or_-654"><span class="linenos">654</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.or_-655"><a href="#Condition.or_-655"><span class="linenos">655</span></a><span class="sd"> Or: the new condition.</span> +</span><span id="Condition.or_-656"><a href="#Condition.or_-656"><span class="linenos">656</span></a><span class="sd"> """</span> +</span><span id="Condition.or_-657"><a href="#Condition.or_-657"><span class="linenos">657</span></a> <span class="k">return</span> <span class="n">or_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -9451,18 +9599,18 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Condition.not_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.not_-645"><a href="#Condition.not_-645"><span class="linenos">645</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Condition.not_-646"><a href="#Condition.not_-646"><span class="linenos">646</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Condition.not_-647"><a href="#Condition.not_-647"><span class="linenos">647</span></a><span class="sd"> Wrap this condition with NOT.</span> -</span><span id="Condition.not_-648"><a href="#Condition.not_-648"><span class="linenos">648</span></a> -</span><span id="Condition.not_-649"><a href="#Condition.not_-649"><span class="linenos">649</span></a><span class="sd"> Example:</span> -</span><span id="Condition.not_-650"><a href="#Condition.not_-650"><span class="linenos">650</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> -</span><span id="Condition.not_-651"><a href="#Condition.not_-651"><span class="linenos">651</span></a><span class="sd"> 'NOT x = 1'</span> -</span><span id="Condition.not_-652"><a href="#Condition.not_-652"><span class="linenos">652</span></a> -</span><span id="Condition.not_-653"><a href="#Condition.not_-653"><span class="linenos">653</span></a><span class="sd"> Returns:</span> -</span><span id="Condition.not_-654"><a href="#Condition.not_-654"><span class="linenos">654</span></a><span class="sd"> Not: the new condition.</span> -</span><span id="Condition.not_-655"><a href="#Condition.not_-655"><span class="linenos">655</span></a><span class="sd"> """</span> -</span><span id="Condition.not_-656"><a href="#Condition.not_-656"><span class="linenos">656</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Condition.not_-659"><a href="#Condition.not_-659"><span class="linenos">659</span></a> <span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Condition.not_-660"><a href="#Condition.not_-660"><span class="linenos">660</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Condition.not_-661"><a href="#Condition.not_-661"><span class="linenos">661</span></a><span class="sd"> Wrap this condition with NOT.</span> +</span><span id="Condition.not_-662"><a href="#Condition.not_-662"><span class="linenos">662</span></a> +</span><span id="Condition.not_-663"><a href="#Condition.not_-663"><span class="linenos">663</span></a><span class="sd"> Example:</span> +</span><span id="Condition.not_-664"><a href="#Condition.not_-664"><span class="linenos">664</span></a><span class="sd"> >>> condition("x=1").not_().sql()</span> +</span><span id="Condition.not_-665"><a href="#Condition.not_-665"><span class="linenos">665</span></a><span class="sd"> 'NOT x = 1'</span> +</span><span id="Condition.not_-666"><a href="#Condition.not_-666"><span class="linenos">666</span></a> +</span><span id="Condition.not_-667"><a href="#Condition.not_-667"><span class="linenos">667</span></a><span class="sd"> Returns:</span> +</span><span id="Condition.not_-668"><a href="#Condition.not_-668"><span class="linenos">668</span></a><span class="sd"> Not: the new condition.</span> +</span><span id="Condition.not_-669"><a href="#Condition.not_-669"><span class="linenos">669</span></a><span class="sd"> """</span> +</span><span id="Condition.not_-670"><a href="#Condition.not_-670"><span class="linenos">670</span></a> <span class="k">return</span> <span class="n">not_</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> </span></pre></div> @@ -9541,8 +9689,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Predicate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Predicate-659"><a href="#Predicate-659"><span class="linenos">659</span></a><span class="k">class</span> <span class="nc">Predicate</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Predicate-660"><a href="#Predicate-660"><span class="linenos">660</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Predicate-673"><a href="#Predicate-673"><span class="linenos">673</span></a><span class="k">class</span> <span class="nc">Predicate</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Predicate-674"><a href="#Predicate-674"><span class="linenos">674</span></a><span class="w"> </span><span class="sd">"""Relationships like x = y, x > 1, x >= y."""</span> </span></pre></div> @@ -9610,26 +9758,26 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DerivedTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DerivedTable-663"><a href="#DerivedTable-663"><span class="linenos">663</span></a><span class="k">class</span> <span class="nc">DerivedTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="DerivedTable-664"><a href="#DerivedTable-664"><span class="linenos">664</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-665"><a href="#DerivedTable-665"><span class="linenos">665</span></a> <span class="k">def</span> <span class="nf">alias_column_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="DerivedTable-666"><a href="#DerivedTable-666"><span class="linenos">666</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> -</span><span id="DerivedTable-667"><a href="#DerivedTable-667"><span class="linenos">667</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table_alias</span><span class="p">:</span> -</span><span id="DerivedTable-668"><a href="#DerivedTable-668"><span class="linenos">668</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="DerivedTable-669"><a href="#DerivedTable-669"><span class="linenos">669</span></a> <span class="n">column_list</span> <span class="o">=</span> <span class="n">table_alias</span><span class="o">.</span><span class="n">assert_is</span><span class="p">(</span><span class="n">TableAlias</span><span class="p">)</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> -</span><span id="DerivedTable-670"><a href="#DerivedTable-670"><span class="linenos">670</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">c</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">column_list</span><span class="p">]</span> -</span><span id="DerivedTable-671"><a href="#DerivedTable-671"><span class="linenos">671</span></a> -</span><span id="DerivedTable-672"><a href="#DerivedTable-672"><span class="linenos">672</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-673"><a href="#DerivedTable-673"><span class="linenos">673</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="DerivedTable-674"><a href="#DerivedTable-674"><span class="linenos">674</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> -</span><span id="DerivedTable-675"><a href="#DerivedTable-675"><span class="linenos">675</span></a> -</span><span id="DerivedTable-676"><a href="#DerivedTable-676"><span class="linenos">676</span></a> <span class="k">if</span> <span class="n">alias</span><span class="p">:</span> -</span><span id="DerivedTable-677"><a href="#DerivedTable-677"><span class="linenos">677</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> -</span><span id="DerivedTable-678"><a href="#DerivedTable-678"><span class="linenos">678</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="DerivedTable-679"><a href="#DerivedTable-679"><span class="linenos">679</span></a> -</span><span id="DerivedTable-680"><a href="#DerivedTable-680"><span class="linenos">680</span></a> <span class="nd">@property</span> -</span><span id="DerivedTable-681"><a href="#DerivedTable-681"><span class="linenos">681</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="DerivedTable-682"><a href="#DerivedTable-682"><span class="linenos">682</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">select</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">selects</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DerivedTable-677"><a href="#DerivedTable-677"><span class="linenos">677</span></a><span class="k">class</span> <span class="nc">DerivedTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="DerivedTable-678"><a href="#DerivedTable-678"><span class="linenos">678</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-679"><a href="#DerivedTable-679"><span class="linenos">679</span></a> <span class="k">def</span> <span class="nf">alias_column_names</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="DerivedTable-680"><a href="#DerivedTable-680"><span class="linenos">680</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="DerivedTable-681"><a href="#DerivedTable-681"><span class="linenos">681</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table_alias</span><span class="p">:</span> +</span><span id="DerivedTable-682"><a href="#DerivedTable-682"><span class="linenos">682</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="DerivedTable-683"><a href="#DerivedTable-683"><span class="linenos">683</span></a> <span class="n">column_list</span> <span class="o">=</span> <span class="n">table_alias</span><span class="o">.</span><span class="n">assert_is</span><span class="p">(</span><span class="n">TableAlias</span><span class="p">)</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> +</span><span id="DerivedTable-684"><a href="#DerivedTable-684"><span class="linenos">684</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">c</span><span class="o">.</span><span class="n">name</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">column_list</span><span class="p">]</span> +</span><span id="DerivedTable-685"><a href="#DerivedTable-685"><span class="linenos">685</span></a> +</span><span id="DerivedTable-686"><a href="#DerivedTable-686"><span class="linenos">686</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-687"><a href="#DerivedTable-687"><span class="linenos">687</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="DerivedTable-688"><a href="#DerivedTable-688"><span class="linenos">688</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">)</span> +</span><span id="DerivedTable-689"><a href="#DerivedTable-689"><span class="linenos">689</span></a> +</span><span id="DerivedTable-690"><a href="#DerivedTable-690"><span class="linenos">690</span></a> <span class="k">if</span> <span class="n">alias</span><span class="p">:</span> +</span><span id="DerivedTable-691"><a href="#DerivedTable-691"><span class="linenos">691</span></a> <span class="k">return</span> <span class="n">alias</span><span class="o">.</span><span class="n">columns</span> +</span><span id="DerivedTable-692"><a href="#DerivedTable-692"><span class="linenos">692</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="DerivedTable-693"><a href="#DerivedTable-693"><span class="linenos">693</span></a> +</span><span id="DerivedTable-694"><a href="#DerivedTable-694"><span class="linenos">694</span></a> <span class="nd">@property</span> +</span><span id="DerivedTable-695"><a href="#DerivedTable-695"><span class="linenos">695</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="DerivedTable-696"><a href="#DerivedTable-696"><span class="linenos">696</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">select</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">select</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">selects</span><span class="p">]</span> </span></pre></div> @@ -9689,66 +9837,66 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unionable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable-685"><a href="#Unionable-685"><span class="linenos">685</span></a><span class="k">class</span> <span class="nc">Unionable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Unionable-686"><a href="#Unionable-686"><span class="linenos">686</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable-687"><a href="#Unionable-687"><span class="linenos">687</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-688"><a href="#Unionable-688"><span class="linenos">688</span></a><span class="sd"> Builds a UNION expression.</span> -</span><span id="Unionable-689"><a href="#Unionable-689"><span class="linenos">689</span></a> -</span><span id="Unionable-690"><a href="#Unionable-690"><span class="linenos">690</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-691"><a href="#Unionable-691"><span class="linenos">691</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-692"><a href="#Unionable-692"><span class="linenos">692</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-693"><a href="#Unionable-693"><span class="linenos">693</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="Unionable-694"><a href="#Unionable-694"><span class="linenos">694</span></a> -</span><span id="Unionable-695"><a href="#Unionable-695"><span class="linenos">695</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-696"><a href="#Unionable-696"><span class="linenos">696</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable-697"><a href="#Unionable-697"><span class="linenos">697</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-698"><a href="#Unionable-698"><span class="linenos">698</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-699"><a href="#Unionable-699"><span class="linenos">699</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable-700"><a href="#Unionable-700"><span class="linenos">700</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable-701"><a href="#Unionable-701"><span class="linenos">701</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-702"><a href="#Unionable-702"><span class="linenos">702</span></a><span class="sd"> Union: the Union expression.</span> -</span><span id="Unionable-703"><a href="#Unionable-703"><span class="linenos">703</span></a><span class="sd"> """</span> -</span><span id="Unionable-704"><a href="#Unionable-704"><span class="linenos">704</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Unionable-705"><a href="#Unionable-705"><span class="linenos">705</span></a> -</span><span id="Unionable-706"><a href="#Unionable-706"><span class="linenos">706</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable-707"><a href="#Unionable-707"><span class="linenos">707</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-708"><a href="#Unionable-708"><span class="linenos">708</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="Unionable-709"><a href="#Unionable-709"><span class="linenos">709</span></a> -</span><span id="Unionable-710"><a href="#Unionable-710"><span class="linenos">710</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-711"><a href="#Unionable-711"><span class="linenos">711</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-712"><a href="#Unionable-712"><span class="linenos">712</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-713"><a href="#Unionable-713"><span class="linenos">713</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="Unionable-714"><a href="#Unionable-714"><span class="linenos">714</span></a> -</span><span id="Unionable-715"><a href="#Unionable-715"><span class="linenos">715</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-716"><a href="#Unionable-716"><span class="linenos">716</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable-717"><a href="#Unionable-717"><span class="linenos">717</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-718"><a href="#Unionable-718"><span class="linenos">718</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-719"><a href="#Unionable-719"><span class="linenos">719</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable-720"><a href="#Unionable-720"><span class="linenos">720</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable-721"><a href="#Unionable-721"><span class="linenos">721</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-722"><a href="#Unionable-722"><span class="linenos">722</span></a><span class="sd"> Intersect: the Intersect expression</span> -</span><span id="Unionable-723"><a href="#Unionable-723"><span class="linenos">723</span></a><span class="sd"> """</span> -</span><span id="Unionable-724"><a href="#Unionable-724"><span class="linenos">724</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Unionable-725"><a href="#Unionable-725"><span class="linenos">725</span></a> -</span><span id="Unionable-726"><a href="#Unionable-726"><span class="linenos">726</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable-727"><a href="#Unionable-727"><span class="linenos">727</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable-728"><a href="#Unionable-728"><span class="linenos">728</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</span><span id="Unionable-729"><a href="#Unionable-729"><span class="linenos">729</span></a> -</span><span id="Unionable-730"><a href="#Unionable-730"><span class="linenos">730</span></a><span class="sd"> Example:</span> -</span><span id="Unionable-731"><a href="#Unionable-731"><span class="linenos">731</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable-732"><a href="#Unionable-732"><span class="linenos">732</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="Unionable-733"><a href="#Unionable-733"><span class="linenos">733</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="Unionable-734"><a href="#Unionable-734"><span class="linenos">734</span></a> -</span><span id="Unionable-735"><a href="#Unionable-735"><span class="linenos">735</span></a><span class="sd"> Args:</span> -</span><span id="Unionable-736"><a href="#Unionable-736"><span class="linenos">736</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable-737"><a href="#Unionable-737"><span class="linenos">737</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable-738"><a href="#Unionable-738"><span class="linenos">738</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable-739"><a href="#Unionable-739"><span class="linenos">739</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable-740"><a href="#Unionable-740"><span class="linenos">740</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable-741"><a href="#Unionable-741"><span class="linenos">741</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable-742"><a href="#Unionable-742"><span class="linenos">742</span></a><span class="sd"> Except: the Except expression</span> -</span><span id="Unionable-743"><a href="#Unionable-743"><span class="linenos">743</span></a><span class="sd"> """</span> -</span><span id="Unionable-744"><a href="#Unionable-744"><span class="linenos">744</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable-699"><a href="#Unionable-699"><span class="linenos">699</span></a><span class="k">class</span> <span class="nc">Unionable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Unionable-700"><a href="#Unionable-700"><span class="linenos">700</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable-701"><a href="#Unionable-701"><span class="linenos">701</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-702"><a href="#Unionable-702"><span class="linenos">702</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="Unionable-703"><a href="#Unionable-703"><span class="linenos">703</span></a> +</span><span id="Unionable-704"><a href="#Unionable-704"><span class="linenos">704</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-705"><a href="#Unionable-705"><span class="linenos">705</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-706"><a href="#Unionable-706"><span class="linenos">706</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-707"><a href="#Unionable-707"><span class="linenos">707</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="Unionable-708"><a href="#Unionable-708"><span class="linenos">708</span></a> +</span><span id="Unionable-709"><a href="#Unionable-709"><span class="linenos">709</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-710"><a href="#Unionable-710"><span class="linenos">710</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable-711"><a href="#Unionable-711"><span class="linenos">711</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-712"><a href="#Unionable-712"><span class="linenos">712</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-713"><a href="#Unionable-713"><span class="linenos">713</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable-714"><a href="#Unionable-714"><span class="linenos">714</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable-715"><a href="#Unionable-715"><span class="linenos">715</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-716"><a href="#Unionable-716"><span class="linenos">716</span></a><span class="sd"> Union: the Union expression.</span> +</span><span id="Unionable-717"><a href="#Unionable-717"><span class="linenos">717</span></a><span class="sd"> """</span> +</span><span id="Unionable-718"><a href="#Unionable-718"><span class="linenos">718</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Unionable-719"><a href="#Unionable-719"><span class="linenos">719</span></a> +</span><span id="Unionable-720"><a href="#Unionable-720"><span class="linenos">720</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable-721"><a href="#Unionable-721"><span class="linenos">721</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-722"><a href="#Unionable-722"><span class="linenos">722</span></a><span class="sd"> Builds an INTERSECT expression.</span> +</span><span id="Unionable-723"><a href="#Unionable-723"><span class="linenos">723</span></a> +</span><span id="Unionable-724"><a href="#Unionable-724"><span class="linenos">724</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-725"><a href="#Unionable-725"><span class="linenos">725</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-726"><a href="#Unionable-726"><span class="linenos">726</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-727"><a href="#Unionable-727"><span class="linenos">727</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="Unionable-728"><a href="#Unionable-728"><span class="linenos">728</span></a> +</span><span id="Unionable-729"><a href="#Unionable-729"><span class="linenos">729</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-730"><a href="#Unionable-730"><span class="linenos">730</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable-731"><a href="#Unionable-731"><span class="linenos">731</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-732"><a href="#Unionable-732"><span class="linenos">732</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-733"><a href="#Unionable-733"><span class="linenos">733</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable-734"><a href="#Unionable-734"><span class="linenos">734</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable-735"><a href="#Unionable-735"><span class="linenos">735</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-736"><a href="#Unionable-736"><span class="linenos">736</span></a><span class="sd"> Intersect: the Intersect expression</span> +</span><span id="Unionable-737"><a href="#Unionable-737"><span class="linenos">737</span></a><span class="sd"> """</span> +</span><span id="Unionable-738"><a href="#Unionable-738"><span class="linenos">738</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Unionable-739"><a href="#Unionable-739"><span class="linenos">739</span></a> +</span><span id="Unionable-740"><a href="#Unionable-740"><span class="linenos">740</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable-741"><a href="#Unionable-741"><span class="linenos">741</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable-742"><a href="#Unionable-742"><span class="linenos">742</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="Unionable-743"><a href="#Unionable-743"><span class="linenos">743</span></a> +</span><span id="Unionable-744"><a href="#Unionable-744"><span class="linenos">744</span></a><span class="sd"> Example:</span> +</span><span id="Unionable-745"><a href="#Unionable-745"><span class="linenos">745</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable-746"><a href="#Unionable-746"><span class="linenos">746</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="Unionable-747"><a href="#Unionable-747"><span class="linenos">747</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="Unionable-748"><a href="#Unionable-748"><span class="linenos">748</span></a> +</span><span id="Unionable-749"><a href="#Unionable-749"><span class="linenos">749</span></a><span class="sd"> Args:</span> +</span><span id="Unionable-750"><a href="#Unionable-750"><span class="linenos">750</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable-751"><a href="#Unionable-751"><span class="linenos">751</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable-752"><a href="#Unionable-752"><span class="linenos">752</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable-753"><a href="#Unionable-753"><span class="linenos">753</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable-754"><a href="#Unionable-754"><span class="linenos">754</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable-755"><a href="#Unionable-755"><span class="linenos">755</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable-756"><a href="#Unionable-756"><span class="linenos">756</span></a><span class="sd"> Except: the Except expression</span> +</span><span id="Unionable-757"><a href="#Unionable-757"><span class="linenos">757</span></a><span class="sd"> """</span> +</span><span id="Unionable-758"><a href="#Unionable-758"><span class="linenos">758</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -9765,25 +9913,25 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unionable.union"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.union-686"><a href="#Unionable.union-686"><span class="linenos">686</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable.union-687"><a href="#Unionable.union-687"><span class="linenos">687</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.union-688"><a href="#Unionable.union-688"><span class="linenos">688</span></a><span class="sd"> Builds a UNION expression.</span> -</span><span id="Unionable.union-689"><a href="#Unionable.union-689"><span class="linenos">689</span></a> -</span><span id="Unionable.union-690"><a href="#Unionable.union-690"><span class="linenos">690</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.union-691"><a href="#Unionable.union-691"><span class="linenos">691</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.union-692"><a href="#Unionable.union-692"><span class="linenos">692</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.union-693"><a href="#Unionable.union-693"><span class="linenos">693</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="Unionable.union-694"><a href="#Unionable.union-694"><span class="linenos">694</span></a> -</span><span id="Unionable.union-695"><a href="#Unionable.union-695"><span class="linenos">695</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.union-696"><a href="#Unionable.union-696"><span class="linenos">696</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable.union-697"><a href="#Unionable.union-697"><span class="linenos">697</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.union-698"><a href="#Unionable.union-698"><span class="linenos">698</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.union-699"><a href="#Unionable.union-699"><span class="linenos">699</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable.union-700"><a href="#Unionable.union-700"><span class="linenos">700</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable.union-701"><a href="#Unionable.union-701"><span class="linenos">701</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.union-702"><a href="#Unionable.union-702"><span class="linenos">702</span></a><span class="sd"> Union: the Union expression.</span> -</span><span id="Unionable.union-703"><a href="#Unionable.union-703"><span class="linenos">703</span></a><span class="sd"> """</span> -</span><span id="Unionable.union-704"><a href="#Unionable.union-704"><span class="linenos">704</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.union-700"><a href="#Unionable.union-700"><span class="linenos">700</span></a> <span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable.union-701"><a href="#Unionable.union-701"><span class="linenos">701</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.union-702"><a href="#Unionable.union-702"><span class="linenos">702</span></a><span class="sd"> Builds a UNION expression.</span> +</span><span id="Unionable.union-703"><a href="#Unionable.union-703"><span class="linenos">703</span></a> +</span><span id="Unionable.union-704"><a href="#Unionable.union-704"><span class="linenos">704</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.union-705"><a href="#Unionable.union-705"><span class="linenos">705</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.union-706"><a href="#Unionable.union-706"><span class="linenos">706</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.union-707"><a href="#Unionable.union-707"><span class="linenos">707</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="Unionable.union-708"><a href="#Unionable.union-708"><span class="linenos">708</span></a> +</span><span id="Unionable.union-709"><a href="#Unionable.union-709"><span class="linenos">709</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.union-710"><a href="#Unionable.union-710"><span class="linenos">710</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable.union-711"><a href="#Unionable.union-711"><span class="linenos">711</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.union-712"><a href="#Unionable.union-712"><span class="linenos">712</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.union-713"><a href="#Unionable.union-713"><span class="linenos">713</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable.union-714"><a href="#Unionable.union-714"><span class="linenos">714</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable.union-715"><a href="#Unionable.union-715"><span class="linenos">715</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.union-716"><a href="#Unionable.union-716"><span class="linenos">716</span></a><span class="sd"> Union: the Union expression.</span> +</span><span id="Unionable.union-717"><a href="#Unionable.union-717"><span class="linenos">717</span></a><span class="sd"> """</span> +</span><span id="Unionable.union-718"><a href="#Unionable.union-718"><span class="linenos">718</span></a> <span class="k">return</span> <span class="n">union</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -9830,25 +9978,25 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unionable.intersect"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.intersect-706"><a href="#Unionable.intersect-706"><span class="linenos">706</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable.intersect-707"><a href="#Unionable.intersect-707"><span class="linenos">707</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.intersect-708"><a href="#Unionable.intersect-708"><span class="linenos">708</span></a><span class="sd"> Builds an INTERSECT expression.</span> -</span><span id="Unionable.intersect-709"><a href="#Unionable.intersect-709"><span class="linenos">709</span></a> -</span><span id="Unionable.intersect-710"><a href="#Unionable.intersect-710"><span class="linenos">710</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.intersect-711"><a href="#Unionable.intersect-711"><span class="linenos">711</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.intersect-712"><a href="#Unionable.intersect-712"><span class="linenos">712</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.intersect-713"><a href="#Unionable.intersect-713"><span class="linenos">713</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="Unionable.intersect-714"><a href="#Unionable.intersect-714"><span class="linenos">714</span></a> -</span><span id="Unionable.intersect-715"><a href="#Unionable.intersect-715"><span class="linenos">715</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.intersect-716"><a href="#Unionable.intersect-716"><span class="linenos">716</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable.intersect-717"><a href="#Unionable.intersect-717"><span class="linenos">717</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.intersect-718"><a href="#Unionable.intersect-718"><span class="linenos">718</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.intersect-719"><a href="#Unionable.intersect-719"><span class="linenos">719</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable.intersect-720"><a href="#Unionable.intersect-720"><span class="linenos">720</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable.intersect-721"><a href="#Unionable.intersect-721"><span class="linenos">721</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.intersect-722"><a href="#Unionable.intersect-722"><span class="linenos">722</span></a><span class="sd"> Intersect: the Intersect expression</span> -</span><span id="Unionable.intersect-723"><a href="#Unionable.intersect-723"><span class="linenos">723</span></a><span class="sd"> """</span> -</span><span id="Unionable.intersect-724"><a href="#Unionable.intersect-724"><span class="linenos">724</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.intersect-720"><a href="#Unionable.intersect-720"><span class="linenos">720</span></a> <span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable.intersect-721"><a href="#Unionable.intersect-721"><span class="linenos">721</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.intersect-722"><a href="#Unionable.intersect-722"><span class="linenos">722</span></a><span class="sd"> Builds an INTERSECT expression.</span> +</span><span id="Unionable.intersect-723"><a href="#Unionable.intersect-723"><span class="linenos">723</span></a> +</span><span id="Unionable.intersect-724"><a href="#Unionable.intersect-724"><span class="linenos">724</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.intersect-725"><a href="#Unionable.intersect-725"><span class="linenos">725</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.intersect-726"><a href="#Unionable.intersect-726"><span class="linenos">726</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.intersect-727"><a href="#Unionable.intersect-727"><span class="linenos">727</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="Unionable.intersect-728"><a href="#Unionable.intersect-728"><span class="linenos">728</span></a> +</span><span id="Unionable.intersect-729"><a href="#Unionable.intersect-729"><span class="linenos">729</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.intersect-730"><a href="#Unionable.intersect-730"><span class="linenos">730</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable.intersect-731"><a href="#Unionable.intersect-731"><span class="linenos">731</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.intersect-732"><a href="#Unionable.intersect-732"><span class="linenos">732</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.intersect-733"><a href="#Unionable.intersect-733"><span class="linenos">733</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable.intersect-734"><a href="#Unionable.intersect-734"><span class="linenos">734</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable.intersect-735"><a href="#Unionable.intersect-735"><span class="linenos">735</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.intersect-736"><a href="#Unionable.intersect-736"><span class="linenos">736</span></a><span class="sd"> Intersect: the Intersect expression</span> +</span><span id="Unionable.intersect-737"><a href="#Unionable.intersect-737"><span class="linenos">737</span></a><span class="sd"> """</span> +</span><span id="Unionable.intersect-738"><a href="#Unionable.intersect-738"><span class="linenos">738</span></a> <span class="k">return</span> <span class="n">intersect</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -9895,25 +10043,25 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unionable.except_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.except_-726"><a href="#Unionable.except_-726"><span class="linenos">726</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Unionable.except_-727"><a href="#Unionable.except_-727"><span class="linenos">727</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Unionable.except_-728"><a href="#Unionable.except_-728"><span class="linenos">728</span></a><span class="sd"> Builds an EXCEPT expression.</span> -</span><span id="Unionable.except_-729"><a href="#Unionable.except_-729"><span class="linenos">729</span></a> -</span><span id="Unionable.except_-730"><a href="#Unionable.except_-730"><span class="linenos">730</span></a><span class="sd"> Example:</span> -</span><span id="Unionable.except_-731"><a href="#Unionable.except_-731"><span class="linenos">731</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Unionable.except_-732"><a href="#Unionable.except_-732"><span class="linenos">732</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> -</span><span id="Unionable.except_-733"><a href="#Unionable.except_-733"><span class="linenos">733</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="Unionable.except_-734"><a href="#Unionable.except_-734"><span class="linenos">734</span></a> -</span><span id="Unionable.except_-735"><a href="#Unionable.except_-735"><span class="linenos">735</span></a><span class="sd"> Args:</span> -</span><span id="Unionable.except_-736"><a href="#Unionable.except_-736"><span class="linenos">736</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> -</span><span id="Unionable.except_-737"><a href="#Unionable.except_-737"><span class="linenos">737</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Unionable.except_-738"><a href="#Unionable.except_-738"><span class="linenos">738</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="Unionable.except_-739"><a href="#Unionable.except_-739"><span class="linenos">739</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Unionable.except_-740"><a href="#Unionable.except_-740"><span class="linenos">740</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Unionable.except_-741"><a href="#Unionable.except_-741"><span class="linenos">741</span></a><span class="sd"> Returns:</span> -</span><span id="Unionable.except_-742"><a href="#Unionable.except_-742"><span class="linenos">742</span></a><span class="sd"> Except: the Except expression</span> -</span><span id="Unionable.except_-743"><a href="#Unionable.except_-743"><span class="linenos">743</span></a><span class="sd"> """</span> -</span><span id="Unionable.except_-744"><a href="#Unionable.except_-744"><span class="linenos">744</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unionable.except_-740"><a href="#Unionable.except_-740"><span class="linenos">740</span></a> <span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Unionable.except_-741"><a href="#Unionable.except_-741"><span class="linenos">741</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Unionable.except_-742"><a href="#Unionable.except_-742"><span class="linenos">742</span></a><span class="sd"> Builds an EXCEPT expression.</span> +</span><span id="Unionable.except_-743"><a href="#Unionable.except_-743"><span class="linenos">743</span></a> +</span><span id="Unionable.except_-744"><a href="#Unionable.except_-744"><span class="linenos">744</span></a><span class="sd"> Example:</span> +</span><span id="Unionable.except_-745"><a href="#Unionable.except_-745"><span class="linenos">745</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Unionable.except_-746"><a href="#Unionable.except_-746"><span class="linenos">746</span></a><span class="sd"> >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()</span> +</span><span id="Unionable.except_-747"><a href="#Unionable.except_-747"><span class="linenos">747</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="Unionable.except_-748"><a href="#Unionable.except_-748"><span class="linenos">748</span></a> +</span><span id="Unionable.except_-749"><a href="#Unionable.except_-749"><span class="linenos">749</span></a><span class="sd"> Args:</span> +</span><span id="Unionable.except_-750"><a href="#Unionable.except_-750"><span class="linenos">750</span></a><span class="sd"> expression (str | Expression): the SQL code string.</span> +</span><span id="Unionable.except_-751"><a href="#Unionable.except_-751"><span class="linenos">751</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Unionable.except_-752"><a href="#Unionable.except_-752"><span class="linenos">752</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="Unionable.except_-753"><a href="#Unionable.except_-753"><span class="linenos">753</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Unionable.except_-754"><a href="#Unionable.except_-754"><span class="linenos">754</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Unionable.except_-755"><a href="#Unionable.except_-755"><span class="linenos">755</span></a><span class="sd"> Returns:</span> +</span><span id="Unionable.except_-756"><a href="#Unionable.except_-756"><span class="linenos">756</span></a><span class="sd"> Except: the Except expression</span> +</span><span id="Unionable.except_-757"><a href="#Unionable.except_-757"><span class="linenos">757</span></a><span class="sd"> """</span> +</span><span id="Unionable.except_-758"><a href="#Unionable.except_-758"><span class="linenos">758</span></a> <span class="k">return</span> <span class="n">except_</span><span class="p">(</span><span class="n">left</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">right</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -10003,8 +10151,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#UDTF"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UDTF-747"><a href="#UDTF-747"><span class="linenos">747</span></a><span class="k">class</span> <span class="nc">UDTF</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> -</span><span id="UDTF-748"><a href="#UDTF-748"><span class="linenos">748</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UDTF-761"><a href="#UDTF-761"><span class="linenos">761</span></a><span class="k">class</span> <span class="nc">UDTF</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> +</span><span id="UDTF-762"><a href="#UDTF-762"><span class="linenos">762</span></a> <span class="k">pass</span> </span></pre></div> @@ -10070,14 +10218,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Cache"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Cache-751"><a href="#Cache-751"><span class="linenos">751</span></a><span class="k">class</span> <span class="nc">Cache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Cache-752"><a href="#Cache-752"><span class="linenos">752</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Cache-753"><a href="#Cache-753"><span class="linenos">753</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-754"><a href="#Cache-754"><span class="linenos">754</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Cache-755"><a href="#Cache-755"><span class="linenos">755</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-756"><a href="#Cache-756"><span class="linenos">756</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-757"><a href="#Cache-757"><span class="linenos">757</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Cache-758"><a href="#Cache-758"><span class="linenos">758</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cache-765"><a href="#Cache-765"><span class="linenos">765</span></a><span class="k">class</span> <span class="nc">Cache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Cache-766"><a href="#Cache-766"><span class="linenos">766</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Cache-767"><a href="#Cache-767"><span class="linenos">767</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-768"><a href="#Cache-768"><span class="linenos">768</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Cache-769"><a href="#Cache-769"><span class="linenos">769</span></a> <span class="s2">"lazy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-770"><a href="#Cache-770"><span class="linenos">770</span></a> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-771"><a href="#Cache-771"><span class="linenos">771</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Cache-772"><a href="#Cache-772"><span class="linenos">772</span></a> <span class="p">}</span> </span></pre></div> @@ -10137,8 +10285,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Uncache"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Uncache-761"><a href="#Uncache-761"><span class="linenos">761</span></a><span class="k">class</span> <span class="nc">Uncache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Uncache-762"><a href="#Uncache-762"><span class="linenos">762</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Uncache-775"><a href="#Uncache-775"><span class="linenos">775</span></a><span class="k">class</span> <span class="nc">Uncache</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Uncache-776"><a href="#Uncache-776"><span class="linenos">776</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -10198,31 +10346,20 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Create"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Create-765"><a href="#Create-765"><span class="linenos">765</span></a><span class="k">class</span> <span class="nc">Create</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Create-766"><a href="#Create-766"><span class="linenos">766</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Create-767"><a href="#Create-767"><span class="linenos">767</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-768"><a href="#Create-768"><span class="linenos">768</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Create-769"><a href="#Create-769"><span class="linenos">769</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Create-770"><a href="#Create-770"><span class="linenos">770</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-771"><a href="#Create-771"><span class="linenos">771</span></a> <span class="s2">"set"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-772"><a href="#Create-772"><span class="linenos">772</span></a> <span class="s2">"multiset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-773"><a href="#Create-773"><span class="linenos">773</span></a> <span class="s2">"global_temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-774"><a href="#Create-774"><span class="linenos">774</span></a> <span class="s2">"volatile"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-775"><a href="#Create-775"><span class="linenos">775</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-776"><a href="#Create-776"><span class="linenos">776</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-777"><a href="#Create-777"><span class="linenos">777</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-778"><a href="#Create-778"><span class="linenos">778</span></a> <span class="s2">"transient"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-779"><a href="#Create-779"><span class="linenos">779</span></a> <span class="s2">"external"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-780"><a href="#Create-780"><span class="linenos">780</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-781"><a href="#Create-781"><span class="linenos">781</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-782"><a href="#Create-782"><span class="linenos">782</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-783"><a href="#Create-783"><span class="linenos">783</span></a> <span class="s2">"data"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-784"><a href="#Create-784"><span class="linenos">784</span></a> <span class="s2">"statistics"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-785"><a href="#Create-785"><span class="linenos">785</span></a> <span class="s2">"no_primary_index"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-786"><a href="#Create-786"><span class="linenos">786</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-787"><a href="#Create-787"><span class="linenos">787</span></a> <span class="s2">"no_schema_binding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-788"><a href="#Create-788"><span class="linenos">788</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Create-789"><a href="#Create-789"><span class="linenos">789</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Create-779"><a href="#Create-779"><span class="linenos">779</span></a><span class="k">class</span> <span class="nc">Create</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Create-780"><a href="#Create-780"><span class="linenos">780</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Create-781"><a href="#Create-781"><span class="linenos">781</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-782"><a href="#Create-782"><span class="linenos">782</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Create-783"><a href="#Create-783"><span class="linenos">783</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Create-784"><a href="#Create-784"><span class="linenos">784</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-785"><a href="#Create-785"><span class="linenos">785</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-786"><a href="#Create-786"><span class="linenos">786</span></a> <span class="s2">"properties"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-787"><a href="#Create-787"><span class="linenos">787</span></a> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-788"><a href="#Create-788"><span class="linenos">788</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-789"><a href="#Create-789"><span class="linenos">789</span></a> <span class="s2">"indexes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-790"><a href="#Create-790"><span class="linenos">790</span></a> <span class="s2">"no_schema_binding"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-791"><a href="#Create-791"><span class="linenos">791</span></a> <span class="s2">"begin"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Create-792"><a href="#Create-792"><span class="linenos">792</span></a> <span class="p">}</span> </span></pre></div> @@ -10282,8 +10419,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Describe"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Describe-792"><a href="#Describe-792"><span class="linenos">792</span></a><span class="k">class</span> <span class="nc">Describe</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Describe-793"><a href="#Describe-793"><span class="linenos">793</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Describe-795"><a href="#Describe-795"><span class="linenos">795</span></a><span class="k">class</span> <span class="nc">Describe</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Describe-796"><a href="#Describe-796"><span class="linenos">796</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -10343,8 +10480,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Set"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Set-796"><a href="#Set-796"><span class="linenos">796</span></a><span class="k">class</span> <span class="nc">Set</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Set-797"><a href="#Set-797"><span class="linenos">797</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Set-799"><a href="#Set-799"><span class="linenos">799</span></a><span class="k">class</span> <span class="nc">Set</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Set-800"><a href="#Set-800"><span class="linenos">800</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -10404,14 +10541,14 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#SetItem"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SetItem-800"><a href="#SetItem-800"><span class="linenos">800</span></a><span class="k">class</span> <span class="nc">SetItem</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="SetItem-801"><a href="#SetItem-801"><span class="linenos">801</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="SetItem-802"><a href="#SetItem-802"><span class="linenos">802</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-803"><a href="#SetItem-803"><span class="linenos">803</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-804"><a href="#SetItem-804"><span class="linenos">804</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-805"><a href="#SetItem-805"><span class="linenos">805</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># MySQL SET NAMES statement</span> -</span><span id="SetItem-806"><a href="#SetItem-806"><span class="linenos">806</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SetItem-807"><a href="#SetItem-807"><span class="linenos">807</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetItem-803"><a href="#SetItem-803"><span class="linenos">803</span></a><span class="k">class</span> <span class="nc">SetItem</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="SetItem-804"><a href="#SetItem-804"><span class="linenos">804</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="SetItem-805"><a href="#SetItem-805"><span class="linenos">805</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-806"><a href="#SetItem-806"><span class="linenos">806</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-807"><a href="#SetItem-807"><span class="linenos">807</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-808"><a href="#SetItem-808"><span class="linenos">808</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># MySQL SET NAMES statement</span> +</span><span id="SetItem-809"><a href="#SetItem-809"><span class="linenos">809</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SetItem-810"><a href="#SetItem-810"><span class="linenos">810</span></a> <span class="p">}</span> </span></pre></div> @@ -10471,24 +10608,24 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Show"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Show-810"><a href="#Show-810"><span class="linenos">810</span></a><span class="k">class</span> <span class="nc">Show</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Show-811"><a href="#Show-811"><span class="linenos">811</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Show-812"><a href="#Show-812"><span class="linenos">812</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Show-813"><a href="#Show-813"><span class="linenos">813</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-814"><a href="#Show-814"><span class="linenos">814</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-815"><a href="#Show-815"><span class="linenos">815</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-816"><a href="#Show-816"><span class="linenos">816</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-817"><a href="#Show-817"><span class="linenos">817</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-818"><a href="#Show-818"><span class="linenos">818</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-819"><a href="#Show-819"><span class="linenos">819</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-820"><a href="#Show-820"><span class="linenos">820</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-821"><a href="#Show-821"><span class="linenos">821</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-822"><a href="#Show-822"><span class="linenos">822</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-823"><a href="#Show-823"><span class="linenos">823</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-824"><a href="#Show-824"><span class="linenos">824</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-825"><a href="#Show-825"><span class="linenos">825</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-826"><a href="#Show-826"><span class="linenos">826</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Show-827"><a href="#Show-827"><span class="linenos">827</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Show-813"><a href="#Show-813"><span class="linenos">813</span></a><span class="k">class</span> <span class="nc">Show</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Show-814"><a href="#Show-814"><span class="linenos">814</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Show-815"><a href="#Show-815"><span class="linenos">815</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Show-816"><a href="#Show-816"><span class="linenos">816</span></a> <span class="s2">"target"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-817"><a href="#Show-817"><span class="linenos">817</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-818"><a href="#Show-818"><span class="linenos">818</span></a> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-819"><a href="#Show-819"><span class="linenos">819</span></a> <span class="s2">"like"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-820"><a href="#Show-820"><span class="linenos">820</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-821"><a href="#Show-821"><span class="linenos">821</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-822"><a href="#Show-822"><span class="linenos">822</span></a> <span class="s2">"full"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-823"><a href="#Show-823"><span class="linenos">823</span></a> <span class="s2">"mutex"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-824"><a href="#Show-824"><span class="linenos">824</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-825"><a href="#Show-825"><span class="linenos">825</span></a> <span class="s2">"channel"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-826"><a href="#Show-826"><span class="linenos">826</span></a> <span class="s2">"global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-827"><a href="#Show-827"><span class="linenos">827</span></a> <span class="s2">"log"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-828"><a href="#Show-828"><span class="linenos">828</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-829"><a href="#Show-829"><span class="linenos">829</span></a> <span class="s2">"types"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Show-830"><a href="#Show-830"><span class="linenos">830</span></a> <span class="p">}</span> </span></pre></div> @@ -10548,8 +10685,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#UserDefinedFunction"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UserDefinedFunction-830"><a href="#UserDefinedFunction-830"><span class="linenos">830</span></a><span class="k">class</span> <span class="nc">UserDefinedFunction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="UserDefinedFunction-831"><a href="#UserDefinedFunction-831"><span class="linenos">831</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UserDefinedFunction-833"><a href="#UserDefinedFunction-833"><span class="linenos">833</span></a><span class="k">class</span> <span class="nc">UserDefinedFunction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="UserDefinedFunction-834"><a href="#UserDefinedFunction-834"><span class="linenos">834</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -10609,8 +10746,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CharacterSet"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSet-834"><a href="#CharacterSet-834"><span class="linenos">834</span></a><span class="k">class</span> <span class="nc">CharacterSet</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="CharacterSet-835"><a href="#CharacterSet-835"><span class="linenos">835</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSet-837"><a href="#CharacterSet-837"><span class="linenos">837</span></a><span class="k">class</span> <span class="nc">CharacterSet</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="CharacterSet-838"><a href="#CharacterSet-838"><span class="linenos">838</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -10670,12 +10807,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#With"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="With-838"><a href="#With-838"><span class="linenos">838</span></a><span class="k">class</span> <span class="nc">With</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="With-839"><a href="#With-839"><span class="linenos">839</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"recursive"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="With-840"><a href="#With-840"><span class="linenos">840</span></a> -</span><span id="With-841"><a href="#With-841"><span class="linenos">841</span></a> <span class="nd">@property</span> -</span><span id="With-842"><a href="#With-842"><span class="linenos">842</span></a> <span class="k">def</span> <span class="nf">recursive</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="With-843"><a href="#With-843"><span class="linenos">843</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"recursive"</span><span class="p">))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="With-841"><a href="#With-841"><span class="linenos">841</span></a><span class="k">class</span> <span class="nc">With</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="With-842"><a href="#With-842"><span class="linenos">842</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"recursive"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="With-843"><a href="#With-843"><span class="linenos">843</span></a> +</span><span id="With-844"><a href="#With-844"><span class="linenos">844</span></a> <span class="nd">@property</span> +</span><span id="With-845"><a href="#With-845"><span class="linenos">845</span></a> <span class="k">def</span> <span class="nf">recursive</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="With-846"><a href="#With-846"><span class="linenos">846</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"recursive"</span><span class="p">))</span> </span></pre></div> @@ -10735,8 +10872,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#WithinGroup"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WithinGroup-846"><a href="#WithinGroup-846"><span class="linenos">846</span></a><span class="k">class</span> <span class="nc">WithinGroup</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="WithinGroup-847"><a href="#WithinGroup-847"><span class="linenos">847</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="WithinGroup-849"><a href="#WithinGroup-849"><span class="linenos">849</span></a><span class="k">class</span> <span class="nc">WithinGroup</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="WithinGroup-850"><a href="#WithinGroup-850"><span class="linenos">850</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -10796,8 +10933,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CTE"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CTE-850"><a href="#CTE-850"><span class="linenos">850</span></a><span class="k">class</span> <span class="nc">CTE</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">):</span> -</span><span id="CTE-851"><a href="#CTE-851"><span class="linenos">851</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CTE-853"><a href="#CTE-853"><span class="linenos">853</span></a><span class="k">class</span> <span class="nc">CTE</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">):</span> +</span><span id="CTE-854"><a href="#CTE-854"><span class="linenos">854</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -10857,12 +10994,12 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#TableAlias"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TableAlias-854"><a href="#TableAlias-854"><span class="linenos">854</span></a><span class="k">class</span> <span class="nc">TableAlias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="TableAlias-855"><a href="#TableAlias-855"><span class="linenos">855</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="TableAlias-856"><a href="#TableAlias-856"><span class="linenos">856</span></a> -</span><span id="TableAlias-857"><a href="#TableAlias-857"><span class="linenos">857</span></a> <span class="nd">@property</span> -</span><span id="TableAlias-858"><a href="#TableAlias-858"><span class="linenos">858</span></a> <span class="k">def</span> <span class="nf">columns</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="TableAlias-859"><a href="#TableAlias-859"><span class="linenos">859</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TableAlias-857"><a href="#TableAlias-857"><span class="linenos">857</span></a><span class="k">class</span> <span class="nc">TableAlias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="TableAlias-858"><a href="#TableAlias-858"><span class="linenos">858</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="TableAlias-859"><a href="#TableAlias-859"><span class="linenos">859</span></a> +</span><span id="TableAlias-860"><a href="#TableAlias-860"><span class="linenos">860</span></a> <span class="nd">@property</span> +</span><span id="TableAlias-861"><a href="#TableAlias-861"><span class="linenos">861</span></a> <span class="k">def</span> <span class="nf">columns</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="TableAlias-862"><a href="#TableAlias-862"><span class="linenos">862</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">)</span> <span class="ow">or</span> <span class="p">[]</span> </span></pre></div> @@ -10922,8 +11059,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#BitString"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitString-862"><a href="#BitString-862"><span class="linenos">862</span></a><span class="k">class</span> <span class="nc">BitString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="BitString-863"><a href="#BitString-863"><span class="linenos">863</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitString-865"><a href="#BitString-865"><span class="linenos">865</span></a><span class="k">class</span> <span class="nc">BitString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="BitString-866"><a href="#BitString-866"><span class="linenos">866</span></a> <span class="k">pass</span> </span></pre></div> @@ -10989,8 +11126,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#HexString"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="HexString-866"><a href="#HexString-866"><span class="linenos">866</span></a><span class="k">class</span> <span class="nc">HexString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="HexString-867"><a href="#HexString-867"><span class="linenos">867</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="HexString-869"><a href="#HexString-869"><span class="linenos">869</span></a><span class="k">class</span> <span class="nc">HexString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="HexString-870"><a href="#HexString-870"><span class="linenos">870</span></a> <span class="k">pass</span> </span></pre></div> @@ -11056,8 +11193,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ByteString"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ByteString-870"><a href="#ByteString-870"><span class="linenos">870</span></a><span class="k">class</span> <span class="nc">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="ByteString-871"><a href="#ByteString-871"><span class="linenos">871</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ByteString-873"><a href="#ByteString-873"><span class="linenos">873</span></a><span class="k">class</span> <span class="nc">ByteString</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="ByteString-874"><a href="#ByteString-874"><span class="linenos">874</span></a> <span class="k">pass</span> </span></pre></div> @@ -11123,24 +11260,24 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Column"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Column-874"><a href="#Column-874"><span class="linenos">874</span></a><span class="k">class</span> <span class="nc">Column</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Column-875"><a href="#Column-875"><span class="linenos">875</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Column-876"><a href="#Column-876"><span class="linenos">876</span></a> -</span><span id="Column-877"><a href="#Column-877"><span class="linenos">877</span></a> <span class="nd">@property</span> -</span><span id="Column-878"><a href="#Column-878"><span class="linenos">878</span></a> <span class="k">def</span> <span class="nf">table</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Column-879"><a href="#Column-879"><span class="linenos">879</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"table"</span><span class="p">)</span> -</span><span id="Column-880"><a href="#Column-880"><span class="linenos">880</span></a> -</span><span id="Column-881"><a href="#Column-881"><span class="linenos">881</span></a> <span class="nd">@property</span> -</span><span id="Column-882"><a href="#Column-882"><span class="linenos">882</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Column-883"><a href="#Column-883"><span class="linenos">883</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> -</span><span id="Column-884"><a href="#Column-884"><span class="linenos">884</span></a> -</span><span id="Column-885"><a href="#Column-885"><span class="linenos">885</span></a> <span class="nd">@property</span> -</span><span id="Column-886"><a href="#Column-886"><span class="linenos">886</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Column-887"><a href="#Column-887"><span class="linenos">887</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> -</span><span id="Column-888"><a href="#Column-888"><span class="linenos">888</span></a> -</span><span id="Column-889"><a href="#Column-889"><span class="linenos">889</span></a> <span class="nd">@property</span> -</span><span id="Column-890"><a href="#Column-890"><span class="linenos">890</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Column-891"><a href="#Column-891"><span class="linenos">891</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Column-877"><a href="#Column-877"><span class="linenos">877</span></a><span class="k">class</span> <span class="nc">Column</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Column-878"><a href="#Column-878"><span class="linenos">878</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Column-879"><a href="#Column-879"><span class="linenos">879</span></a> +</span><span id="Column-880"><a href="#Column-880"><span class="linenos">880</span></a> <span class="nd">@property</span> +</span><span id="Column-881"><a href="#Column-881"><span class="linenos">881</span></a> <span class="k">def</span> <span class="nf">table</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Column-882"><a href="#Column-882"><span class="linenos">882</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"table"</span><span class="p">)</span> +</span><span id="Column-883"><a href="#Column-883"><span class="linenos">883</span></a> +</span><span id="Column-884"><a href="#Column-884"><span class="linenos">884</span></a> <span class="nd">@property</span> +</span><span id="Column-885"><a href="#Column-885"><span class="linenos">885</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Column-886"><a href="#Column-886"><span class="linenos">886</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> +</span><span id="Column-887"><a href="#Column-887"><span class="linenos">887</span></a> +</span><span id="Column-888"><a href="#Column-888"><span class="linenos">888</span></a> <span class="nd">@property</span> +</span><span id="Column-889"><a href="#Column-889"><span class="linenos">889</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Column-890"><a href="#Column-890"><span class="linenos">890</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> +</span><span id="Column-891"><a href="#Column-891"><span class="linenos">891</span></a> +</span><span id="Column-892"><a href="#Column-892"><span class="linenos">892</span></a> <span class="nd">@property</span> +</span><span id="Column-893"><a href="#Column-893"><span class="linenos">893</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Column-894"><a href="#Column-894"><span class="linenos">894</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -11235,13 +11372,13 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ColumnDef"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnDef-894"><a href="#ColumnDef-894"><span class="linenos">894</span></a><span class="k">class</span> <span class="nc">ColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="ColumnDef-895"><a href="#ColumnDef-895"><span class="linenos">895</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="ColumnDef-896"><a href="#ColumnDef-896"><span class="linenos">896</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="ColumnDef-897"><a href="#ColumnDef-897"><span class="linenos">897</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-898"><a href="#ColumnDef-898"><span class="linenos">898</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-899"><a href="#ColumnDef-899"><span class="linenos">899</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ColumnDef-900"><a href="#ColumnDef-900"><span class="linenos">900</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnDef-897"><a href="#ColumnDef-897"><span class="linenos">897</span></a><span class="k">class</span> <span class="nc">ColumnDef</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="ColumnDef-898"><a href="#ColumnDef-898"><span class="linenos">898</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="ColumnDef-899"><a href="#ColumnDef-899"><span class="linenos">899</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="ColumnDef-900"><a href="#ColumnDef-900"><span class="linenos">900</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-901"><a href="#ColumnDef-901"><span class="linenos">901</span></a> <span class="s2">"constraints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-902"><a href="#ColumnDef-902"><span class="linenos">902</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ColumnDef-903"><a href="#ColumnDef-903"><span class="linenos">903</span></a> <span class="p">}</span> </span></pre></div> @@ -11301,15 +11438,15 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#AlterColumn"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AlterColumn-903"><a href="#AlterColumn-903"><span class="linenos">903</span></a><span class="k">class</span> <span class="nc">AlterColumn</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="AlterColumn-904"><a href="#AlterColumn-904"><span class="linenos">904</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="AlterColumn-905"><a href="#AlterColumn-905"><span class="linenos">905</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="AlterColumn-906"><a href="#AlterColumn-906"><span class="linenos">906</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-907"><a href="#AlterColumn-907"><span class="linenos">907</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-908"><a href="#AlterColumn-908"><span class="linenos">908</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-909"><a href="#AlterColumn-909"><span class="linenos">909</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-910"><a href="#AlterColumn-910"><span class="linenos">910</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="AlterColumn-911"><a href="#AlterColumn-911"><span class="linenos">911</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AlterColumn-906"><a href="#AlterColumn-906"><span class="linenos">906</span></a><span class="k">class</span> <span class="nc">AlterColumn</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="AlterColumn-907"><a href="#AlterColumn-907"><span class="linenos">907</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="AlterColumn-908"><a href="#AlterColumn-908"><span class="linenos">908</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="AlterColumn-909"><a href="#AlterColumn-909"><span class="linenos">909</span></a> <span class="s2">"dtype"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-910"><a href="#AlterColumn-910"><span class="linenos">910</span></a> <span class="s2">"collate"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-911"><a href="#AlterColumn-911"><span class="linenos">911</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-912"><a href="#AlterColumn-912"><span class="linenos">912</span></a> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-913"><a href="#AlterColumn-913"><span class="linenos">913</span></a> <span class="s2">"drop"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="AlterColumn-914"><a href="#AlterColumn-914"><span class="linenos">914</span></a> <span class="p">}</span> </span></pre></div> @@ -11369,8 +11506,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#RenameTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RenameTable-914"><a href="#RenameTable-914"><span class="linenos">914</span></a><span class="k">class</span> <span class="nc">RenameTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="RenameTable-915"><a href="#RenameTable-915"><span class="linenos">915</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RenameTable-917"><a href="#RenameTable-917"><span class="linenos">917</span></a><span class="k">class</span> <span class="nc">RenameTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="RenameTable-918"><a href="#RenameTable-918"><span class="linenos">918</span></a> <span class="k">pass</span> </span></pre></div> @@ -11430,8 +11567,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraint-918"><a href="#ColumnConstraint-918"><span class="linenos">918</span></a><span class="k">class</span> <span class="nc">ColumnConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="ColumnConstraint-919"><a href="#ColumnConstraint-919"><span class="linenos">919</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraint-921"><a href="#ColumnConstraint-921"><span class="linenos">921</span></a><span class="k">class</span> <span class="nc">ColumnConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="ColumnConstraint-922"><a href="#ColumnConstraint-922"><span class="linenos">922</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -11491,8 +11628,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ColumnConstraintKind"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraintKind-922"><a href="#ColumnConstraintKind-922"><span class="linenos">922</span></a><span class="k">class</span> <span class="nc">ColumnConstraintKind</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="ColumnConstraintKind-923"><a href="#ColumnConstraintKind-923"><span class="linenos">923</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ColumnConstraintKind-925"><a href="#ColumnConstraintKind-925"><span class="linenos">925</span></a><span class="k">class</span> <span class="nc">ColumnConstraintKind</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="ColumnConstraintKind-926"><a href="#ColumnConstraintKind-926"><span class="linenos">926</span></a> <span class="k">pass</span> </span></pre></div> @@ -11552,8 +11689,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#AutoIncrementColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementColumnConstraint-926"><a href="#AutoIncrementColumnConstraint-926"><span class="linenos">926</span></a><span class="k">class</span> <span class="nc">AutoIncrementColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="AutoIncrementColumnConstraint-927"><a href="#AutoIncrementColumnConstraint-927"><span class="linenos">927</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementColumnConstraint-929"><a href="#AutoIncrementColumnConstraint-929"><span class="linenos">929</span></a><span class="k">class</span> <span class="nc">AutoIncrementColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="AutoIncrementColumnConstraint-930"><a href="#AutoIncrementColumnConstraint-930"><span class="linenos">930</span></a> <span class="k">pass</span> </span></pre></div> @@ -11613,8 +11750,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CaseSpecificColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CaseSpecificColumnConstraint-930"><a href="#CaseSpecificColumnConstraint-930"><span class="linenos">930</span></a><span class="k">class</span> <span class="nc">CaseSpecificColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="CaseSpecificColumnConstraint-931"><a href="#CaseSpecificColumnConstraint-931"><span class="linenos">931</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"not_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CaseSpecificColumnConstraint-933"><a href="#CaseSpecificColumnConstraint-933"><span class="linenos">933</span></a><span class="k">class</span> <span class="nc">CaseSpecificColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CaseSpecificColumnConstraint-934"><a href="#CaseSpecificColumnConstraint-934"><span class="linenos">934</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"not_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -11674,8 +11811,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CharacterSetColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetColumnConstraint-934"><a href="#CharacterSetColumnConstraint-934"><span class="linenos">934</span></a><span class="k">class</span> <span class="nc">CharacterSetColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="CharacterSetColumnConstraint-935"><a href="#CharacterSetColumnConstraint-935"><span class="linenos">935</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetColumnConstraint-937"><a href="#CharacterSetColumnConstraint-937"><span class="linenos">937</span></a><span class="k">class</span> <span class="nc">CharacterSetColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CharacterSetColumnConstraint-938"><a href="#CharacterSetColumnConstraint-938"><span class="linenos">938</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -11735,8 +11872,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CheckColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CheckColumnConstraint-938"><a href="#CheckColumnConstraint-938"><span class="linenos">938</span></a><span class="k">class</span> <span class="nc">CheckColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="CheckColumnConstraint-939"><a href="#CheckColumnConstraint-939"><span class="linenos">939</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CheckColumnConstraint-941"><a href="#CheckColumnConstraint-941"><span class="linenos">941</span></a><span class="k">class</span> <span class="nc">CheckColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CheckColumnConstraint-942"><a href="#CheckColumnConstraint-942"><span class="linenos">942</span></a> <span class="k">pass</span> </span></pre></div> @@ -11796,8 +11933,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CollateColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CollateColumnConstraint-942"><a href="#CollateColumnConstraint-942"><span class="linenos">942</span></a><span class="k">class</span> <span class="nc">CollateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="CollateColumnConstraint-943"><a href="#CollateColumnConstraint-943"><span class="linenos">943</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CollateColumnConstraint-945"><a href="#CollateColumnConstraint-945"><span class="linenos">945</span></a><span class="k">class</span> <span class="nc">CollateColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CollateColumnConstraint-946"><a href="#CollateColumnConstraint-946"><span class="linenos">946</span></a> <span class="k">pass</span> </span></pre></div> @@ -11857,8 +11994,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#CommentColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CommentColumnConstraint-946"><a href="#CommentColumnConstraint-946"><span class="linenos">946</span></a><span class="k">class</span> <span class="nc">CommentColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="CommentColumnConstraint-947"><a href="#CommentColumnConstraint-947"><span class="linenos">947</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CommentColumnConstraint-949"><a href="#CommentColumnConstraint-949"><span class="linenos">949</span></a><span class="k">class</span> <span class="nc">CommentColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CommentColumnConstraint-950"><a href="#CommentColumnConstraint-950"><span class="linenos">950</span></a> <span class="k">pass</span> </span></pre></div> @@ -11907,6 +12044,67 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </dl> </div> </section> + <section id="CompressColumnConstraint"> + <input id="CompressColumnConstraint-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">CompressColumnConstraint</span><wbr>(<span class="base"><a href="#ColumnConstraintKind">ColumnConstraintKind</a></span>): + + <label class="view-source-button" for="CompressColumnConstraint-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#CompressColumnConstraint"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="CompressColumnConstraint-953"><a href="#CompressColumnConstraint-953"><span class="linenos">953</span></a><span class="k">class</span> <span class="nc">CompressColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="CompressColumnConstraint-954"><a href="#CompressColumnConstraint-954"><span class="linenos">954</span></a> <span class="k">pass</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="CompressColumnConstraint.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="CompressColumnConstraint.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="CompressColumnConstraint.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="CompressColumnConstraint.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="CompressColumnConstraint.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="CompressColumnConstraint.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="CompressColumnConstraint.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="CompressColumnConstraint.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="CompressColumnConstraint.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="CompressColumnConstraint.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="CompressColumnConstraint.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="CompressColumnConstraint.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="CompressColumnConstraint.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="CompressColumnConstraint.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="CompressColumnConstraint.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="CompressColumnConstraint.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="CompressColumnConstraint.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="CompressColumnConstraint.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="CompressColumnConstraint.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="CompressColumnConstraint.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="CompressColumnConstraint.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="CompressColumnConstraint.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="CompressColumnConstraint.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="CompressColumnConstraint.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="CompressColumnConstraint.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="CompressColumnConstraint.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="CompressColumnConstraint.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="CompressColumnConstraint.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="CompressColumnConstraint.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="CompressColumnConstraint.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="CompressColumnConstraint.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="CompressColumnConstraint.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="CompressColumnConstraint.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="CompressColumnConstraint.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> <section id="DateFormatColumnConstraint"> <input id="DateFormatColumnConstraint-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -11918,8 +12116,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DateFormatColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateFormatColumnConstraint-950"><a href="#DateFormatColumnConstraint-950"><span class="linenos">950</span></a><span class="k">class</span> <span class="nc">DateFormatColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="DateFormatColumnConstraint-951"><a href="#DateFormatColumnConstraint-951"><span class="linenos">951</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateFormatColumnConstraint-957"><a href="#DateFormatColumnConstraint-957"><span class="linenos">957</span></a><span class="k">class</span> <span class="nc">DateFormatColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="DateFormatColumnConstraint-958"><a href="#DateFormatColumnConstraint-958"><span class="linenos">958</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -11979,8 +12177,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#DefaultColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DefaultColumnConstraint-954"><a href="#DefaultColumnConstraint-954"><span class="linenos">954</span></a><span class="k">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="DefaultColumnConstraint-955"><a href="#DefaultColumnConstraint-955"><span class="linenos">955</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DefaultColumnConstraint-961"><a href="#DefaultColumnConstraint-961"><span class="linenos">961</span></a><span class="k">class</span> <span class="nc">DefaultColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="DefaultColumnConstraint-962"><a href="#DefaultColumnConstraint-962"><span class="linenos">962</span></a> <span class="k">pass</span> </span></pre></div> @@ -12040,8 +12238,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#EncodeColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="EncodeColumnConstraint-958"><a href="#EncodeColumnConstraint-958"><span class="linenos">958</span></a><span class="k">class</span> <span class="nc">EncodeColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="EncodeColumnConstraint-959"><a href="#EncodeColumnConstraint-959"><span class="linenos">959</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="EncodeColumnConstraint-965"><a href="#EncodeColumnConstraint-965"><span class="linenos">965</span></a><span class="k">class</span> <span class="nc">EncodeColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="EncodeColumnConstraint-966"><a href="#EncodeColumnConstraint-966"><span class="linenos">966</span></a> <span class="k">pass</span> </span></pre></div> @@ -12101,16 +12299,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#GeneratedAsIdentityColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GeneratedAsIdentityColumnConstraint-962"><a href="#GeneratedAsIdentityColumnConstraint-962"><span class="linenos">962</span></a><span class="k">class</span> <span class="nc">GeneratedAsIdentityColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="GeneratedAsIdentityColumnConstraint-963"><a href="#GeneratedAsIdentityColumnConstraint-963"><span class="linenos">963</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> -</span><span id="GeneratedAsIdentityColumnConstraint-964"><a href="#GeneratedAsIdentityColumnConstraint-964"><span class="linenos">964</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="GeneratedAsIdentityColumnConstraint-965"><a href="#GeneratedAsIdentityColumnConstraint-965"><span class="linenos">965</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-966"><a href="#GeneratedAsIdentityColumnConstraint-966"><span class="linenos">966</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-967"><a href="#GeneratedAsIdentityColumnConstraint-967"><span class="linenos">967</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-968"><a href="#GeneratedAsIdentityColumnConstraint-968"><span class="linenos">968</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-969"><a href="#GeneratedAsIdentityColumnConstraint-969"><span class="linenos">969</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-970"><a href="#GeneratedAsIdentityColumnConstraint-970"><span class="linenos">970</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="GeneratedAsIdentityColumnConstraint-971"><a href="#GeneratedAsIdentityColumnConstraint-971"><span class="linenos">971</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GeneratedAsIdentityColumnConstraint-969"><a href="#GeneratedAsIdentityColumnConstraint-969"><span class="linenos">969</span></a><span class="k">class</span> <span class="nc">GeneratedAsIdentityColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="GeneratedAsIdentityColumnConstraint-970"><a href="#GeneratedAsIdentityColumnConstraint-970"><span class="linenos">970</span></a> <span class="c1"># this: True -> ALWAYS, this: False -> BY DEFAULT</span> +</span><span id="GeneratedAsIdentityColumnConstraint-971"><a href="#GeneratedAsIdentityColumnConstraint-971"><span class="linenos">971</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="GeneratedAsIdentityColumnConstraint-972"><a href="#GeneratedAsIdentityColumnConstraint-972"><span class="linenos">972</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-973"><a href="#GeneratedAsIdentityColumnConstraint-973"><span class="linenos">973</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-974"><a href="#GeneratedAsIdentityColumnConstraint-974"><span class="linenos">974</span></a> <span class="s2">"increment"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-975"><a href="#GeneratedAsIdentityColumnConstraint-975"><span class="linenos">975</span></a> <span class="s2">"minvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-976"><a href="#GeneratedAsIdentityColumnConstraint-976"><span class="linenos">976</span></a> <span class="s2">"maxvalue"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-977"><a href="#GeneratedAsIdentityColumnConstraint-977"><span class="linenos">977</span></a> <span class="s2">"cycle"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="GeneratedAsIdentityColumnConstraint-978"><a href="#GeneratedAsIdentityColumnConstraint-978"><span class="linenos">978</span></a> <span class="p">}</span> </span></pre></div> @@ -12159,6 +12357,67 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </dl> </div> </section> + <section id="InlineLengthColumnConstraint"> + <input id="InlineLengthColumnConstraint-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">InlineLengthColumnConstraint</span><wbr>(<span class="base"><a href="#ColumnConstraintKind">ColumnConstraintKind</a></span>): + + <label class="view-source-button" for="InlineLengthColumnConstraint-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#InlineLengthColumnConstraint"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="InlineLengthColumnConstraint-981"><a href="#InlineLengthColumnConstraint-981"><span class="linenos">981</span></a><span class="k">class</span> <span class="nc">InlineLengthColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="InlineLengthColumnConstraint-982"><a href="#InlineLengthColumnConstraint-982"><span class="linenos">982</span></a> <span class="k">pass</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="InlineLengthColumnConstraint.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="InlineLengthColumnConstraint.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="InlineLengthColumnConstraint.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="InlineLengthColumnConstraint.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="InlineLengthColumnConstraint.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="InlineLengthColumnConstraint.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="InlineLengthColumnConstraint.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="InlineLengthColumnConstraint.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="InlineLengthColumnConstraint.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="InlineLengthColumnConstraint.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="InlineLengthColumnConstraint.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="InlineLengthColumnConstraint.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="InlineLengthColumnConstraint.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="InlineLengthColumnConstraint.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="InlineLengthColumnConstraint.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="InlineLengthColumnConstraint.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="InlineLengthColumnConstraint.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="InlineLengthColumnConstraint.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="InlineLengthColumnConstraint.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="InlineLengthColumnConstraint.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="InlineLengthColumnConstraint.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="InlineLengthColumnConstraint.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="InlineLengthColumnConstraint.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="InlineLengthColumnConstraint.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="InlineLengthColumnConstraint.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="InlineLengthColumnConstraint.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="InlineLengthColumnConstraint.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="InlineLengthColumnConstraint.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="InlineLengthColumnConstraint.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="InlineLengthColumnConstraint.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="InlineLengthColumnConstraint.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="InlineLengthColumnConstraint.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="InlineLengthColumnConstraint.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="InlineLengthColumnConstraint.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> <section id="NotNullColumnConstraint"> <input id="NotNullColumnConstraint-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -12170,8 +12429,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#NotNullColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NotNullColumnConstraint-974"><a href="#NotNullColumnConstraint-974"><span class="linenos">974</span></a><span class="k">class</span> <span class="nc">NotNullColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="NotNullColumnConstraint-975"><a href="#NotNullColumnConstraint-975"><span class="linenos">975</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"allow_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NotNullColumnConstraint-985"><a href="#NotNullColumnConstraint-985"><span class="linenos">985</span></a><span class="k">class</span> <span class="nc">NotNullColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="NotNullColumnConstraint-986"><a href="#NotNullColumnConstraint-986"><span class="linenos">986</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"allow_null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -12231,8 +12490,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#PrimaryKeyColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PrimaryKeyColumnConstraint-978"><a href="#PrimaryKeyColumnConstraint-978"><span class="linenos">978</span></a><span class="k">class</span> <span class="nc">PrimaryKeyColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="PrimaryKeyColumnConstraint-979"><a href="#PrimaryKeyColumnConstraint-979"><span class="linenos">979</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"desc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PrimaryKeyColumnConstraint-989"><a href="#PrimaryKeyColumnConstraint-989"><span class="linenos">989</span></a><span class="k">class</span> <span class="nc">PrimaryKeyColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="PrimaryKeyColumnConstraint-990"><a href="#PrimaryKeyColumnConstraint-990"><span class="linenos">990</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"desc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -12292,8 +12551,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#TitleColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TitleColumnConstraint-982"><a href="#TitleColumnConstraint-982"><span class="linenos">982</span></a><span class="k">class</span> <span class="nc">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="TitleColumnConstraint-983"><a href="#TitleColumnConstraint-983"><span class="linenos">983</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TitleColumnConstraint-993"><a href="#TitleColumnConstraint-993"><span class="linenos">993</span></a><span class="k">class</span> <span class="nc">TitleColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="TitleColumnConstraint-994"><a href="#TitleColumnConstraint-994"><span class="linenos">994</span></a> <span class="k">pass</span> </span></pre></div> @@ -12353,8 +12612,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#UniqueColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UniqueColumnConstraint-986"><a href="#UniqueColumnConstraint-986"><span class="linenos">986</span></a><span class="k">class</span> <span class="nc">UniqueColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="UniqueColumnConstraint-987"><a href="#UniqueColumnConstraint-987"><span class="linenos">987</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UniqueColumnConstraint-997"><a href="#UniqueColumnConstraint-997"><span class="linenos">997</span></a><span class="k">class</span> <span class="nc">UniqueColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="UniqueColumnConstraint-998"><a href="#UniqueColumnConstraint-998"><span class="linenos">998</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -12414,8 +12673,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#UppercaseColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UppercaseColumnConstraint-990"><a href="#UppercaseColumnConstraint-990"><span class="linenos">990</span></a><span class="k">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="UppercaseColumnConstraint-991"><a href="#UppercaseColumnConstraint-991"><span class="linenos">991</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UppercaseColumnConstraint-1001"><a href="#UppercaseColumnConstraint-1001"><span class="linenos">1001</span></a><span class="k">class</span> <span class="nc">UppercaseColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="UppercaseColumnConstraint-1002"><a href="#UppercaseColumnConstraint-1002"><span class="linenos">1002</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -12475,8 +12734,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#PathColumnConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PathColumnConstraint-994"><a href="#PathColumnConstraint-994"><span class="linenos">994</span></a><span class="k">class</span> <span class="nc">PathColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> -</span><span id="PathColumnConstraint-995"><a href="#PathColumnConstraint-995"><span class="linenos">995</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PathColumnConstraint-1005"><a href="#PathColumnConstraint-1005"><span class="linenos">1005</span></a><span class="k">class</span> <span class="nc">PathColumnConstraint</span><span class="p">(</span><span class="n">ColumnConstraintKind</span><span class="p">):</span> +</span><span id="PathColumnConstraint-1006"><a href="#PathColumnConstraint-1006"><span class="linenos">1006</span></a> <span class="k">pass</span> </span></pre></div> @@ -12536,8 +12795,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Constraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Constraint-998"><a href="#Constraint-998"><span class="linenos">998</span></a><span class="k">class</span> <span class="nc">Constraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Constraint-999"><a href="#Constraint-999"><span class="linenos">999</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Constraint-1009"><a href="#Constraint-1009"><span class="linenos">1009</span></a><span class="k">class</span> <span class="nc">Constraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Constraint-1010"><a href="#Constraint-1010"><span class="linenos">1010</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -12597,8 +12856,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Delete"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Delete-1002"><a href="#Delete-1002"><span class="linenos">1002</span></a><span class="k">class</span> <span class="nc">Delete</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Delete-1003"><a href="#Delete-1003"><span class="linenos">1003</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Delete-1013"><a href="#Delete-1013"><span class="linenos">1013</span></a><span class="k">class</span> <span class="nc">Delete</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Delete-1014"><a href="#Delete-1014"><span class="linenos">1014</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -12658,15 +12917,15 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Drop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Drop-1006"><a href="#Drop-1006"><span class="linenos">1006</span></a><span class="k">class</span> <span class="nc">Drop</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Drop-1007"><a href="#Drop-1007"><span class="linenos">1007</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Drop-1008"><a href="#Drop-1008"><span class="linenos">1008</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1009"><a href="#Drop-1009"><span class="linenos">1009</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1010"><a href="#Drop-1010"><span class="linenos">1010</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1011"><a href="#Drop-1011"><span class="linenos">1011</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1012"><a href="#Drop-1012"><span class="linenos">1012</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1013"><a href="#Drop-1013"><span class="linenos">1013</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Drop-1014"><a href="#Drop-1014"><span class="linenos">1014</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Drop-1017"><a href="#Drop-1017"><span class="linenos">1017</span></a><span class="k">class</span> <span class="nc">Drop</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Drop-1018"><a href="#Drop-1018"><span class="linenos">1018</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Drop-1019"><a href="#Drop-1019"><span class="linenos">1019</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1020"><a href="#Drop-1020"><span class="linenos">1020</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1021"><a href="#Drop-1021"><span class="linenos">1021</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1022"><a href="#Drop-1022"><span class="linenos">1022</span></a> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1023"><a href="#Drop-1023"><span class="linenos">1023</span></a> <span class="s2">"materialized"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1024"><a href="#Drop-1024"><span class="linenos">1024</span></a> <span class="s2">"cascade"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Drop-1025"><a href="#Drop-1025"><span class="linenos">1025</span></a> <span class="p">}</span> </span></pre></div> @@ -12726,8 +12985,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Filter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Filter-1017"><a href="#Filter-1017"><span class="linenos">1017</span></a><span class="k">class</span> <span class="nc">Filter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Filter-1018"><a href="#Filter-1018"><span class="linenos">1018</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Filter-1028"><a href="#Filter-1028"><span class="linenos">1028</span></a><span class="k">class</span> <span class="nc">Filter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Filter-1029"><a href="#Filter-1029"><span class="linenos">1029</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -12787,8 +13046,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Check"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Check-1021"><a href="#Check-1021"><span class="linenos">1021</span></a><span class="k">class</span> <span class="nc">Check</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Check-1022"><a href="#Check-1022"><span class="linenos">1022</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Check-1032"><a href="#Check-1032"><span class="linenos">1032</span></a><span class="k">class</span> <span class="nc">Check</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Check-1033"><a href="#Check-1033"><span class="linenos">1033</span></a> <span class="k">pass</span> </span></pre></div> @@ -12848,9 +13107,9 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Directory"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Directory-1025"><a href="#Directory-1025"><span class="linenos">1025</span></a><span class="k">class</span> <span class="nc">Directory</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Directory-1026"><a href="#Directory-1026"><span class="linenos">1026</span></a> <span class="c1"># https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html</span> -</span><span id="Directory-1027"><a href="#Directory-1027"><span class="linenos">1027</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"row_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Directory-1036"><a href="#Directory-1036"><span class="linenos">1036</span></a><span class="k">class</span> <span class="nc">Directory</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Directory-1037"><a href="#Directory-1037"><span class="linenos">1037</span></a> <span class="c1"># https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html</span> +</span><span id="Directory-1038"><a href="#Directory-1038"><span class="linenos">1038</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"row_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -12910,13 +13169,13 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#ForeignKey"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ForeignKey-1030"><a href="#ForeignKey-1030"><span class="linenos">1030</span></a><span class="k">class</span> <span class="nc">ForeignKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="ForeignKey-1031"><a href="#ForeignKey-1031"><span class="linenos">1031</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="ForeignKey-1032"><a href="#ForeignKey-1032"><span class="linenos">1032</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="ForeignKey-1033"><a href="#ForeignKey-1033"><span class="linenos">1033</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1034"><a href="#ForeignKey-1034"><span class="linenos">1034</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1035"><a href="#ForeignKey-1035"><span class="linenos">1035</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="ForeignKey-1036"><a href="#ForeignKey-1036"><span class="linenos">1036</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ForeignKey-1041"><a href="#ForeignKey-1041"><span class="linenos">1041</span></a><span class="k">class</span> <span class="nc">ForeignKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="ForeignKey-1042"><a href="#ForeignKey-1042"><span class="linenos">1042</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="ForeignKey-1043"><a href="#ForeignKey-1043"><span class="linenos">1043</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="ForeignKey-1044"><a href="#ForeignKey-1044"><span class="linenos">1044</span></a> <span class="s2">"reference"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1045"><a href="#ForeignKey-1045"><span class="linenos">1045</span></a> <span class="s2">"delete"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1046"><a href="#ForeignKey-1046"><span class="linenos">1046</span></a> <span class="s2">"update"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="ForeignKey-1047"><a href="#ForeignKey-1047"><span class="linenos">1047</span></a> <span class="p">}</span> </span></pre></div> @@ -12976,8 +13235,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#PrimaryKey"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PrimaryKey-1039"><a href="#PrimaryKey-1039"><span class="linenos">1039</span></a><span class="k">class</span> <span class="nc">PrimaryKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="PrimaryKey-1040"><a href="#PrimaryKey-1040"><span class="linenos">1040</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PrimaryKey-1050"><a href="#PrimaryKey-1050"><span class="linenos">1050</span></a><span class="k">class</span> <span class="nc">PrimaryKey</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="PrimaryKey-1051"><a href="#PrimaryKey-1051"><span class="linenos">1051</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -13037,8 +13296,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Unique"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unique-1043"><a href="#Unique-1043"><span class="linenos">1043</span></a><span class="k">class</span> <span class="nc">Unique</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Unique-1044"><a href="#Unique-1044"><span class="linenos">1044</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unique-1054"><a href="#Unique-1054"><span class="linenos">1054</span></a><span class="k">class</span> <span class="nc">Unique</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Unique-1055"><a href="#Unique-1055"><span class="linenos">1055</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13098,8 +13357,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Into"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Into-1049"><a href="#Into-1049"><span class="linenos">1049</span></a><span class="k">class</span> <span class="nc">Into</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Into-1050"><a href="#Into-1050"><span class="linenos">1050</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unlogged"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Into-1060"><a href="#Into-1060"><span class="linenos">1060</span></a><span class="k">class</span> <span class="nc">Into</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Into-1061"><a href="#Into-1061"><span class="linenos">1061</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"temporary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unlogged"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -13159,8 +13418,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#From"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="From-1053"><a href="#From-1053"><span class="linenos">1053</span></a><span class="k">class</span> <span class="nc">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="From-1054"><a href="#From-1054"><span class="linenos">1054</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="From-1064"><a href="#From-1064"><span class="linenos">1064</span></a><span class="k">class</span> <span class="nc">From</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="From-1065"><a href="#From-1065"><span class="linenos">1065</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13220,8 +13479,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Having"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Having-1057"><a href="#Having-1057"><span class="linenos">1057</span></a><span class="k">class</span> <span class="nc">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Having-1058"><a href="#Having-1058"><span class="linenos">1058</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Having-1068"><a href="#Having-1068"><span class="linenos">1068</span></a><span class="k">class</span> <span class="nc">Having</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Having-1069"><a href="#Having-1069"><span class="linenos">1069</span></a> <span class="k">pass</span> </span></pre></div> @@ -13281,8 +13540,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Hint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Hint-1061"><a href="#Hint-1061"><span class="linenos">1061</span></a><span class="k">class</span> <span class="nc">Hint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Hint-1062"><a href="#Hint-1062"><span class="linenos">1062</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Hint-1072"><a href="#Hint-1072"><span class="linenos">1072</span></a><span class="k">class</span> <span class="nc">Hint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Hint-1073"><a href="#Hint-1073"><span class="linenos">1073</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13342,8 +13601,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#JoinHint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JoinHint-1065"><a href="#JoinHint-1065"><span class="linenos">1065</span></a><span class="k">class</span> <span class="nc">JoinHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="JoinHint-1066"><a href="#JoinHint-1066"><span class="linenos">1066</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JoinHint-1076"><a href="#JoinHint-1076"><span class="linenos">1076</span></a><span class="k">class</span> <span class="nc">JoinHint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="JoinHint-1077"><a href="#JoinHint-1077"><span class="linenos">1077</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13403,22 +13662,22 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Identifier"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Identifier-1069"><a href="#Identifier-1069"><span class="linenos">1069</span></a><span class="k">class</span> <span class="nc">Identifier</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Identifier-1070"><a href="#Identifier-1070"><span class="linenos">1070</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quoted"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Identifier-1071"><a href="#Identifier-1071"><span class="linenos">1071</span></a> -</span><span id="Identifier-1072"><a href="#Identifier-1072"><span class="linenos">1072</span></a> <span class="nd">@property</span> -</span><span id="Identifier-1073"><a href="#Identifier-1073"><span class="linenos">1073</span></a> <span class="k">def</span> <span class="nf">quoted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Identifier-1074"><a href="#Identifier-1074"><span class="linenos">1074</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"quoted"</span><span class="p">))</span> -</span><span id="Identifier-1075"><a href="#Identifier-1075"><span class="linenos">1075</span></a> -</span><span id="Identifier-1076"><a href="#Identifier-1076"><span class="linenos">1076</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> -</span><span id="Identifier-1077"><a href="#Identifier-1077"><span class="linenos">1077</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> -</span><span id="Identifier-1078"><a href="#Identifier-1078"><span class="linenos">1078</span></a> -</span><span id="Identifier-1079"><a href="#Identifier-1079"><span class="linenos">1079</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Identifier-1080"><a href="#Identifier-1080"><span class="linenos">1080</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">lower</span><span class="p">()))</span> -</span><span id="Identifier-1081"><a href="#Identifier-1081"><span class="linenos">1081</span></a> -</span><span id="Identifier-1082"><a href="#Identifier-1082"><span class="linenos">1082</span></a> <span class="nd">@property</span> -</span><span id="Identifier-1083"><a href="#Identifier-1083"><span class="linenos">1083</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Identifier-1084"><a href="#Identifier-1084"><span class="linenos">1084</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Identifier-1080"><a href="#Identifier-1080"><span class="linenos">1080</span></a><span class="k">class</span> <span class="nc">Identifier</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Identifier-1081"><a href="#Identifier-1081"><span class="linenos">1081</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quoted"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Identifier-1082"><a href="#Identifier-1082"><span class="linenos">1082</span></a> +</span><span id="Identifier-1083"><a href="#Identifier-1083"><span class="linenos">1083</span></a> <span class="nd">@property</span> +</span><span id="Identifier-1084"><a href="#Identifier-1084"><span class="linenos">1084</span></a> <span class="k">def</span> <span class="nf">quoted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Identifier-1085"><a href="#Identifier-1085"><span class="linenos">1085</span></a> <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"quoted"</span><span class="p">))</span> +</span><span id="Identifier-1086"><a href="#Identifier-1086"><span class="linenos">1086</span></a> +</span><span id="Identifier-1087"><a href="#Identifier-1087"><span class="linenos">1087</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> +</span><span id="Identifier-1088"><a href="#Identifier-1088"><span class="linenos">1088</span></a> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">)</span> <span class="ow">and</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> <span class="o">==</span> <span class="n">_norm_arg</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">this</span><span class="p">)</span> +</span><span id="Identifier-1089"><a href="#Identifier-1089"><span class="linenos">1089</span></a> +</span><span id="Identifier-1090"><a href="#Identifier-1090"><span class="linenos">1090</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Identifier-1091"><a href="#Identifier-1091"><span class="linenos">1091</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">lower</span><span class="p">()))</span> +</span><span id="Identifier-1092"><a href="#Identifier-1092"><span class="linenos">1092</span></a> +</span><span id="Identifier-1093"><a href="#Identifier-1093"><span class="linenos">1093</span></a> <span class="nd">@property</span> +</span><span id="Identifier-1094"><a href="#Identifier-1094"><span class="linenos">1094</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Identifier-1095"><a href="#Identifier-1095"><span class="linenos">1095</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -13507,16 +13766,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Index"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Index-1087"><a href="#Index-1087"><span class="linenos">1087</span></a><span class="k">class</span> <span class="nc">Index</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Index-1088"><a href="#Index-1088"><span class="linenos">1088</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Index-1089"><a href="#Index-1089"><span class="linenos">1089</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1090"><a href="#Index-1090"><span class="linenos">1090</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1091"><a href="#Index-1091"><span class="linenos">1091</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1092"><a href="#Index-1092"><span class="linenos">1092</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1093"><a href="#Index-1093"><span class="linenos">1093</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1094"><a href="#Index-1094"><span class="linenos">1094</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Index-1095"><a href="#Index-1095"><span class="linenos">1095</span></a> <span class="s2">"amp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> -</span><span id="Index-1096"><a href="#Index-1096"><span class="linenos">1096</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Index-1098"><a href="#Index-1098"><span class="linenos">1098</span></a><span class="k">class</span> <span class="nc">Index</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Index-1099"><a href="#Index-1099"><span class="linenos">1099</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Index-1100"><a href="#Index-1100"><span class="linenos">1100</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1101"><a href="#Index-1101"><span class="linenos">1101</span></a> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1102"><a href="#Index-1102"><span class="linenos">1102</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1103"><a href="#Index-1103"><span class="linenos">1103</span></a> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1104"><a href="#Index-1104"><span class="linenos">1104</span></a> <span class="s2">"unique"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1105"><a href="#Index-1105"><span class="linenos">1105</span></a> <span class="s2">"primary"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Index-1106"><a href="#Index-1106"><span class="linenos">1106</span></a> <span class="s2">"amp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="c1"># teradata</span> +</span><span id="Index-1107"><a href="#Index-1107"><span class="linenos">1107</span></a> <span class="p">}</span> </span></pre></div> @@ -13576,16 +13835,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Insert"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Insert-1099"><a href="#Insert-1099"><span class="linenos">1099</span></a><span class="k">class</span> <span class="nc">Insert</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Insert-1100"><a href="#Insert-1100"><span class="linenos">1100</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Insert-1101"><a href="#Insert-1101"><span class="linenos">1101</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1102"><a href="#Insert-1102"><span class="linenos">1102</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Insert-1103"><a href="#Insert-1103"><span class="linenos">1103</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1104"><a href="#Insert-1104"><span class="linenos">1104</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1105"><a href="#Insert-1105"><span class="linenos">1105</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1106"><a href="#Insert-1106"><span class="linenos">1106</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1107"><a href="#Insert-1107"><span class="linenos">1107</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Insert-1108"><a href="#Insert-1108"><span class="linenos">1108</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Insert-1110"><a href="#Insert-1110"><span class="linenos">1110</span></a><span class="k">class</span> <span class="nc">Insert</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Insert-1111"><a href="#Insert-1111"><span class="linenos">1111</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Insert-1112"><a href="#Insert-1112"><span class="linenos">1112</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1113"><a href="#Insert-1113"><span class="linenos">1113</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Insert-1114"><a href="#Insert-1114"><span class="linenos">1114</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1115"><a href="#Insert-1115"><span class="linenos">1115</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1116"><a href="#Insert-1116"><span class="linenos">1116</span></a> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1117"><a href="#Insert-1117"><span class="linenos">1117</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1118"><a href="#Insert-1118"><span class="linenos">1118</span></a> <span class="s2">"alternative"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Insert-1119"><a href="#Insert-1119"><span class="linenos">1119</span></a> <span class="p">}</span> </span></pre></div> @@ -13645,8 +13904,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Introducer"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Introducer-1112"><a href="#Introducer-1112"><span class="linenos">1112</span></a><span class="k">class</span> <span class="nc">Introducer</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Introducer-1113"><a href="#Introducer-1113"><span class="linenos">1113</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Introducer-1123"><a href="#Introducer-1123"><span class="linenos">1123</span></a><span class="k">class</span> <span class="nc">Introducer</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Introducer-1124"><a href="#Introducer-1124"><span class="linenos">1124</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13706,8 +13965,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#National"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="National-1117"><a href="#National-1117"><span class="linenos">1117</span></a><span class="k">class</span> <span class="nc">National</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="National-1118"><a href="#National-1118"><span class="linenos">1118</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="National-1128"><a href="#National-1128"><span class="linenos">1128</span></a><span class="k">class</span> <span class="nc">National</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="National-1129"><a href="#National-1129"><span class="linenos">1129</span></a> <span class="k">pass</span> </span></pre></div> @@ -13767,16 +14026,16 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#LoadData"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LoadData-1121"><a href="#LoadData-1121"><span class="linenos">1121</span></a><span class="k">class</span> <span class="nc">LoadData</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="LoadData-1122"><a href="#LoadData-1122"><span class="linenos">1122</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="LoadData-1123"><a href="#LoadData-1123"><span class="linenos">1123</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LoadData-1124"><a href="#LoadData-1124"><span class="linenos">1124</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1125"><a href="#LoadData-1125"><span class="linenos">1125</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1126"><a href="#LoadData-1126"><span class="linenos">1126</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LoadData-1127"><a href="#LoadData-1127"><span class="linenos">1127</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1128"><a href="#LoadData-1128"><span class="linenos">1128</span></a> <span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1129"><a href="#LoadData-1129"><span class="linenos">1129</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LoadData-1130"><a href="#LoadData-1130"><span class="linenos">1130</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LoadData-1132"><a href="#LoadData-1132"><span class="linenos">1132</span></a><span class="k">class</span> <span class="nc">LoadData</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="LoadData-1133"><a href="#LoadData-1133"><span class="linenos">1133</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="LoadData-1134"><a href="#LoadData-1134"><span class="linenos">1134</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LoadData-1135"><a href="#LoadData-1135"><span class="linenos">1135</span></a> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1136"><a href="#LoadData-1136"><span class="linenos">1136</span></a> <span class="s2">"overwrite"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1137"><a href="#LoadData-1137"><span class="linenos">1137</span></a> <span class="s2">"inpath"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LoadData-1138"><a href="#LoadData-1138"><span class="linenos">1138</span></a> <span class="s2">"partition"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1139"><a href="#LoadData-1139"><span class="linenos">1139</span></a> <span class="s2">"input_format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1140"><a href="#LoadData-1140"><span class="linenos">1140</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LoadData-1141"><a href="#LoadData-1141"><span class="linenos">1141</span></a> <span class="p">}</span> </span></pre></div> @@ -13836,8 +14095,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Partition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Partition-1133"><a href="#Partition-1133"><span class="linenos">1133</span></a><span class="k">class</span> <span class="nc">Partition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Partition-1134"><a href="#Partition-1134"><span class="linenos">1134</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Partition-1144"><a href="#Partition-1144"><span class="linenos">1144</span></a><span class="k">class</span> <span class="nc">Partition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Partition-1145"><a href="#Partition-1145"><span class="linenos">1145</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -13897,8 +14156,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Fetch"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Fetch-1137"><a href="#Fetch-1137"><span class="linenos">1137</span></a><span class="k">class</span> <span class="nc">Fetch</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Fetch-1138"><a href="#Fetch-1138"><span class="linenos">1138</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Fetch-1148"><a href="#Fetch-1148"><span class="linenos">1148</span></a><span class="k">class</span> <span class="nc">Fetch</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Fetch-1149"><a href="#Fetch-1149"><span class="linenos">1149</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"direction"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"count"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -13958,13 +14217,13 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Group"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Group-1141"><a href="#Group-1141"><span class="linenos">1141</span></a><span class="k">class</span> <span class="nc">Group</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Group-1142"><a href="#Group-1142"><span class="linenos">1142</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Group-1143"><a href="#Group-1143"><span class="linenos">1143</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1144"><a href="#Group-1144"><span class="linenos">1144</span></a> <span class="s2">"grouping_sets"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1145"><a href="#Group-1145"><span class="linenos">1145</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1146"><a href="#Group-1146"><span class="linenos">1146</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Group-1147"><a href="#Group-1147"><span class="linenos">1147</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Group-1152"><a href="#Group-1152"><span class="linenos">1152</span></a><span class="k">class</span> <span class="nc">Group</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Group-1153"><a href="#Group-1153"><span class="linenos">1153</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Group-1154"><a href="#Group-1154"><span class="linenos">1154</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1155"><a href="#Group-1155"><span class="linenos">1155</span></a> <span class="s2">"grouping_sets"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1156"><a href="#Group-1156"><span class="linenos">1156</span></a> <span class="s2">"cube"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1157"><a href="#Group-1157"><span class="linenos">1157</span></a> <span class="s2">"rollup"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Group-1158"><a href="#Group-1158"><span class="linenos">1158</span></a> <span class="p">}</span> </span></pre></div> @@ -14024,8 +14283,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Lambda"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Lambda-1150"><a href="#Lambda-1150"><span class="linenos">1150</span></a><span class="k">class</span> <span class="nc">Lambda</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Lambda-1151"><a href="#Lambda-1151"><span class="linenos">1151</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Lambda-1161"><a href="#Lambda-1161"><span class="linenos">1161</span></a><span class="k">class</span> <span class="nc">Lambda</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Lambda-1162"><a href="#Lambda-1162"><span class="linenos">1162</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -14085,8 +14344,8 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Limit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Limit-1154"><a href="#Limit-1154"><span class="linenos">1154</span></a><span class="k">class</span> <span class="nc">Limit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Limit-1155"><a href="#Limit-1155"><span class="linenos">1155</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Limit-1165"><a href="#Limit-1165"><span class="linenos">1165</span></a><span class="k">class</span> <span class="nc">Limit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Limit-1166"><a href="#Limit-1166"><span class="linenos">1166</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -14146,30 +14405,30 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Literal"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal-1158"><a href="#Literal-1158"><span class="linenos">1158</span></a><span class="k">class</span> <span class="nc">Literal</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Literal-1159"><a href="#Literal-1159"><span class="linenos">1159</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_string"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Literal-1160"><a href="#Literal-1160"><span class="linenos">1160</span></a> -</span><span id="Literal-1161"><a href="#Literal-1161"><span class="linenos">1161</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> -</span><span id="Literal-1162"><a href="#Literal-1162"><span class="linenos">1162</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="Literal-1163"><a href="#Literal-1163"><span class="linenos">1163</span></a> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> -</span><span id="Literal-1164"><a href="#Literal-1164"><span class="linenos">1164</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">this</span> -</span><span id="Literal-1165"><a href="#Literal-1165"><span class="linenos">1165</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> -</span><span id="Literal-1166"><a href="#Literal-1166"><span class="linenos">1166</span></a> <span class="p">)</span> -</span><span id="Literal-1167"><a href="#Literal-1167"><span class="linenos">1167</span></a> -</span><span id="Literal-1168"><a href="#Literal-1168"><span class="linenos">1168</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Literal-1169"><a href="#Literal-1169"><span class="linenos">1169</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]))</span> -</span><span id="Literal-1170"><a href="#Literal-1170"><span class="linenos">1170</span></a> -</span><span id="Literal-1171"><a href="#Literal-1171"><span class="linenos">1171</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal-1172"><a href="#Literal-1172"><span class="linenos">1172</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="Literal-1173"><a href="#Literal-1173"><span class="linenos">1173</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> -</span><span id="Literal-1174"><a href="#Literal-1174"><span class="linenos">1174</span></a> -</span><span id="Literal-1175"><a href="#Literal-1175"><span class="linenos">1175</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal-1176"><a href="#Literal-1176"><span class="linenos">1176</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="Literal-1177"><a href="#Literal-1177"><span class="linenos">1177</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Literal-1169"><a href="#Literal-1169"><span class="linenos">1169</span></a><span class="k">class</span> <span class="nc">Literal</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Literal-1170"><a href="#Literal-1170"><span class="linenos">1170</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_string"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Literal-1171"><a href="#Literal-1171"><span class="linenos">1171</span></a> +</span><span id="Literal-1172"><a href="#Literal-1172"><span class="linenos">1172</span></a> <span class="k">def</span> <span class="fm">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> +</span><span id="Literal-1173"><a href="#Literal-1173"><span class="linenos">1173</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="Literal-1174"><a href="#Literal-1174"><span class="linenos">1174</span></a> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Literal</span><span class="p">)</span> +</span><span id="Literal-1175"><a href="#Literal-1175"><span class="linenos">1175</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">this</span> +</span><span id="Literal-1176"><a href="#Literal-1176"><span class="linenos">1176</span></a> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> <span class="o">==</span> <span class="n">other</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]</span> +</span><span id="Literal-1177"><a href="#Literal-1177"><span class="linenos">1177</span></a> <span class="p">)</span> </span><span id="Literal-1178"><a href="#Literal-1178"><span class="linenos">1178</span></a> -</span><span id="Literal-1179"><a href="#Literal-1179"><span class="linenos">1179</span></a> <span class="nd">@property</span> -</span><span id="Literal-1180"><a href="#Literal-1180"><span class="linenos">1180</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Literal-1181"><a href="#Literal-1181"><span class="linenos">1181</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="Literal-1179"><a href="#Literal-1179"><span class="linenos">1179</span></a> <span class="k">def</span> <span class="fm">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Literal-1180"><a href="#Literal-1180"><span class="linenos">1180</span></a> <span class="k">return</span> <span class="nb">hash</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"is_string"</span><span class="p">]))</span> +</span><span id="Literal-1181"><a href="#Literal-1181"><span class="linenos">1181</span></a> +</span><span id="Literal-1182"><a href="#Literal-1182"><span class="linenos">1182</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal-1183"><a href="#Literal-1183"><span class="linenos">1183</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="Literal-1184"><a href="#Literal-1184"><span class="linenos">1184</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> +</span><span id="Literal-1185"><a href="#Literal-1185"><span class="linenos">1185</span></a> +</span><span id="Literal-1186"><a href="#Literal-1186"><span class="linenos">1186</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal-1187"><a href="#Literal-1187"><span class="linenos">1187</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="Literal-1188"><a href="#Literal-1188"><span class="linenos">1188</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> +</span><span id="Literal-1189"><a href="#Literal-1189"><span class="linenos">1189</span></a> +</span><span id="Literal-1190"><a href="#Literal-1190"><span class="linenos">1190</span></a> <span class="nd">@property</span> +</span><span id="Literal-1191"><a href="#Literal-1191"><span class="linenos">1191</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Literal-1192"><a href="#Literal-1192"><span class="linenos">1192</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -14187,9 +14446,9 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Literal.number"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.number-1171"><a href="#Literal.number-1171"><span class="linenos">1171</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal.number-1172"><a href="#Literal.number-1172"><span class="linenos">1172</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="Literal.number-1173"><a href="#Literal.number-1173"><span class="linenos">1173</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.number-1182"><a href="#Literal.number-1182"><span class="linenos">1182</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal.number-1183"><a href="#Literal.number-1183"><span class="linenos">1183</span></a> <span class="k">def</span> <span class="nf">number</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">number</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="Literal.number-1184"><a href="#Literal.number-1184"><span class="linenos">1184</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">number</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></pre></div> @@ -14208,9 +14467,9 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Literal.string"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.string-1175"><a href="#Literal.string-1175"><span class="linenos">1175</span></a> <span class="nd">@classmethod</span> -</span><span id="Literal.string-1176"><a href="#Literal.string-1176"><span class="linenos">1176</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> -</span><span id="Literal.string-1177"><a href="#Literal.string-1177"><span class="linenos">1177</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Literal.string-1186"><a href="#Literal.string-1186"><span class="linenos">1186</span></a> <span class="nd">@classmethod</span> +</span><span id="Literal.string-1187"><a href="#Literal.string-1187"><span class="linenos">1187</span></a> <span class="k">def</span> <span class="nf">string</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">string</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">:</span> +</span><span id="Literal.string-1188"><a href="#Literal.string-1188"><span class="linenos">1188</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">string</span><span class="p">),</span> <span class="n">is_string</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></pre></div> @@ -14306,100 +14565,100 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Join"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Join-1184"><a href="#Join-1184"><span class="linenos">1184</span></a><span class="k">class</span> <span class="nc">Join</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Join-1185"><a href="#Join-1185"><span class="linenos">1185</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Join-1186"><a href="#Join-1186"><span class="linenos">1186</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Join-1187"><a href="#Join-1187"><span class="linenos">1187</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1188"><a href="#Join-1188"><span class="linenos">1188</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1189"><a href="#Join-1189"><span class="linenos">1189</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1190"><a href="#Join-1190"><span class="linenos">1190</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1191"><a href="#Join-1191"><span class="linenos">1191</span></a> <span class="s2">"natural"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Join-1192"><a href="#Join-1192"><span class="linenos">1192</span></a> <span class="p">}</span> -</span><span id="Join-1193"><a href="#Join-1193"><span class="linenos">1193</span></a> -</span><span id="Join-1194"><a href="#Join-1194"><span class="linenos">1194</span></a> <span class="nd">@property</span> -</span><span id="Join-1195"><a href="#Join-1195"><span class="linenos">1195</span></a> <span class="k">def</span> <span class="nf">kind</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Join-1196"><a href="#Join-1196"><span class="linenos">1196</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Join-1197"><a href="#Join-1197"><span class="linenos">1197</span></a> -</span><span id="Join-1198"><a href="#Join-1198"><span class="linenos">1198</span></a> <span class="nd">@property</span> -</span><span id="Join-1199"><a href="#Join-1199"><span class="linenos">1199</span></a> <span class="k">def</span> <span class="nf">side</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Join-1200"><a href="#Join-1200"><span class="linenos">1200</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"side"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> -</span><span id="Join-1201"><a href="#Join-1201"><span class="linenos">1201</span></a> -</span><span id="Join-1202"><a href="#Join-1202"><span class="linenos">1202</span></a> <span class="nd">@property</span> -</span><span id="Join-1203"><a href="#Join-1203"><span class="linenos">1203</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Join-1204"><a href="#Join-1204"><span class="linenos">1204</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">alias_or_name</span> -</span><span id="Join-1205"><a href="#Join-1205"><span class="linenos">1205</span></a> -</span><span id="Join-1206"><a href="#Join-1206"><span class="linenos">1206</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Join-1207"><a href="#Join-1207"><span class="linenos">1207</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join-1208"><a href="#Join-1208"><span class="linenos">1208</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="Join-1209"><a href="#Join-1209"><span class="linenos">1209</span></a> -</span><span id="Join-1210"><a href="#Join-1210"><span class="linenos">1210</span></a><span class="sd"> Example:</span> -</span><span id="Join-1211"><a href="#Join-1211"><span class="linenos">1211</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join-1212"><a href="#Join-1212"><span class="linenos">1212</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="Join-1213"><a href="#Join-1213"><span class="linenos">1213</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="Join-1214"><a href="#Join-1214"><span class="linenos">1214</span></a> -</span><span id="Join-1215"><a href="#Join-1215"><span class="linenos">1215</span></a><span class="sd"> Args:</span> -</span><span id="Join-1216"><a href="#Join-1216"><span class="linenos">1216</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Join-1217"><a href="#Join-1217"><span class="linenos">1217</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join-1218"><a href="#Join-1218"><span class="linenos">1218</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Join-1219"><a href="#Join-1219"><span class="linenos">1219</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Join-1220"><a href="#Join-1220"><span class="linenos">1220</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join-1221"><a href="#Join-1221"><span class="linenos">1221</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Join-1222"><a href="#Join-1222"><span class="linenos">1222</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Join-1223"><a href="#Join-1223"><span class="linenos">1223</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Join-1224"><a href="#Join-1224"><span class="linenos">1224</span></a> -</span><span id="Join-1225"><a href="#Join-1225"><span class="linenos">1225</span></a><span class="sd"> Returns:</span> -</span><span id="Join-1226"><a href="#Join-1226"><span class="linenos">1226</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="Join-1227"><a href="#Join-1227"><span class="linenos">1227</span></a><span class="sd"> """</span> -</span><span id="Join-1228"><a href="#Join-1228"><span class="linenos">1228</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Join-1229"><a href="#Join-1229"><span class="linenos">1229</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join-1230"><a href="#Join-1230"><span class="linenos">1230</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1231"><a href="#Join-1231"><span class="linenos">1231</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> -</span><span id="Join-1232"><a href="#Join-1232"><span class="linenos">1232</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join-1233"><a href="#Join-1233"><span class="linenos">1233</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join-1234"><a href="#Join-1234"><span class="linenos">1234</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join-1235"><a href="#Join-1235"><span class="linenos">1235</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1236"><a href="#Join-1236"><span class="linenos">1236</span></a> <span class="p">)</span> -</span><span id="Join-1237"><a href="#Join-1237"><span class="linenos">1237</span></a> -</span><span id="Join-1238"><a href="#Join-1238"><span class="linenos">1238</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="Join-1239"><a href="#Join-1239"><span class="linenos">1239</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Join-1240"><a href="#Join-1240"><span class="linenos">1240</span></a> -</span><span id="Join-1241"><a href="#Join-1241"><span class="linenos">1241</span></a> <span class="k">return</span> <span class="n">join</span> -</span><span id="Join-1242"><a href="#Join-1242"><span class="linenos">1242</span></a> -</span><span id="Join-1243"><a href="#Join-1243"><span class="linenos">1243</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Join-1244"><a href="#Join-1244"><span class="linenos">1244</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join-1245"><a href="#Join-1245"><span class="linenos">1245</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="Join-1246"><a href="#Join-1246"><span class="linenos">1246</span></a> -</span><span id="Join-1247"><a href="#Join-1247"><span class="linenos">1247</span></a><span class="sd"> Example:</span> -</span><span id="Join-1248"><a href="#Join-1248"><span class="linenos">1248</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join-1249"><a href="#Join-1249"><span class="linenos">1249</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="Join-1250"><a href="#Join-1250"><span class="linenos">1250</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join-1195"><a href="#Join-1195"><span class="linenos">1195</span></a><span class="k">class</span> <span class="nc">Join</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Join-1196"><a href="#Join-1196"><span class="linenos">1196</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Join-1197"><a href="#Join-1197"><span class="linenos">1197</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Join-1198"><a href="#Join-1198"><span class="linenos">1198</span></a> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1199"><a href="#Join-1199"><span class="linenos">1199</span></a> <span class="s2">"side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1200"><a href="#Join-1200"><span class="linenos">1200</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1201"><a href="#Join-1201"><span class="linenos">1201</span></a> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1202"><a href="#Join-1202"><span class="linenos">1202</span></a> <span class="s2">"natural"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Join-1203"><a href="#Join-1203"><span class="linenos">1203</span></a> <span class="p">}</span> +</span><span id="Join-1204"><a href="#Join-1204"><span class="linenos">1204</span></a> +</span><span id="Join-1205"><a href="#Join-1205"><span class="linenos">1205</span></a> <span class="nd">@property</span> +</span><span id="Join-1206"><a href="#Join-1206"><span class="linenos">1206</span></a> <span class="k">def</span> <span class="nf">kind</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Join-1207"><a href="#Join-1207"><span class="linenos">1207</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Join-1208"><a href="#Join-1208"><span class="linenos">1208</span></a> +</span><span id="Join-1209"><a href="#Join-1209"><span class="linenos">1209</span></a> <span class="nd">@property</span> +</span><span id="Join-1210"><a href="#Join-1210"><span class="linenos">1210</span></a> <span class="k">def</span> <span class="nf">side</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Join-1211"><a href="#Join-1211"><span class="linenos">1211</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"side"</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> +</span><span id="Join-1212"><a href="#Join-1212"><span class="linenos">1212</span></a> +</span><span id="Join-1213"><a href="#Join-1213"><span class="linenos">1213</span></a> <span class="nd">@property</span> +</span><span id="Join-1214"><a href="#Join-1214"><span class="linenos">1214</span></a> <span class="k">def</span> <span class="nf">alias_or_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Join-1215"><a href="#Join-1215"><span class="linenos">1215</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">alias_or_name</span> +</span><span id="Join-1216"><a href="#Join-1216"><span class="linenos">1216</span></a> +</span><span id="Join-1217"><a href="#Join-1217"><span class="linenos">1217</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Join-1218"><a href="#Join-1218"><span class="linenos">1218</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join-1219"><a href="#Join-1219"><span class="linenos">1219</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="Join-1220"><a href="#Join-1220"><span class="linenos">1220</span></a> +</span><span id="Join-1221"><a href="#Join-1221"><span class="linenos">1221</span></a><span class="sd"> Example:</span> +</span><span id="Join-1222"><a href="#Join-1222"><span class="linenos">1222</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join-1223"><a href="#Join-1223"><span class="linenos">1223</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="Join-1224"><a href="#Join-1224"><span class="linenos">1224</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="Join-1225"><a href="#Join-1225"><span class="linenos">1225</span></a> +</span><span id="Join-1226"><a href="#Join-1226"><span class="linenos">1226</span></a><span class="sd"> Args:</span> +</span><span id="Join-1227"><a href="#Join-1227"><span class="linenos">1227</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Join-1228"><a href="#Join-1228"><span class="linenos">1228</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join-1229"><a href="#Join-1229"><span class="linenos">1229</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Join-1230"><a href="#Join-1230"><span class="linenos">1230</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Join-1231"><a href="#Join-1231"><span class="linenos">1231</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join-1232"><a href="#Join-1232"><span class="linenos">1232</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Join-1233"><a href="#Join-1233"><span class="linenos">1233</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Join-1234"><a href="#Join-1234"><span class="linenos">1234</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Join-1235"><a href="#Join-1235"><span class="linenos">1235</span></a> +</span><span id="Join-1236"><a href="#Join-1236"><span class="linenos">1236</span></a><span class="sd"> Returns:</span> +</span><span id="Join-1237"><a href="#Join-1237"><span class="linenos">1237</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="Join-1238"><a href="#Join-1238"><span class="linenos">1238</span></a><span class="sd"> """</span> +</span><span id="Join-1239"><a href="#Join-1239"><span class="linenos">1239</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Join-1240"><a href="#Join-1240"><span class="linenos">1240</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join-1241"><a href="#Join-1241"><span class="linenos">1241</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1242"><a href="#Join-1242"><span class="linenos">1242</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> +</span><span id="Join-1243"><a href="#Join-1243"><span class="linenos">1243</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join-1244"><a href="#Join-1244"><span class="linenos">1244</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join-1245"><a href="#Join-1245"><span class="linenos">1245</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join-1246"><a href="#Join-1246"><span class="linenos">1246</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1247"><a href="#Join-1247"><span class="linenos">1247</span></a> <span class="p">)</span> +</span><span id="Join-1248"><a href="#Join-1248"><span class="linenos">1248</span></a> +</span><span id="Join-1249"><a href="#Join-1249"><span class="linenos">1249</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="Join-1250"><a href="#Join-1250"><span class="linenos">1250</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> </span><span id="Join-1251"><a href="#Join-1251"><span class="linenos">1251</span></a> -</span><span id="Join-1252"><a href="#Join-1252"><span class="linenos">1252</span></a><span class="sd"> Args:</span> -</span><span id="Join-1253"><a href="#Join-1253"><span class="linenos">1253</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Join-1254"><a href="#Join-1254"><span class="linenos">1254</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join-1255"><a href="#Join-1255"><span class="linenos">1255</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="Join-1256"><a href="#Join-1256"><span class="linenos">1256</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join-1257"><a href="#Join-1257"><span class="linenos">1257</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Join-1258"><a href="#Join-1258"><span class="linenos">1258</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Join-1259"><a href="#Join-1259"><span class="linenos">1259</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Join-1260"><a href="#Join-1260"><span class="linenos">1260</span></a> -</span><span id="Join-1261"><a href="#Join-1261"><span class="linenos">1261</span></a><span class="sd"> Returns:</span> -</span><span id="Join-1262"><a href="#Join-1262"><span class="linenos">1262</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="Join-1263"><a href="#Join-1263"><span class="linenos">1263</span></a><span class="sd"> """</span> -</span><span id="Join-1264"><a href="#Join-1264"><span class="linenos">1264</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Join-1265"><a href="#Join-1265"><span class="linenos">1265</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join-1266"><a href="#Join-1266"><span class="linenos">1266</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join-1267"><a href="#Join-1267"><span class="linenos">1267</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Join-1268"><a href="#Join-1268"><span class="linenos">1268</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join-1269"><a href="#Join-1269"><span class="linenos">1269</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join-1270"><a href="#Join-1270"><span class="linenos">1270</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join-1271"><a href="#Join-1271"><span class="linenos">1271</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join-1272"><a href="#Join-1272"><span class="linenos">1272</span></a> <span class="p">)</span> -</span><span id="Join-1273"><a href="#Join-1273"><span class="linenos">1273</span></a> -</span><span id="Join-1274"><a href="#Join-1274"><span class="linenos">1274</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="Join-1275"><a href="#Join-1275"><span class="linenos">1275</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Join-1276"><a href="#Join-1276"><span class="linenos">1276</span></a> -</span><span id="Join-1277"><a href="#Join-1277"><span class="linenos">1277</span></a> <span class="k">return</span> <span class="n">join</span> +</span><span id="Join-1252"><a href="#Join-1252"><span class="linenos">1252</span></a> <span class="k">return</span> <span class="n">join</span> +</span><span id="Join-1253"><a href="#Join-1253"><span class="linenos">1253</span></a> +</span><span id="Join-1254"><a href="#Join-1254"><span class="linenos">1254</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Join-1255"><a href="#Join-1255"><span class="linenos">1255</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join-1256"><a href="#Join-1256"><span class="linenos">1256</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="Join-1257"><a href="#Join-1257"><span class="linenos">1257</span></a> +</span><span id="Join-1258"><a href="#Join-1258"><span class="linenos">1258</span></a><span class="sd"> Example:</span> +</span><span id="Join-1259"><a href="#Join-1259"><span class="linenos">1259</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join-1260"><a href="#Join-1260"><span class="linenos">1260</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="Join-1261"><a href="#Join-1261"><span class="linenos">1261</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="Join-1262"><a href="#Join-1262"><span class="linenos">1262</span></a> +</span><span id="Join-1263"><a href="#Join-1263"><span class="linenos">1263</span></a><span class="sd"> Args:</span> +</span><span id="Join-1264"><a href="#Join-1264"><span class="linenos">1264</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Join-1265"><a href="#Join-1265"><span class="linenos">1265</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join-1266"><a href="#Join-1266"><span class="linenos">1266</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="Join-1267"><a href="#Join-1267"><span class="linenos">1267</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join-1268"><a href="#Join-1268"><span class="linenos">1268</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Join-1269"><a href="#Join-1269"><span class="linenos">1269</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Join-1270"><a href="#Join-1270"><span class="linenos">1270</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Join-1271"><a href="#Join-1271"><span class="linenos">1271</span></a> +</span><span id="Join-1272"><a href="#Join-1272"><span class="linenos">1272</span></a><span class="sd"> Returns:</span> +</span><span id="Join-1273"><a href="#Join-1273"><span class="linenos">1273</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="Join-1274"><a href="#Join-1274"><span class="linenos">1274</span></a><span class="sd"> """</span> +</span><span id="Join-1275"><a href="#Join-1275"><span class="linenos">1275</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Join-1276"><a href="#Join-1276"><span class="linenos">1276</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join-1277"><a href="#Join-1277"><span class="linenos">1277</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join-1278"><a href="#Join-1278"><span class="linenos">1278</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Join-1279"><a href="#Join-1279"><span class="linenos">1279</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join-1280"><a href="#Join-1280"><span class="linenos">1280</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join-1281"><a href="#Join-1281"><span class="linenos">1281</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join-1282"><a href="#Join-1282"><span class="linenos">1282</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join-1283"><a href="#Join-1283"><span class="linenos">1283</span></a> <span class="p">)</span> +</span><span id="Join-1284"><a href="#Join-1284"><span class="linenos">1284</span></a> +</span><span id="Join-1285"><a href="#Join-1285"><span class="linenos">1285</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="Join-1286"><a href="#Join-1286"><span class="linenos">1286</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Join-1287"><a href="#Join-1287"><span class="linenos">1287</span></a> +</span><span id="Join-1288"><a href="#Join-1288"><span class="linenos">1288</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -14416,42 +14675,42 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#Join.on"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Join.on-1206"><a href="#Join.on-1206"><span class="linenos">1206</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Join.on-1207"><a href="#Join.on-1207"><span class="linenos">1207</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join.on-1208"><a href="#Join.on-1208"><span class="linenos">1208</span></a><span class="sd"> Append to or set the ON expressions.</span> -</span><span id="Join.on-1209"><a href="#Join.on-1209"><span class="linenos">1209</span></a> -</span><span id="Join.on-1210"><a href="#Join.on-1210"><span class="linenos">1210</span></a><span class="sd"> Example:</span> -</span><span id="Join.on-1211"><a href="#Join.on-1211"><span class="linenos">1211</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join.on-1212"><a href="#Join.on-1212"><span class="linenos">1212</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> -</span><span id="Join.on-1213"><a href="#Join.on-1213"><span class="linenos">1213</span></a><span class="sd"> 'JOIN x ON y = 1'</span> -</span><span id="Join.on-1214"><a href="#Join.on-1214"><span class="linenos">1214</span></a> -</span><span id="Join.on-1215"><a href="#Join.on-1215"><span class="linenos">1215</span></a><span class="sd"> Args:</span> -</span><span id="Join.on-1216"><a href="#Join.on-1216"><span class="linenos">1216</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Join.on-1217"><a href="#Join.on-1217"><span class="linenos">1217</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join.on-1218"><a href="#Join.on-1218"><span class="linenos">1218</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Join.on-1219"><a href="#Join.on-1219"><span class="linenos">1219</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Join.on-1220"><a href="#Join.on-1220"><span class="linenos">1220</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join.on-1221"><a href="#Join.on-1221"><span class="linenos">1221</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Join.on-1222"><a href="#Join.on-1222"><span class="linenos">1222</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Join.on-1223"><a href="#Join.on-1223"><span class="linenos">1223</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Join.on-1224"><a href="#Join.on-1224"><span class="linenos">1224</span></a> -</span><span id="Join.on-1225"><a href="#Join.on-1225"><span class="linenos">1225</span></a><span class="sd"> Returns:</span> -</span><span id="Join.on-1226"><a href="#Join.on-1226"><span class="linenos">1226</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="Join.on-1227"><a href="#Join.on-1227"><span class="linenos">1227</span></a><span class="sd"> """</span> -</span><span id="Join.on-1228"><a href="#Join.on-1228"><span class="linenos">1228</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Join.on-1229"><a href="#Join.on-1229"><span class="linenos">1229</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join.on-1230"><a href="#Join.on-1230"><span class="linenos">1230</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join.on-1231"><a href="#Join.on-1231"><span class="linenos">1231</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> -</span><span id="Join.on-1232"><a href="#Join.on-1232"><span class="linenos">1232</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join.on-1233"><a href="#Join.on-1233"><span class="linenos">1233</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join.on-1234"><a href="#Join.on-1234"><span class="linenos">1234</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join.on-1235"><a href="#Join.on-1235"><span class="linenos">1235</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.on-1236"><a href="#Join.on-1236"><span class="linenos">1236</span></a> <span class="p">)</span> -</span><span id="Join.on-1237"><a href="#Join.on-1237"><span class="linenos">1237</span></a> -</span><span id="Join.on-1238"><a href="#Join.on-1238"><span class="linenos">1238</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="Join.on-1239"><a href="#Join.on-1239"><span class="linenos">1239</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Join.on-1240"><a href="#Join.on-1240"><span class="linenos">1240</span></a> -</span><span id="Join.on-1241"><a href="#Join.on-1241"><span class="linenos">1241</span></a> <span class="k">return</span> <span class="n">join</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join.on-1217"><a href="#Join.on-1217"><span class="linenos">1217</span></a> <span class="k">def</span> <span class="nf">on</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Join.on-1218"><a href="#Join.on-1218"><span class="linenos">1218</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join.on-1219"><a href="#Join.on-1219"><span class="linenos">1219</span></a><span class="sd"> Append to or set the ON expressions.</span> +</span><span id="Join.on-1220"><a href="#Join.on-1220"><span class="linenos">1220</span></a> +</span><span id="Join.on-1221"><a href="#Join.on-1221"><span class="linenos">1221</span></a><span class="sd"> Example:</span> +</span><span id="Join.on-1222"><a href="#Join.on-1222"><span class="linenos">1222</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join.on-1223"><a href="#Join.on-1223"><span class="linenos">1223</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()</span> +</span><span id="Join.on-1224"><a href="#Join.on-1224"><span class="linenos">1224</span></a><span class="sd"> 'JOIN x ON y = 1'</span> +</span><span id="Join.on-1225"><a href="#Join.on-1225"><span class="linenos">1225</span></a> +</span><span id="Join.on-1226"><a href="#Join.on-1226"><span class="linenos">1226</span></a><span class="sd"> Args:</span> +</span><span id="Join.on-1227"><a href="#Join.on-1227"><span class="linenos">1227</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Join.on-1228"><a href="#Join.on-1228"><span class="linenos">1228</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join.on-1229"><a href="#Join.on-1229"><span class="linenos">1229</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Join.on-1230"><a href="#Join.on-1230"><span class="linenos">1230</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Join.on-1231"><a href="#Join.on-1231"><span class="linenos">1231</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join.on-1232"><a href="#Join.on-1232"><span class="linenos">1232</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Join.on-1233"><a href="#Join.on-1233"><span class="linenos">1233</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Join.on-1234"><a href="#Join.on-1234"><span class="linenos">1234</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Join.on-1235"><a href="#Join.on-1235"><span class="linenos">1235</span></a> +</span><span id="Join.on-1236"><a href="#Join.on-1236"><span class="linenos">1236</span></a><span class="sd"> Returns:</span> +</span><span id="Join.on-1237"><a href="#Join.on-1237"><span class="linenos">1237</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="Join.on-1238"><a href="#Join.on-1238"><span class="linenos">1238</span></a><span class="sd"> """</span> +</span><span id="Join.on-1239"><a href="#Join.on-1239"><span class="linenos">1239</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Join.on-1240"><a href="#Join.on-1240"><span class="linenos">1240</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join.on-1241"><a href="#Join.on-1241"><span class="linenos">1241</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join.on-1242"><a href="#Join.on-1242"><span class="linenos">1242</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"on"</span><span class="p">,</span> +</span><span id="Join.on-1243"><a href="#Join.on-1243"><span class="linenos">1243</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join.on-1244"><a href="#Join.on-1244"><span class="linenos">1244</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join.on-1245"><a href="#Join.on-1245"><span class="linenos">1245</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join.on-1246"><a href="#Join.on-1246"><span class="linenos">1246</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.on-1247"><a href="#Join.on-1247"><span class="linenos">1247</span></a> <span class="p">)</span> +</span><span id="Join.on-1248"><a href="#Join.on-1248"><span class="linenos">1248</span></a> +</span><span id="Join.on-1249"><a href="#Join.on-1249"><span class="linenos">1249</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="Join.on-1250"><a href="#Join.on-1250"><span class="linenos">1250</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Join.on-1251"><a href="#Join.on-1251"><span class="linenos">1251</span></a> +</span><span id="Join.on-1252"><a href="#Join.on-1252"><span class="linenos">1252</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -14501,41 +14760,41 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Join.using"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Join.using-1243"><a href="#Join.using-1243"><span class="linenos">1243</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="Join.using-1244"><a href="#Join.using-1244"><span class="linenos">1244</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Join.using-1245"><a href="#Join.using-1245"><span class="linenos">1245</span></a><span class="sd"> Append to or set the USING expressions.</span> -</span><span id="Join.using-1246"><a href="#Join.using-1246"><span class="linenos">1246</span></a> -</span><span id="Join.using-1247"><a href="#Join.using-1247"><span class="linenos">1247</span></a><span class="sd"> Example:</span> -</span><span id="Join.using-1248"><a href="#Join.using-1248"><span class="linenos">1248</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="Join.using-1249"><a href="#Join.using-1249"><span class="linenos">1249</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> -</span><span id="Join.using-1250"><a href="#Join.using-1250"><span class="linenos">1250</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> -</span><span id="Join.using-1251"><a href="#Join.using-1251"><span class="linenos">1251</span></a> -</span><span id="Join.using-1252"><a href="#Join.using-1252"><span class="linenos">1252</span></a><span class="sd"> Args:</span> -</span><span id="Join.using-1253"><a href="#Join.using-1253"><span class="linenos">1253</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Join.using-1254"><a href="#Join.using-1254"><span class="linenos">1254</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Join.using-1255"><a href="#Join.using-1255"><span class="linenos">1255</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> -</span><span id="Join.using-1256"><a href="#Join.using-1256"><span class="linenos">1256</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Join.using-1257"><a href="#Join.using-1257"><span class="linenos">1257</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Join.using-1258"><a href="#Join.using-1258"><span class="linenos">1258</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Join.using-1259"><a href="#Join.using-1259"><span class="linenos">1259</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Join.using-1260"><a href="#Join.using-1260"><span class="linenos">1260</span></a> -</span><span id="Join.using-1261"><a href="#Join.using-1261"><span class="linenos">1261</span></a><span class="sd"> Returns:</span> -</span><span id="Join.using-1262"><a href="#Join.using-1262"><span class="linenos">1262</span></a><span class="sd"> Join: the modified join expression.</span> -</span><span id="Join.using-1263"><a href="#Join.using-1263"><span class="linenos">1263</span></a><span class="sd"> """</span> -</span><span id="Join.using-1264"><a href="#Join.using-1264"><span class="linenos">1264</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Join.using-1265"><a href="#Join.using-1265"><span class="linenos">1265</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Join.using-1266"><a href="#Join.using-1266"><span class="linenos">1266</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Join.using-1267"><a href="#Join.using-1267"><span class="linenos">1267</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Join.using-1268"><a href="#Join.using-1268"><span class="linenos">1268</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Join.using-1269"><a href="#Join.using-1269"><span class="linenos">1269</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Join.using-1270"><a href="#Join.using-1270"><span class="linenos">1270</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Join.using-1271"><a href="#Join.using-1271"><span class="linenos">1271</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Join.using-1272"><a href="#Join.using-1272"><span class="linenos">1272</span></a> <span class="p">)</span> -</span><span id="Join.using-1273"><a href="#Join.using-1273"><span class="linenos">1273</span></a> -</span><span id="Join.using-1274"><a href="#Join.using-1274"><span class="linenos">1274</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> -</span><span id="Join.using-1275"><a href="#Join.using-1275"><span class="linenos">1275</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Join.using-1276"><a href="#Join.using-1276"><span class="linenos">1276</span></a> -</span><span id="Join.using-1277"><a href="#Join.using-1277"><span class="linenos">1277</span></a> <span class="k">return</span> <span class="n">join</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Join.using-1254"><a href="#Join.using-1254"><span class="linenos">1254</span></a> <span class="k">def</span> <span class="nf">using</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="Join.using-1255"><a href="#Join.using-1255"><span class="linenos">1255</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Join.using-1256"><a href="#Join.using-1256"><span class="linenos">1256</span></a><span class="sd"> Append to or set the USING expressions.</span> +</span><span id="Join.using-1257"><a href="#Join.using-1257"><span class="linenos">1257</span></a> +</span><span id="Join.using-1258"><a href="#Join.using-1258"><span class="linenos">1258</span></a><span class="sd"> Example:</span> +</span><span id="Join.using-1259"><a href="#Join.using-1259"><span class="linenos">1259</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="Join.using-1260"><a href="#Join.using-1260"><span class="linenos">1260</span></a><span class="sd"> >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()</span> +</span><span id="Join.using-1261"><a href="#Join.using-1261"><span class="linenos">1261</span></a><span class="sd"> 'JOIN x USING (foo, bla)'</span> +</span><span id="Join.using-1262"><a href="#Join.using-1262"><span class="linenos">1262</span></a> +</span><span id="Join.using-1263"><a href="#Join.using-1263"><span class="linenos">1263</span></a><span class="sd"> Args:</span> +</span><span id="Join.using-1264"><a href="#Join.using-1264"><span class="linenos">1264</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Join.using-1265"><a href="#Join.using-1265"><span class="linenos">1265</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Join.using-1266"><a href="#Join.using-1266"><span class="linenos">1266</span></a><span class="sd"> append (bool): if `True`, concatenate the new expressions to the existing "using" list.</span> +</span><span id="Join.using-1267"><a href="#Join.using-1267"><span class="linenos">1267</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Join.using-1268"><a href="#Join.using-1268"><span class="linenos">1268</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Join.using-1269"><a href="#Join.using-1269"><span class="linenos">1269</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Join.using-1270"><a href="#Join.using-1270"><span class="linenos">1270</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Join.using-1271"><a href="#Join.using-1271"><span class="linenos">1271</span></a> +</span><span id="Join.using-1272"><a href="#Join.using-1272"><span class="linenos">1272</span></a><span class="sd"> Returns:</span> +</span><span id="Join.using-1273"><a href="#Join.using-1273"><span class="linenos">1273</span></a><span class="sd"> Join: the modified join expression.</span> +</span><span id="Join.using-1274"><a href="#Join.using-1274"><span class="linenos">1274</span></a><span class="sd"> """</span> +</span><span id="Join.using-1275"><a href="#Join.using-1275"><span class="linenos">1275</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Join.using-1276"><a href="#Join.using-1276"><span class="linenos">1276</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Join.using-1277"><a href="#Join.using-1277"><span class="linenos">1277</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Join.using-1278"><a href="#Join.using-1278"><span class="linenos">1278</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Join.using-1279"><a href="#Join.using-1279"><span class="linenos">1279</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Join.using-1280"><a href="#Join.using-1280"><span class="linenos">1280</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Join.using-1281"><a href="#Join.using-1281"><span class="linenos">1281</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Join.using-1282"><a href="#Join.using-1282"><span class="linenos">1282</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Join.using-1283"><a href="#Join.using-1283"><span class="linenos">1283</span></a> <span class="p">)</span> +</span><span id="Join.using-1284"><a href="#Join.using-1284"><span class="linenos">1284</span></a> +</span><span id="Join.using-1285"><a href="#Join.using-1285"><span class="linenos">1285</span></a> <span class="k">if</span> <span class="n">join</span><span class="o">.</span><span class="n">kind</span> <span class="o">==</span> <span class="s2">"CROSS"</span><span class="p">:</span> +</span><span id="Join.using-1286"><a href="#Join.using-1286"><span class="linenos">1286</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Join.using-1287"><a href="#Join.using-1287"><span class="linenos">1287</span></a> +</span><span id="Join.using-1288"><a href="#Join.using-1288"><span class="linenos">1288</span></a> <span class="k">return</span> <span class="n">join</span> </span></pre></div> @@ -14627,8 +14886,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Lateral"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Lateral-1280"><a href="#Lateral-1280"><span class="linenos">1280</span></a><span class="k">class</span> <span class="nc">Lateral</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="Lateral-1281"><a href="#Lateral-1281"><span class="linenos">1281</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"view"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"outer"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Lateral-1291"><a href="#Lateral-1291"><span class="linenos">1291</span></a><span class="k">class</span> <span class="nc">Lateral</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="Lateral-1292"><a href="#Lateral-1292"><span class="linenos">1292</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"view"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"outer"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -14694,16 +14953,16 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#MatchRecognize"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MatchRecognize-1284"><a href="#MatchRecognize-1284"><span class="linenos">1284</span></a><span class="k">class</span> <span class="nc">MatchRecognize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="MatchRecognize-1285"><a href="#MatchRecognize-1285"><span class="linenos">1285</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="MatchRecognize-1286"><a href="#MatchRecognize-1286"><span class="linenos">1286</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1287"><a href="#MatchRecognize-1287"><span class="linenos">1287</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1288"><a href="#MatchRecognize-1288"><span class="linenos">1288</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1289"><a href="#MatchRecognize-1289"><span class="linenos">1289</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1290"><a href="#MatchRecognize-1290"><span class="linenos">1290</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1291"><a href="#MatchRecognize-1291"><span class="linenos">1291</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1292"><a href="#MatchRecognize-1292"><span class="linenos">1292</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="MatchRecognize-1293"><a href="#MatchRecognize-1293"><span class="linenos">1293</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="MatchRecognize-1295"><a href="#MatchRecognize-1295"><span class="linenos">1295</span></a><span class="k">class</span> <span class="nc">MatchRecognize</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="MatchRecognize-1296"><a href="#MatchRecognize-1296"><span class="linenos">1296</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="MatchRecognize-1297"><a href="#MatchRecognize-1297"><span class="linenos">1297</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1298"><a href="#MatchRecognize-1298"><span class="linenos">1298</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1299"><a href="#MatchRecognize-1299"><span class="linenos">1299</span></a> <span class="s2">"measures"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1300"><a href="#MatchRecognize-1300"><span class="linenos">1300</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1301"><a href="#MatchRecognize-1301"><span class="linenos">1301</span></a> <span class="s2">"after"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1302"><a href="#MatchRecognize-1302"><span class="linenos">1302</span></a> <span class="s2">"pattern"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1303"><a href="#MatchRecognize-1303"><span class="linenos">1303</span></a> <span class="s2">"define"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="MatchRecognize-1304"><a href="#MatchRecognize-1304"><span class="linenos">1304</span></a> <span class="p">}</span> </span></pre></div> @@ -14763,8 +15022,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Final"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Final-1298"><a href="#Final-1298"><span class="linenos">1298</span></a><span class="k">class</span> <span class="nc">Final</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Final-1299"><a href="#Final-1299"><span class="linenos">1299</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Final-1309"><a href="#Final-1309"><span class="linenos">1309</span></a><span class="k">class</span> <span class="nc">Final</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Final-1310"><a href="#Final-1310"><span class="linenos">1310</span></a> <span class="k">pass</span> </span></pre></div> @@ -14824,8 +15083,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Offset"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Offset-1302"><a href="#Offset-1302"><span class="linenos">1302</span></a><span class="k">class</span> <span class="nc">Offset</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Offset-1303"><a href="#Offset-1303"><span class="linenos">1303</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Offset-1313"><a href="#Offset-1313"><span class="linenos">1313</span></a><span class="k">class</span> <span class="nc">Offset</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Offset-1314"><a href="#Offset-1314"><span class="linenos">1314</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -14885,8 +15144,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Order"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Order-1306"><a href="#Order-1306"><span class="linenos">1306</span></a><span class="k">class</span> <span class="nc">Order</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Order-1307"><a href="#Order-1307"><span class="linenos">1307</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Order-1317"><a href="#Order-1317"><span class="linenos">1317</span></a><span class="k">class</span> <span class="nc">Order</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Order-1318"><a href="#Order-1318"><span class="linenos">1318</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -14946,8 +15205,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Cluster"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Cluster-1312"><a href="#Cluster-1312"><span class="linenos">1312</span></a><span class="k">class</span> <span class="nc">Cluster</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="Cluster-1313"><a href="#Cluster-1313"><span class="linenos">1313</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cluster-1323"><a href="#Cluster-1323"><span class="linenos">1323</span></a><span class="k">class</span> <span class="nc">Cluster</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="Cluster-1324"><a href="#Cluster-1324"><span class="linenos">1324</span></a> <span class="k">pass</span> </span></pre></div> @@ -15007,8 +15266,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Distribute"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Distribute-1316"><a href="#Distribute-1316"><span class="linenos">1316</span></a><span class="k">class</span> <span class="nc">Distribute</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="Distribute-1317"><a href="#Distribute-1317"><span class="linenos">1317</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Distribute-1327"><a href="#Distribute-1327"><span class="linenos">1327</span></a><span class="k">class</span> <span class="nc">Distribute</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="Distribute-1328"><a href="#Distribute-1328"><span class="linenos">1328</span></a> <span class="k">pass</span> </span></pre></div> @@ -15068,8 +15327,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Sort"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sort-1320"><a href="#Sort-1320"><span class="linenos">1320</span></a><span class="k">class</span> <span class="nc">Sort</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> -</span><span id="Sort-1321"><a href="#Sort-1321"><span class="linenos">1321</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sort-1331"><a href="#Sort-1331"><span class="linenos">1331</span></a><span class="k">class</span> <span class="nc">Sort</span><span class="p">(</span><span class="n">Order</span><span class="p">):</span> +</span><span id="Sort-1332"><a href="#Sort-1332"><span class="linenos">1332</span></a> <span class="k">pass</span> </span></pre></div> @@ -15129,8 +15388,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Ordered"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Ordered-1324"><a href="#Ordered-1324"><span class="linenos">1324</span></a><span class="k">class</span> <span class="nc">Ordered</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Ordered-1325"><a href="#Ordered-1325"><span class="linenos">1325</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"desc"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"nulls_first"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Ordered-1335"><a href="#Ordered-1335"><span class="linenos">1335</span></a><span class="k">class</span> <span class="nc">Ordered</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Ordered-1336"><a href="#Ordered-1336"><span class="linenos">1336</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"desc"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"nulls_first"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15190,8 +15449,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Property"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Property-1328"><a href="#Property-1328"><span class="linenos">1328</span></a><span class="k">class</span> <span class="nc">Property</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Property-1329"><a href="#Property-1329"><span class="linenos">1329</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Property-1339"><a href="#Property-1339"><span class="linenos">1339</span></a><span class="k">class</span> <span class="nc">Property</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Property-1340"><a href="#Property-1340"><span class="linenos">1340</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"value"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15240,6 +15499,67 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> + <section id="AfterJournalProperty"> + <input id="AfterJournalProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">AfterJournalProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="AfterJournalProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#AfterJournalProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="AfterJournalProperty-1343"><a href="#AfterJournalProperty-1343"><span class="linenos">1343</span></a><span class="k">class</span> <span class="nc">AfterJournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="AfterJournalProperty-1344"><a href="#AfterJournalProperty-1344"><span class="linenos">1344</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="AfterJournalProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="AfterJournalProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="AfterJournalProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="AfterJournalProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="AfterJournalProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="AfterJournalProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="AfterJournalProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="AfterJournalProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="AfterJournalProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="AfterJournalProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="AfterJournalProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="AfterJournalProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="AfterJournalProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="AfterJournalProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="AfterJournalProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="AfterJournalProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="AfterJournalProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="AfterJournalProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="AfterJournalProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="AfterJournalProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="AfterJournalProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="AfterJournalProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="AfterJournalProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="AfterJournalProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="AfterJournalProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="AfterJournalProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="AfterJournalProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="AfterJournalProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="AfterJournalProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="AfterJournalProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="AfterJournalProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="AfterJournalProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="AfterJournalProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="AfterJournalProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> <section id="AlgorithmProperty"> <input id="AlgorithmProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -15251,8 +15571,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#AlgorithmProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AlgorithmProperty-1332"><a href="#AlgorithmProperty-1332"><span class="linenos">1332</span></a><span class="k">class</span> <span class="nc">AlgorithmProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="AlgorithmProperty-1333"><a href="#AlgorithmProperty-1333"><span class="linenos">1333</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AlgorithmProperty-1347"><a href="#AlgorithmProperty-1347"><span class="linenos">1347</span></a><span class="k">class</span> <span class="nc">AlgorithmProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="AlgorithmProperty-1348"><a href="#AlgorithmProperty-1348"><span class="linenos">1348</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15301,6 +15621,372 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> + <section id="AutoIncrementProperty"> + <input id="AutoIncrementProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">AutoIncrementProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="AutoIncrementProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#AutoIncrementProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementProperty-1351"><a href="#AutoIncrementProperty-1351"><span class="linenos">1351</span></a><span class="k">class</span> <span class="nc">AutoIncrementProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="AutoIncrementProperty-1352"><a href="#AutoIncrementProperty-1352"><span class="linenos">1352</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="AutoIncrementProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="AutoIncrementProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="AutoIncrementProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="AutoIncrementProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="AutoIncrementProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="AutoIncrementProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="AutoIncrementProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="AutoIncrementProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="AutoIncrementProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="AutoIncrementProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="AutoIncrementProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="AutoIncrementProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="AutoIncrementProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="AutoIncrementProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="AutoIncrementProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="AutoIncrementProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="AutoIncrementProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="AutoIncrementProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="AutoIncrementProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="AutoIncrementProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="AutoIncrementProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="AutoIncrementProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="AutoIncrementProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="AutoIncrementProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="AutoIncrementProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="AutoIncrementProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="AutoIncrementProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="AutoIncrementProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="AutoIncrementProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="AutoIncrementProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="AutoIncrementProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="AutoIncrementProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="AutoIncrementProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="AutoIncrementProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="BlockCompressionProperty"> + <input id="BlockCompressionProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">BlockCompressionProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="BlockCompressionProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#BlockCompressionProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="BlockCompressionProperty-1355"><a href="#BlockCompressionProperty-1355"><span class="linenos">1355</span></a><span class="k">class</span> <span class="nc">BlockCompressionProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="BlockCompressionProperty-1356"><a href="#BlockCompressionProperty-1356"><span class="linenos">1356</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"autotemp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"always"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"manual"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"never"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="BlockCompressionProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="BlockCompressionProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="BlockCompressionProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="BlockCompressionProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="BlockCompressionProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="BlockCompressionProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="BlockCompressionProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="BlockCompressionProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="BlockCompressionProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="BlockCompressionProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="BlockCompressionProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="BlockCompressionProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="BlockCompressionProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="BlockCompressionProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="BlockCompressionProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="BlockCompressionProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="BlockCompressionProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="BlockCompressionProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="BlockCompressionProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="BlockCompressionProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="BlockCompressionProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="BlockCompressionProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="BlockCompressionProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="BlockCompressionProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="BlockCompressionProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="BlockCompressionProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="BlockCompressionProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="BlockCompressionProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="BlockCompressionProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="BlockCompressionProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="BlockCompressionProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="BlockCompressionProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="BlockCompressionProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="BlockCompressionProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="CharacterSetProperty"> + <input id="CharacterSetProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">CharacterSetProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="CharacterSetProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#CharacterSetProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetProperty-1359"><a href="#CharacterSetProperty-1359"><span class="linenos">1359</span></a><span class="k">class</span> <span class="nc">CharacterSetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="CharacterSetProperty-1360"><a href="#CharacterSetProperty-1360"><span class="linenos">1360</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="CharacterSetProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="CharacterSetProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="CharacterSetProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="CharacterSetProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="CharacterSetProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="CharacterSetProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="CharacterSetProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="CharacterSetProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="CharacterSetProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="CharacterSetProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="CharacterSetProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="CharacterSetProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="CharacterSetProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="CharacterSetProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="CharacterSetProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="CharacterSetProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="CharacterSetProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="CharacterSetProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="CharacterSetProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="CharacterSetProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="CharacterSetProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="CharacterSetProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="CharacterSetProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="CharacterSetProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="CharacterSetProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="CharacterSetProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="CharacterSetProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="CharacterSetProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="CharacterSetProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="CharacterSetProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="CharacterSetProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="CharacterSetProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="CharacterSetProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="CharacterSetProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="ChecksumProperty"> + <input id="ChecksumProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">ChecksumProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="ChecksumProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#ChecksumProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="ChecksumProperty-1363"><a href="#ChecksumProperty-1363"><span class="linenos">1363</span></a><span class="k">class</span> <span class="nc">ChecksumProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ChecksumProperty-1364"><a href="#ChecksumProperty-1364"><span class="linenos">1364</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="ChecksumProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="ChecksumProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="ChecksumProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="ChecksumProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="ChecksumProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="ChecksumProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="ChecksumProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="ChecksumProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="ChecksumProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="ChecksumProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="ChecksumProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="ChecksumProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="ChecksumProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="ChecksumProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="ChecksumProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="ChecksumProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="ChecksumProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="ChecksumProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="ChecksumProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="ChecksumProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="ChecksumProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="ChecksumProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="ChecksumProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="ChecksumProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="ChecksumProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="ChecksumProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="ChecksumProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="ChecksumProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="ChecksumProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="ChecksumProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="ChecksumProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="ChecksumProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="ChecksumProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="ChecksumProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="CollateProperty"> + <input id="CollateProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">CollateProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="CollateProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#CollateProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="CollateProperty-1367"><a href="#CollateProperty-1367"><span class="linenos">1367</span></a><span class="k">class</span> <span class="nc">CollateProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="CollateProperty-1368"><a href="#CollateProperty-1368"><span class="linenos">1368</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="CollateProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="CollateProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="CollateProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="CollateProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="CollateProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="CollateProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="CollateProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="CollateProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="CollateProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="CollateProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="CollateProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="CollateProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="CollateProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="CollateProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="CollateProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="CollateProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="CollateProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="CollateProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="CollateProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="CollateProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="CollateProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="CollateProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="CollateProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="CollateProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="CollateProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="CollateProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="CollateProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="CollateProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="CollateProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="CollateProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="CollateProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="CollateProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="CollateProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="CollateProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="DataBlocksizeProperty"> + <input id="DataBlocksizeProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">DataBlocksizeProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="DataBlocksizeProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#DataBlocksizeProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataBlocksizeProperty-1371"><a href="#DataBlocksizeProperty-1371"><span class="linenos">1371</span></a><span class="k">class</span> <span class="nc">DataBlocksizeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DataBlocksizeProperty-1372"><a href="#DataBlocksizeProperty-1372"><span class="linenos">1372</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="DataBlocksizeProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="DataBlocksizeProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="DataBlocksizeProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="DataBlocksizeProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="DataBlocksizeProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="DataBlocksizeProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="DataBlocksizeProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="DataBlocksizeProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="DataBlocksizeProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="DataBlocksizeProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="DataBlocksizeProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="DataBlocksizeProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="DataBlocksizeProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="DataBlocksizeProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="DataBlocksizeProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="DataBlocksizeProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="DataBlocksizeProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="DataBlocksizeProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="DataBlocksizeProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="DataBlocksizeProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="DataBlocksizeProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="DataBlocksizeProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="DataBlocksizeProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="DataBlocksizeProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="DataBlocksizeProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="DataBlocksizeProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="DataBlocksizeProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="DataBlocksizeProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="DataBlocksizeProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="DataBlocksizeProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="DataBlocksizeProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="DataBlocksizeProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="DataBlocksizeProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="DataBlocksizeProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> <section id="DefinerProperty"> <input id="DefinerProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -15312,8 +15998,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#DefinerProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DefinerProperty-1336"><a href="#DefinerProperty-1336"><span class="linenos">1336</span></a><span class="k">class</span> <span class="nc">DefinerProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DefinerProperty-1337"><a href="#DefinerProperty-1337"><span class="linenos">1337</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DefinerProperty-1375"><a href="#DefinerProperty-1375"><span class="linenos">1375</span></a><span class="k">class</span> <span class="nc">DefinerProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DefinerProperty-1376"><a href="#DefinerProperty-1376"><span class="linenos">1376</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15362,19 +16048,19 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> - <section id="SqlSecurityProperty"> - <input id="SqlSecurityProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="DistKeyProperty"> + <input id="DistKeyProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">SqlSecurityProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">DistKeyProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="SqlSecurityProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="DistKeyProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#SqlSecurityProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SqlSecurityProperty-1340"><a href="#SqlSecurityProperty-1340"><span class="linenos">1340</span></a><span class="k">class</span> <span class="nc">SqlSecurityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="SqlSecurityProperty-1341"><a href="#SqlSecurityProperty-1341"><span class="linenos">1341</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"definer"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#DistKeyProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="DistKeyProperty-1379"><a href="#DistKeyProperty-1379"><span class="linenos">1379</span></a><span class="k">class</span> <span class="nc">DistKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DistKeyProperty-1380"><a href="#DistKeyProperty-1380"><span class="linenos">1380</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15384,58 +16070,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="SqlSecurityProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="SqlSecurityProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="SqlSecurityProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="SqlSecurityProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="SqlSecurityProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="SqlSecurityProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="SqlSecurityProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="SqlSecurityProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="SqlSecurityProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="SqlSecurityProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="SqlSecurityProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="SqlSecurityProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="SqlSecurityProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="SqlSecurityProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="SqlSecurityProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="SqlSecurityProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="SqlSecurityProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="SqlSecurityProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="SqlSecurityProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="SqlSecurityProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="SqlSecurityProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="SqlSecurityProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="SqlSecurityProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="SqlSecurityProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="SqlSecurityProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="SqlSecurityProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="SqlSecurityProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="SqlSecurityProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="SqlSecurityProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="SqlSecurityProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="SqlSecurityProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="SqlSecurityProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="SqlSecurityProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="SqlSecurityProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="DistKeyProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="DistKeyProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="DistKeyProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="DistKeyProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="DistKeyProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="DistKeyProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="DistKeyProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="DistKeyProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="DistKeyProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="DistKeyProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="DistKeyProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="DistKeyProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="DistKeyProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="DistKeyProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="DistKeyProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="DistKeyProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="DistKeyProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="DistKeyProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="DistKeyProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="DistKeyProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="DistKeyProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="DistKeyProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="DistKeyProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="DistKeyProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="DistKeyProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="DistKeyProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="DistKeyProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="DistKeyProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="DistKeyProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="DistKeyProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="DistKeyProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="DistKeyProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="DistKeyProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="DistKeyProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="TableFormatProperty"> - <input id="TableFormatProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="DistStyleProperty"> + <input id="DistStyleProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">TableFormatProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">DistStyleProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="TableFormatProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="DistStyleProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#TableFormatProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TableFormatProperty-1344"><a href="#TableFormatProperty-1344"><span class="linenos">1344</span></a><span class="k">class</span> <span class="nc">TableFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="TableFormatProperty-1345"><a href="#TableFormatProperty-1345"><span class="linenos">1345</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#DistStyleProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="DistStyleProperty-1383"><a href="#DistStyleProperty-1383"><span class="linenos">1383</span></a><span class="k">class</span> <span class="nc">DistStyleProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="DistStyleProperty-1384"><a href="#DistStyleProperty-1384"><span class="linenos">1384</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15445,58 +16131,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="TableFormatProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="TableFormatProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="TableFormatProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="TableFormatProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="TableFormatProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="TableFormatProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="TableFormatProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="TableFormatProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="TableFormatProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="TableFormatProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="TableFormatProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="TableFormatProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="TableFormatProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="TableFormatProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="TableFormatProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="TableFormatProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="TableFormatProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="TableFormatProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="TableFormatProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="TableFormatProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="TableFormatProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="TableFormatProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="TableFormatProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="TableFormatProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="TableFormatProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="TableFormatProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="TableFormatProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="TableFormatProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="TableFormatProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="TableFormatProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="TableFormatProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="TableFormatProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="TableFormatProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="TableFormatProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="DistStyleProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="DistStyleProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="DistStyleProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="DistStyleProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="DistStyleProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="DistStyleProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="DistStyleProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="DistStyleProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="DistStyleProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="DistStyleProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="DistStyleProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="DistStyleProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="DistStyleProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="DistStyleProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="DistStyleProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="DistStyleProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="DistStyleProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="DistStyleProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="DistStyleProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="DistStyleProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="DistStyleProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="DistStyleProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="DistStyleProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="DistStyleProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="DistStyleProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="DistStyleProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="DistStyleProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="DistStyleProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="DistStyleProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="DistStyleProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="DistStyleProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="DistStyleProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="DistStyleProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="DistStyleProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="PartitionedByProperty"> - <input id="PartitionedByProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="EngineProperty"> + <input id="EngineProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">PartitionedByProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">EngineProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="PartitionedByProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="EngineProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#PartitionedByProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PartitionedByProperty-1348"><a href="#PartitionedByProperty-1348"><span class="linenos">1348</span></a><span class="k">class</span> <span class="nc">PartitionedByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="PartitionedByProperty-1349"><a href="#PartitionedByProperty-1349"><span class="linenos">1349</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#EngineProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="EngineProperty-1387"><a href="#EngineProperty-1387"><span class="linenos">1387</span></a><span class="k">class</span> <span class="nc">EngineProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="EngineProperty-1388"><a href="#EngineProperty-1388"><span class="linenos">1388</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15506,40 +16192,223 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="PartitionedByProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="PartitionedByProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="PartitionedByProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="PartitionedByProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="PartitionedByProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="PartitionedByProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="PartitionedByProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="PartitionedByProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="PartitionedByProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="PartitionedByProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="PartitionedByProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="PartitionedByProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="PartitionedByProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="PartitionedByProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="PartitionedByProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="PartitionedByProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="PartitionedByProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="PartitionedByProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="PartitionedByProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="PartitionedByProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="PartitionedByProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="PartitionedByProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="PartitionedByProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="PartitionedByProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="PartitionedByProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="PartitionedByProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="PartitionedByProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="PartitionedByProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="PartitionedByProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="PartitionedByProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="PartitionedByProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="PartitionedByProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="PartitionedByProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="PartitionedByProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="EngineProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="EngineProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="EngineProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="EngineProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="EngineProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="EngineProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="EngineProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="EngineProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="EngineProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="EngineProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="EngineProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="EngineProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="EngineProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="EngineProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="EngineProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="EngineProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="EngineProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="EngineProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="EngineProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="EngineProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="EngineProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="EngineProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="EngineProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="EngineProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="EngineProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="EngineProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="EngineProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="EngineProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="EngineProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="EngineProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="EngineProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="EngineProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="EngineProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="EngineProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="ExecuteAsProperty"> + <input id="ExecuteAsProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">ExecuteAsProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="ExecuteAsProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#ExecuteAsProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="ExecuteAsProperty-1391"><a href="#ExecuteAsProperty-1391"><span class="linenos">1391</span></a><span class="k">class</span> <span class="nc">ExecuteAsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ExecuteAsProperty-1392"><a href="#ExecuteAsProperty-1392"><span class="linenos">1392</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="ExecuteAsProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="ExecuteAsProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="ExecuteAsProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="ExecuteAsProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="ExecuteAsProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="ExecuteAsProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="ExecuteAsProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="ExecuteAsProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="ExecuteAsProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="ExecuteAsProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="ExecuteAsProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="ExecuteAsProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="ExecuteAsProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="ExecuteAsProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="ExecuteAsProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="ExecuteAsProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="ExecuteAsProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="ExecuteAsProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="ExecuteAsProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="ExecuteAsProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="ExecuteAsProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="ExecuteAsProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="ExecuteAsProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="ExecuteAsProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="ExecuteAsProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="ExecuteAsProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="ExecuteAsProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="ExecuteAsProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="ExecuteAsProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="ExecuteAsProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="ExecuteAsProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="ExecuteAsProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="ExecuteAsProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="ExecuteAsProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="ExternalProperty"> + <input id="ExternalProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">ExternalProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="ExternalProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#ExternalProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="ExternalProperty-1395"><a href="#ExternalProperty-1395"><span class="linenos">1395</span></a><span class="k">class</span> <span class="nc">ExternalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ExternalProperty-1396"><a href="#ExternalProperty-1396"><span class="linenos">1396</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="ExternalProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="ExternalProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="ExternalProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="ExternalProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="ExternalProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="ExternalProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="ExternalProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="ExternalProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="ExternalProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="ExternalProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="ExternalProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="ExternalProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="ExternalProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="ExternalProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="ExternalProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="ExternalProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="ExternalProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="ExternalProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="ExternalProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="ExternalProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="ExternalProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="ExternalProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="ExternalProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="ExternalProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="ExternalProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="ExternalProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="ExternalProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="ExternalProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="ExternalProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="ExternalProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="ExternalProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="ExternalProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="ExternalProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="ExternalProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="FallbackProperty"> + <input id="FallbackProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">FallbackProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="FallbackProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#FallbackProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="FallbackProperty-1399"><a href="#FallbackProperty-1399"><span class="linenos">1399</span></a><span class="k">class</span> <span class="nc">FallbackProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="FallbackProperty-1400"><a href="#FallbackProperty-1400"><span class="linenos">1400</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"protection"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="FallbackProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="FallbackProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="FallbackProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="FallbackProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="FallbackProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="FallbackProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="FallbackProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="FallbackProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="FallbackProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="FallbackProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="FallbackProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="FallbackProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="FallbackProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="FallbackProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="FallbackProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="FallbackProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="FallbackProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="FallbackProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="FallbackProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="FallbackProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="FallbackProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="FallbackProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="FallbackProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="FallbackProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="FallbackProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="FallbackProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="FallbackProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="FallbackProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="FallbackProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="FallbackProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="FallbackProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="FallbackProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="FallbackProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="FallbackProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> @@ -15556,8 +16425,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#FileFormatProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FileFormatProperty-1352"><a href="#FileFormatProperty-1352"><span class="linenos">1352</span></a><span class="k">class</span> <span class="nc">FileFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="FileFormatProperty-1353"><a href="#FileFormatProperty-1353"><span class="linenos">1353</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="FileFormatProperty-1403"><a href="#FileFormatProperty-1403"><span class="linenos">1403</span></a><span class="k">class</span> <span class="nc">FileFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="FileFormatProperty-1404"><a href="#FileFormatProperty-1404"><span class="linenos">1404</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15606,19 +16475,19 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> - <section id="DistKeyProperty"> - <input id="DistKeyProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="FreespaceProperty"> + <input id="FreespaceProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">DistKeyProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">FreespaceProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="DistKeyProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="FreespaceProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#DistKeyProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DistKeyProperty-1356"><a href="#DistKeyProperty-1356"><span class="linenos">1356</span></a><span class="k">class</span> <span class="nc">DistKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DistKeyProperty-1357"><a href="#DistKeyProperty-1357"><span class="linenos">1357</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#FreespaceProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="FreespaceProperty-1407"><a href="#FreespaceProperty-1407"><span class="linenos">1407</span></a><span class="k">class</span> <span class="nc">FreespaceProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="FreespaceProperty-1408"><a href="#FreespaceProperty-1408"><span class="linenos">1408</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -15628,58 +16497,64 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="DistKeyProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="DistKeyProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="DistKeyProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="DistKeyProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="DistKeyProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="DistKeyProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="DistKeyProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="DistKeyProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="DistKeyProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="DistKeyProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="DistKeyProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="DistKeyProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="DistKeyProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="DistKeyProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="DistKeyProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="DistKeyProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="DistKeyProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="DistKeyProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="DistKeyProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="DistKeyProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="DistKeyProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="DistKeyProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="DistKeyProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="DistKeyProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="DistKeyProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="DistKeyProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="DistKeyProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="DistKeyProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="DistKeyProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="DistKeyProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="DistKeyProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="DistKeyProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="DistKeyProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="DistKeyProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="FreespaceProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="FreespaceProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="FreespaceProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="FreespaceProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="FreespaceProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="FreespaceProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="FreespaceProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="FreespaceProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="FreespaceProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="FreespaceProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="FreespaceProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="FreespaceProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="FreespaceProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="FreespaceProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="FreespaceProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="FreespaceProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="FreespaceProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="FreespaceProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="FreespaceProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="FreespaceProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="FreespaceProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="FreespaceProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="FreespaceProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="FreespaceProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="FreespaceProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="FreespaceProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="FreespaceProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="FreespaceProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="FreespaceProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="FreespaceProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="FreespaceProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="FreespaceProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="FreespaceProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="FreespaceProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="SortKeyProperty"> - <input id="SortKeyProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="IsolatedLoadingProperty"> + <input id="IsolatedLoadingProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">SortKeyProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">IsolatedLoadingProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="SortKeyProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="IsolatedLoadingProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#SortKeyProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SortKeyProperty-1360"><a href="#SortKeyProperty-1360"><span class="linenos">1360</span></a><span class="k">class</span> <span class="nc">SortKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="SortKeyProperty-1361"><a href="#SortKeyProperty-1361"><span class="linenos">1361</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"compound"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#IsolatedLoadingProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="IsolatedLoadingProperty-1411"><a href="#IsolatedLoadingProperty-1411"><span class="linenos">1411</span></a><span class="k">class</span> <span class="nc">IsolatedLoadingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="IsolatedLoadingProperty-1412"><a href="#IsolatedLoadingProperty-1412"><span class="linenos">1412</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="IsolatedLoadingProperty-1413"><a href="#IsolatedLoadingProperty-1413"><span class="linenos">1413</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1414"><a href="#IsolatedLoadingProperty-1414"><span class="linenos">1414</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1415"><a href="#IsolatedLoadingProperty-1415"><span class="linenos">1415</span></a> <span class="s2">"for_all"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1416"><a href="#IsolatedLoadingProperty-1416"><span class="linenos">1416</span></a> <span class="s2">"for_insert"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1417"><a href="#IsolatedLoadingProperty-1417"><span class="linenos">1417</span></a> <span class="s2">"for_none"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="IsolatedLoadingProperty-1418"><a href="#IsolatedLoadingProperty-1418"><span class="linenos">1418</span></a> <span class="p">}</span> </span></pre></div> @@ -15689,58 +16564,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="SortKeyProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="SortKeyProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="SortKeyProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="SortKeyProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="SortKeyProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="SortKeyProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="SortKeyProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="SortKeyProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="SortKeyProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="SortKeyProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="SortKeyProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="SortKeyProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="SortKeyProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="SortKeyProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="SortKeyProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="SortKeyProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="SortKeyProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="SortKeyProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="SortKeyProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="SortKeyProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="SortKeyProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="SortKeyProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="SortKeyProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="SortKeyProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="SortKeyProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="SortKeyProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="SortKeyProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="SortKeyProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="SortKeyProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="SortKeyProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="SortKeyProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="SortKeyProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="SortKeyProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="SortKeyProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="IsolatedLoadingProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="IsolatedLoadingProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="IsolatedLoadingProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="IsolatedLoadingProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="IsolatedLoadingProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="IsolatedLoadingProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="IsolatedLoadingProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="IsolatedLoadingProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="IsolatedLoadingProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="IsolatedLoadingProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="IsolatedLoadingProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="IsolatedLoadingProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="IsolatedLoadingProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="IsolatedLoadingProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="IsolatedLoadingProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="IsolatedLoadingProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="IsolatedLoadingProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="IsolatedLoadingProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="IsolatedLoadingProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="IsolatedLoadingProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="IsolatedLoadingProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="IsolatedLoadingProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="IsolatedLoadingProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="IsolatedLoadingProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="IsolatedLoadingProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="IsolatedLoadingProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="IsolatedLoadingProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="IsolatedLoadingProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="IsolatedLoadingProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="IsolatedLoadingProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="IsolatedLoadingProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="IsolatedLoadingProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="IsolatedLoadingProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="IsolatedLoadingProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="DistStyleProperty"> - <input id="DistStyleProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="JournalProperty"> + <input id="JournalProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">DistStyleProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">JournalProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="DistStyleProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="JournalProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#DistStyleProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DistStyleProperty-1364"><a href="#DistStyleProperty-1364"><span class="linenos">1364</span></a><span class="k">class</span> <span class="nc">DistStyleProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DistStyleProperty-1365"><a href="#DistStyleProperty-1365"><span class="linenos">1365</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#JournalProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="JournalProperty-1421"><a href="#JournalProperty-1421"><span class="linenos">1421</span></a><span class="k">class</span> <span class="nc">JournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="JournalProperty-1422"><a href="#JournalProperty-1422"><span class="linenos">1422</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -15750,40 +16625,101 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="DistStyleProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="DistStyleProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="DistStyleProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="DistStyleProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="DistStyleProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="DistStyleProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="DistStyleProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="DistStyleProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="DistStyleProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="DistStyleProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="DistStyleProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="DistStyleProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="DistStyleProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="DistStyleProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="DistStyleProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="DistStyleProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="DistStyleProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="DistStyleProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="DistStyleProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="DistStyleProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="DistStyleProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="DistStyleProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="DistStyleProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="DistStyleProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="DistStyleProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="DistStyleProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="DistStyleProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="DistStyleProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="DistStyleProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="DistStyleProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="DistStyleProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="DistStyleProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="DistStyleProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="DistStyleProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="JournalProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="JournalProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="JournalProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="JournalProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="JournalProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="JournalProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="JournalProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="JournalProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="JournalProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="JournalProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="JournalProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="JournalProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="JournalProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="JournalProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="JournalProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="JournalProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="JournalProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="JournalProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="JournalProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="JournalProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="JournalProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="JournalProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="JournalProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="JournalProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="JournalProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="JournalProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="JournalProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="JournalProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="JournalProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="JournalProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="JournalProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="JournalProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="JournalProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="JournalProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> + <section id="LanguageProperty"> + <input id="LanguageProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">LanguageProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="LanguageProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#LanguageProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="LanguageProperty-1425"><a href="#LanguageProperty-1425"><span class="linenos">1425</span></a><span class="k">class</span> <span class="nc">LanguageProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="LanguageProperty-1426"><a href="#LanguageProperty-1426"><span class="linenos">1426</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="LanguageProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="LanguageProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="LanguageProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="LanguageProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="LanguageProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="LanguageProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="LanguageProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="LanguageProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="LanguageProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="LanguageProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="LanguageProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="LanguageProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="LanguageProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="LanguageProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="LanguageProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="LanguageProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="LanguageProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="LanguageProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="LanguageProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="LanguageProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="LanguageProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="LanguageProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="LanguageProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="LanguageProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="LanguageProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="LanguageProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="LanguageProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="LanguageProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="LanguageProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="LanguageProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="LanguageProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="LanguageProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="LanguageProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="LanguageProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> @@ -15800,8 +16736,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#LikeProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LikeProperty-1368"><a href="#LikeProperty-1368"><span class="linenos">1368</span></a><span class="k">class</span> <span class="nc">LikeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="LikeProperty-1369"><a href="#LikeProperty-1369"><span class="linenos">1369</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LikeProperty-1429"><a href="#LikeProperty-1429"><span class="linenos">1429</span></a><span class="k">class</span> <span class="nc">LikeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="LikeProperty-1430"><a href="#LikeProperty-1430"><span class="linenos">1430</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -15861,8 +16797,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#LocationProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LocationProperty-1372"><a href="#LocationProperty-1372"><span class="linenos">1372</span></a><span class="k">class</span> <span class="nc">LocationProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="LocationProperty-1373"><a href="#LocationProperty-1373"><span class="linenos">1373</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LocationProperty-1433"><a href="#LocationProperty-1433"><span class="linenos">1433</span></a><span class="k">class</span> <span class="nc">LocationProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="LocationProperty-1434"><a href="#LocationProperty-1434"><span class="linenos">1434</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -15911,80 +16847,25 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> - <section id="EngineProperty"> - <input id="EngineProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> -<div class="attr class"> - - <span class="def">class</span> - <span class="name">EngineProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - - <label class="view-source-button" for="EngineProperty-view-source"><span>View Source</span></label> - - </div> - <a class="headerlink" href="#EngineProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="EngineProperty-1376"><a href="#EngineProperty-1376"><span class="linenos">1376</span></a><span class="k">class</span> <span class="nc">EngineProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="EngineProperty-1377"><a href="#EngineProperty-1377"><span class="linenos">1377</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span></pre></div> - - - - - <div class="inherited"> - <h5>Inherited Members</h5> - <dl> - <div><dt><a href="#Expression">Expression</a></dt> - <dd id="EngineProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="EngineProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="EngineProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="EngineProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="EngineProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="EngineProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="EngineProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="EngineProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="EngineProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="EngineProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="EngineProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="EngineProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="EngineProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="EngineProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="EngineProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="EngineProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="EngineProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="EngineProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="EngineProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="EngineProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="EngineProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="EngineProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="EngineProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="EngineProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="EngineProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="EngineProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="EngineProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="EngineProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="EngineProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="EngineProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="EngineProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="EngineProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="EngineProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="EngineProperty.load" class="function"><a href="#Expression.load">load</a></dd> - - </div> - </dl> - </div> - </section> - <section id="AutoIncrementProperty"> - <input id="AutoIncrementProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="LockingProperty"> + <input id="LockingProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">AutoIncrementProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">LockingProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="AutoIncrementProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="LockingProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#AutoIncrementProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AutoIncrementProperty-1380"><a href="#AutoIncrementProperty-1380"><span class="linenos">1380</span></a><span class="k">class</span> <span class="nc">AutoIncrementProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="AutoIncrementProperty-1381"><a href="#AutoIncrementProperty-1381"><span class="linenos">1381</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#LockingProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="LockingProperty-1437"><a href="#LockingProperty-1437"><span class="linenos">1437</span></a><span class="k">class</span> <span class="nc">LockingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="LockingProperty-1438"><a href="#LockingProperty-1438"><span class="linenos">1438</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="LockingProperty-1439"><a href="#LockingProperty-1439"><span class="linenos">1439</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LockingProperty-1440"><a href="#LockingProperty-1440"><span class="linenos">1440</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LockingProperty-1441"><a href="#LockingProperty-1441"><span class="linenos">1441</span></a> <span class="s2">"for_or_in"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LockingProperty-1442"><a href="#LockingProperty-1442"><span class="linenos">1442</span></a> <span class="s2">"lock_type"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="LockingProperty-1443"><a href="#LockingProperty-1443"><span class="linenos">1443</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="LockingProperty-1444"><a href="#LockingProperty-1444"><span class="linenos">1444</span></a> <span class="p">}</span> </span></pre></div> @@ -15994,58 +16875,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="AutoIncrementProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="AutoIncrementProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="AutoIncrementProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="AutoIncrementProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="AutoIncrementProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="AutoIncrementProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="AutoIncrementProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="AutoIncrementProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="AutoIncrementProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="AutoIncrementProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="AutoIncrementProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="AutoIncrementProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="AutoIncrementProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="AutoIncrementProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="AutoIncrementProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="AutoIncrementProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="AutoIncrementProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="AutoIncrementProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="AutoIncrementProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="AutoIncrementProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="AutoIncrementProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="AutoIncrementProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="AutoIncrementProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="AutoIncrementProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="AutoIncrementProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="AutoIncrementProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="AutoIncrementProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="AutoIncrementProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="AutoIncrementProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="AutoIncrementProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="AutoIncrementProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="AutoIncrementProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="AutoIncrementProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="AutoIncrementProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="LockingProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="LockingProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="LockingProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="LockingProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="LockingProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="LockingProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="LockingProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="LockingProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="LockingProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="LockingProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="LockingProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="LockingProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="LockingProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="LockingProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="LockingProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="LockingProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="LockingProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="LockingProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="LockingProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="LockingProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="LockingProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="LockingProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="LockingProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="LockingProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="LockingProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="LockingProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="LockingProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="LockingProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="LockingProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="LockingProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="LockingProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="LockingProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="LockingProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="LockingProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="CharacterSetProperty"> - <input id="CharacterSetProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="LogProperty"> + <input id="LogProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">CharacterSetProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">LogProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="CharacterSetProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="LogProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#CharacterSetProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CharacterSetProperty-1384"><a href="#CharacterSetProperty-1384"><span class="linenos">1384</span></a><span class="k">class</span> <span class="nc">CharacterSetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="CharacterSetProperty-1385"><a href="#CharacterSetProperty-1385"><span class="linenos">1385</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#LogProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="LogProperty-1447"><a href="#LogProperty-1447"><span class="linenos">1447</span></a><span class="k">class</span> <span class="nc">LogProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="LogProperty-1448"><a href="#LogProperty-1448"><span class="linenos">1448</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16055,58 +16936,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="CharacterSetProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="CharacterSetProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="CharacterSetProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="CharacterSetProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="CharacterSetProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="CharacterSetProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="CharacterSetProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="CharacterSetProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="CharacterSetProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="CharacterSetProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="CharacterSetProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="CharacterSetProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="CharacterSetProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="CharacterSetProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="CharacterSetProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="CharacterSetProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="CharacterSetProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="CharacterSetProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="CharacterSetProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="CharacterSetProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="CharacterSetProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="CharacterSetProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="CharacterSetProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="CharacterSetProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="CharacterSetProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="CharacterSetProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="CharacterSetProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="CharacterSetProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="CharacterSetProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="CharacterSetProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="CharacterSetProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="CharacterSetProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="CharacterSetProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="CharacterSetProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="LogProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="LogProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="LogProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="LogProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="LogProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="LogProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="LogProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="LogProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="LogProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="LogProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="LogProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="LogProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="LogProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="LogProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="LogProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="LogProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="LogProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="LogProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="LogProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="LogProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="LogProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="LogProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="LogProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="LogProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="LogProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="LogProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="LogProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="LogProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="LogProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="LogProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="LogProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="LogProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="LogProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="LogProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="CollateProperty"> - <input id="CollateProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="MaterializedProperty"> + <input id="MaterializedProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">CollateProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">MaterializedProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="CollateProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="MaterializedProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#CollateProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CollateProperty-1388"><a href="#CollateProperty-1388"><span class="linenos">1388</span></a><span class="k">class</span> <span class="nc">CollateProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="CollateProperty-1389"><a href="#CollateProperty-1389"><span class="linenos">1389</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#MaterializedProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="MaterializedProperty-1451"><a href="#MaterializedProperty-1451"><span class="linenos">1451</span></a><span class="k">class</span> <span class="nc">MaterializedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="MaterializedProperty-1452"><a href="#MaterializedProperty-1452"><span class="linenos">1452</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16116,58 +16997,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="CollateProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="CollateProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="CollateProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="CollateProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="CollateProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="CollateProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="CollateProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="CollateProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="CollateProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="CollateProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="CollateProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="CollateProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="CollateProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="CollateProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="CollateProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="CollateProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="CollateProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="CollateProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="CollateProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="CollateProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="CollateProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="CollateProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="CollateProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="CollateProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="CollateProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="CollateProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="CollateProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="CollateProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="CollateProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="CollateProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="CollateProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="CollateProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="CollateProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="CollateProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="MaterializedProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="MaterializedProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="MaterializedProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="MaterializedProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="MaterializedProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="MaterializedProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="MaterializedProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="MaterializedProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="MaterializedProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="MaterializedProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="MaterializedProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="MaterializedProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="MaterializedProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="MaterializedProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="MaterializedProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="MaterializedProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="MaterializedProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="MaterializedProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="MaterializedProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="MaterializedProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="MaterializedProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="MaterializedProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="MaterializedProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="MaterializedProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="MaterializedProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="MaterializedProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="MaterializedProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="MaterializedProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="MaterializedProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="MaterializedProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="MaterializedProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="MaterializedProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="MaterializedProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="MaterializedProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="SchemaCommentProperty"> - <input id="SchemaCommentProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="MergeBlockRatioProperty"> + <input id="MergeBlockRatioProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">SchemaCommentProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">MergeBlockRatioProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="SchemaCommentProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="MergeBlockRatioProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#SchemaCommentProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SchemaCommentProperty-1392"><a href="#SchemaCommentProperty-1392"><span class="linenos">1392</span></a><span class="k">class</span> <span class="nc">SchemaCommentProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="SchemaCommentProperty-1393"><a href="#SchemaCommentProperty-1393"><span class="linenos">1393</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#MergeBlockRatioProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="MergeBlockRatioProperty-1455"><a href="#MergeBlockRatioProperty-1455"><span class="linenos">1455</span></a><span class="k">class</span> <span class="nc">MergeBlockRatioProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="MergeBlockRatioProperty-1456"><a href="#MergeBlockRatioProperty-1456"><span class="linenos">1456</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16177,58 +17058,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="SchemaCommentProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="SchemaCommentProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="SchemaCommentProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="SchemaCommentProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="SchemaCommentProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="SchemaCommentProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="SchemaCommentProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="SchemaCommentProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="SchemaCommentProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="SchemaCommentProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="SchemaCommentProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="SchemaCommentProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="SchemaCommentProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="SchemaCommentProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="SchemaCommentProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="SchemaCommentProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="SchemaCommentProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="SchemaCommentProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="SchemaCommentProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="SchemaCommentProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="SchemaCommentProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="SchemaCommentProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="SchemaCommentProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="SchemaCommentProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="SchemaCommentProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="SchemaCommentProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="SchemaCommentProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="SchemaCommentProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="SchemaCommentProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="SchemaCommentProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="SchemaCommentProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="SchemaCommentProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="SchemaCommentProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="SchemaCommentProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="MergeBlockRatioProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="MergeBlockRatioProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="MergeBlockRatioProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="MergeBlockRatioProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="MergeBlockRatioProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="MergeBlockRatioProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="MergeBlockRatioProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="MergeBlockRatioProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="MergeBlockRatioProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="MergeBlockRatioProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="MergeBlockRatioProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="MergeBlockRatioProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="MergeBlockRatioProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="MergeBlockRatioProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="MergeBlockRatioProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="MergeBlockRatioProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="MergeBlockRatioProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="MergeBlockRatioProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="MergeBlockRatioProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="MergeBlockRatioProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="MergeBlockRatioProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="MergeBlockRatioProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="MergeBlockRatioProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="MergeBlockRatioProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="MergeBlockRatioProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="MergeBlockRatioProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="MergeBlockRatioProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="MergeBlockRatioProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="MergeBlockRatioProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="MergeBlockRatioProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="MergeBlockRatioProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="MergeBlockRatioProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="MergeBlockRatioProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="MergeBlockRatioProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="ReturnsProperty"> - <input id="ReturnsProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="NoPrimaryIndexProperty"> + <input id="NoPrimaryIndexProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">ReturnsProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">NoPrimaryIndexProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="ReturnsProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="NoPrimaryIndexProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#ReturnsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ReturnsProperty-1396"><a href="#ReturnsProperty-1396"><span class="linenos">1396</span></a><span class="k">class</span> <span class="nc">ReturnsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="ReturnsProperty-1397"><a href="#ReturnsProperty-1397"><span class="linenos">1397</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#NoPrimaryIndexProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="NoPrimaryIndexProperty-1459"><a href="#NoPrimaryIndexProperty-1459"><span class="linenos">1459</span></a><span class="k">class</span> <span class="nc">NoPrimaryIndexProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="NoPrimaryIndexProperty-1460"><a href="#NoPrimaryIndexProperty-1460"><span class="linenos">1460</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16238,58 +17119,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="ReturnsProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="ReturnsProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="ReturnsProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="ReturnsProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="ReturnsProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="ReturnsProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="ReturnsProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="ReturnsProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="ReturnsProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="ReturnsProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="ReturnsProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="ReturnsProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="ReturnsProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="ReturnsProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="ReturnsProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="ReturnsProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="ReturnsProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="ReturnsProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="ReturnsProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="ReturnsProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="ReturnsProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="ReturnsProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="ReturnsProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="ReturnsProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="ReturnsProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="ReturnsProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="ReturnsProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="ReturnsProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="ReturnsProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="ReturnsProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="ReturnsProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="ReturnsProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="ReturnsProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="ReturnsProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="NoPrimaryIndexProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="NoPrimaryIndexProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="NoPrimaryIndexProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="NoPrimaryIndexProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="NoPrimaryIndexProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="NoPrimaryIndexProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="NoPrimaryIndexProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="NoPrimaryIndexProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="NoPrimaryIndexProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="NoPrimaryIndexProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="NoPrimaryIndexProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="NoPrimaryIndexProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="NoPrimaryIndexProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="NoPrimaryIndexProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="NoPrimaryIndexProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="NoPrimaryIndexProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="NoPrimaryIndexProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="NoPrimaryIndexProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="NoPrimaryIndexProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="NoPrimaryIndexProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="NoPrimaryIndexProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="NoPrimaryIndexProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="NoPrimaryIndexProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="NoPrimaryIndexProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="NoPrimaryIndexProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="NoPrimaryIndexProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="NoPrimaryIndexProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="NoPrimaryIndexProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="NoPrimaryIndexProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="NoPrimaryIndexProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="NoPrimaryIndexProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="NoPrimaryIndexProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="NoPrimaryIndexProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="NoPrimaryIndexProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="LanguageProperty"> - <input id="LanguageProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="OnCommitProperty"> + <input id="OnCommitProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">LanguageProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">OnCommitProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="LanguageProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="OnCommitProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#LanguageProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LanguageProperty-1400"><a href="#LanguageProperty-1400"><span class="linenos">1400</span></a><span class="k">class</span> <span class="nc">LanguageProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="LanguageProperty-1401"><a href="#LanguageProperty-1401"><span class="linenos">1401</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#OnCommitProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="OnCommitProperty-1463"><a href="#OnCommitProperty-1463"><span class="linenos">1463</span></a><span class="k">class</span> <span class="nc">OnCommitProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="OnCommitProperty-1464"><a href="#OnCommitProperty-1464"><span class="linenos">1464</span></a> <span class="n">arg_type</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16299,58 +17180,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="LanguageProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="LanguageProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="LanguageProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="LanguageProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="LanguageProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="LanguageProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="LanguageProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="LanguageProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="LanguageProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="LanguageProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="LanguageProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="LanguageProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="LanguageProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="LanguageProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="LanguageProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="LanguageProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="LanguageProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="LanguageProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="LanguageProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="LanguageProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="LanguageProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="LanguageProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="LanguageProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="LanguageProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="LanguageProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="LanguageProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="LanguageProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="LanguageProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="LanguageProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="LanguageProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="LanguageProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="LanguageProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="LanguageProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="LanguageProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="OnCommitProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="OnCommitProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="OnCommitProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="OnCommitProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="OnCommitProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="OnCommitProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="OnCommitProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="OnCommitProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="OnCommitProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="OnCommitProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="OnCommitProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="OnCommitProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="OnCommitProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="OnCommitProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="OnCommitProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="OnCommitProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="OnCommitProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="OnCommitProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="OnCommitProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="OnCommitProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="OnCommitProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="OnCommitProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="OnCommitProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="OnCommitProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="OnCommitProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="OnCommitProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="OnCommitProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="OnCommitProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="OnCommitProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="OnCommitProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="OnCommitProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="OnCommitProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="OnCommitProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="OnCommitProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="ExecuteAsProperty"> - <input id="ExecuteAsProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="PartitionedByProperty"> + <input id="PartitionedByProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">ExecuteAsProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">PartitionedByProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="ExecuteAsProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="PartitionedByProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#ExecuteAsProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ExecuteAsProperty-1404"><a href="#ExecuteAsProperty-1404"><span class="linenos">1404</span></a><span class="k">class</span> <span class="nc">ExecuteAsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="ExecuteAsProperty-1405"><a href="#ExecuteAsProperty-1405"><span class="linenos">1405</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#PartitionedByProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="PartitionedByProperty-1467"><a href="#PartitionedByProperty-1467"><span class="linenos">1467</span></a><span class="k">class</span> <span class="nc">PartitionedByProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="PartitionedByProperty-1468"><a href="#PartitionedByProperty-1468"><span class="linenos">1468</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16360,58 +17241,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="ExecuteAsProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="ExecuteAsProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="ExecuteAsProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="ExecuteAsProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="ExecuteAsProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="ExecuteAsProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="ExecuteAsProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="ExecuteAsProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="ExecuteAsProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="ExecuteAsProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="ExecuteAsProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="ExecuteAsProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="ExecuteAsProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="ExecuteAsProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="ExecuteAsProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="ExecuteAsProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="ExecuteAsProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="ExecuteAsProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="ExecuteAsProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="ExecuteAsProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="ExecuteAsProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="ExecuteAsProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="ExecuteAsProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="ExecuteAsProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="ExecuteAsProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="ExecuteAsProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="ExecuteAsProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="ExecuteAsProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="ExecuteAsProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="ExecuteAsProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="ExecuteAsProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="ExecuteAsProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="ExecuteAsProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="ExecuteAsProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="PartitionedByProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="PartitionedByProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="PartitionedByProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="PartitionedByProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="PartitionedByProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="PartitionedByProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="PartitionedByProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="PartitionedByProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="PartitionedByProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="PartitionedByProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="PartitionedByProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="PartitionedByProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="PartitionedByProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="PartitionedByProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="PartitionedByProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="PartitionedByProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="PartitionedByProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="PartitionedByProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="PartitionedByProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="PartitionedByProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="PartitionedByProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="PartitionedByProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="PartitionedByProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="PartitionedByProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="PartitionedByProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="PartitionedByProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="PartitionedByProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="PartitionedByProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="PartitionedByProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="PartitionedByProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="PartitionedByProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="PartitionedByProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="PartitionedByProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="PartitionedByProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="VolatilityProperty"> - <input id="VolatilityProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="ReturnsProperty"> + <input id="ReturnsProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">VolatilityProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">ReturnsProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="VolatilityProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="ReturnsProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#VolatilityProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="VolatilityProperty-1408"><a href="#VolatilityProperty-1408"><span class="linenos">1408</span></a><span class="k">class</span> <span class="nc">VolatilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="VolatilityProperty-1409"><a href="#VolatilityProperty-1409"><span class="linenos">1409</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#ReturnsProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="ReturnsProperty-1471"><a href="#ReturnsProperty-1471"><span class="linenos">1471</span></a><span class="k">class</span> <span class="nc">ReturnsProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="ReturnsProperty-1472"><a href="#ReturnsProperty-1472"><span class="linenos">1472</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"is_table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"table"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16421,40 +17302,40 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="VolatilityProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="VolatilityProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="VolatilityProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="VolatilityProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="VolatilityProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="VolatilityProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="VolatilityProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="VolatilityProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="VolatilityProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="VolatilityProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="VolatilityProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="VolatilityProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="VolatilityProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="VolatilityProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="VolatilityProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="VolatilityProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="VolatilityProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="VolatilityProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="VolatilityProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="VolatilityProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="VolatilityProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="VolatilityProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="VolatilityProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="VolatilityProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="VolatilityProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="VolatilityProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="VolatilityProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="VolatilityProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="VolatilityProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="VolatilityProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="VolatilityProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="VolatilityProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="VolatilityProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="VolatilityProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="ReturnsProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="ReturnsProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="ReturnsProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="ReturnsProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="ReturnsProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="ReturnsProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="ReturnsProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="ReturnsProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="ReturnsProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="ReturnsProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="ReturnsProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="ReturnsProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="ReturnsProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="ReturnsProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="ReturnsProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="ReturnsProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="ReturnsProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="ReturnsProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="ReturnsProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="ReturnsProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="ReturnsProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="ReturnsProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="ReturnsProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="ReturnsProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="ReturnsProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="ReturnsProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="ReturnsProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="ReturnsProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="ReturnsProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="ReturnsProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="ReturnsProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="ReturnsProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="ReturnsProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="ReturnsProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> @@ -16471,17 +17352,17 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#RowFormatDelimitedProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatDelimitedProperty-1412"><a href="#RowFormatDelimitedProperty-1412"><span class="linenos">1412</span></a><span class="k">class</span> <span class="nc">RowFormatDelimitedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="RowFormatDelimitedProperty-1413"><a href="#RowFormatDelimitedProperty-1413"><span class="linenos">1413</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> -</span><span id="RowFormatDelimitedProperty-1414"><a href="#RowFormatDelimitedProperty-1414"><span class="linenos">1414</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="RowFormatDelimitedProperty-1415"><a href="#RowFormatDelimitedProperty-1415"><span class="linenos">1415</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1416"><a href="#RowFormatDelimitedProperty-1416"><span class="linenos">1416</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1417"><a href="#RowFormatDelimitedProperty-1417"><span class="linenos">1417</span></a> <span class="s2">"collection_items"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1418"><a href="#RowFormatDelimitedProperty-1418"><span class="linenos">1418</span></a> <span class="s2">"map_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1419"><a href="#RowFormatDelimitedProperty-1419"><span class="linenos">1419</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1420"><a href="#RowFormatDelimitedProperty-1420"><span class="linenos">1420</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1421"><a href="#RowFormatDelimitedProperty-1421"><span class="linenos">1421</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RowFormatDelimitedProperty-1422"><a href="#RowFormatDelimitedProperty-1422"><span class="linenos">1422</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatDelimitedProperty-1475"><a href="#RowFormatDelimitedProperty-1475"><span class="linenos">1475</span></a><span class="k">class</span> <span class="nc">RowFormatDelimitedProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="RowFormatDelimitedProperty-1476"><a href="#RowFormatDelimitedProperty-1476"><span class="linenos">1476</span></a> <span class="c1"># https://cwiki.apache.org/confluence/display/hive/languagemanual+dml</span> +</span><span id="RowFormatDelimitedProperty-1477"><a href="#RowFormatDelimitedProperty-1477"><span class="linenos">1477</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="RowFormatDelimitedProperty-1478"><a href="#RowFormatDelimitedProperty-1478"><span class="linenos">1478</span></a> <span class="s2">"fields"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1479"><a href="#RowFormatDelimitedProperty-1479"><span class="linenos">1479</span></a> <span class="s2">"escaped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1480"><a href="#RowFormatDelimitedProperty-1480"><span class="linenos">1480</span></a> <span class="s2">"collection_items"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1481"><a href="#RowFormatDelimitedProperty-1481"><span class="linenos">1481</span></a> <span class="s2">"map_keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1482"><a href="#RowFormatDelimitedProperty-1482"><span class="linenos">1482</span></a> <span class="s2">"lines"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1483"><a href="#RowFormatDelimitedProperty-1483"><span class="linenos">1483</span></a> <span class="s2">"null"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1484"><a href="#RowFormatDelimitedProperty-1484"><span class="linenos">1484</span></a> <span class="s2">"serde"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RowFormatDelimitedProperty-1485"><a href="#RowFormatDelimitedProperty-1485"><span class="linenos">1485</span></a> <span class="p">}</span> </span></pre></div> @@ -16541,8 +17422,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#RowFormatSerdeProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatSerdeProperty-1425"><a href="#RowFormatSerdeProperty-1425"><span class="linenos">1425</span></a><span class="k">class</span> <span class="nc">RowFormatSerdeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="RowFormatSerdeProperty-1426"><a href="#RowFormatSerdeProperty-1426"><span class="linenos">1426</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RowFormatSerdeProperty-1488"><a href="#RowFormatSerdeProperty-1488"><span class="linenos">1488</span></a><span class="k">class</span> <span class="nc">RowFormatSerdeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="RowFormatSerdeProperty-1489"><a href="#RowFormatSerdeProperty-1489"><span class="linenos">1489</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16591,6 +17472,67 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> + <section id="SchemaCommentProperty"> + <input id="SchemaCommentProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> +<div class="attr class"> + + <span class="def">class</span> + <span class="name">SchemaCommentProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + + <label class="view-source-button" for="SchemaCommentProperty-view-source"><span>View Source</span></label> + + </div> + <a class="headerlink" href="#SchemaCommentProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="SchemaCommentProperty-1492"><a href="#SchemaCommentProperty-1492"><span class="linenos">1492</span></a><span class="k">class</span> <span class="nc">SchemaCommentProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SchemaCommentProperty-1493"><a href="#SchemaCommentProperty-1493"><span class="linenos">1493</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span></pre></div> + + + + + <div class="inherited"> + <h5>Inherited Members</h5> + <dl> + <div><dt><a href="#Expression">Expression</a></dt> + <dd id="SchemaCommentProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="SchemaCommentProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="SchemaCommentProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="SchemaCommentProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="SchemaCommentProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="SchemaCommentProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="SchemaCommentProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="SchemaCommentProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="SchemaCommentProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="SchemaCommentProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="SchemaCommentProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="SchemaCommentProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="SchemaCommentProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="SchemaCommentProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="SchemaCommentProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="SchemaCommentProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="SchemaCommentProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="SchemaCommentProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="SchemaCommentProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="SchemaCommentProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="SchemaCommentProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="SchemaCommentProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="SchemaCommentProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="SchemaCommentProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="SchemaCommentProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="SchemaCommentProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="SchemaCommentProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="SchemaCommentProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="SchemaCommentProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="SchemaCommentProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="SchemaCommentProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="SchemaCommentProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="SchemaCommentProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="SchemaCommentProperty.load" class="function"><a href="#Expression.load">load</a></dd> + + </div> + </dl> + </div> + </section> <section id="SerdeProperties"> <input id="SerdeProperties-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> @@ -16602,8 +17544,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#SerdeProperties"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SerdeProperties-1429"><a href="#SerdeProperties-1429"><span class="linenos">1429</span></a><span class="k">class</span> <span class="nc">SerdeProperties</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="SerdeProperties-1430"><a href="#SerdeProperties-1430"><span class="linenos">1430</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SerdeProperties-1496"><a href="#SerdeProperties-1496"><span class="linenos">1496</span></a><span class="k">class</span> <span class="nc">SerdeProperties</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SerdeProperties-1497"><a href="#SerdeProperties-1497"><span class="linenos">1497</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16652,19 +17594,19 @@ Otherwise, this resets the expression.</li> </dl> </div> </section> - <section id="FallbackProperty"> - <input id="FallbackProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="SetProperty"> + <input id="SetProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">FallbackProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">SetProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="FallbackProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="SetProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#FallbackProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FallbackProperty-1433"><a href="#FallbackProperty-1433"><span class="linenos">1433</span></a><span class="k">class</span> <span class="nc">FallbackProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="FallbackProperty-1434"><a href="#FallbackProperty-1434"><span class="linenos">1434</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"protection"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#SetProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetProperty-1500"><a href="#SetProperty-1500"><span class="linenos">1500</span></a><span class="k">class</span> <span class="nc">SetProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SetProperty-1501"><a href="#SetProperty-1501"><span class="linenos">1501</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"multi"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16674,241 +17616,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="FallbackProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="FallbackProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="FallbackProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="FallbackProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="FallbackProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="FallbackProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="FallbackProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="FallbackProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="FallbackProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="FallbackProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="FallbackProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="FallbackProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="FallbackProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="FallbackProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="FallbackProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="FallbackProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="FallbackProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="FallbackProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="FallbackProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="FallbackProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="FallbackProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="FallbackProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="FallbackProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="FallbackProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="FallbackProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="FallbackProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="FallbackProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="FallbackProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="FallbackProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="FallbackProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="FallbackProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="FallbackProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="FallbackProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="FallbackProperty.load" class="function"><a href="#Expression.load">load</a></dd> - - </div> - </dl> - </div> - </section> - <section id="WithJournalTableProperty"> - <input id="WithJournalTableProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> -<div class="attr class"> - - <span class="def">class</span> - <span class="name">WithJournalTableProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - - <label class="view-source-button" for="WithJournalTableProperty-view-source"><span>View Source</span></label> - - </div> - <a class="headerlink" href="#WithJournalTableProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WithJournalTableProperty-1437"><a href="#WithJournalTableProperty-1437"><span class="linenos">1437</span></a><span class="k">class</span> <span class="nc">WithJournalTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="WithJournalTableProperty-1438"><a href="#WithJournalTableProperty-1438"><span class="linenos">1438</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span></pre></div> - - - - - <div class="inherited"> - <h5>Inherited Members</h5> - <dl> - <div><dt><a href="#Expression">Expression</a></dt> - <dd id="WithJournalTableProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="WithJournalTableProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="WithJournalTableProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="WithJournalTableProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="WithJournalTableProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="WithJournalTableProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="WithJournalTableProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="WithJournalTableProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="WithJournalTableProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="WithJournalTableProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="WithJournalTableProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="WithJournalTableProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="WithJournalTableProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="WithJournalTableProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="WithJournalTableProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="WithJournalTableProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="WithJournalTableProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="WithJournalTableProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="WithJournalTableProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="WithJournalTableProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="WithJournalTableProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="WithJournalTableProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="WithJournalTableProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="WithJournalTableProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="WithJournalTableProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="WithJournalTableProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="WithJournalTableProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="WithJournalTableProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="WithJournalTableProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="WithJournalTableProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="WithJournalTableProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="WithJournalTableProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="WithJournalTableProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="WithJournalTableProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="SetProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="SetProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="SetProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="SetProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="SetProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="SetProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="SetProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="SetProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="SetProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="SetProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="SetProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="SetProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="SetProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="SetProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="SetProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="SetProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="SetProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="SetProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="SetProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="SetProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="SetProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="SetProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="SetProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="SetProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="SetProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="SetProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="SetProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="SetProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="SetProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="SetProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="SetProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="SetProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="SetProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="SetProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="LogProperty"> - <input id="LogProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> -<div class="attr class"> - - <span class="def">class</span> - <span class="name">LogProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - - <label class="view-source-button" for="LogProperty-view-source"><span>View Source</span></label> - - </div> - <a class="headerlink" href="#LogProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LogProperty-1441"><a href="#LogProperty-1441"><span class="linenos">1441</span></a><span class="k">class</span> <span class="nc">LogProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="LogProperty-1442"><a href="#LogProperty-1442"><span class="linenos">1442</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span></pre></div> - - - - - <div class="inherited"> - <h5>Inherited Members</h5> - <dl> - <div><dt><a href="#Expression">Expression</a></dt> - <dd id="LogProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="LogProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="LogProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="LogProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="LogProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="LogProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="LogProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="LogProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="LogProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="LogProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="LogProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="LogProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="LogProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="LogProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="LogProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="LogProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="LogProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="LogProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="LogProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="LogProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="LogProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="LogProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="LogProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="LogProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="LogProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="LogProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="LogProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="LogProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="LogProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="LogProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="LogProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="LogProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="LogProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="LogProperty.load" class="function"><a href="#Expression.load">load</a></dd> - - </div> - </dl> - </div> - </section> - <section id="JournalProperty"> - <input id="JournalProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> -<div class="attr class"> - - <span class="def">class</span> - <span class="name">JournalProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - - <label class="view-source-button" for="JournalProperty-view-source"><span>View Source</span></label> - - </div> - <a class="headerlink" href="#JournalProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JournalProperty-1445"><a href="#JournalProperty-1445"><span class="linenos">1445</span></a><span class="k">class</span> <span class="nc">JournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="JournalProperty-1446"><a href="#JournalProperty-1446"><span class="linenos">1446</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"before"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span></pre></div> - - - - - <div class="inherited"> - <h5>Inherited Members</h5> - <dl> - <div><dt><a href="#Expression">Expression</a></dt> - <dd id="JournalProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="JournalProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="JournalProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="JournalProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="JournalProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="JournalProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="JournalProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="JournalProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="JournalProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="JournalProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="JournalProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="JournalProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="JournalProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="JournalProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="JournalProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="JournalProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="JournalProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="JournalProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="JournalProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="JournalProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="JournalProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="JournalProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="JournalProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="JournalProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="JournalProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="JournalProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="JournalProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="JournalProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="JournalProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="JournalProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="JournalProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="JournalProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="JournalProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="JournalProperty.load" class="function"><a href="#Expression.load">load</a></dd> - - </div> - </dl> - </div> - </section> - <section id="AfterJournalProperty"> - <input id="AfterJournalProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="SortKeyProperty"> + <input id="SortKeyProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">AfterJournalProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">SortKeyProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="AfterJournalProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="SortKeyProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#AfterJournalProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AfterJournalProperty-1449"><a href="#AfterJournalProperty-1449"><span class="linenos">1449</span></a><span class="k">class</span> <span class="nc">AfterJournalProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="AfterJournalProperty-1450"><a href="#AfterJournalProperty-1450"><span class="linenos">1450</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"dual"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"local"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#SortKeyProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="SortKeyProperty-1504"><a href="#SortKeyProperty-1504"><span class="linenos">1504</span></a><span class="k">class</span> <span class="nc">SortKeyProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SortKeyProperty-1505"><a href="#SortKeyProperty-1505"><span class="linenos">1505</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"compound"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -16918,58 +17677,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="AfterJournalProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="AfterJournalProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="AfterJournalProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="AfterJournalProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="AfterJournalProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="AfterJournalProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="AfterJournalProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="AfterJournalProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="AfterJournalProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="AfterJournalProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="AfterJournalProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="AfterJournalProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="AfterJournalProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="AfterJournalProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="AfterJournalProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="AfterJournalProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="AfterJournalProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="AfterJournalProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="AfterJournalProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="AfterJournalProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="AfterJournalProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="AfterJournalProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="AfterJournalProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="AfterJournalProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="AfterJournalProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="AfterJournalProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="AfterJournalProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="AfterJournalProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="AfterJournalProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="AfterJournalProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="AfterJournalProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="AfterJournalProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="AfterJournalProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="AfterJournalProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="SortKeyProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="SortKeyProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="SortKeyProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="SortKeyProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="SortKeyProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="SortKeyProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="SortKeyProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="SortKeyProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="SortKeyProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="SortKeyProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="SortKeyProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="SortKeyProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="SortKeyProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="SortKeyProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="SortKeyProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="SortKeyProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="SortKeyProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="SortKeyProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="SortKeyProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="SortKeyProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="SortKeyProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="SortKeyProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="SortKeyProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="SortKeyProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="SortKeyProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="SortKeyProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="SortKeyProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="SortKeyProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="SortKeyProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="SortKeyProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="SortKeyProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="SortKeyProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="SortKeyProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="SortKeyProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="ChecksumProperty"> - <input id="ChecksumProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="SqlSecurityProperty"> + <input id="SqlSecurityProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">ChecksumProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">SqlSecurityProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="ChecksumProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="SqlSecurityProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#ChecksumProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ChecksumProperty-1453"><a href="#ChecksumProperty-1453"><span class="linenos">1453</span></a><span class="k">class</span> <span class="nc">ChecksumProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="ChecksumProperty-1454"><a href="#ChecksumProperty-1454"><span class="linenos">1454</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#SqlSecurityProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="SqlSecurityProperty-1508"><a href="#SqlSecurityProperty-1508"><span class="linenos">1508</span></a><span class="k">class</span> <span class="nc">SqlSecurityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="SqlSecurityProperty-1509"><a href="#SqlSecurityProperty-1509"><span class="linenos">1509</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"definer"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -16979,58 +17738,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="ChecksumProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="ChecksumProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="ChecksumProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="ChecksumProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="ChecksumProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="ChecksumProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="ChecksumProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="ChecksumProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="ChecksumProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="ChecksumProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="ChecksumProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="ChecksumProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="ChecksumProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="ChecksumProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="ChecksumProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="ChecksumProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="ChecksumProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="ChecksumProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="ChecksumProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="ChecksumProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="ChecksumProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="ChecksumProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="ChecksumProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="ChecksumProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="ChecksumProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="ChecksumProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="ChecksumProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="ChecksumProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="ChecksumProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="ChecksumProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="ChecksumProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="ChecksumProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="ChecksumProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="ChecksumProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="SqlSecurityProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="SqlSecurityProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="SqlSecurityProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="SqlSecurityProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="SqlSecurityProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="SqlSecurityProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="SqlSecurityProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="SqlSecurityProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="SqlSecurityProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="SqlSecurityProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="SqlSecurityProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="SqlSecurityProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="SqlSecurityProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="SqlSecurityProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="SqlSecurityProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="SqlSecurityProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="SqlSecurityProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="SqlSecurityProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="SqlSecurityProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="SqlSecurityProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="SqlSecurityProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="SqlSecurityProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="SqlSecurityProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="SqlSecurityProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="SqlSecurityProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="SqlSecurityProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="SqlSecurityProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="SqlSecurityProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="SqlSecurityProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="SqlSecurityProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="SqlSecurityProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="SqlSecurityProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="SqlSecurityProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="SqlSecurityProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="FreespaceProperty"> - <input id="FreespaceProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="TableFormatProperty"> + <input id="TableFormatProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">FreespaceProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">TableFormatProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="FreespaceProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="TableFormatProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#FreespaceProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="FreespaceProperty-1457"><a href="#FreespaceProperty-1457"><span class="linenos">1457</span></a><span class="k">class</span> <span class="nc">FreespaceProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="FreespaceProperty-1458"><a href="#FreespaceProperty-1458"><span class="linenos">1458</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#TableFormatProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="TableFormatProperty-1512"><a href="#TableFormatProperty-1512"><span class="linenos">1512</span></a><span class="k">class</span> <span class="nc">TableFormatProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="TableFormatProperty-1513"><a href="#TableFormatProperty-1513"><span class="linenos">1513</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -17040,58 +17799,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="FreespaceProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="FreespaceProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="FreespaceProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="FreespaceProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="FreespaceProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="FreespaceProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="FreespaceProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="FreespaceProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="FreespaceProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="FreespaceProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="FreespaceProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="FreespaceProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="FreespaceProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="FreespaceProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="FreespaceProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="FreespaceProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="FreespaceProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="FreespaceProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="FreespaceProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="FreespaceProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="FreespaceProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="FreespaceProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="FreespaceProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="FreespaceProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="FreespaceProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="FreespaceProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="FreespaceProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="FreespaceProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="FreespaceProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="FreespaceProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="FreespaceProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="FreespaceProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="FreespaceProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="FreespaceProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="TableFormatProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="TableFormatProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="TableFormatProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="TableFormatProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="TableFormatProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="TableFormatProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="TableFormatProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="TableFormatProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="TableFormatProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="TableFormatProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="TableFormatProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="TableFormatProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="TableFormatProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="TableFormatProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="TableFormatProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="TableFormatProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="TableFormatProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="TableFormatProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="TableFormatProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="TableFormatProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="TableFormatProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="TableFormatProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="TableFormatProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="TableFormatProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="TableFormatProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="TableFormatProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="TableFormatProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="TableFormatProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="TableFormatProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="TableFormatProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="TableFormatProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="TableFormatProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="TableFormatProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="TableFormatProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="MergeBlockRatioProperty"> - <input id="MergeBlockRatioProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="TemporaryProperty"> + <input id="TemporaryProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">MergeBlockRatioProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">TemporaryProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="MergeBlockRatioProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="TemporaryProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#MergeBlockRatioProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="MergeBlockRatioProperty-1461"><a href="#MergeBlockRatioProperty-1461"><span class="linenos">1461</span></a><span class="k">class</span> <span class="nc">MergeBlockRatioProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="MergeBlockRatioProperty-1462"><a href="#MergeBlockRatioProperty-1462"><span class="linenos">1462</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#TemporaryProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="TemporaryProperty-1516"><a href="#TemporaryProperty-1516"><span class="linenos">1516</span></a><span class="k">class</span> <span class="nc">TemporaryProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="TemporaryProperty-1517"><a href="#TemporaryProperty-1517"><span class="linenos">1517</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"global_"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -17101,58 +17860,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="MergeBlockRatioProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="MergeBlockRatioProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="MergeBlockRatioProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="MergeBlockRatioProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="MergeBlockRatioProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="MergeBlockRatioProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="MergeBlockRatioProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="MergeBlockRatioProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="MergeBlockRatioProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="MergeBlockRatioProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="MergeBlockRatioProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="MergeBlockRatioProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="MergeBlockRatioProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="MergeBlockRatioProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="MergeBlockRatioProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="MergeBlockRatioProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="MergeBlockRatioProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="MergeBlockRatioProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="MergeBlockRatioProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="MergeBlockRatioProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="MergeBlockRatioProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="MergeBlockRatioProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="MergeBlockRatioProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="MergeBlockRatioProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="MergeBlockRatioProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="MergeBlockRatioProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="MergeBlockRatioProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="MergeBlockRatioProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="MergeBlockRatioProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="MergeBlockRatioProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="MergeBlockRatioProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="MergeBlockRatioProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="MergeBlockRatioProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="MergeBlockRatioProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="TemporaryProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="TemporaryProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="TemporaryProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="TemporaryProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="TemporaryProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="TemporaryProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="TemporaryProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="TemporaryProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="TemporaryProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="TemporaryProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="TemporaryProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="TemporaryProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="TemporaryProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="TemporaryProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="TemporaryProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="TemporaryProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="TemporaryProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="TemporaryProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="TemporaryProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="TemporaryProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="TemporaryProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="TemporaryProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="TemporaryProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="TemporaryProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="TemporaryProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="TemporaryProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="TemporaryProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="TemporaryProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="TemporaryProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="TemporaryProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="TemporaryProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="TemporaryProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="TemporaryProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="TemporaryProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="DataBlocksizeProperty"> - <input id="DataBlocksizeProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="TransientProperty"> + <input id="TransientProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">DataBlocksizeProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">TransientProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="DataBlocksizeProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="TransientProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#DataBlocksizeProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataBlocksizeProperty-1465"><a href="#DataBlocksizeProperty-1465"><span class="linenos">1465</span></a><span class="k">class</span> <span class="nc">DataBlocksizeProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="DataBlocksizeProperty-1466"><a href="#DataBlocksizeProperty-1466"><span class="linenos">1466</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"units"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"min"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <a class="headerlink" href="#TransientProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="TransientProperty-1520"><a href="#TransientProperty-1520"><span class="linenos">1520</span></a><span class="k">class</span> <span class="nc">TransientProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="TransientProperty-1521"><a href="#TransientProperty-1521"><span class="linenos">1521</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -17162,58 +17921,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="DataBlocksizeProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="DataBlocksizeProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="DataBlocksizeProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="DataBlocksizeProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="DataBlocksizeProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="DataBlocksizeProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="DataBlocksizeProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="DataBlocksizeProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="DataBlocksizeProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="DataBlocksizeProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="DataBlocksizeProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="DataBlocksizeProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="DataBlocksizeProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="DataBlocksizeProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="DataBlocksizeProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="DataBlocksizeProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="DataBlocksizeProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="DataBlocksizeProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="DataBlocksizeProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="DataBlocksizeProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="DataBlocksizeProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="DataBlocksizeProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="DataBlocksizeProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="DataBlocksizeProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="DataBlocksizeProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="DataBlocksizeProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="DataBlocksizeProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="DataBlocksizeProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="DataBlocksizeProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="DataBlocksizeProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="DataBlocksizeProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="DataBlocksizeProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="DataBlocksizeProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="DataBlocksizeProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="TransientProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="TransientProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="TransientProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="TransientProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="TransientProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="TransientProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="TransientProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="TransientProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="TransientProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="TransientProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="TransientProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="TransientProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="TransientProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="TransientProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="TransientProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="TransientProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="TransientProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="TransientProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="TransientProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="TransientProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="TransientProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="TransientProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="TransientProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="TransientProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="TransientProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="TransientProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="TransientProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="TransientProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="TransientProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="TransientProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="TransientProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="TransientProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="TransientProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="TransientProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="BlockCompressionProperty"> - <input id="BlockCompressionProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="VolatilityProperty"> + <input id="VolatilityProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">BlockCompressionProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">VolatilityProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="BlockCompressionProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="VolatilityProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#BlockCompressionProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BlockCompressionProperty-1469"><a href="#BlockCompressionProperty-1469"><span class="linenos">1469</span></a><span class="k">class</span> <span class="nc">BlockCompressionProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="BlockCompressionProperty-1470"><a href="#BlockCompressionProperty-1470"><span class="linenos">1470</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"autotemp"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"always"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"manual"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"never"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <a class="headerlink" href="#VolatilityProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="VolatilityProperty-1524"><a href="#VolatilityProperty-1524"><span class="linenos">1524</span></a><span class="k">class</span> <span class="nc">VolatilityProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="VolatilityProperty-1525"><a href="#VolatilityProperty-1525"><span class="linenos">1525</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -17223,64 +17982,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="BlockCompressionProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="BlockCompressionProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="BlockCompressionProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="BlockCompressionProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="BlockCompressionProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="BlockCompressionProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="BlockCompressionProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="BlockCompressionProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="BlockCompressionProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="BlockCompressionProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="BlockCompressionProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="BlockCompressionProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="BlockCompressionProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="BlockCompressionProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="BlockCompressionProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="BlockCompressionProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="BlockCompressionProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="BlockCompressionProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="BlockCompressionProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="BlockCompressionProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="BlockCompressionProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="BlockCompressionProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="BlockCompressionProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="BlockCompressionProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="BlockCompressionProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="BlockCompressionProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="BlockCompressionProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="BlockCompressionProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="BlockCompressionProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="BlockCompressionProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="BlockCompressionProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="BlockCompressionProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="BlockCompressionProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="BlockCompressionProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="VolatilityProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="VolatilityProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="VolatilityProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="VolatilityProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="VolatilityProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="VolatilityProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="VolatilityProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="VolatilityProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="VolatilityProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="VolatilityProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="VolatilityProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="VolatilityProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="VolatilityProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="VolatilityProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="VolatilityProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="VolatilityProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="VolatilityProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="VolatilityProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="VolatilityProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="VolatilityProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="VolatilityProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="VolatilityProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="VolatilityProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="VolatilityProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="VolatilityProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="VolatilityProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="VolatilityProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="VolatilityProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="VolatilityProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="VolatilityProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="VolatilityProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="VolatilityProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="VolatilityProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="VolatilityProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="IsolatedLoadingProperty"> - <input id="IsolatedLoadingProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="WithDataProperty"> + <input id="WithDataProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">IsolatedLoadingProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">WithDataProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="IsolatedLoadingProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="WithDataProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#IsolatedLoadingProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IsolatedLoadingProperty-1473"><a href="#IsolatedLoadingProperty-1473"><span class="linenos">1473</span></a><span class="k">class</span> <span class="nc">IsolatedLoadingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="IsolatedLoadingProperty-1474"><a href="#IsolatedLoadingProperty-1474"><span class="linenos">1474</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="IsolatedLoadingProperty-1475"><a href="#IsolatedLoadingProperty-1475"><span class="linenos">1475</span></a> <span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1476"><a href="#IsolatedLoadingProperty-1476"><span class="linenos">1476</span></a> <span class="s2">"concurrent"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1477"><a href="#IsolatedLoadingProperty-1477"><span class="linenos">1477</span></a> <span class="s2">"for_all"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1478"><a href="#IsolatedLoadingProperty-1478"><span class="linenos">1478</span></a> <span class="s2">"for_insert"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1479"><a href="#IsolatedLoadingProperty-1479"><span class="linenos">1479</span></a> <span class="s2">"for_none"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="IsolatedLoadingProperty-1480"><a href="#IsolatedLoadingProperty-1480"><span class="linenos">1480</span></a> <span class="p">}</span> + <a class="headerlink" href="#WithDataProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="WithDataProperty-1528"><a href="#WithDataProperty-1528"><span class="linenos">1528</span></a><span class="k">class</span> <span class="nc">WithDataProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="WithDataProperty-1529"><a href="#WithDataProperty-1529"><span class="linenos">1529</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"no"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"statistics"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -17290,64 +18043,58 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="IsolatedLoadingProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="IsolatedLoadingProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="IsolatedLoadingProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="IsolatedLoadingProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="IsolatedLoadingProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="IsolatedLoadingProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="IsolatedLoadingProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="IsolatedLoadingProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="IsolatedLoadingProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="IsolatedLoadingProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="IsolatedLoadingProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="IsolatedLoadingProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="IsolatedLoadingProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="IsolatedLoadingProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="IsolatedLoadingProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="IsolatedLoadingProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="IsolatedLoadingProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="IsolatedLoadingProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="IsolatedLoadingProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="IsolatedLoadingProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="IsolatedLoadingProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="IsolatedLoadingProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="IsolatedLoadingProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="IsolatedLoadingProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="IsolatedLoadingProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="IsolatedLoadingProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="IsolatedLoadingProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="IsolatedLoadingProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="IsolatedLoadingProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="IsolatedLoadingProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="IsolatedLoadingProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="IsolatedLoadingProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="IsolatedLoadingProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="IsolatedLoadingProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="WithDataProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="WithDataProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="WithDataProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="WithDataProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="WithDataProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="WithDataProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="WithDataProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="WithDataProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="WithDataProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="WithDataProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="WithDataProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="WithDataProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="WithDataProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="WithDataProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="WithDataProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="WithDataProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="WithDataProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="WithDataProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="WithDataProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="WithDataProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="WithDataProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="WithDataProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="WithDataProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="WithDataProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="WithDataProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="WithDataProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="WithDataProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="WithDataProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="WithDataProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="WithDataProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="WithDataProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="WithDataProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="WithDataProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="WithDataProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> </div> </section> - <section id="LockingProperty"> - <input id="LockingProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> + <section id="WithJournalTableProperty"> + <input id="WithJournalTableProperty-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1"> <div class="attr class"> <span class="def">class</span> - <span class="name">LockingProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): + <span class="name">WithJournalTableProperty</span><wbr>(<span class="base"><a href="#Property">Property</a></span>): - <label class="view-source-button" for="LockingProperty-view-source"><span>View Source</span></label> + <label class="view-source-button" for="WithJournalTableProperty-view-source"><span>View Source</span></label> </div> - <a class="headerlink" href="#LockingProperty"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LockingProperty-1483"><a href="#LockingProperty-1483"><span class="linenos">1483</span></a><span class="k">class</span> <span class="nc">LockingProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> -</span><span id="LockingProperty-1484"><a href="#LockingProperty-1484"><span class="linenos">1484</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="LockingProperty-1485"><a href="#LockingProperty-1485"><span class="linenos">1485</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LockingProperty-1486"><a href="#LockingProperty-1486"><span class="linenos">1486</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LockingProperty-1487"><a href="#LockingProperty-1487"><span class="linenos">1487</span></a> <span class="s2">"for_or_in"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LockingProperty-1488"><a href="#LockingProperty-1488"><span class="linenos">1488</span></a> <span class="s2">"lock_type"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="LockingProperty-1489"><a href="#LockingProperty-1489"><span class="linenos">1489</span></a> <span class="s2">"override"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="LockingProperty-1490"><a href="#LockingProperty-1490"><span class="linenos">1490</span></a> <span class="p">}</span> + <a class="headerlink" href="#WithJournalTableProperty"></a> + <div class="pdoc-code codehilite"><pre><span></span><span id="WithJournalTableProperty-1532"><a href="#WithJournalTableProperty-1532"><span class="linenos">1532</span></a><span class="k">class</span> <span class="nc">WithJournalTableProperty</span><span class="p">(</span><span class="n">Property</span><span class="p">):</span> +</span><span id="WithJournalTableProperty-1533"><a href="#WithJournalTableProperty-1533"><span class="linenos">1533</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -17357,40 +18104,40 @@ Otherwise, this resets the expression.</li> <h5>Inherited Members</h5> <dl> <div><dt><a href="#Expression">Expression</a></dt> - <dd id="LockingProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> - <dd id="LockingProperty.this" class="variable"><a href="#Expression.this">this</a></dd> - <dd id="LockingProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> - <dd id="LockingProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> - <dd id="LockingProperty.text" class="function"><a href="#Expression.text">text</a></dd> - <dd id="LockingProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> - <dd id="LockingProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> - <dd id="LockingProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="LockingProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> - <dd id="LockingProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> - <dd id="LockingProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> - <dd id="LockingProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> - <dd id="LockingProperty.append" class="function"><a href="#Expression.append">append</a></dd> - <dd id="LockingProperty.set" class="function"><a href="#Expression.set">set</a></dd> - <dd id="LockingProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> - <dd id="LockingProperty.find" class="function"><a href="#Expression.find">find</a></dd> - <dd id="LockingProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> - <dd id="LockingProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> - <dd id="LockingProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> - <dd id="LockingProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> - <dd id="LockingProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> - <dd id="LockingProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> - <dd id="LockingProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> - <dd id="LockingProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> - <dd id="LockingProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> - <dd id="LockingProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> - <dd id="LockingProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> - <dd id="LockingProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> - <dd id="LockingProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> - <dd id="LockingProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> - <dd id="LockingProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> - <dd id="LockingProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> - <dd id="LockingProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> - <dd id="LockingProperty.load" class="function"><a href="#Expression.load">load</a></dd> + <dd id="WithJournalTableProperty.__init__" class="function"><a href="#Expression.__init__">Expression</a></dd> + <dd id="WithJournalTableProperty.this" class="variable"><a href="#Expression.this">this</a></dd> + <dd id="WithJournalTableProperty.expression" class="variable"><a href="#Expression.expression">expression</a></dd> + <dd id="WithJournalTableProperty.expressions" class="variable"><a href="#Expression.expressions">expressions</a></dd> + <dd id="WithJournalTableProperty.text" class="function"><a href="#Expression.text">text</a></dd> + <dd id="WithJournalTableProperty.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> + <dd id="WithJournalTableProperty.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> + <dd id="WithJournalTableProperty.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> + <dd id="WithJournalTableProperty.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> + <dd id="WithJournalTableProperty.alias" class="variable"><a href="#Expression.alias">alias</a></dd> + <dd id="WithJournalTableProperty.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> + <dd id="WithJournalTableProperty.copy" class="function"><a href="#Expression.copy">copy</a></dd> + <dd id="WithJournalTableProperty.append" class="function"><a href="#Expression.append">append</a></dd> + <dd id="WithJournalTableProperty.set" class="function"><a href="#Expression.set">set</a></dd> + <dd id="WithJournalTableProperty.depth" class="variable"><a href="#Expression.depth">depth</a></dd> + <dd id="WithJournalTableProperty.find" class="function"><a href="#Expression.find">find</a></dd> + <dd id="WithJournalTableProperty.find_all" class="function"><a href="#Expression.find_all">find_all</a></dd> + <dd id="WithJournalTableProperty.find_ancestor" class="function"><a href="#Expression.find_ancestor">find_ancestor</a></dd> + <dd id="WithJournalTableProperty.parent_select" class="variable"><a href="#Expression.parent_select">parent_select</a></dd> + <dd id="WithJournalTableProperty.walk" class="function"><a href="#Expression.walk">walk</a></dd> + <dd id="WithJournalTableProperty.dfs" class="function"><a href="#Expression.dfs">dfs</a></dd> + <dd id="WithJournalTableProperty.bfs" class="function"><a href="#Expression.bfs">bfs</a></dd> + <dd id="WithJournalTableProperty.unnest" class="function"><a href="#Expression.unnest">unnest</a></dd> + <dd id="WithJournalTableProperty.unalias" class="function"><a href="#Expression.unalias">unalias</a></dd> + <dd id="WithJournalTableProperty.unnest_operands" class="function"><a href="#Expression.unnest_operands">unnest_operands</a></dd> + <dd id="WithJournalTableProperty.flatten" class="function"><a href="#Expression.flatten">flatten</a></dd> + <dd id="WithJournalTableProperty.sql" class="function"><a href="#Expression.sql">sql</a></dd> + <dd id="WithJournalTableProperty.transform" class="function"><a href="#Expression.transform">transform</a></dd> + <dd id="WithJournalTableProperty.replace" class="function"><a href="#Expression.replace">replace</a></dd> + <dd id="WithJournalTableProperty.pop" class="function"><a href="#Expression.pop">pop</a></dd> + <dd id="WithJournalTableProperty.assert_is" class="function"><a href="#Expression.assert_is">assert_is</a></dd> + <dd id="WithJournalTableProperty.error_messages" class="function"><a href="#Expression.error_messages">error_messages</a></dd> + <dd id="WithJournalTableProperty.dump" class="function"><a href="#Expression.dump">dump</a></dd> + <dd id="WithJournalTableProperty.load" class="function"><a href="#Expression.load">load</a></dd> </div> </dl> @@ -17407,64 +18154,65 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Properties"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Properties-1493"><a href="#Properties-1493"><span class="linenos">1493</span></a><span class="k">class</span> <span class="nc">Properties</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Properties-1494"><a href="#Properties-1494"><span class="linenos">1494</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Properties-1495"><a href="#Properties-1495"><span class="linenos">1495</span></a> -</span><span id="Properties-1496"><a href="#Properties-1496"><span class="linenos">1496</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Properties-1497"><a href="#Properties-1497"><span class="linenos">1497</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> -</span><span id="Properties-1498"><a href="#Properties-1498"><span class="linenos">1498</span></a> <span class="s2">"AUTO_INCREMENT"</span><span class="p">:</span> <span class="n">AutoIncrementProperty</span><span class="p">,</span> -</span><span id="Properties-1499"><a href="#Properties-1499"><span class="linenos">1499</span></a> <span class="s2">"CHARACTER SET"</span><span class="p">:</span> <span class="n">CharacterSetProperty</span><span class="p">,</span> -</span><span id="Properties-1500"><a href="#Properties-1500"><span class="linenos">1500</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> -</span><span id="Properties-1501"><a href="#Properties-1501"><span class="linenos">1501</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> -</span><span id="Properties-1502"><a href="#Properties-1502"><span class="linenos">1502</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> -</span><span id="Properties-1503"><a href="#Properties-1503"><span class="linenos">1503</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> -</span><span id="Properties-1504"><a href="#Properties-1504"><span class="linenos">1504</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> -</span><span id="Properties-1505"><a href="#Properties-1505"><span class="linenos">1505</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> -</span><span id="Properties-1506"><a href="#Properties-1506"><span class="linenos">1506</span></a> <span class="s2">"EXECUTE AS"</span><span class="p">:</span> <span class="n">ExecuteAsProperty</span><span class="p">,</span> -</span><span id="Properties-1507"><a href="#Properties-1507"><span class="linenos">1507</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> -</span><span id="Properties-1508"><a href="#Properties-1508"><span class="linenos">1508</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> -</span><span id="Properties-1509"><a href="#Properties-1509"><span class="linenos">1509</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> -</span><span id="Properties-1510"><a href="#Properties-1510"><span class="linenos">1510</span></a> <span class="s2">"PARTITIONED_BY"</span><span class="p">:</span> <span class="n">PartitionedByProperty</span><span class="p">,</span> -</span><span id="Properties-1511"><a href="#Properties-1511"><span class="linenos">1511</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> -</span><span id="Properties-1512"><a href="#Properties-1512"><span class="linenos">1512</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> -</span><span id="Properties-1513"><a href="#Properties-1513"><span class="linenos">1513</span></a> <span class="s2">"TABLE_FORMAT"</span><span class="p">:</span> <span class="n">TableFormatProperty</span><span class="p">,</span> -</span><span id="Properties-1514"><a href="#Properties-1514"><span class="linenos">1514</span></a> <span class="p">}</span> -</span><span id="Properties-1515"><a href="#Properties-1515"><span class="linenos">1515</span></a> -</span><span id="Properties-1516"><a href="#Properties-1516"><span class="linenos">1516</span></a> <span class="n">PROPERTY_TO_NAME</span> <span class="o">=</span> <span class="p">{</span><span class="n">v</span><span class="p">:</span> <span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> -</span><span id="Properties-1517"><a href="#Properties-1517"><span class="linenos">1517</span></a> -</span><span id="Properties-1518"><a href="#Properties-1518"><span class="linenos">1518</span></a> <span class="c1"># CREATE property locations</span> -</span><span id="Properties-1519"><a href="#Properties-1519"><span class="linenos">1519</span></a> <span class="c1"># Form: schema specified</span> -</span><span id="Properties-1520"><a href="#Properties-1520"><span class="linenos">1520</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="Properties-1521"><a href="#Properties-1521"><span class="linenos">1521</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="Properties-1522"><a href="#Properties-1522"><span class="linenos">1522</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> -</span><span id="Properties-1523"><a href="#Properties-1523"><span class="linenos">1523</span></a> <span class="c1"># with ([POST_WITH])</span> -</span><span id="Properties-1524"><a href="#Properties-1524"><span class="linenos">1524</span></a> <span class="c1"># index (b) [POST_INDEX]</span> -</span><span id="Properties-1525"><a href="#Properties-1525"><span class="linenos">1525</span></a> <span class="c1">#</span> -</span><span id="Properties-1526"><a href="#Properties-1526"><span class="linenos">1526</span></a> <span class="c1"># Form: alias selection</span> -</span><span id="Properties-1527"><a href="#Properties-1527"><span class="linenos">1527</span></a> <span class="c1"># create [POST_CREATE]</span> -</span><span id="Properties-1528"><a href="#Properties-1528"><span class="linenos">1528</span></a> <span class="c1"># table a [POST_NAME]</span> -</span><span id="Properties-1529"><a href="#Properties-1529"><span class="linenos">1529</span></a> <span class="c1"># as [POST_ALIAS] (select * from b)</span> -</span><span id="Properties-1530"><a href="#Properties-1530"><span class="linenos">1530</span></a> <span class="c1"># index (c) [POST_INDEX]</span> -</span><span id="Properties-1531"><a href="#Properties-1531"><span class="linenos">1531</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="Properties-1532"><a href="#Properties-1532"><span class="linenos">1532</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1533"><a href="#Properties-1533"><span class="linenos">1533</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1534"><a href="#Properties-1534"><span class="linenos">1534</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1535"><a href="#Properties-1535"><span class="linenos">1535</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1536"><a href="#Properties-1536"><span class="linenos">1536</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1537"><a href="#Properties-1537"><span class="linenos">1537</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1538"><a href="#Properties-1538"><span class="linenos">1538</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties-1539"><a href="#Properties-1539"><span class="linenos">1539</span></a> -</span><span id="Properties-1540"><a href="#Properties-1540"><span class="linenos">1540</span></a> <span class="nd">@classmethod</span> -</span><span id="Properties-1541"><a href="#Properties-1541"><span class="linenos">1541</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> -</span><span id="Properties-1542"><a href="#Properties-1542"><span class="linenos">1542</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Properties-1543"><a href="#Properties-1543"><span class="linenos">1543</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Properties-1544"><a href="#Properties-1544"><span class="linenos">1544</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> -</span><span id="Properties-1545"><a href="#Properties-1545"><span class="linenos">1545</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="Properties-1546"><a href="#Properties-1546"><span class="linenos">1546</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="Properties-1547"><a href="#Properties-1547"><span class="linenos">1547</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Properties-1548"><a href="#Properties-1548"><span class="linenos">1548</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="Properties-1549"><a href="#Properties-1549"><span class="linenos">1549</span></a> -</span><span id="Properties-1550"><a href="#Properties-1550"><span class="linenos">1550</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Properties-1536"><a href="#Properties-1536"><span class="linenos">1536</span></a><span class="k">class</span> <span class="nc">Properties</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Properties-1537"><a href="#Properties-1537"><span class="linenos">1537</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Properties-1538"><a href="#Properties-1538"><span class="linenos">1538</span></a> +</span><span id="Properties-1539"><a href="#Properties-1539"><span class="linenos">1539</span></a> <span class="n">NAME_TO_PROPERTY</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Properties-1540"><a href="#Properties-1540"><span class="linenos">1540</span></a> <span class="s2">"ALGORITHM"</span><span class="p">:</span> <span class="n">AlgorithmProperty</span><span class="p">,</span> +</span><span id="Properties-1541"><a href="#Properties-1541"><span class="linenos">1541</span></a> <span class="s2">"AUTO_INCREMENT"</span><span class="p">:</span> <span class="n">AutoIncrementProperty</span><span class="p">,</span> +</span><span id="Properties-1542"><a href="#Properties-1542"><span class="linenos">1542</span></a> <span class="s2">"CHARACTER SET"</span><span class="p">:</span> <span class="n">CharacterSetProperty</span><span class="p">,</span> +</span><span id="Properties-1543"><a href="#Properties-1543"><span class="linenos">1543</span></a> <span class="s2">"COLLATE"</span><span class="p">:</span> <span class="n">CollateProperty</span><span class="p">,</span> +</span><span id="Properties-1544"><a href="#Properties-1544"><span class="linenos">1544</span></a> <span class="s2">"COMMENT"</span><span class="p">:</span> <span class="n">SchemaCommentProperty</span><span class="p">,</span> +</span><span id="Properties-1545"><a href="#Properties-1545"><span class="linenos">1545</span></a> <span class="s2">"DEFINER"</span><span class="p">:</span> <span class="n">DefinerProperty</span><span class="p">,</span> +</span><span id="Properties-1546"><a href="#Properties-1546"><span class="linenos">1546</span></a> <span class="s2">"DISTKEY"</span><span class="p">:</span> <span class="n">DistKeyProperty</span><span class="p">,</span> +</span><span id="Properties-1547"><a href="#Properties-1547"><span class="linenos">1547</span></a> <span class="s2">"DISTSTYLE"</span><span class="p">:</span> <span class="n">DistStyleProperty</span><span class="p">,</span> +</span><span id="Properties-1548"><a href="#Properties-1548"><span class="linenos">1548</span></a> <span class="s2">"ENGINE"</span><span class="p">:</span> <span class="n">EngineProperty</span><span class="p">,</span> +</span><span id="Properties-1549"><a href="#Properties-1549"><span class="linenos">1549</span></a> <span class="s2">"EXECUTE AS"</span><span class="p">:</span> <span class="n">ExecuteAsProperty</span><span class="p">,</span> +</span><span id="Properties-1550"><a href="#Properties-1550"><span class="linenos">1550</span></a> <span class="s2">"FORMAT"</span><span class="p">:</span> <span class="n">FileFormatProperty</span><span class="p">,</span> +</span><span id="Properties-1551"><a href="#Properties-1551"><span class="linenos">1551</span></a> <span class="s2">"LANGUAGE"</span><span class="p">:</span> <span class="n">LanguageProperty</span><span class="p">,</span> +</span><span id="Properties-1552"><a href="#Properties-1552"><span class="linenos">1552</span></a> <span class="s2">"LOCATION"</span><span class="p">:</span> <span class="n">LocationProperty</span><span class="p">,</span> +</span><span id="Properties-1553"><a href="#Properties-1553"><span class="linenos">1553</span></a> <span class="s2">"PARTITIONED_BY"</span><span class="p">:</span> <span class="n">PartitionedByProperty</span><span class="p">,</span> +</span><span id="Properties-1554"><a href="#Properties-1554"><span class="linenos">1554</span></a> <span class="s2">"RETURNS"</span><span class="p">:</span> <span class="n">ReturnsProperty</span><span class="p">,</span> +</span><span id="Properties-1555"><a href="#Properties-1555"><span class="linenos">1555</span></a> <span class="s2">"SORTKEY"</span><span class="p">:</span> <span class="n">SortKeyProperty</span><span class="p">,</span> +</span><span id="Properties-1556"><a href="#Properties-1556"><span class="linenos">1556</span></a> <span class="s2">"TABLE_FORMAT"</span><span class="p">:</span> <span class="n">TableFormatProperty</span><span class="p">,</span> +</span><span id="Properties-1557"><a href="#Properties-1557"><span class="linenos">1557</span></a> <span class="p">}</span> +</span><span id="Properties-1558"><a href="#Properties-1558"><span class="linenos">1558</span></a> +</span><span id="Properties-1559"><a href="#Properties-1559"><span class="linenos">1559</span></a> <span class="n">PROPERTY_TO_NAME</span> <span class="o">=</span> <span class="p">{</span><span class="n">v</span><span class="p">:</span> <span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> +</span><span id="Properties-1560"><a href="#Properties-1560"><span class="linenos">1560</span></a> +</span><span id="Properties-1561"><a href="#Properties-1561"><span class="linenos">1561</span></a> <span class="c1"># CREATE property locations</span> +</span><span id="Properties-1562"><a href="#Properties-1562"><span class="linenos">1562</span></a> <span class="c1"># Form: schema specified</span> +</span><span id="Properties-1563"><a href="#Properties-1563"><span class="linenos">1563</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="Properties-1564"><a href="#Properties-1564"><span class="linenos">1564</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="Properties-1565"><a href="#Properties-1565"><span class="linenos">1565</span></a> <span class="c1"># (b int) [POST_SCHEMA]</span> +</span><span id="Properties-1566"><a href="#Properties-1566"><span class="linenos">1566</span></a> <span class="c1"># with ([POST_WITH])</span> +</span><span id="Properties-1567"><a href="#Properties-1567"><span class="linenos">1567</span></a> <span class="c1"># index (b) [POST_INDEX]</span> +</span><span id="Properties-1568"><a href="#Properties-1568"><span class="linenos">1568</span></a> <span class="c1">#</span> +</span><span id="Properties-1569"><a href="#Properties-1569"><span class="linenos">1569</span></a> <span class="c1"># Form: alias selection</span> +</span><span id="Properties-1570"><a href="#Properties-1570"><span class="linenos">1570</span></a> <span class="c1"># create [POST_CREATE]</span> +</span><span id="Properties-1571"><a href="#Properties-1571"><span class="linenos">1571</span></a> <span class="c1"># table a [POST_NAME]</span> +</span><span id="Properties-1572"><a href="#Properties-1572"><span class="linenos">1572</span></a> <span class="c1"># as [POST_ALIAS] (select * from b) [POST_EXPRESSION]</span> +</span><span id="Properties-1573"><a href="#Properties-1573"><span class="linenos">1573</span></a> <span class="c1"># index (c) [POST_INDEX]</span> +</span><span id="Properties-1574"><a href="#Properties-1574"><span class="linenos">1574</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="Properties-1575"><a href="#Properties-1575"><span class="linenos">1575</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1576"><a href="#Properties-1576"><span class="linenos">1576</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1577"><a href="#Properties-1577"><span class="linenos">1577</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1578"><a href="#Properties-1578"><span class="linenos">1578</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1579"><a href="#Properties-1579"><span class="linenos">1579</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1580"><a href="#Properties-1580"><span class="linenos">1580</span></a> <span class="n">POST_EXPRESSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1581"><a href="#Properties-1581"><span class="linenos">1581</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1582"><a href="#Properties-1582"><span class="linenos">1582</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties-1583"><a href="#Properties-1583"><span class="linenos">1583</span></a> +</span><span id="Properties-1584"><a href="#Properties-1584"><span class="linenos">1584</span></a> <span class="nd">@classmethod</span> +</span><span id="Properties-1585"><a href="#Properties-1585"><span class="linenos">1585</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> +</span><span id="Properties-1586"><a href="#Properties-1586"><span class="linenos">1586</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Properties-1587"><a href="#Properties-1587"><span class="linenos">1587</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Properties-1588"><a href="#Properties-1588"><span class="linenos">1588</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> +</span><span id="Properties-1589"><a href="#Properties-1589"><span class="linenos">1589</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="Properties-1590"><a href="#Properties-1590"><span class="linenos">1590</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="Properties-1591"><a href="#Properties-1591"><span class="linenos">1591</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Properties-1592"><a href="#Properties-1592"><span class="linenos">1592</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="Properties-1593"><a href="#Properties-1593"><span class="linenos">1593</span></a> +</span><span id="Properties-1594"><a href="#Properties-1594"><span class="linenos">1594</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> </span></pre></div> @@ -17482,17 +18230,17 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Properties.from_dict"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Properties.from_dict-1540"><a href="#Properties.from_dict-1540"><span class="linenos">1540</span></a> <span class="nd">@classmethod</span> -</span><span id="Properties.from_dict-1541"><a href="#Properties.from_dict-1541"><span class="linenos">1541</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> -</span><span id="Properties.from_dict-1542"><a href="#Properties.from_dict-1542"><span class="linenos">1542</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="Properties.from_dict-1543"><a href="#Properties.from_dict-1543"><span class="linenos">1543</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="Properties.from_dict-1544"><a href="#Properties.from_dict-1544"><span class="linenos">1544</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> -</span><span id="Properties.from_dict-1545"><a href="#Properties.from_dict-1545"><span class="linenos">1545</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> -</span><span id="Properties.from_dict-1546"><a href="#Properties.from_dict-1546"><span class="linenos">1546</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="Properties.from_dict-1547"><a href="#Properties.from_dict-1547"><span class="linenos">1547</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Properties.from_dict-1548"><a href="#Properties.from_dict-1548"><span class="linenos">1548</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> -</span><span id="Properties.from_dict-1549"><a href="#Properties.from_dict-1549"><span class="linenos">1549</span></a> -</span><span id="Properties.from_dict-1550"><a href="#Properties.from_dict-1550"><span class="linenos">1550</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Properties.from_dict-1584"><a href="#Properties.from_dict-1584"><span class="linenos">1584</span></a> <span class="nd">@classmethod</span> +</span><span id="Properties.from_dict-1585"><a href="#Properties.from_dict-1585"><span class="linenos">1585</span></a> <span class="k">def</span> <span class="nf">from_dict</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">properties_dict</span><span class="p">)</span> <span class="o">-></span> <span class="n">Properties</span><span class="p">:</span> +</span><span id="Properties.from_dict-1586"><a href="#Properties.from_dict-1586"><span class="linenos">1586</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="Properties.from_dict-1587"><a href="#Properties.from_dict-1587"><span class="linenos">1587</span></a> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">properties_dict</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="Properties.from_dict-1588"><a href="#Properties.from_dict-1588"><span class="linenos">1588</span></a> <span class="n">property_cls</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">NAME_TO_PROPERTY</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> +</span><span id="Properties.from_dict-1589"><a href="#Properties.from_dict-1589"><span class="linenos">1589</span></a> <span class="k">if</span> <span class="n">property_cls</span><span class="p">:</span> +</span><span id="Properties.from_dict-1590"><a href="#Properties.from_dict-1590"><span class="linenos">1590</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">property_cls</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="Properties.from_dict-1591"><a href="#Properties.from_dict-1591"><span class="linenos">1591</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Properties.from_dict-1592"><a href="#Properties.from_dict-1592"><span class="linenos">1592</span></a> <span class="n">expressions</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">Property</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">key</span><span class="p">),</span> <span class="n">value</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)))</span> +</span><span id="Properties.from_dict-1593"><a href="#Properties.from_dict-1593"><span class="linenos">1593</span></a> +</span><span id="Properties.from_dict-1594"><a href="#Properties.from_dict-1594"><span class="linenos">1594</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">)</span> </span></pre></div> @@ -17553,14 +18301,15 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Properties.Location"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Properties.Location-1531"><a href="#Properties.Location-1531"><span class="linenos">1531</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="Properties.Location-1532"><a href="#Properties.Location-1532"><span class="linenos">1532</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1533"><a href="#Properties.Location-1533"><span class="linenos">1533</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1534"><a href="#Properties.Location-1534"><span class="linenos">1534</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1535"><a href="#Properties.Location-1535"><span class="linenos">1535</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1536"><a href="#Properties.Location-1536"><span class="linenos">1536</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1537"><a href="#Properties.Location-1537"><span class="linenos">1537</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="Properties.Location-1538"><a href="#Properties.Location-1538"><span class="linenos">1538</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Properties.Location-1574"><a href="#Properties.Location-1574"><span class="linenos">1574</span></a> <span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="Properties.Location-1575"><a href="#Properties.Location-1575"><span class="linenos">1575</span></a> <span class="n">POST_CREATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1576"><a href="#Properties.Location-1576"><span class="linenos">1576</span></a> <span class="n">POST_NAME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1577"><a href="#Properties.Location-1577"><span class="linenos">1577</span></a> <span class="n">POST_SCHEMA</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1578"><a href="#Properties.Location-1578"><span class="linenos">1578</span></a> <span class="n">POST_WITH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1579"><a href="#Properties.Location-1579"><span class="linenos">1579</span></a> <span class="n">POST_ALIAS</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1580"><a href="#Properties.Location-1580"><span class="linenos">1580</span></a> <span class="n">POST_EXPRESSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1581"><a href="#Properties.Location-1581"><span class="linenos">1581</span></a> <span class="n">POST_INDEX</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="Properties.Location-1582"><a href="#Properties.Location-1582"><span class="linenos">1582</span></a> <span class="n">UNSUPPORTED</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> </span></pre></div> @@ -17570,7 +18319,8 @@ Otherwise, this resets the expression.</li> <div id="Properties.Location.POST_CREATE" class="classattr"> <div class="attr variable"> - <span class="name">POST_CREATE</span><span class="default_value"> = <Location.POST_CREATE: 'POST_CREATE'></span> + <span class="name">POST_CREATE</span> = +<span class="default_value"><Location.POST_CREATE: 'POST_CREATE'></span> </div> @@ -17581,7 +18331,8 @@ Otherwise, this resets the expression.</li> </div> <div id="Properties.Location.POST_NAME" class="classattr"> <div class="attr variable"> - <span class="name">POST_NAME</span><span class="default_value"> = <Location.POST_NAME: 'POST_NAME'></span> + <span class="name">POST_NAME</span> = +<span class="default_value"><Location.POST_NAME: 'POST_NAME'></span> </div> @@ -17592,7 +18343,8 @@ Otherwise, this resets the expression.</li> </div> <div id="Properties.Location.POST_SCHEMA" class="classattr"> <div class="attr variable"> - <span class="name">POST_SCHEMA</span><span class="default_value"> = <Location.POST_SCHEMA: 'POST_SCHEMA'></span> + <span class="name">POST_SCHEMA</span> = +<span class="default_value"><Location.POST_SCHEMA: 'POST_SCHEMA'></span> </div> @@ -17603,7 +18355,8 @@ Otherwise, this resets the expression.</li> </div> <div id="Properties.Location.POST_WITH" class="classattr"> <div class="attr variable"> - <span class="name">POST_WITH</span><span class="default_value"> = <Location.POST_WITH: 'POST_WITH'></span> + <span class="name">POST_WITH</span> = +<span class="default_value"><Location.POST_WITH: 'POST_WITH'></span> </div> @@ -17614,7 +18367,8 @@ Otherwise, this resets the expression.</li> </div> <div id="Properties.Location.POST_ALIAS" class="classattr"> <div class="attr variable"> - <span class="name">POST_ALIAS</span><span class="default_value"> = <Location.POST_ALIAS: 'POST_ALIAS'></span> + <span class="name">POST_ALIAS</span> = +<span class="default_value"><Location.POST_ALIAS: 'POST_ALIAS'></span> </div> @@ -17623,9 +18377,22 @@ Otherwise, this resets the expression.</li> </div> + <div id="Properties.Location.POST_EXPRESSION" class="classattr"> + <div class="attr variable"> + <span class="name">POST_EXPRESSION</span> = +<span class="default_value"><Location.POST_EXPRESSION: 'POST_EXPRESSION'></span> + + + </div> + <a class="headerlink" href="#Properties.Location.POST_EXPRESSION"></a> + + + + </div> <div id="Properties.Location.POST_INDEX" class="classattr"> <div class="attr variable"> - <span class="name">POST_INDEX</span><span class="default_value"> = <Location.POST_INDEX: 'POST_INDEX'></span> + <span class="name">POST_INDEX</span> = +<span class="default_value"><Location.POST_INDEX: 'POST_INDEX'></span> </div> @@ -17636,7 +18403,8 @@ Otherwise, this resets the expression.</li> </div> <div id="Properties.Location.UNSUPPORTED" class="classattr"> <div class="attr variable"> - <span class="name">UNSUPPORTED</span><span class="default_value"> = <Location.UNSUPPORTED: 'UNSUPPORTED'></span> + <span class="name">UNSUPPORTED</span> = +<span class="default_value"><Location.UNSUPPORTED: 'UNSUPPORTED'></span> </div> @@ -17667,8 +18435,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Qualify"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Qualify-1553"><a href="#Qualify-1553"><span class="linenos">1553</span></a><span class="k">class</span> <span class="nc">Qualify</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Qualify-1554"><a href="#Qualify-1554"><span class="linenos">1554</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Qualify-1597"><a href="#Qualify-1597"><span class="linenos">1597</span></a><span class="k">class</span> <span class="nc">Qualify</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Qualify-1598"><a href="#Qualify-1598"><span class="linenos">1598</span></a> <span class="k">pass</span> </span></pre></div> @@ -17728,8 +18496,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Return"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Return-1558"><a href="#Return-1558"><span class="linenos">1558</span></a><span class="k">class</span> <span class="nc">Return</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Return-1559"><a href="#Return-1559"><span class="linenos">1559</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Return-1602"><a href="#Return-1602"><span class="linenos">1602</span></a><span class="k">class</span> <span class="nc">Return</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Return-1603"><a href="#Return-1603"><span class="linenos">1603</span></a> <span class="k">pass</span> </span></pre></div> @@ -17789,8 +18557,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Reference"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Reference-1562"><a href="#Reference-1562"><span class="linenos">1562</span></a><span class="k">class</span> <span class="nc">Reference</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Reference-1563"><a href="#Reference-1563"><span class="linenos">1563</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Reference-1606"><a href="#Reference-1606"><span class="linenos">1606</span></a><span class="k">class</span> <span class="nc">Reference</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Reference-1607"><a href="#Reference-1607"><span class="linenos">1607</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"options"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -17850,8 +18618,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Tuple"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple-1566"><a href="#Tuple-1566"><span class="linenos">1566</span></a><span class="k">class</span> <span class="nc">Tuple</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Tuple-1567"><a href="#Tuple-1567"><span class="linenos">1567</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Tuple-1610"><a href="#Tuple-1610"><span class="linenos">1610</span></a><span class="k">class</span> <span class="nc">Tuple</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Tuple-1611"><a href="#Tuple-1611"><span class="linenos">1611</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -17911,103 +18679,103 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Subqueryable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable-1570"><a href="#Subqueryable-1570"><span class="linenos">1570</span></a><span class="k">class</span> <span class="nc">Subqueryable</span><span class="p">(</span><span class="n">Unionable</span><span class="p">):</span> -</span><span id="Subqueryable-1571"><a href="#Subqueryable-1571"><span class="linenos">1571</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> -</span><span id="Subqueryable-1572"><a href="#Subqueryable-1572"><span class="linenos">1572</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable-1573"><a href="#Subqueryable-1573"><span class="linenos">1573</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> -</span><span id="Subqueryable-1574"><a href="#Subqueryable-1574"><span class="linenos">1574</span></a> -</span><span id="Subqueryable-1575"><a href="#Subqueryable-1575"><span class="linenos">1575</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable-1576"><a href="#Subqueryable-1576"><span class="linenos">1576</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="Subqueryable-1577"><a href="#Subqueryable-1577"><span class="linenos">1577</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="Subqueryable-1578"><a href="#Subqueryable-1578"><span class="linenos">1578</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="Subqueryable-1579"><a href="#Subqueryable-1579"><span class="linenos">1579</span></a> -</span><span id="Subqueryable-1580"><a href="#Subqueryable-1580"><span class="linenos">1580</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable-1581"><a href="#Subqueryable-1581"><span class="linenos">1581</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="Subqueryable-1582"><a href="#Subqueryable-1582"><span class="linenos">1582</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable-1583"><a href="#Subqueryable-1583"><span class="linenos">1583</span></a> -</span><span id="Subqueryable-1584"><a href="#Subqueryable-1584"><span class="linenos">1584</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable-1585"><a href="#Subqueryable-1585"><span class="linenos">1585</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="Subqueryable-1586"><a href="#Subqueryable-1586"><span class="linenos">1586</span></a><span class="sd"> """</span> -</span><span id="Subqueryable-1587"><a href="#Subqueryable-1587"><span class="linenos">1587</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Subqueryable-1588"><a href="#Subqueryable-1588"><span class="linenos">1588</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> -</span><span id="Subqueryable-1589"><a href="#Subqueryable-1589"><span class="linenos">1589</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="Subqueryable-1590"><a href="#Subqueryable-1590"><span class="linenos">1590</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> -</span><span id="Subqueryable-1591"><a href="#Subqueryable-1591"><span class="linenos">1591</span></a> <span class="p">)</span> -</span><span id="Subqueryable-1592"><a href="#Subqueryable-1592"><span class="linenos">1592</span></a> -</span><span id="Subqueryable-1593"><a href="#Subqueryable-1593"><span class="linenos">1593</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Subqueryable-1594"><a href="#Subqueryable-1594"><span class="linenos">1594</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> -</span><span id="Subqueryable-1595"><a href="#Subqueryable-1595"><span class="linenos">1595</span></a> -</span><span id="Subqueryable-1596"><a href="#Subqueryable-1596"><span class="linenos">1596</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-1597"><a href="#Subqueryable-1597"><span class="linenos">1597</span></a> <span class="k">def</span> <span class="nf">ctes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subqueryable-1598"><a href="#Subqueryable-1598"><span class="linenos">1598</span></a> <span class="n">with_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"with"</span><span class="p">)</span> -</span><span id="Subqueryable-1599"><a href="#Subqueryable-1599"><span class="linenos">1599</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">with_</span><span class="p">:</span> -</span><span id="Subqueryable-1600"><a href="#Subqueryable-1600"><span class="linenos">1600</span></a> <span class="k">return</span> <span class="p">[]</span> -</span><span id="Subqueryable-1601"><a href="#Subqueryable-1601"><span class="linenos">1601</span></a> <span class="k">return</span> <span class="n">with_</span><span class="o">.</span><span class="n">expressions</span> -</span><span id="Subqueryable-1602"><a href="#Subqueryable-1602"><span class="linenos">1602</span></a> -</span><span id="Subqueryable-1603"><a href="#Subqueryable-1603"><span class="linenos">1603</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-1604"><a href="#Subqueryable-1604"><span class="linenos">1604</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subqueryable-1605"><a href="#Subqueryable-1605"><span class="linenos">1605</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `selects`"</span><span class="p">)</span> -</span><span id="Subqueryable-1606"><a href="#Subqueryable-1606"><span class="linenos">1606</span></a> -</span><span id="Subqueryable-1607"><a href="#Subqueryable-1607"><span class="linenos">1607</span></a> <span class="nd">@property</span> -</span><span id="Subqueryable-1608"><a href="#Subqueryable-1608"><span class="linenos">1608</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subqueryable-1609"><a href="#Subqueryable-1609"><span class="linenos">1609</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `named_selects`"</span><span class="p">)</span> -</span><span id="Subqueryable-1610"><a href="#Subqueryable-1610"><span class="linenos">1610</span></a> -</span><span id="Subqueryable-1611"><a href="#Subqueryable-1611"><span class="linenos">1611</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Subqueryable-1612"><a href="#Subqueryable-1612"><span class="linenos">1612</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable-1613"><a href="#Subqueryable-1613"><span class="linenos">1613</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="Subqueryable-1614"><a href="#Subqueryable-1614"><span class="linenos">1614</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="Subqueryable-1615"><a href="#Subqueryable-1615"><span class="linenos">1615</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Subqueryable-1616"><a href="#Subqueryable-1616"><span class="linenos">1616</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Subqueryable-1617"><a href="#Subqueryable-1617"><span class="linenos">1617</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Subqueryable-1618"><a href="#Subqueryable-1618"><span class="linenos">1618</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Subqueryable-1619"><a href="#Subqueryable-1619"><span class="linenos">1619</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable-1620"><a href="#Subqueryable-1620"><span class="linenos">1620</span></a> <span class="p">):</span> -</span><span id="Subqueryable-1621"><a href="#Subqueryable-1621"><span class="linenos">1621</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable-1622"><a href="#Subqueryable-1622"><span class="linenos">1622</span></a><span class="sd"> Append to or set the common table expressions.</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable-1614"><a href="#Subqueryable-1614"><span class="linenos">1614</span></a><span class="k">class</span> <span class="nc">Subqueryable</span><span class="p">(</span><span class="n">Unionable</span><span class="p">):</span> +</span><span id="Subqueryable-1615"><a href="#Subqueryable-1615"><span class="linenos">1615</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> +</span><span id="Subqueryable-1616"><a href="#Subqueryable-1616"><span class="linenos">1616</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable-1617"><a href="#Subqueryable-1617"><span class="linenos">1617</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> +</span><span id="Subqueryable-1618"><a href="#Subqueryable-1618"><span class="linenos">1618</span></a> +</span><span id="Subqueryable-1619"><a href="#Subqueryable-1619"><span class="linenos">1619</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable-1620"><a href="#Subqueryable-1620"><span class="linenos">1620</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="Subqueryable-1621"><a href="#Subqueryable-1621"><span class="linenos">1621</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="Subqueryable-1622"><a href="#Subqueryable-1622"><span class="linenos">1622</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> </span><span id="Subqueryable-1623"><a href="#Subqueryable-1623"><span class="linenos">1623</span></a> -</span><span id="Subqueryable-1624"><a href="#Subqueryable-1624"><span class="linenos">1624</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable-1625"><a href="#Subqueryable-1625"><span class="linenos">1625</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="Subqueryable-1626"><a href="#Subqueryable-1626"><span class="linenos">1626</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="Subqueryable-1624"><a href="#Subqueryable-1624"><span class="linenos">1624</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable-1625"><a href="#Subqueryable-1625"><span class="linenos">1625</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="Subqueryable-1626"><a href="#Subqueryable-1626"><span class="linenos">1626</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> </span><span id="Subqueryable-1627"><a href="#Subqueryable-1627"><span class="linenos">1627</span></a> -</span><span id="Subqueryable-1628"><a href="#Subqueryable-1628"><span class="linenos">1628</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable-1629"><a href="#Subqueryable-1629"><span class="linenos">1629</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="Subqueryable-1630"><a href="#Subqueryable-1630"><span class="linenos">1630</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Subqueryable-1631"><a href="#Subqueryable-1631"><span class="linenos">1631</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> -</span><span id="Subqueryable-1632"><a href="#Subqueryable-1632"><span class="linenos">1632</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Subqueryable-1633"><a href="#Subqueryable-1633"><span class="linenos">1633</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Subqueryable-1634"><a href="#Subqueryable-1634"><span class="linenos">1634</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Subqueryable-1635"><a href="#Subqueryable-1635"><span class="linenos">1635</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Subqueryable-1636"><a href="#Subqueryable-1636"><span class="linenos">1636</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Subqueryable-1637"><a href="#Subqueryable-1637"><span class="linenos">1637</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable-1638"><a href="#Subqueryable-1638"><span class="linenos">1638</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Subqueryable-1628"><a href="#Subqueryable-1628"><span class="linenos">1628</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable-1629"><a href="#Subqueryable-1629"><span class="linenos">1629</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="Subqueryable-1630"><a href="#Subqueryable-1630"><span class="linenos">1630</span></a><span class="sd"> """</span> +</span><span id="Subqueryable-1631"><a href="#Subqueryable-1631"><span class="linenos">1631</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Subqueryable-1632"><a href="#Subqueryable-1632"><span class="linenos">1632</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> +</span><span id="Subqueryable-1633"><a href="#Subqueryable-1633"><span class="linenos">1633</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="Subqueryable-1634"><a href="#Subqueryable-1634"><span class="linenos">1634</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> +</span><span id="Subqueryable-1635"><a href="#Subqueryable-1635"><span class="linenos">1635</span></a> <span class="p">)</span> +</span><span id="Subqueryable-1636"><a href="#Subqueryable-1636"><span class="linenos">1636</span></a> +</span><span id="Subqueryable-1637"><a href="#Subqueryable-1637"><span class="linenos">1637</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Subqueryable-1638"><a href="#Subqueryable-1638"><span class="linenos">1638</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> </span><span id="Subqueryable-1639"><a href="#Subqueryable-1639"><span class="linenos">1639</span></a> -</span><span id="Subqueryable-1640"><a href="#Subqueryable-1640"><span class="linenos">1640</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable-1641"><a href="#Subqueryable-1641"><span class="linenos">1641</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Subqueryable-1642"><a href="#Subqueryable-1642"><span class="linenos">1642</span></a><span class="sd"> """</span> -</span><span id="Subqueryable-1643"><a href="#Subqueryable-1643"><span class="linenos">1643</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Subqueryable-1644"><a href="#Subqueryable-1644"><span class="linenos">1644</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="Subqueryable-1645"><a href="#Subqueryable-1645"><span class="linenos">1645</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Subqueryable-1646"><a href="#Subqueryable-1646"><span class="linenos">1646</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> -</span><span id="Subqueryable-1647"><a href="#Subqueryable-1647"><span class="linenos">1647</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable-1648"><a href="#Subqueryable-1648"><span class="linenos">1648</span></a> <span class="p">)</span> -</span><span id="Subqueryable-1649"><a href="#Subqueryable-1649"><span class="linenos">1649</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Subqueryable-1650"><a href="#Subqueryable-1650"><span class="linenos">1650</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="Subqueryable-1651"><a href="#Subqueryable-1651"><span class="linenos">1651</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Subqueryable-1652"><a href="#Subqueryable-1652"><span class="linenos">1652</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable-1653"><a href="#Subqueryable-1653"><span class="linenos">1653</span></a> <span class="p">)</span> -</span><span id="Subqueryable-1654"><a href="#Subqueryable-1654"><span class="linenos">1654</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> -</span><span id="Subqueryable-1655"><a href="#Subqueryable-1655"><span class="linenos">1655</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> -</span><span id="Subqueryable-1656"><a href="#Subqueryable-1656"><span class="linenos">1656</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> -</span><span id="Subqueryable-1657"><a href="#Subqueryable-1657"><span class="linenos">1657</span></a> <span class="p">)</span> -</span><span id="Subqueryable-1658"><a href="#Subqueryable-1658"><span class="linenos">1658</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Subqueryable-1659"><a href="#Subqueryable-1659"><span class="linenos">1659</span></a> <span class="n">cte</span><span class="p">,</span> -</span><span id="Subqueryable-1660"><a href="#Subqueryable-1660"><span class="linenos">1660</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable-1661"><a href="#Subqueryable-1661"><span class="linenos">1661</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> -</span><span id="Subqueryable-1662"><a href="#Subqueryable-1662"><span class="linenos">1662</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Subqueryable-1663"><a href="#Subqueryable-1663"><span class="linenos">1663</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Subqueryable-1664"><a href="#Subqueryable-1664"><span class="linenos">1664</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> -</span><span id="Subqueryable-1665"><a href="#Subqueryable-1665"><span class="linenos">1665</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> -</span><span id="Subqueryable-1666"><a href="#Subqueryable-1666"><span class="linenos">1666</span></a> <span class="p">)</span> +</span><span id="Subqueryable-1640"><a href="#Subqueryable-1640"><span class="linenos">1640</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-1641"><a href="#Subqueryable-1641"><span class="linenos">1641</span></a> <span class="k">def</span> <span class="nf">ctes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subqueryable-1642"><a href="#Subqueryable-1642"><span class="linenos">1642</span></a> <span class="n">with_</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"with"</span><span class="p">)</span> +</span><span id="Subqueryable-1643"><a href="#Subqueryable-1643"><span class="linenos">1643</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">with_</span><span class="p">:</span> +</span><span id="Subqueryable-1644"><a href="#Subqueryable-1644"><span class="linenos">1644</span></a> <span class="k">return</span> <span class="p">[]</span> +</span><span id="Subqueryable-1645"><a href="#Subqueryable-1645"><span class="linenos">1645</span></a> <span class="k">return</span> <span class="n">with_</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="Subqueryable-1646"><a href="#Subqueryable-1646"><span class="linenos">1646</span></a> +</span><span id="Subqueryable-1647"><a href="#Subqueryable-1647"><span class="linenos">1647</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-1648"><a href="#Subqueryable-1648"><span class="linenos">1648</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subqueryable-1649"><a href="#Subqueryable-1649"><span class="linenos">1649</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `selects`"</span><span class="p">)</span> +</span><span id="Subqueryable-1650"><a href="#Subqueryable-1650"><span class="linenos">1650</span></a> +</span><span id="Subqueryable-1651"><a href="#Subqueryable-1651"><span class="linenos">1651</span></a> <span class="nd">@property</span> +</span><span id="Subqueryable-1652"><a href="#Subqueryable-1652"><span class="linenos">1652</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subqueryable-1653"><a href="#Subqueryable-1653"><span class="linenos">1653</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span><span class="s2">"Subqueryable objects must implement `named_selects`"</span><span class="p">)</span> +</span><span id="Subqueryable-1654"><a href="#Subqueryable-1654"><span class="linenos">1654</span></a> +</span><span id="Subqueryable-1655"><a href="#Subqueryable-1655"><span class="linenos">1655</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Subqueryable-1656"><a href="#Subqueryable-1656"><span class="linenos">1656</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable-1657"><a href="#Subqueryable-1657"><span class="linenos">1657</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="Subqueryable-1658"><a href="#Subqueryable-1658"><span class="linenos">1658</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="Subqueryable-1659"><a href="#Subqueryable-1659"><span class="linenos">1659</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Subqueryable-1660"><a href="#Subqueryable-1660"><span class="linenos">1660</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Subqueryable-1661"><a href="#Subqueryable-1661"><span class="linenos">1661</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Subqueryable-1662"><a href="#Subqueryable-1662"><span class="linenos">1662</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Subqueryable-1663"><a href="#Subqueryable-1663"><span class="linenos">1663</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable-1664"><a href="#Subqueryable-1664"><span class="linenos">1664</span></a> <span class="p">):</span> +</span><span id="Subqueryable-1665"><a href="#Subqueryable-1665"><span class="linenos">1665</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable-1666"><a href="#Subqueryable-1666"><span class="linenos">1666</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Subqueryable-1667"><a href="#Subqueryable-1667"><span class="linenos">1667</span></a> +</span><span id="Subqueryable-1668"><a href="#Subqueryable-1668"><span class="linenos">1668</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable-1669"><a href="#Subqueryable-1669"><span class="linenos">1669</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="Subqueryable-1670"><a href="#Subqueryable-1670"><span class="linenos">1670</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="Subqueryable-1671"><a href="#Subqueryable-1671"><span class="linenos">1671</span></a> +</span><span id="Subqueryable-1672"><a href="#Subqueryable-1672"><span class="linenos">1672</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable-1673"><a href="#Subqueryable-1673"><span class="linenos">1673</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="Subqueryable-1674"><a href="#Subqueryable-1674"><span class="linenos">1674</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Subqueryable-1675"><a href="#Subqueryable-1675"><span class="linenos">1675</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> +</span><span id="Subqueryable-1676"><a href="#Subqueryable-1676"><span class="linenos">1676</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Subqueryable-1677"><a href="#Subqueryable-1677"><span class="linenos">1677</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Subqueryable-1678"><a href="#Subqueryable-1678"><span class="linenos">1678</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Subqueryable-1679"><a href="#Subqueryable-1679"><span class="linenos">1679</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Subqueryable-1680"><a href="#Subqueryable-1680"><span class="linenos">1680</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Subqueryable-1681"><a href="#Subqueryable-1681"><span class="linenos">1681</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable-1682"><a href="#Subqueryable-1682"><span class="linenos">1682</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Subqueryable-1683"><a href="#Subqueryable-1683"><span class="linenos">1683</span></a> +</span><span id="Subqueryable-1684"><a href="#Subqueryable-1684"><span class="linenos">1684</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable-1685"><a href="#Subqueryable-1685"><span class="linenos">1685</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Subqueryable-1686"><a href="#Subqueryable-1686"><span class="linenos">1686</span></a><span class="sd"> """</span> +</span><span id="Subqueryable-1687"><a href="#Subqueryable-1687"><span class="linenos">1687</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Subqueryable-1688"><a href="#Subqueryable-1688"><span class="linenos">1688</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="Subqueryable-1689"><a href="#Subqueryable-1689"><span class="linenos">1689</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Subqueryable-1690"><a href="#Subqueryable-1690"><span class="linenos">1690</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> +</span><span id="Subqueryable-1691"><a href="#Subqueryable-1691"><span class="linenos">1691</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable-1692"><a href="#Subqueryable-1692"><span class="linenos">1692</span></a> <span class="p">)</span> +</span><span id="Subqueryable-1693"><a href="#Subqueryable-1693"><span class="linenos">1693</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Subqueryable-1694"><a href="#Subqueryable-1694"><span class="linenos">1694</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="Subqueryable-1695"><a href="#Subqueryable-1695"><span class="linenos">1695</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Subqueryable-1696"><a href="#Subqueryable-1696"><span class="linenos">1696</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable-1697"><a href="#Subqueryable-1697"><span class="linenos">1697</span></a> <span class="p">)</span> +</span><span id="Subqueryable-1698"><a href="#Subqueryable-1698"><span class="linenos">1698</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> +</span><span id="Subqueryable-1699"><a href="#Subqueryable-1699"><span class="linenos">1699</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> +</span><span id="Subqueryable-1700"><a href="#Subqueryable-1700"><span class="linenos">1700</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> +</span><span id="Subqueryable-1701"><a href="#Subqueryable-1701"><span class="linenos">1701</span></a> <span class="p">)</span> +</span><span id="Subqueryable-1702"><a href="#Subqueryable-1702"><span class="linenos">1702</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Subqueryable-1703"><a href="#Subqueryable-1703"><span class="linenos">1703</span></a> <span class="n">cte</span><span class="p">,</span> +</span><span id="Subqueryable-1704"><a href="#Subqueryable-1704"><span class="linenos">1704</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable-1705"><a href="#Subqueryable-1705"><span class="linenos">1705</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> +</span><span id="Subqueryable-1706"><a href="#Subqueryable-1706"><span class="linenos">1706</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Subqueryable-1707"><a href="#Subqueryable-1707"><span class="linenos">1707</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Subqueryable-1708"><a href="#Subqueryable-1708"><span class="linenos">1708</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> +</span><span id="Subqueryable-1709"><a href="#Subqueryable-1709"><span class="linenos">1709</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> +</span><span id="Subqueryable-1710"><a href="#Subqueryable-1710"><span class="linenos">1710</span></a> <span class="p">)</span> </span></pre></div> @@ -18024,27 +18792,27 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Subqueryable.subquery"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.subquery-1571"><a href="#Subqueryable.subquery-1571"><span class="linenos">1571</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> -</span><span id="Subqueryable.subquery-1572"><a href="#Subqueryable.subquery-1572"><span class="linenos">1572</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable.subquery-1573"><a href="#Subqueryable.subquery-1573"><span class="linenos">1573</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> -</span><span id="Subqueryable.subquery-1574"><a href="#Subqueryable.subquery-1574"><span class="linenos">1574</span></a> -</span><span id="Subqueryable.subquery-1575"><a href="#Subqueryable.subquery-1575"><span class="linenos">1575</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable.subquery-1576"><a href="#Subqueryable.subquery-1576"><span class="linenos">1576</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> -</span><span id="Subqueryable.subquery-1577"><a href="#Subqueryable.subquery-1577"><span class="linenos">1577</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> -</span><span id="Subqueryable.subquery-1578"><a href="#Subqueryable.subquery-1578"><span class="linenos">1578</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> -</span><span id="Subqueryable.subquery-1579"><a href="#Subqueryable.subquery-1579"><span class="linenos">1579</span></a> -</span><span id="Subqueryable.subquery-1580"><a href="#Subqueryable.subquery-1580"><span class="linenos">1580</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable.subquery-1581"><a href="#Subqueryable.subquery-1581"><span class="linenos">1581</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> -</span><span id="Subqueryable.subquery-1582"><a href="#Subqueryable.subquery-1582"><span class="linenos">1582</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable.subquery-1583"><a href="#Subqueryable.subquery-1583"><span class="linenos">1583</span></a> -</span><span id="Subqueryable.subquery-1584"><a href="#Subqueryable.subquery-1584"><span class="linenos">1584</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable.subquery-1585"><a href="#Subqueryable.subquery-1585"><span class="linenos">1585</span></a><span class="sd"> Alias: the subquery</span> -</span><span id="Subqueryable.subquery-1586"><a href="#Subqueryable.subquery-1586"><span class="linenos">1586</span></a><span class="sd"> """</span> -</span><span id="Subqueryable.subquery-1587"><a href="#Subqueryable.subquery-1587"><span class="linenos">1587</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Subqueryable.subquery-1588"><a href="#Subqueryable.subquery-1588"><span class="linenos">1588</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> -</span><span id="Subqueryable.subquery-1589"><a href="#Subqueryable.subquery-1589"><span class="linenos">1589</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="Subqueryable.subquery-1590"><a href="#Subqueryable.subquery-1590"><span class="linenos">1590</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> -</span><span id="Subqueryable.subquery-1591"><a href="#Subqueryable.subquery-1591"><span class="linenos">1591</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.subquery-1615"><a href="#Subqueryable.subquery-1615"><span class="linenos">1615</span></a> <span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Subquery</span><span class="p">:</span> +</span><span id="Subqueryable.subquery-1616"><a href="#Subqueryable.subquery-1616"><span class="linenos">1616</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable.subquery-1617"><a href="#Subqueryable.subquery-1617"><span class="linenos">1617</span></a><span class="sd"> Convert this expression to an aliased expression that can be used as a Subquery.</span> +</span><span id="Subqueryable.subquery-1618"><a href="#Subqueryable.subquery-1618"><span class="linenos">1618</span></a> +</span><span id="Subqueryable.subquery-1619"><a href="#Subqueryable.subquery-1619"><span class="linenos">1619</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable.subquery-1620"><a href="#Subqueryable.subquery-1620"><span class="linenos">1620</span></a><span class="sd"> >>> subquery = Select().select("x").from_("tbl").subquery()</span> +</span><span id="Subqueryable.subquery-1621"><a href="#Subqueryable.subquery-1621"><span class="linenos">1621</span></a><span class="sd"> >>> Select().select("x").from_(subquery).sql()</span> +</span><span id="Subqueryable.subquery-1622"><a href="#Subqueryable.subquery-1622"><span class="linenos">1622</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl)'</span> +</span><span id="Subqueryable.subquery-1623"><a href="#Subqueryable.subquery-1623"><span class="linenos">1623</span></a> +</span><span id="Subqueryable.subquery-1624"><a href="#Subqueryable.subquery-1624"><span class="linenos">1624</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable.subquery-1625"><a href="#Subqueryable.subquery-1625"><span class="linenos">1625</span></a><span class="sd"> alias (str | Identifier): an optional alias for the subquery</span> +</span><span id="Subqueryable.subquery-1626"><a href="#Subqueryable.subquery-1626"><span class="linenos">1626</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable.subquery-1627"><a href="#Subqueryable.subquery-1627"><span class="linenos">1627</span></a> +</span><span id="Subqueryable.subquery-1628"><a href="#Subqueryable.subquery-1628"><span class="linenos">1628</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable.subquery-1629"><a href="#Subqueryable.subquery-1629"><span class="linenos">1629</span></a><span class="sd"> Alias: the subquery</span> +</span><span id="Subqueryable.subquery-1630"><a href="#Subqueryable.subquery-1630"><span class="linenos">1630</span></a><span class="sd"> """</span> +</span><span id="Subqueryable.subquery-1631"><a href="#Subqueryable.subquery-1631"><span class="linenos">1631</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Subqueryable.subquery-1632"><a href="#Subqueryable.subquery-1632"><span class="linenos">1632</span></a> <span class="k">return</span> <span class="n">Subquery</span><span class="p">(</span> +</span><span id="Subqueryable.subquery-1633"><a href="#Subqueryable.subquery-1633"><span class="linenos">1633</span></a> <span class="n">this</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="Subqueryable.subquery-1634"><a href="#Subqueryable.subquery-1634"><span class="linenos">1634</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)),</span> +</span><span id="Subqueryable.subquery-1635"><a href="#Subqueryable.subquery-1635"><span class="linenos">1635</span></a> <span class="p">)</span> </span></pre></div> @@ -18088,8 +18856,8 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Subqueryable.limit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.limit-1593"><a href="#Subqueryable.limit-1593"><span class="linenos">1593</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Subqueryable.limit-1594"><a href="#Subqueryable.limit-1594"><span class="linenos">1594</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.limit-1637"><a href="#Subqueryable.limit-1637"><span class="linenos">1637</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Subqueryable.limit-1638"><a href="#Subqueryable.limit-1638"><span class="linenos">1638</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span> </span></pre></div> @@ -18107,62 +18875,62 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Subqueryable.with_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.with_-1611"><a href="#Subqueryable.with_-1611"><span class="linenos">1611</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> -</span><span id="Subqueryable.with_-1612"><a href="#Subqueryable.with_-1612"><span class="linenos">1612</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1613"><a href="#Subqueryable.with_-1613"><span class="linenos">1613</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1614"><a href="#Subqueryable.with_-1614"><span class="linenos">1614</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1615"><a href="#Subqueryable.with_-1615"><span class="linenos">1615</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1616"><a href="#Subqueryable.with_-1616"><span class="linenos">1616</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1617"><a href="#Subqueryable.with_-1617"><span class="linenos">1617</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1618"><a href="#Subqueryable.with_-1618"><span class="linenos">1618</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1619"><a href="#Subqueryable.with_-1619"><span class="linenos">1619</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1620"><a href="#Subqueryable.with_-1620"><span class="linenos">1620</span></a> <span class="p">):</span> -</span><span id="Subqueryable.with_-1621"><a href="#Subqueryable.with_-1621"><span class="linenos">1621</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subqueryable.with_-1622"><a href="#Subqueryable.with_-1622"><span class="linenos">1622</span></a><span class="sd"> Append to or set the common table expressions.</span> -</span><span id="Subqueryable.with_-1623"><a href="#Subqueryable.with_-1623"><span class="linenos">1623</span></a> -</span><span id="Subqueryable.with_-1624"><a href="#Subqueryable.with_-1624"><span class="linenos">1624</span></a><span class="sd"> Example:</span> -</span><span id="Subqueryable.with_-1625"><a href="#Subqueryable.with_-1625"><span class="linenos">1625</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> -</span><span id="Subqueryable.with_-1626"><a href="#Subqueryable.with_-1626"><span class="linenos">1626</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> -</span><span id="Subqueryable.with_-1627"><a href="#Subqueryable.with_-1627"><span class="linenos">1627</span></a> -</span><span id="Subqueryable.with_-1628"><a href="#Subqueryable.with_-1628"><span class="linenos">1628</span></a><span class="sd"> Args:</span> -</span><span id="Subqueryable.with_-1629"><a href="#Subqueryable.with_-1629"><span class="linenos">1629</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="Subqueryable.with_-1630"><a href="#Subqueryable.with_-1630"><span class="linenos">1630</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> -</span><span id="Subqueryable.with_-1631"><a href="#Subqueryable.with_-1631"><span class="linenos">1631</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> -</span><span id="Subqueryable.with_-1632"><a href="#Subqueryable.with_-1632"><span class="linenos">1632</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Subqueryable.with_-1633"><a href="#Subqueryable.with_-1633"><span class="linenos">1633</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> -</span><span id="Subqueryable.with_-1634"><a href="#Subqueryable.with_-1634"><span class="linenos">1634</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Subqueryable.with_-1635"><a href="#Subqueryable.with_-1635"><span class="linenos">1635</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Subqueryable.with_-1636"><a href="#Subqueryable.with_-1636"><span class="linenos">1636</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Subqueryable.with_-1637"><a href="#Subqueryable.with_-1637"><span class="linenos">1637</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Subqueryable.with_-1638"><a href="#Subqueryable.with_-1638"><span class="linenos">1638</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Subqueryable.with_-1639"><a href="#Subqueryable.with_-1639"><span class="linenos">1639</span></a> -</span><span id="Subqueryable.with_-1640"><a href="#Subqueryable.with_-1640"><span class="linenos">1640</span></a><span class="sd"> Returns:</span> -</span><span id="Subqueryable.with_-1641"><a href="#Subqueryable.with_-1641"><span class="linenos">1641</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Subqueryable.with_-1642"><a href="#Subqueryable.with_-1642"><span class="linenos">1642</span></a><span class="sd"> """</span> -</span><span id="Subqueryable.with_-1643"><a href="#Subqueryable.with_-1643"><span class="linenos">1643</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Subqueryable.with_-1644"><a href="#Subqueryable.with_-1644"><span class="linenos">1644</span></a> <span class="n">alias</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1645"><a href="#Subqueryable.with_-1645"><span class="linenos">1645</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1646"><a href="#Subqueryable.with_-1646"><span class="linenos">1646</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1647"><a href="#Subqueryable.with_-1647"><span class="linenos">1647</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1648"><a href="#Subqueryable.with_-1648"><span class="linenos">1648</span></a> <span class="p">)</span> -</span><span id="Subqueryable.with_-1649"><a href="#Subqueryable.with_-1649"><span class="linenos">1649</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Subqueryable.with_-1650"><a href="#Subqueryable.with_-1650"><span class="linenos">1650</span></a> <span class="n">as_</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1651"><a href="#Subqueryable.with_-1651"><span class="linenos">1651</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1652"><a href="#Subqueryable.with_-1652"><span class="linenos">1652</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1653"><a href="#Subqueryable.with_-1653"><span class="linenos">1653</span></a> <span class="p">)</span> -</span><span id="Subqueryable.with_-1654"><a href="#Subqueryable.with_-1654"><span class="linenos">1654</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> -</span><span id="Subqueryable.with_-1655"><a href="#Subqueryable.with_-1655"><span class="linenos">1655</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1656"><a href="#Subqueryable.with_-1656"><span class="linenos">1656</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1657"><a href="#Subqueryable.with_-1657"><span class="linenos">1657</span></a> <span class="p">)</span> -</span><span id="Subqueryable.with_-1658"><a href="#Subqueryable.with_-1658"><span class="linenos">1658</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Subqueryable.with_-1659"><a href="#Subqueryable.with_-1659"><span class="linenos">1659</span></a> <span class="n">cte</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1660"><a href="#Subqueryable.with_-1660"><span class="linenos">1660</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1661"><a href="#Subqueryable.with_-1661"><span class="linenos">1661</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1662"><a href="#Subqueryable.with_-1662"><span class="linenos">1662</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1663"><a href="#Subqueryable.with_-1663"><span class="linenos">1663</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1664"><a href="#Subqueryable.with_-1664"><span class="linenos">1664</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> -</span><span id="Subqueryable.with_-1665"><a href="#Subqueryable.with_-1665"><span class="linenos">1665</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> -</span><span id="Subqueryable.with_-1666"><a href="#Subqueryable.with_-1666"><span class="linenos">1666</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subqueryable.with_-1655"><a href="#Subqueryable.with_-1655"><span class="linenos">1655</span></a> <span class="k">def</span> <span class="nf">with_</span><span class="p">(</span> +</span><span id="Subqueryable.with_-1656"><a href="#Subqueryable.with_-1656"><span class="linenos">1656</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1657"><a href="#Subqueryable.with_-1657"><span class="linenos">1657</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1658"><a href="#Subqueryable.with_-1658"><span class="linenos">1658</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1659"><a href="#Subqueryable.with_-1659"><span class="linenos">1659</span></a> <span class="n">recursive</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1660"><a href="#Subqueryable.with_-1660"><span class="linenos">1660</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1661"><a href="#Subqueryable.with_-1661"><span class="linenos">1661</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1662"><a href="#Subqueryable.with_-1662"><span class="linenos">1662</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1663"><a href="#Subqueryable.with_-1663"><span class="linenos">1663</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1664"><a href="#Subqueryable.with_-1664"><span class="linenos">1664</span></a> <span class="p">):</span> +</span><span id="Subqueryable.with_-1665"><a href="#Subqueryable.with_-1665"><span class="linenos">1665</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subqueryable.with_-1666"><a href="#Subqueryable.with_-1666"><span class="linenos">1666</span></a><span class="sd"> Append to or set the common table expressions.</span> +</span><span id="Subqueryable.with_-1667"><a href="#Subqueryable.with_-1667"><span class="linenos">1667</span></a> +</span><span id="Subqueryable.with_-1668"><a href="#Subqueryable.with_-1668"><span class="linenos">1668</span></a><span class="sd"> Example:</span> +</span><span id="Subqueryable.with_-1669"><a href="#Subqueryable.with_-1669"><span class="linenos">1669</span></a><span class="sd"> >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()</span> +</span><span id="Subqueryable.with_-1670"><a href="#Subqueryable.with_-1670"><span class="linenos">1670</span></a><span class="sd"> 'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'</span> +</span><span id="Subqueryable.with_-1671"><a href="#Subqueryable.with_-1671"><span class="linenos">1671</span></a> +</span><span id="Subqueryable.with_-1672"><a href="#Subqueryable.with_-1672"><span class="linenos">1672</span></a><span class="sd"> Args:</span> +</span><span id="Subqueryable.with_-1673"><a href="#Subqueryable.with_-1673"><span class="linenos">1673</span></a><span class="sd"> alias (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="Subqueryable.with_-1674"><a href="#Subqueryable.with_-1674"><span class="linenos">1674</span></a><span class="sd"> If an `Expression` instance is passed, this is used as-is.</span> +</span><span id="Subqueryable.with_-1675"><a href="#Subqueryable.with_-1675"><span class="linenos">1675</span></a><span class="sd"> as_ (str | Expression): the SQL code string to parse as the table expression.</span> +</span><span id="Subqueryable.with_-1676"><a href="#Subqueryable.with_-1676"><span class="linenos">1676</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Subqueryable.with_-1677"><a href="#Subqueryable.with_-1677"><span class="linenos">1677</span></a><span class="sd"> recursive (bool): set the RECURSIVE part of the expression. Defaults to `False`.</span> +</span><span id="Subqueryable.with_-1678"><a href="#Subqueryable.with_-1678"><span class="linenos">1678</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Subqueryable.with_-1679"><a href="#Subqueryable.with_-1679"><span class="linenos">1679</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Subqueryable.with_-1680"><a href="#Subqueryable.with_-1680"><span class="linenos">1680</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Subqueryable.with_-1681"><a href="#Subqueryable.with_-1681"><span class="linenos">1681</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Subqueryable.with_-1682"><a href="#Subqueryable.with_-1682"><span class="linenos">1682</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Subqueryable.with_-1683"><a href="#Subqueryable.with_-1683"><span class="linenos">1683</span></a> +</span><span id="Subqueryable.with_-1684"><a href="#Subqueryable.with_-1684"><span class="linenos">1684</span></a><span class="sd"> Returns:</span> +</span><span id="Subqueryable.with_-1685"><a href="#Subqueryable.with_-1685"><span class="linenos">1685</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Subqueryable.with_-1686"><a href="#Subqueryable.with_-1686"><span class="linenos">1686</span></a><span class="sd"> """</span> +</span><span id="Subqueryable.with_-1687"><a href="#Subqueryable.with_-1687"><span class="linenos">1687</span></a> <span class="n">alias_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Subqueryable.with_-1688"><a href="#Subqueryable.with_-1688"><span class="linenos">1688</span></a> <span class="n">alias</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1689"><a href="#Subqueryable.with_-1689"><span class="linenos">1689</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1690"><a href="#Subqueryable.with_-1690"><span class="linenos">1690</span></a> <span class="n">into</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1691"><a href="#Subqueryable.with_-1691"><span class="linenos">1691</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1692"><a href="#Subqueryable.with_-1692"><span class="linenos">1692</span></a> <span class="p">)</span> +</span><span id="Subqueryable.with_-1693"><a href="#Subqueryable.with_-1693"><span class="linenos">1693</span></a> <span class="n">as_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Subqueryable.with_-1694"><a href="#Subqueryable.with_-1694"><span class="linenos">1694</span></a> <span class="n">as_</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1695"><a href="#Subqueryable.with_-1695"><span class="linenos">1695</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1696"><a href="#Subqueryable.with_-1696"><span class="linenos">1696</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1697"><a href="#Subqueryable.with_-1697"><span class="linenos">1697</span></a> <span class="p">)</span> +</span><span id="Subqueryable.with_-1698"><a href="#Subqueryable.with_-1698"><span class="linenos">1698</span></a> <span class="n">cte</span> <span class="o">=</span> <span class="n">CTE</span><span class="p">(</span> +</span><span id="Subqueryable.with_-1699"><a href="#Subqueryable.with_-1699"><span class="linenos">1699</span></a> <span class="n">this</span><span class="o">=</span><span class="n">as_expression</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1700"><a href="#Subqueryable.with_-1700"><span class="linenos">1700</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">alias_expression</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1701"><a href="#Subqueryable.with_-1701"><span class="linenos">1701</span></a> <span class="p">)</span> +</span><span id="Subqueryable.with_-1702"><a href="#Subqueryable.with_-1702"><span class="linenos">1702</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Subqueryable.with_-1703"><a href="#Subqueryable.with_-1703"><span class="linenos">1703</span></a> <span class="n">cte</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1704"><a href="#Subqueryable.with_-1704"><span class="linenos">1704</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1705"><a href="#Subqueryable.with_-1705"><span class="linenos">1705</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"with"</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1706"><a href="#Subqueryable.with_-1706"><span class="linenos">1706</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1707"><a href="#Subqueryable.with_-1707"><span class="linenos">1707</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1708"><a href="#Subqueryable.with_-1708"><span class="linenos">1708</span></a> <span class="n">into</span><span class="o">=</span><span class="n">With</span><span class="p">,</span> +</span><span id="Subqueryable.with_-1709"><a href="#Subqueryable.with_-1709"><span class="linenos">1709</span></a> <span class="n">properties</span><span class="o">=</span><span class="p">{</span><span class="s2">"recursive"</span><span class="p">:</span> <span class="n">recursive</span> <span class="ow">or</span> <span class="kc">False</span><span class="p">},</span> +</span><span id="Subqueryable.with_-1710"><a href="#Subqueryable.with_-1710"><span class="linenos">1710</span></a> <span class="p">)</span> </span></pre></div> @@ -18262,26 +19030,26 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Table"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Table-1689"><a href="#Table-1689"><span class="linenos">1689</span></a><span class="k">class</span> <span class="nc">Table</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Table-1690"><a href="#Table-1690"><span class="linenos">1690</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Table-1691"><a href="#Table-1691"><span class="linenos">1691</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Table-1692"><a href="#Table-1692"><span class="linenos">1692</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1693"><a href="#Table-1693"><span class="linenos">1693</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1694"><a href="#Table-1694"><span class="linenos">1694</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1695"><a href="#Table-1695"><span class="linenos">1695</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1696"><a href="#Table-1696"><span class="linenos">1696</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1697"><a href="#Table-1697"><span class="linenos">1697</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1698"><a href="#Table-1698"><span class="linenos">1698</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1699"><a href="#Table-1699"><span class="linenos">1699</span></a> <span class="s2">"system_time"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Table-1700"><a href="#Table-1700"><span class="linenos">1700</span></a> <span class="p">}</span> -</span><span id="Table-1701"><a href="#Table-1701"><span class="linenos">1701</span></a> -</span><span id="Table-1702"><a href="#Table-1702"><span class="linenos">1702</span></a> <span class="nd">@property</span> -</span><span id="Table-1703"><a href="#Table-1703"><span class="linenos">1703</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Table-1704"><a href="#Table-1704"><span class="linenos">1704</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> -</span><span id="Table-1705"><a href="#Table-1705"><span class="linenos">1705</span></a> -</span><span id="Table-1706"><a href="#Table-1706"><span class="linenos">1706</span></a> <span class="nd">@property</span> -</span><span id="Table-1707"><a href="#Table-1707"><span class="linenos">1707</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Table-1708"><a href="#Table-1708"><span class="linenos">1708</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Table-1733"><a href="#Table-1733"><span class="linenos">1733</span></a><span class="k">class</span> <span class="nc">Table</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Table-1734"><a href="#Table-1734"><span class="linenos">1734</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Table-1735"><a href="#Table-1735"><span class="linenos">1735</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Table-1736"><a href="#Table-1736"><span class="linenos">1736</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1737"><a href="#Table-1737"><span class="linenos">1737</span></a> <span class="s2">"db"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1738"><a href="#Table-1738"><span class="linenos">1738</span></a> <span class="s2">"catalog"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1739"><a href="#Table-1739"><span class="linenos">1739</span></a> <span class="s2">"laterals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1740"><a href="#Table-1740"><span class="linenos">1740</span></a> <span class="s2">"joins"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1741"><a href="#Table-1741"><span class="linenos">1741</span></a> <span class="s2">"pivots"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1742"><a href="#Table-1742"><span class="linenos">1742</span></a> <span class="s2">"hints"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1743"><a href="#Table-1743"><span class="linenos">1743</span></a> <span class="s2">"system_time"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Table-1744"><a href="#Table-1744"><span class="linenos">1744</span></a> <span class="p">}</span> +</span><span id="Table-1745"><a href="#Table-1745"><span class="linenos">1745</span></a> +</span><span id="Table-1746"><a href="#Table-1746"><span class="linenos">1746</span></a> <span class="nd">@property</span> +</span><span id="Table-1747"><a href="#Table-1747"><span class="linenos">1747</span></a> <span class="k">def</span> <span class="nf">db</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Table-1748"><a href="#Table-1748"><span class="linenos">1748</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">)</span> +</span><span id="Table-1749"><a href="#Table-1749"><span class="linenos">1749</span></a> +</span><span id="Table-1750"><a href="#Table-1750"><span class="linenos">1750</span></a> <span class="nd">@property</span> +</span><span id="Table-1751"><a href="#Table-1751"><span class="linenos">1751</span></a> <span class="k">def</span> <span class="nf">catalog</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Table-1752"><a href="#Table-1752"><span class="linenos">1752</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">)</span> </span></pre></div> @@ -18341,12 +19109,12 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#SystemTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SystemTime-1712"><a href="#SystemTime-1712"><span class="linenos">1712</span></a><span class="k">class</span> <span class="nc">SystemTime</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="SystemTime-1713"><a href="#SystemTime-1713"><span class="linenos">1713</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="SystemTime-1714"><a href="#SystemTime-1714"><span class="linenos">1714</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SystemTime-1715"><a href="#SystemTime-1715"><span class="linenos">1715</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="SystemTime-1716"><a href="#SystemTime-1716"><span class="linenos">1716</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="SystemTime-1717"><a href="#SystemTime-1717"><span class="linenos">1717</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SystemTime-1756"><a href="#SystemTime-1756"><span class="linenos">1756</span></a><span class="k">class</span> <span class="nc">SystemTime</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="SystemTime-1757"><a href="#SystemTime-1757"><span class="linenos">1757</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="SystemTime-1758"><a href="#SystemTime-1758"><span class="linenos">1758</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SystemTime-1759"><a href="#SystemTime-1759"><span class="linenos">1759</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="SystemTime-1760"><a href="#SystemTime-1760"><span class="linenos">1760</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="SystemTime-1761"><a href="#SystemTime-1761"><span class="linenos">1761</span></a> <span class="p">}</span> </span></pre></div> @@ -18406,90 +19174,94 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Union"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Union-1720"><a href="#Union-1720"><span class="linenos">1720</span></a><span class="k">class</span> <span class="nc">Union</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> -</span><span id="Union-1721"><a href="#Union-1721"><span class="linenos">1721</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Union-1722"><a href="#Union-1722"><span class="linenos">1722</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Union-1723"><a href="#Union-1723"><span class="linenos">1723</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-1724"><a href="#Union-1724"><span class="linenos">1724</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-1725"><a href="#Union-1725"><span class="linenos">1725</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Union-1726"><a href="#Union-1726"><span class="linenos">1726</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Union-1727"><a href="#Union-1727"><span class="linenos">1727</span></a> <span class="p">}</span> -</span><span id="Union-1728"><a href="#Union-1728"><span class="linenos">1728</span></a> -</span><span id="Union-1729"><a href="#Union-1729"><span class="linenos">1729</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Union-1730"><a href="#Union-1730"><span class="linenos">1730</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Union-1731"><a href="#Union-1731"><span class="linenos">1731</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Union-1732"><a href="#Union-1732"><span class="linenos">1732</span></a> -</span><span id="Union-1733"><a href="#Union-1733"><span class="linenos">1733</span></a><span class="sd"> Example:</span> -</span><span id="Union-1734"><a href="#Union-1734"><span class="linenos">1734</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="Union-1735"><a href="#Union-1735"><span class="linenos">1735</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="Union-1736"><a href="#Union-1736"><span class="linenos">1736</span></a> -</span><span id="Union-1737"><a href="#Union-1737"><span class="linenos">1737</span></a><span class="sd"> Args:</span> -</span><span id="Union-1738"><a href="#Union-1738"><span class="linenos">1738</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Union-1739"><a href="#Union-1739"><span class="linenos">1739</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Union-1740"><a href="#Union-1740"><span class="linenos">1740</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Union-1741"><a href="#Union-1741"><span class="linenos">1741</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Union-1742"><a href="#Union-1742"><span class="linenos">1742</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Union-1743"><a href="#Union-1743"><span class="linenos">1743</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Union-1744"><a href="#Union-1744"><span class="linenos">1744</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Union-1745"><a href="#Union-1745"><span class="linenos">1745</span></a> -</span><span id="Union-1746"><a href="#Union-1746"><span class="linenos">1746</span></a><span class="sd"> Returns:</span> -</span><span id="Union-1747"><a href="#Union-1747"><span class="linenos">1747</span></a><span class="sd"> Select: The limited subqueryable.</span> -</span><span id="Union-1748"><a href="#Union-1748"><span class="linenos">1748</span></a><span class="sd"> """</span> -</span><span id="Union-1749"><a href="#Union-1749"><span class="linenos">1749</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="Union-1750"><a href="#Union-1750"><span class="linenos">1750</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="Union-1751"><a href="#Union-1751"><span class="linenos">1751</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> -</span><span id="Union-1752"><a href="#Union-1752"><span class="linenos">1752</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Union-1753"><a href="#Union-1753"><span class="linenos">1753</span></a> <span class="p">)</span> -</span><span id="Union-1754"><a href="#Union-1754"><span class="linenos">1754</span></a> -</span><span id="Union-1755"><a href="#Union-1755"><span class="linenos">1755</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Union-1756"><a href="#Union-1756"><span class="linenos">1756</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Union-1757"><a href="#Union-1757"><span class="linenos">1757</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="Union-1758"><a href="#Union-1758"><span class="linenos">1758</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-1759"><a href="#Union-1759"><span class="linenos">1759</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Union-1760"><a href="#Union-1760"><span class="linenos">1760</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union-1761"><a href="#Union-1761"><span class="linenos">1761</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Union-1762"><a href="#Union-1762"><span class="linenos">1762</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="Union-1763"><a href="#Union-1763"><span class="linenos">1763</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> -</span><span id="Union-1764"><a href="#Union-1764"><span class="linenos">1764</span></a> -</span><span id="Union-1765"><a href="#Union-1765"><span class="linenos">1765</span></a><span class="sd"> Example:</span> -</span><span id="Union-1766"><a href="#Union-1766"><span class="linenos">1766</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Union-1767"><a href="#Union-1767"><span class="linenos">1767</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> -</span><span id="Union-1768"><a href="#Union-1768"><span class="linenos">1768</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> -</span><span id="Union-1769"><a href="#Union-1769"><span class="linenos">1769</span></a> -</span><span id="Union-1770"><a href="#Union-1770"><span class="linenos">1770</span></a><span class="sd"> Args:</span> -</span><span id="Union-1771"><a href="#Union-1771"><span class="linenos">1771</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Union-1772"><a href="#Union-1772"><span class="linenos">1772</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Union-1773"><a href="#Union-1773"><span class="linenos">1773</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Union-1774"><a href="#Union-1774"><span class="linenos">1774</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Union-1775"><a href="#Union-1775"><span class="linenos">1775</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Union-1776"><a href="#Union-1776"><span class="linenos">1776</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union-1777"><a href="#Union-1777"><span class="linenos">1777</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union-1778"><a href="#Union-1778"><span class="linenos">1778</span></a> -</span><span id="Union-1779"><a href="#Union-1779"><span class="linenos">1779</span></a><span class="sd"> Returns:</span> -</span><span id="Union-1780"><a href="#Union-1780"><span class="linenos">1780</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="Union-1781"><a href="#Union-1781"><span class="linenos">1781</span></a><span class="sd"> """</span> -</span><span id="Union-1782"><a href="#Union-1782"><span class="linenos">1782</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="Union-1783"><a href="#Union-1783"><span class="linenos">1783</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Union-1784"><a href="#Union-1784"><span class="linenos">1784</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> -</span><span id="Union-1785"><a href="#Union-1785"><span class="linenos">1785</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Union-1786"><a href="#Union-1786"><span class="linenos">1786</span></a> <span class="p">)</span> -</span><span id="Union-1787"><a href="#Union-1787"><span class="linenos">1787</span></a> <span class="k">return</span> <span class="n">this</span> -</span><span id="Union-1788"><a href="#Union-1788"><span class="linenos">1788</span></a> -</span><span id="Union-1789"><a href="#Union-1789"><span class="linenos">1789</span></a> <span class="nd">@property</span> -</span><span id="Union-1790"><a href="#Union-1790"><span class="linenos">1790</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Union-1791"><a href="#Union-1791"><span class="linenos">1791</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">named_selects</span> -</span><span id="Union-1792"><a href="#Union-1792"><span class="linenos">1792</span></a> -</span><span id="Union-1793"><a href="#Union-1793"><span class="linenos">1793</span></a> <span class="nd">@property</span> -</span><span id="Union-1794"><a href="#Union-1794"><span class="linenos">1794</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Union-1795"><a href="#Union-1795"><span class="linenos">1795</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">selects</span> -</span><span id="Union-1796"><a href="#Union-1796"><span class="linenos">1796</span></a> -</span><span id="Union-1797"><a href="#Union-1797"><span class="linenos">1797</span></a> <span class="nd">@property</span> -</span><span id="Union-1798"><a href="#Union-1798"><span class="linenos">1798</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Union-1799"><a href="#Union-1799"><span class="linenos">1799</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="Union-1800"><a href="#Union-1800"><span class="linenos">1800</span></a> -</span><span id="Union-1801"><a href="#Union-1801"><span class="linenos">1801</span></a> <span class="nd">@property</span> -</span><span id="Union-1802"><a href="#Union-1802"><span class="linenos">1802</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Union-1803"><a href="#Union-1803"><span class="linenos">1803</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Union-1764"><a href="#Union-1764"><span class="linenos">1764</span></a><span class="k">class</span> <span class="nc">Union</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> +</span><span id="Union-1765"><a href="#Union-1765"><span class="linenos">1765</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Union-1766"><a href="#Union-1766"><span class="linenos">1766</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Union-1767"><a href="#Union-1767"><span class="linenos">1767</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-1768"><a href="#Union-1768"><span class="linenos">1768</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-1769"><a href="#Union-1769"><span class="linenos">1769</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Union-1770"><a href="#Union-1770"><span class="linenos">1770</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Union-1771"><a href="#Union-1771"><span class="linenos">1771</span></a> <span class="p">}</span> +</span><span id="Union-1772"><a href="#Union-1772"><span class="linenos">1772</span></a> +</span><span id="Union-1773"><a href="#Union-1773"><span class="linenos">1773</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Union-1774"><a href="#Union-1774"><span class="linenos">1774</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Union-1775"><a href="#Union-1775"><span class="linenos">1775</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Union-1776"><a href="#Union-1776"><span class="linenos">1776</span></a> +</span><span id="Union-1777"><a href="#Union-1777"><span class="linenos">1777</span></a><span class="sd"> Example:</span> +</span><span id="Union-1778"><a href="#Union-1778"><span class="linenos">1778</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="Union-1779"><a href="#Union-1779"><span class="linenos">1779</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> +</span><span id="Union-1780"><a href="#Union-1780"><span class="linenos">1780</span></a> +</span><span id="Union-1781"><a href="#Union-1781"><span class="linenos">1781</span></a><span class="sd"> Args:</span> +</span><span id="Union-1782"><a href="#Union-1782"><span class="linenos">1782</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Union-1783"><a href="#Union-1783"><span class="linenos">1783</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Union-1784"><a href="#Union-1784"><span class="linenos">1784</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Union-1785"><a href="#Union-1785"><span class="linenos">1785</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Union-1786"><a href="#Union-1786"><span class="linenos">1786</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Union-1787"><a href="#Union-1787"><span class="linenos">1787</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Union-1788"><a href="#Union-1788"><span class="linenos">1788</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Union-1789"><a href="#Union-1789"><span class="linenos">1789</span></a> +</span><span id="Union-1790"><a href="#Union-1790"><span class="linenos">1790</span></a><span class="sd"> Returns:</span> +</span><span id="Union-1791"><a href="#Union-1791"><span class="linenos">1791</span></a><span class="sd"> Select: The limited subqueryable.</span> +</span><span id="Union-1792"><a href="#Union-1792"><span class="linenos">1792</span></a><span class="sd"> """</span> +</span><span id="Union-1793"><a href="#Union-1793"><span class="linenos">1793</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="Union-1794"><a href="#Union-1794"><span class="linenos">1794</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="Union-1795"><a href="#Union-1795"><span class="linenos">1795</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> +</span><span id="Union-1796"><a href="#Union-1796"><span class="linenos">1796</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Union-1797"><a href="#Union-1797"><span class="linenos">1797</span></a> <span class="p">)</span> +</span><span id="Union-1798"><a href="#Union-1798"><span class="linenos">1798</span></a> +</span><span id="Union-1799"><a href="#Union-1799"><span class="linenos">1799</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Union-1800"><a href="#Union-1800"><span class="linenos">1800</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Union-1801"><a href="#Union-1801"><span class="linenos">1801</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="Union-1802"><a href="#Union-1802"><span class="linenos">1802</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-1803"><a href="#Union-1803"><span class="linenos">1803</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Union-1804"><a href="#Union-1804"><span class="linenos">1804</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union-1805"><a href="#Union-1805"><span class="linenos">1805</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Union-1806"><a href="#Union-1806"><span class="linenos">1806</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="Union-1807"><a href="#Union-1807"><span class="linenos">1807</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> +</span><span id="Union-1808"><a href="#Union-1808"><span class="linenos">1808</span></a> +</span><span id="Union-1809"><a href="#Union-1809"><span class="linenos">1809</span></a><span class="sd"> Example:</span> +</span><span id="Union-1810"><a href="#Union-1810"><span class="linenos">1810</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Union-1811"><a href="#Union-1811"><span class="linenos">1811</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> +</span><span id="Union-1812"><a href="#Union-1812"><span class="linenos">1812</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> +</span><span id="Union-1813"><a href="#Union-1813"><span class="linenos">1813</span></a> +</span><span id="Union-1814"><a href="#Union-1814"><span class="linenos">1814</span></a><span class="sd"> Args:</span> +</span><span id="Union-1815"><a href="#Union-1815"><span class="linenos">1815</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Union-1816"><a href="#Union-1816"><span class="linenos">1816</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Union-1817"><a href="#Union-1817"><span class="linenos">1817</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Union-1818"><a href="#Union-1818"><span class="linenos">1818</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Union-1819"><a href="#Union-1819"><span class="linenos">1819</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Union-1820"><a href="#Union-1820"><span class="linenos">1820</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union-1821"><a href="#Union-1821"><span class="linenos">1821</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union-1822"><a href="#Union-1822"><span class="linenos">1822</span></a> +</span><span id="Union-1823"><a href="#Union-1823"><span class="linenos">1823</span></a><span class="sd"> Returns:</span> +</span><span id="Union-1824"><a href="#Union-1824"><span class="linenos">1824</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="Union-1825"><a href="#Union-1825"><span class="linenos">1825</span></a><span class="sd"> """</span> +</span><span id="Union-1826"><a href="#Union-1826"><span class="linenos">1826</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="Union-1827"><a href="#Union-1827"><span class="linenos">1827</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Union-1828"><a href="#Union-1828"><span class="linenos">1828</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> +</span><span id="Union-1829"><a href="#Union-1829"><span class="linenos">1829</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Union-1830"><a href="#Union-1830"><span class="linenos">1830</span></a> <span class="p">)</span> +</span><span id="Union-1831"><a href="#Union-1831"><span class="linenos">1831</span></a> <span class="k">return</span> <span class="n">this</span> +</span><span id="Union-1832"><a href="#Union-1832"><span class="linenos">1832</span></a> +</span><span id="Union-1833"><a href="#Union-1833"><span class="linenos">1833</span></a> <span class="nd">@property</span> +</span><span id="Union-1834"><a href="#Union-1834"><span class="linenos">1834</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Union-1835"><a href="#Union-1835"><span class="linenos">1835</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">named_selects</span> +</span><span id="Union-1836"><a href="#Union-1836"><span class="linenos">1836</span></a> +</span><span id="Union-1837"><a href="#Union-1837"><span class="linenos">1837</span></a> <span class="nd">@property</span> +</span><span id="Union-1838"><a href="#Union-1838"><span class="linenos">1838</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Union-1839"><a href="#Union-1839"><span class="linenos">1839</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">is_star</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">is_star</span> +</span><span id="Union-1840"><a href="#Union-1840"><span class="linenos">1840</span></a> +</span><span id="Union-1841"><a href="#Union-1841"><span class="linenos">1841</span></a> <span class="nd">@property</span> +</span><span id="Union-1842"><a href="#Union-1842"><span class="linenos">1842</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Union-1843"><a href="#Union-1843"><span class="linenos">1843</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">selects</span> +</span><span id="Union-1844"><a href="#Union-1844"><span class="linenos">1844</span></a> +</span><span id="Union-1845"><a href="#Union-1845"><span class="linenos">1845</span></a> <span class="nd">@property</span> +</span><span id="Union-1846"><a href="#Union-1846"><span class="linenos">1846</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Union-1847"><a href="#Union-1847"><span class="linenos">1847</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> +</span><span id="Union-1848"><a href="#Union-1848"><span class="linenos">1848</span></a> +</span><span id="Union-1849"><a href="#Union-1849"><span class="linenos">1849</span></a> <span class="nd">@property</span> +</span><span id="Union-1850"><a href="#Union-1850"><span class="linenos">1850</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Union-1851"><a href="#Union-1851"><span class="linenos">1851</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> </span></pre></div> @@ -18506,31 +19278,31 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Union.limit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Union.limit-1729"><a href="#Union.limit-1729"><span class="linenos">1729</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Union.limit-1730"><a href="#Union.limit-1730"><span class="linenos">1730</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Union.limit-1731"><a href="#Union.limit-1731"><span class="linenos">1731</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Union.limit-1732"><a href="#Union.limit-1732"><span class="linenos">1732</span></a> -</span><span id="Union.limit-1733"><a href="#Union.limit-1733"><span class="linenos">1733</span></a><span class="sd"> Example:</span> -</span><span id="Union.limit-1734"><a href="#Union.limit-1734"><span class="linenos">1734</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> -</span><span id="Union.limit-1735"><a href="#Union.limit-1735"><span class="linenos">1735</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> -</span><span id="Union.limit-1736"><a href="#Union.limit-1736"><span class="linenos">1736</span></a> -</span><span id="Union.limit-1737"><a href="#Union.limit-1737"><span class="linenos">1737</span></a><span class="sd"> Args:</span> -</span><span id="Union.limit-1738"><a href="#Union.limit-1738"><span class="linenos">1738</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Union.limit-1739"><a href="#Union.limit-1739"><span class="linenos">1739</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Union.limit-1740"><a href="#Union.limit-1740"><span class="linenos">1740</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Union.limit-1741"><a href="#Union.limit-1741"><span class="linenos">1741</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Union.limit-1742"><a href="#Union.limit-1742"><span class="linenos">1742</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Union.limit-1743"><a href="#Union.limit-1743"><span class="linenos">1743</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Union.limit-1744"><a href="#Union.limit-1744"><span class="linenos">1744</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Union.limit-1745"><a href="#Union.limit-1745"><span class="linenos">1745</span></a> -</span><span id="Union.limit-1746"><a href="#Union.limit-1746"><span class="linenos">1746</span></a><span class="sd"> Returns:</span> -</span><span id="Union.limit-1747"><a href="#Union.limit-1747"><span class="linenos">1747</span></a><span class="sd"> Select: The limited subqueryable.</span> -</span><span id="Union.limit-1748"><a href="#Union.limit-1748"><span class="linenos">1748</span></a><span class="sd"> """</span> -</span><span id="Union.limit-1749"><a href="#Union.limit-1749"><span class="linenos">1749</span></a> <span class="k">return</span> <span class="p">(</span> -</span><span id="Union.limit-1750"><a href="#Union.limit-1750"><span class="linenos">1750</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> -</span><span id="Union.limit-1751"><a href="#Union.limit-1751"><span class="linenos">1751</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> -</span><span id="Union.limit-1752"><a href="#Union.limit-1752"><span class="linenos">1752</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Union.limit-1753"><a href="#Union.limit-1753"><span class="linenos">1753</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Union.limit-1773"><a href="#Union.limit-1773"><span class="linenos">1773</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Union.limit-1774"><a href="#Union.limit-1774"><span class="linenos">1774</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Union.limit-1775"><a href="#Union.limit-1775"><span class="linenos">1775</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Union.limit-1776"><a href="#Union.limit-1776"><span class="linenos">1776</span></a> +</span><span id="Union.limit-1777"><a href="#Union.limit-1777"><span class="linenos">1777</span></a><span class="sd"> Example:</span> +</span><span id="Union.limit-1778"><a href="#Union.limit-1778"><span class="linenos">1778</span></a><span class="sd"> >>> select("1").union(select("1")).limit(1).sql()</span> +</span><span id="Union.limit-1779"><a href="#Union.limit-1779"><span class="linenos">1779</span></a><span class="sd"> 'SELECT * FROM (SELECT 1 UNION SELECT 1) AS _l_0 LIMIT 1'</span> +</span><span id="Union.limit-1780"><a href="#Union.limit-1780"><span class="linenos">1780</span></a> +</span><span id="Union.limit-1781"><a href="#Union.limit-1781"><span class="linenos">1781</span></a><span class="sd"> Args:</span> +</span><span id="Union.limit-1782"><a href="#Union.limit-1782"><span class="linenos">1782</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Union.limit-1783"><a href="#Union.limit-1783"><span class="linenos">1783</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Union.limit-1784"><a href="#Union.limit-1784"><span class="linenos">1784</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Union.limit-1785"><a href="#Union.limit-1785"><span class="linenos">1785</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Union.limit-1786"><a href="#Union.limit-1786"><span class="linenos">1786</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Union.limit-1787"><a href="#Union.limit-1787"><span class="linenos">1787</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Union.limit-1788"><a href="#Union.limit-1788"><span class="linenos">1788</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Union.limit-1789"><a href="#Union.limit-1789"><span class="linenos">1789</span></a> +</span><span id="Union.limit-1790"><a href="#Union.limit-1790"><span class="linenos">1790</span></a><span class="sd"> Returns:</span> +</span><span id="Union.limit-1791"><a href="#Union.limit-1791"><span class="linenos">1791</span></a><span class="sd"> Select: The limited subqueryable.</span> +</span><span id="Union.limit-1792"><a href="#Union.limit-1792"><span class="linenos">1792</span></a><span class="sd"> """</span> +</span><span id="Union.limit-1793"><a href="#Union.limit-1793"><span class="linenos">1793</span></a> <span class="k">return</span> <span class="p">(</span> +</span><span id="Union.limit-1794"><a href="#Union.limit-1794"><span class="linenos">1794</span></a> <span class="n">select</span><span class="p">(</span><span class="s2">"*"</span><span class="p">)</span> +</span><span id="Union.limit-1795"><a href="#Union.limit-1795"><span class="linenos">1795</span></a> <span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="o">=</span><span class="s2">"_l_0"</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">))</span> +</span><span id="Union.limit-1796"><a href="#Union.limit-1796"><span class="linenos">1796</span></a> <span class="o">.</span><span class="n">limit</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Union.limit-1797"><a href="#Union.limit-1797"><span class="linenos">1797</span></a> <span class="p">)</span> </span></pre></div> @@ -18578,39 +19350,39 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Union.select"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Union.select-1755"><a href="#Union.select-1755"><span class="linenos">1755</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Union.select-1756"><a href="#Union.select-1756"><span class="linenos">1756</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Union.select-1757"><a href="#Union.select-1757"><span class="linenos">1757</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="Union.select-1758"><a href="#Union.select-1758"><span class="linenos">1758</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union.select-1759"><a href="#Union.select-1759"><span class="linenos">1759</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Union.select-1760"><a href="#Union.select-1760"><span class="linenos">1760</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Union.select-1761"><a href="#Union.select-1761"><span class="linenos">1761</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Union.select-1762"><a href="#Union.select-1762"><span class="linenos">1762</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> -</span><span id="Union.select-1763"><a href="#Union.select-1763"><span class="linenos">1763</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> -</span><span id="Union.select-1764"><a href="#Union.select-1764"><span class="linenos">1764</span></a> -</span><span id="Union.select-1765"><a href="#Union.select-1765"><span class="linenos">1765</span></a><span class="sd"> Example:</span> -</span><span id="Union.select-1766"><a href="#Union.select-1766"><span class="linenos">1766</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="Union.select-1767"><a href="#Union.select-1767"><span class="linenos">1767</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> -</span><span id="Union.select-1768"><a href="#Union.select-1768"><span class="linenos">1768</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> -</span><span id="Union.select-1769"><a href="#Union.select-1769"><span class="linenos">1769</span></a> -</span><span id="Union.select-1770"><a href="#Union.select-1770"><span class="linenos">1770</span></a><span class="sd"> Args:</span> -</span><span id="Union.select-1771"><a href="#Union.select-1771"><span class="linenos">1771</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Union.select-1772"><a href="#Union.select-1772"><span class="linenos">1772</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Union.select-1773"><a href="#Union.select-1773"><span class="linenos">1773</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Union.select-1774"><a href="#Union.select-1774"><span class="linenos">1774</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Union.select-1775"><a href="#Union.select-1775"><span class="linenos">1775</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Union.select-1776"><a href="#Union.select-1776"><span class="linenos">1776</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Union.select-1777"><a href="#Union.select-1777"><span class="linenos">1777</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Union.select-1778"><a href="#Union.select-1778"><span class="linenos">1778</span></a> -</span><span id="Union.select-1779"><a href="#Union.select-1779"><span class="linenos">1779</span></a><span class="sd"> Returns:</span> -</span><span id="Union.select-1780"><a href="#Union.select-1780"><span class="linenos">1780</span></a><span class="sd"> Union: the modified expression.</span> -</span><span id="Union.select-1781"><a href="#Union.select-1781"><span class="linenos">1781</span></a><span class="sd"> """</span> -</span><span id="Union.select-1782"><a href="#Union.select-1782"><span class="linenos">1782</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> -</span><span id="Union.select-1783"><a href="#Union.select-1783"><span class="linenos">1783</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Union.select-1784"><a href="#Union.select-1784"><span class="linenos">1784</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> -</span><span id="Union.select-1785"><a href="#Union.select-1785"><span class="linenos">1785</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> -</span><span id="Union.select-1786"><a href="#Union.select-1786"><span class="linenos">1786</span></a> <span class="p">)</span> -</span><span id="Union.select-1787"><a href="#Union.select-1787"><span class="linenos">1787</span></a> <span class="k">return</span> <span class="n">this</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Union.select-1799"><a href="#Union.select-1799"><span class="linenos">1799</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Union.select-1800"><a href="#Union.select-1800"><span class="linenos">1800</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Union.select-1801"><a href="#Union.select-1801"><span class="linenos">1801</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="Union.select-1802"><a href="#Union.select-1802"><span class="linenos">1802</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union.select-1803"><a href="#Union.select-1803"><span class="linenos">1803</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Union.select-1804"><a href="#Union.select-1804"><span class="linenos">1804</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Union.select-1805"><a href="#Union.select-1805"><span class="linenos">1805</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Union.select-1806"><a href="#Union.select-1806"><span class="linenos">1806</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Union</span><span class="p">:</span> +</span><span id="Union.select-1807"><a href="#Union.select-1807"><span class="linenos">1807</span></a><span class="w"> </span><span class="sd">"""Append to or set the SELECT of the union recursively.</span> +</span><span id="Union.select-1808"><a href="#Union.select-1808"><span class="linenos">1808</span></a> +</span><span id="Union.select-1809"><a href="#Union.select-1809"><span class="linenos">1809</span></a><span class="sd"> Example:</span> +</span><span id="Union.select-1810"><a href="#Union.select-1810"><span class="linenos">1810</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="Union.select-1811"><a href="#Union.select-1811"><span class="linenos">1811</span></a><span class="sd"> >>> parse_one("select a from x union select a from y union select a from z").select("b").sql()</span> +</span><span id="Union.select-1812"><a href="#Union.select-1812"><span class="linenos">1812</span></a><span class="sd"> 'SELECT a, b FROM x UNION SELECT a, b FROM y UNION SELECT a, b FROM z'</span> +</span><span id="Union.select-1813"><a href="#Union.select-1813"><span class="linenos">1813</span></a> +</span><span id="Union.select-1814"><a href="#Union.select-1814"><span class="linenos">1814</span></a><span class="sd"> Args:</span> +</span><span id="Union.select-1815"><a href="#Union.select-1815"><span class="linenos">1815</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Union.select-1816"><a href="#Union.select-1816"><span class="linenos">1816</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Union.select-1817"><a href="#Union.select-1817"><span class="linenos">1817</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Union.select-1818"><a href="#Union.select-1818"><span class="linenos">1818</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Union.select-1819"><a href="#Union.select-1819"><span class="linenos">1819</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Union.select-1820"><a href="#Union.select-1820"><span class="linenos">1820</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Union.select-1821"><a href="#Union.select-1821"><span class="linenos">1821</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Union.select-1822"><a href="#Union.select-1822"><span class="linenos">1822</span></a> +</span><span id="Union.select-1823"><a href="#Union.select-1823"><span class="linenos">1823</span></a><span class="sd"> Returns:</span> +</span><span id="Union.select-1824"><a href="#Union.select-1824"><span class="linenos">1824</span></a><span class="sd"> Union: the modified expression.</span> +</span><span id="Union.select-1825"><a href="#Union.select-1825"><span class="linenos">1825</span></a><span class="sd"> """</span> +</span><span id="Union.select-1826"><a href="#Union.select-1826"><span class="linenos">1826</span></a> <span class="n">this</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> <span class="k">if</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span> +</span><span id="Union.select-1827"><a href="#Union.select-1827"><span class="linenos">1827</span></a> <span class="n">this</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Union.select-1828"><a href="#Union.select-1828"><span class="linenos">1828</span></a> <span class="n">this</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">unnest</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span> +</span><span id="Union.select-1829"><a href="#Union.select-1829"><span class="linenos">1829</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span> +</span><span id="Union.select-1830"><a href="#Union.select-1830"><span class="linenos">1830</span></a> <span class="p">)</span> +</span><span id="Union.select-1831"><a href="#Union.select-1831"><span class="linenos">1831</span></a> <span class="k">return</span> <span class="n">this</span> </span></pre></div> @@ -18648,6 +19420,19 @@ Otherwise, this resets the expressions.</li> </div> + <div id="Union.is_star" class="classattr"> + <div class="attr variable"> + <span class="name">is_star</span><span class="annotation">: bool</span> + + + </div> + <a class="headerlink" href="#Union.is_star"></a> + + <div class="docstring"><p>Checks whether an expression is a star.</p> +</div> + + + </div> <div class="inherited"> <h5>Inherited Members</h5> <dl> @@ -18660,7 +19445,6 @@ Otherwise, this resets the expressions.</li> <dd id="Union.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> <dd id="Union.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> <dd id="Union.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="Union.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> <dd id="Union.alias" class="variable"><a href="#Expression.alias">alias</a></dd> <dd id="Union.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> <dd id="Union.copy" class="function"><a href="#Expression.copy">copy</a></dd> @@ -18713,8 +19497,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Except"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Except-1806"><a href="#Except-1806"><span class="linenos">1806</span></a><span class="k">class</span> <span class="nc">Except</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> -</span><span id="Except-1807"><a href="#Except-1807"><span class="linenos">1807</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Except-1854"><a href="#Except-1854"><span class="linenos">1854</span></a><span class="k">class</span> <span class="nc">Except</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> +</span><span id="Except-1855"><a href="#Except-1855"><span class="linenos">1855</span></a> <span class="k">pass</span> </span></pre></div> @@ -18732,7 +19516,6 @@ Otherwise, this resets the expressions.</li> <dd id="Except.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> <dd id="Except.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> <dd id="Except.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="Except.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> <dd id="Except.alias" class="variable"><a href="#Expression.alias">alias</a></dd> <dd id="Except.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> <dd id="Except.copy" class="function"><a href="#Expression.copy">copy</a></dd> @@ -18763,6 +19546,7 @@ Otherwise, this resets the expressions.</li> <div><dt><a href="#Union">Union</a></dt> <dd id="Except.limit" class="function"><a href="#Union.limit">limit</a></dd> <dd id="Except.select" class="function"><a href="#Union.select">select</a></dd> + <dd id="Except.is_star" class="variable"><a href="#Union.is_star">is_star</a></dd> </div> <div><dt><a href="#Subqueryable">Subqueryable</a></dt> @@ -18790,8 +19574,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Intersect"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Intersect-1810"><a href="#Intersect-1810"><span class="linenos">1810</span></a><span class="k">class</span> <span class="nc">Intersect</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> -</span><span id="Intersect-1811"><a href="#Intersect-1811"><span class="linenos">1811</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Intersect-1858"><a href="#Intersect-1858"><span class="linenos">1858</span></a><span class="k">class</span> <span class="nc">Intersect</span><span class="p">(</span><span class="n">Union</span><span class="p">):</span> +</span><span id="Intersect-1859"><a href="#Intersect-1859"><span class="linenos">1859</span></a> <span class="k">pass</span> </span></pre></div> @@ -18809,7 +19593,6 @@ Otherwise, this resets the expressions.</li> <dd id="Intersect.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> <dd id="Intersect.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> <dd id="Intersect.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="Intersect.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> <dd id="Intersect.alias" class="variable"><a href="#Expression.alias">alias</a></dd> <dd id="Intersect.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> <dd id="Intersect.copy" class="function"><a href="#Expression.copy">copy</a></dd> @@ -18840,6 +19623,7 @@ Otherwise, this resets the expressions.</li> <div><dt><a href="#Union">Union</a></dt> <dd id="Intersect.limit" class="function"><a href="#Union.limit">limit</a></dd> <dd id="Intersect.select" class="function"><a href="#Union.select">select</a></dd> + <dd id="Intersect.is_star" class="variable"><a href="#Union.is_star">is_star</a></dd> </div> <div><dt><a href="#Subqueryable">Subqueryable</a></dt> @@ -18867,13 +19651,13 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Unnest"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unnest-1814"><a href="#Unnest-1814"><span class="linenos">1814</span></a><span class="k">class</span> <span class="nc">Unnest</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="Unnest-1815"><a href="#Unnest-1815"><span class="linenos">1815</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Unnest-1816"><a href="#Unnest-1816"><span class="linenos">1816</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Unnest-1817"><a href="#Unnest-1817"><span class="linenos">1817</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-1818"><a href="#Unnest-1818"><span class="linenos">1818</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-1819"><a href="#Unnest-1819"><span class="linenos">1819</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Unnest-1820"><a href="#Unnest-1820"><span class="linenos">1820</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unnest-1862"><a href="#Unnest-1862"><span class="linenos">1862</span></a><span class="k">class</span> <span class="nc">Unnest</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="Unnest-1863"><a href="#Unnest-1863"><span class="linenos">1863</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Unnest-1864"><a href="#Unnest-1864"><span class="linenos">1864</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Unnest-1865"><a href="#Unnest-1865"><span class="linenos">1865</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-1866"><a href="#Unnest-1866"><span class="linenos">1866</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-1867"><a href="#Unnest-1867"><span class="linenos">1867</span></a> <span class="s2">"offset"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Unnest-1868"><a href="#Unnest-1868"><span class="linenos">1868</span></a> <span class="p">}</span> </span></pre></div> @@ -18939,14 +19723,14 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Update"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Update-1823"><a href="#Update-1823"><span class="linenos">1823</span></a><span class="k">class</span> <span class="nc">Update</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Update-1824"><a href="#Update-1824"><span class="linenos">1824</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Update-1825"><a href="#Update-1825"><span class="linenos">1825</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-1826"><a href="#Update-1826"><span class="linenos">1826</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-1827"><a href="#Update-1827"><span class="linenos">1827</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Update-1828"><a href="#Update-1828"><span class="linenos">1828</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-1829"><a href="#Update-1829"><span class="linenos">1829</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Update-1830"><a href="#Update-1830"><span class="linenos">1830</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Update-1871"><a href="#Update-1871"><span class="linenos">1871</span></a><span class="k">class</span> <span class="nc">Update</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Update-1872"><a href="#Update-1872"><span class="linenos">1872</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Update-1873"><a href="#Update-1873"><span class="linenos">1873</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-1874"><a href="#Update-1874"><span class="linenos">1874</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-1875"><a href="#Update-1875"><span class="linenos">1875</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Update-1876"><a href="#Update-1876"><span class="linenos">1876</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-1877"><a href="#Update-1877"><span class="linenos">1877</span></a> <span class="s2">"where"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Update-1878"><a href="#Update-1878"><span class="linenos">1878</span></a> <span class="p">}</span> </span></pre></div> @@ -19006,12 +19790,12 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Values"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Values-1833"><a href="#Values-1833"><span class="linenos">1833</span></a><span class="k">class</span> <span class="nc">Values</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> -</span><span id="Values-1834"><a href="#Values-1834"><span class="linenos">1834</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Values-1835"><a href="#Values-1835"><span class="linenos">1835</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Values-1836"><a href="#Values-1836"><span class="linenos">1836</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Values-1837"><a href="#Values-1837"><span class="linenos">1837</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Values-1838"><a href="#Values-1838"><span class="linenos">1838</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Values-1881"><a href="#Values-1881"><span class="linenos">1881</span></a><span class="k">class</span> <span class="nc">Values</span><span class="p">(</span><span class="n">UDTF</span><span class="p">):</span> +</span><span id="Values-1882"><a href="#Values-1882"><span class="linenos">1882</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Values-1883"><a href="#Values-1883"><span class="linenos">1883</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Values-1884"><a href="#Values-1884"><span class="linenos">1884</span></a> <span class="s2">"ordinality"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Values-1885"><a href="#Values-1885"><span class="linenos">1885</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Values-1886"><a href="#Values-1886"><span class="linenos">1886</span></a> <span class="p">}</span> </span></pre></div> @@ -19077,8 +19861,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Var"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Var-1841"><a href="#Var-1841"><span class="linenos">1841</span></a><span class="k">class</span> <span class="nc">Var</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Var-1842"><a href="#Var-1842"><span class="linenos">1842</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Var-1889"><a href="#Var-1889"><span class="linenos">1889</span></a><span class="k">class</span> <span class="nc">Var</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Var-1890"><a href="#Var-1890"><span class="linenos">1890</span></a> <span class="k">pass</span> </span></pre></div> @@ -19138,8 +19922,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Schema"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Schema-1845"><a href="#Schema-1845"><span class="linenos">1845</span></a><span class="k">class</span> <span class="nc">Schema</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Schema-1846"><a href="#Schema-1846"><span class="linenos">1846</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Schema-1893"><a href="#Schema-1893"><span class="linenos">1893</span></a><span class="k">class</span> <span class="nc">Schema</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Schema-1894"><a href="#Schema-1894"><span class="linenos">1894</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -19199,8 +19983,8 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Lock"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Lock-1851"><a href="#Lock-1851"><span class="linenos">1851</span></a><span class="k">class</span> <span class="nc">Lock</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Lock-1852"><a href="#Lock-1852"><span class="linenos">1852</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"update"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Lock-1899"><a href="#Lock-1899"><span class="linenos">1899</span></a><span class="k">class</span> <span class="nc">Lock</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Lock-1900"><a href="#Lock-1900"><span class="linenos">1900</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"update"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -19260,574 +20044,578 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select-1855"><a href="#Select-1855"><span class="linenos">1855</span></a><span class="k">class</span> <span class="nc">Select</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> -</span><span id="Select-1856"><a href="#Select-1856"><span class="linenos">1856</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Select-1857"><a href="#Select-1857"><span class="linenos">1857</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1858"><a href="#Select-1858"><span class="linenos">1858</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1859"><a href="#Select-1859"><span class="linenos">1859</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1860"><a href="#Select-1860"><span class="linenos">1860</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1861"><a href="#Select-1861"><span class="linenos">1861</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1862"><a href="#Select-1862"><span class="linenos">1862</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Select-1863"><a href="#Select-1863"><span class="linenos">1863</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Select-1864"><a href="#Select-1864"><span class="linenos">1864</span></a> <span class="p">}</span> -</span><span id="Select-1865"><a href="#Select-1865"><span class="linenos">1865</span></a> -</span><span id="Select-1866"><a href="#Select-1866"><span class="linenos">1866</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-1867"><a href="#Select-1867"><span class="linenos">1867</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-1868"><a href="#Select-1868"><span class="linenos">1868</span></a><span class="sd"> Set the FROM expression.</span> -</span><span id="Select-1869"><a href="#Select-1869"><span class="linenos">1869</span></a> -</span><span id="Select-1870"><a href="#Select-1870"><span class="linenos">1870</span></a><span class="sd"> Example:</span> -</span><span id="Select-1871"><a href="#Select-1871"><span class="linenos">1871</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="Select-1872"><a href="#Select-1872"><span class="linenos">1872</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="Select-1873"><a href="#Select-1873"><span class="linenos">1873</span></a> -</span><span id="Select-1874"><a href="#Select-1874"><span class="linenos">1874</span></a><span class="sd"> Args:</span> -</span><span id="Select-1875"><a href="#Select-1875"><span class="linenos">1875</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-1876"><a href="#Select-1876"><span class="linenos">1876</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="Select-1877"><a href="#Select-1877"><span class="linenos">1877</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="Select-1878"><a href="#Select-1878"><span class="linenos">1878</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-1879"><a href="#Select-1879"><span class="linenos">1879</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> -</span><span id="Select-1880"><a href="#Select-1880"><span class="linenos">1880</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-1881"><a href="#Select-1881"><span class="linenos">1881</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-1882"><a href="#Select-1882"><span class="linenos">1882</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-1883"><a href="#Select-1883"><span class="linenos">1883</span></a> -</span><span id="Select-1884"><a href="#Select-1884"><span class="linenos">1884</span></a><span class="sd"> Returns:</span> -</span><span id="Select-1885"><a href="#Select-1885"><span class="linenos">1885</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-1886"><a href="#Select-1886"><span class="linenos">1886</span></a><span class="sd"> """</span> -</span><span id="Select-1887"><a href="#Select-1887"><span class="linenos">1887</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-1888"><a href="#Select-1888"><span class="linenos">1888</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-1889"><a href="#Select-1889"><span class="linenos">1889</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-1890"><a href="#Select-1890"><span class="linenos">1890</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> -</span><span id="Select-1891"><a href="#Select-1891"><span class="linenos">1891</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-1892"><a href="#Select-1892"><span class="linenos">1892</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-1893"><a href="#Select-1893"><span class="linenos">1893</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> -</span><span id="Select-1894"><a href="#Select-1894"><span class="linenos">1894</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> -</span><span id="Select-1895"><a href="#Select-1895"><span class="linenos">1895</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-1896"><a href="#Select-1896"><span class="linenos">1896</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-1897"><a href="#Select-1897"><span class="linenos">1897</span></a> <span class="p">)</span> -</span><span id="Select-1898"><a href="#Select-1898"><span class="linenos">1898</span></a> -</span><span id="Select-1899"><a href="#Select-1899"><span class="linenos">1899</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-1900"><a href="#Select-1900"><span class="linenos">1900</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-1901"><a href="#Select-1901"><span class="linenos">1901</span></a><span class="sd"> Set the GROUP BY expression.</span> -</span><span id="Select-1902"><a href="#Select-1902"><span class="linenos">1902</span></a> -</span><span id="Select-1903"><a href="#Select-1903"><span class="linenos">1903</span></a><span class="sd"> Example:</span> -</span><span id="Select-1904"><a href="#Select-1904"><span class="linenos">1904</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="Select-1905"><a href="#Select-1905"><span class="linenos">1905</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="Select-1906"><a href="#Select-1906"><span class="linenos">1906</span></a> -</span><span id="Select-1907"><a href="#Select-1907"><span class="linenos">1907</span></a><span class="sd"> Args:</span> -</span><span id="Select-1908"><a href="#Select-1908"><span class="linenos">1908</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-1909"><a href="#Select-1909"><span class="linenos">1909</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-1910"><a href="#Select-1910"><span class="linenos">1910</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> -</span><span id="Select-1911"><a href="#Select-1911"><span class="linenos">1911</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> -</span><span id="Select-1912"><a href="#Select-1912"><span class="linenos">1912</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-1913"><a href="#Select-1913"><span class="linenos">1913</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="Select-1914"><a href="#Select-1914"><span class="linenos">1914</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-1915"><a href="#Select-1915"><span class="linenos">1915</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-1916"><a href="#Select-1916"><span class="linenos">1916</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select-1903"><a href="#Select-1903"><span class="linenos">1903</span></a><span class="k">class</span> <span class="nc">Select</span><span class="p">(</span><span class="n">Subqueryable</span><span class="p">):</span> +</span><span id="Select-1904"><a href="#Select-1904"><span class="linenos">1904</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Select-1905"><a href="#Select-1905"><span class="linenos">1905</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1906"><a href="#Select-1906"><span class="linenos">1906</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1907"><a href="#Select-1907"><span class="linenos">1907</span></a> <span class="s2">"hint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1908"><a href="#Select-1908"><span class="linenos">1908</span></a> <span class="s2">"distinct"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1909"><a href="#Select-1909"><span class="linenos">1909</span></a> <span class="s2">"into"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1910"><a href="#Select-1910"><span class="linenos">1910</span></a> <span class="s2">"from"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Select-1911"><a href="#Select-1911"><span class="linenos">1911</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Select-1912"><a href="#Select-1912"><span class="linenos">1912</span></a> <span class="p">}</span> +</span><span id="Select-1913"><a href="#Select-1913"><span class="linenos">1913</span></a> +</span><span id="Select-1914"><a href="#Select-1914"><span class="linenos">1914</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-1915"><a href="#Select-1915"><span class="linenos">1915</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-1916"><a href="#Select-1916"><span class="linenos">1916</span></a><span class="sd"> Set the FROM expression.</span> </span><span id="Select-1917"><a href="#Select-1917"><span class="linenos">1917</span></a> -</span><span id="Select-1918"><a href="#Select-1918"><span class="linenos">1918</span></a><span class="sd"> Returns:</span> -</span><span id="Select-1919"><a href="#Select-1919"><span class="linenos">1919</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-1920"><a href="#Select-1920"><span class="linenos">1920</span></a><span class="sd"> """</span> -</span><span id="Select-1921"><a href="#Select-1921"><span class="linenos">1921</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> -</span><span id="Select-1922"><a href="#Select-1922"><span class="linenos">1922</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="Select-1923"><a href="#Select-1923"><span class="linenos">1923</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-1924"><a href="#Select-1924"><span class="linenos">1924</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-1925"><a href="#Select-1925"><span class="linenos">1925</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-1926"><a href="#Select-1926"><span class="linenos">1926</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> -</span><span id="Select-1927"><a href="#Select-1927"><span class="linenos">1927</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-1928"><a href="#Select-1928"><span class="linenos">1928</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-1929"><a href="#Select-1929"><span class="linenos">1929</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> -</span><span id="Select-1930"><a href="#Select-1930"><span class="linenos">1930</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> -</span><span id="Select-1931"><a href="#Select-1931"><span class="linenos">1931</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-1932"><a href="#Select-1932"><span class="linenos">1932</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-1933"><a href="#Select-1933"><span class="linenos">1933</span></a> <span class="p">)</span> -</span><span id="Select-1934"><a href="#Select-1934"><span class="linenos">1934</span></a> -</span><span id="Select-1935"><a href="#Select-1935"><span class="linenos">1935</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-1936"><a href="#Select-1936"><span class="linenos">1936</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-1937"><a href="#Select-1937"><span class="linenos">1937</span></a><span class="sd"> Set the ORDER BY expression.</span> -</span><span id="Select-1938"><a href="#Select-1938"><span class="linenos">1938</span></a> -</span><span id="Select-1939"><a href="#Select-1939"><span class="linenos">1939</span></a><span class="sd"> Example:</span> -</span><span id="Select-1940"><a href="#Select-1940"><span class="linenos">1940</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="Select-1941"><a href="#Select-1941"><span class="linenos">1941</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="Select-1942"><a href="#Select-1942"><span class="linenos">1942</span></a> -</span><span id="Select-1943"><a href="#Select-1943"><span class="linenos">1943</span></a><span class="sd"> Args:</span> -</span><span id="Select-1944"><a href="#Select-1944"><span class="linenos">1944</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-1945"><a href="#Select-1945"><span class="linenos">1945</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-1946"><a href="#Select-1946"><span class="linenos">1946</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> -</span><span id="Select-1947"><a href="#Select-1947"><span class="linenos">1947</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-1948"><a href="#Select-1948"><span class="linenos">1948</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-1949"><a href="#Select-1949"><span class="linenos">1949</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-1950"><a href="#Select-1950"><span class="linenos">1950</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-1951"><a href="#Select-1951"><span class="linenos">1951</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-1952"><a href="#Select-1952"><span class="linenos">1952</span></a> -</span><span id="Select-1953"><a href="#Select-1953"><span class="linenos">1953</span></a><span class="sd"> Returns:</span> -</span><span id="Select-1954"><a href="#Select-1954"><span class="linenos">1954</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-1955"><a href="#Select-1955"><span class="linenos">1955</span></a><span class="sd"> """</span> -</span><span id="Select-1956"><a href="#Select-1956"><span class="linenos">1956</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-1957"><a href="#Select-1957"><span class="linenos">1957</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-1958"><a href="#Select-1958"><span class="linenos">1958</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-1959"><a href="#Select-1959"><span class="linenos">1959</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> -</span><span id="Select-1960"><a href="#Select-1960"><span class="linenos">1960</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-1961"><a href="#Select-1961"><span class="linenos">1961</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-1962"><a href="#Select-1962"><span class="linenos">1962</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> -</span><span id="Select-1963"><a href="#Select-1963"><span class="linenos">1963</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> -</span><span id="Select-1964"><a href="#Select-1964"><span class="linenos">1964</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-1965"><a href="#Select-1965"><span class="linenos">1965</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-1966"><a href="#Select-1966"><span class="linenos">1966</span></a> <span class="p">)</span> -</span><span id="Select-1967"><a href="#Select-1967"><span class="linenos">1967</span></a> -</span><span id="Select-1968"><a href="#Select-1968"><span class="linenos">1968</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-1969"><a href="#Select-1969"><span class="linenos">1969</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-1970"><a href="#Select-1970"><span class="linenos">1970</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="Select-1971"><a href="#Select-1971"><span class="linenos">1971</span></a> -</span><span id="Select-1972"><a href="#Select-1972"><span class="linenos">1972</span></a><span class="sd"> Example:</span> -</span><span id="Select-1973"><a href="#Select-1973"><span class="linenos">1973</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> -</span><span id="Select-1974"><a href="#Select-1974"><span class="linenos">1974</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="Select-1975"><a href="#Select-1975"><span class="linenos">1975</span></a> -</span><span id="Select-1976"><a href="#Select-1976"><span class="linenos">1976</span></a><span class="sd"> Args:</span> -</span><span id="Select-1977"><a href="#Select-1977"><span class="linenos">1977</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-1978"><a href="#Select-1978"><span class="linenos">1978</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-1979"><a href="#Select-1979"><span class="linenos">1979</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> -</span><span id="Select-1980"><a href="#Select-1980"><span class="linenos">1980</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-1981"><a href="#Select-1981"><span class="linenos">1981</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-1982"><a href="#Select-1982"><span class="linenos">1982</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-1983"><a href="#Select-1983"><span class="linenos">1983</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-1984"><a href="#Select-1984"><span class="linenos">1984</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-1985"><a href="#Select-1985"><span class="linenos">1985</span></a> -</span><span id="Select-1986"><a href="#Select-1986"><span class="linenos">1986</span></a><span class="sd"> Returns:</span> -</span><span id="Select-1987"><a href="#Select-1987"><span class="linenos">1987</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-1988"><a href="#Select-1988"><span class="linenos">1988</span></a><span class="sd"> """</span> -</span><span id="Select-1989"><a href="#Select-1989"><span class="linenos">1989</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-1990"><a href="#Select-1990"><span class="linenos">1990</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-1991"><a href="#Select-1991"><span class="linenos">1991</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-1992"><a href="#Select-1992"><span class="linenos">1992</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> -</span><span id="Select-1993"><a href="#Select-1993"><span class="linenos">1993</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-1994"><a href="#Select-1994"><span class="linenos">1994</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-1995"><a href="#Select-1995"><span class="linenos">1995</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> -</span><span id="Select-1996"><a href="#Select-1996"><span class="linenos">1996</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> -</span><span id="Select-1997"><a href="#Select-1997"><span class="linenos">1997</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-1998"><a href="#Select-1998"><span class="linenos">1998</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-1999"><a href="#Select-1999"><span class="linenos">1999</span></a> <span class="p">)</span> +</span><span id="Select-1918"><a href="#Select-1918"><span class="linenos">1918</span></a><span class="sd"> Example:</span> +</span><span id="Select-1919"><a href="#Select-1919"><span class="linenos">1919</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="Select-1920"><a href="#Select-1920"><span class="linenos">1920</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="Select-1921"><a href="#Select-1921"><span class="linenos">1921</span></a> +</span><span id="Select-1922"><a href="#Select-1922"><span class="linenos">1922</span></a><span class="sd"> Args:</span> +</span><span id="Select-1923"><a href="#Select-1923"><span class="linenos">1923</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-1924"><a href="#Select-1924"><span class="linenos">1924</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="Select-1925"><a href="#Select-1925"><span class="linenos">1925</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="Select-1926"><a href="#Select-1926"><span class="linenos">1926</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-1927"><a href="#Select-1927"><span class="linenos">1927</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> +</span><span id="Select-1928"><a href="#Select-1928"><span class="linenos">1928</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-1929"><a href="#Select-1929"><span class="linenos">1929</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-1930"><a href="#Select-1930"><span class="linenos">1930</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-1931"><a href="#Select-1931"><span class="linenos">1931</span></a> +</span><span id="Select-1932"><a href="#Select-1932"><span class="linenos">1932</span></a><span class="sd"> Returns:</span> +</span><span id="Select-1933"><a href="#Select-1933"><span class="linenos">1933</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-1934"><a href="#Select-1934"><span class="linenos">1934</span></a><span class="sd"> """</span> +</span><span id="Select-1935"><a href="#Select-1935"><span class="linenos">1935</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-1936"><a href="#Select-1936"><span class="linenos">1936</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-1937"><a href="#Select-1937"><span class="linenos">1937</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-1938"><a href="#Select-1938"><span class="linenos">1938</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> +</span><span id="Select-1939"><a href="#Select-1939"><span class="linenos">1939</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-1940"><a href="#Select-1940"><span class="linenos">1940</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-1941"><a href="#Select-1941"><span class="linenos">1941</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> +</span><span id="Select-1942"><a href="#Select-1942"><span class="linenos">1942</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> +</span><span id="Select-1943"><a href="#Select-1943"><span class="linenos">1943</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-1944"><a href="#Select-1944"><span class="linenos">1944</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-1945"><a href="#Select-1945"><span class="linenos">1945</span></a> <span class="p">)</span> +</span><span id="Select-1946"><a href="#Select-1946"><span class="linenos">1946</span></a> +</span><span id="Select-1947"><a href="#Select-1947"><span class="linenos">1947</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-1948"><a href="#Select-1948"><span class="linenos">1948</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-1949"><a href="#Select-1949"><span class="linenos">1949</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="Select-1950"><a href="#Select-1950"><span class="linenos">1950</span></a> +</span><span id="Select-1951"><a href="#Select-1951"><span class="linenos">1951</span></a><span class="sd"> Example:</span> +</span><span id="Select-1952"><a href="#Select-1952"><span class="linenos">1952</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="Select-1953"><a href="#Select-1953"><span class="linenos">1953</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="Select-1954"><a href="#Select-1954"><span class="linenos">1954</span></a> +</span><span id="Select-1955"><a href="#Select-1955"><span class="linenos">1955</span></a><span class="sd"> Args:</span> +</span><span id="Select-1956"><a href="#Select-1956"><span class="linenos">1956</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-1957"><a href="#Select-1957"><span class="linenos">1957</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-1958"><a href="#Select-1958"><span class="linenos">1958</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> +</span><span id="Select-1959"><a href="#Select-1959"><span class="linenos">1959</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> +</span><span id="Select-1960"><a href="#Select-1960"><span class="linenos">1960</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-1961"><a href="#Select-1961"><span class="linenos">1961</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="Select-1962"><a href="#Select-1962"><span class="linenos">1962</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-1963"><a href="#Select-1963"><span class="linenos">1963</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-1964"><a href="#Select-1964"><span class="linenos">1964</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-1965"><a href="#Select-1965"><span class="linenos">1965</span></a> +</span><span id="Select-1966"><a href="#Select-1966"><span class="linenos">1966</span></a><span class="sd"> Returns:</span> +</span><span id="Select-1967"><a href="#Select-1967"><span class="linenos">1967</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-1968"><a href="#Select-1968"><span class="linenos">1968</span></a><span class="sd"> """</span> +</span><span id="Select-1969"><a href="#Select-1969"><span class="linenos">1969</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> +</span><span id="Select-1970"><a href="#Select-1970"><span class="linenos">1970</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="Select-1971"><a href="#Select-1971"><span class="linenos">1971</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-1972"><a href="#Select-1972"><span class="linenos">1972</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-1973"><a href="#Select-1973"><span class="linenos">1973</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-1974"><a href="#Select-1974"><span class="linenos">1974</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> +</span><span id="Select-1975"><a href="#Select-1975"><span class="linenos">1975</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-1976"><a href="#Select-1976"><span class="linenos">1976</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-1977"><a href="#Select-1977"><span class="linenos">1977</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> +</span><span id="Select-1978"><a href="#Select-1978"><span class="linenos">1978</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> +</span><span id="Select-1979"><a href="#Select-1979"><span class="linenos">1979</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-1980"><a href="#Select-1980"><span class="linenos">1980</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-1981"><a href="#Select-1981"><span class="linenos">1981</span></a> <span class="p">)</span> +</span><span id="Select-1982"><a href="#Select-1982"><span class="linenos">1982</span></a> +</span><span id="Select-1983"><a href="#Select-1983"><span class="linenos">1983</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-1984"><a href="#Select-1984"><span class="linenos">1984</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-1985"><a href="#Select-1985"><span class="linenos">1985</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="Select-1986"><a href="#Select-1986"><span class="linenos">1986</span></a> +</span><span id="Select-1987"><a href="#Select-1987"><span class="linenos">1987</span></a><span class="sd"> Example:</span> +</span><span id="Select-1988"><a href="#Select-1988"><span class="linenos">1988</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="Select-1989"><a href="#Select-1989"><span class="linenos">1989</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="Select-1990"><a href="#Select-1990"><span class="linenos">1990</span></a> +</span><span id="Select-1991"><a href="#Select-1991"><span class="linenos">1991</span></a><span class="sd"> Args:</span> +</span><span id="Select-1992"><a href="#Select-1992"><span class="linenos">1992</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-1993"><a href="#Select-1993"><span class="linenos">1993</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-1994"><a href="#Select-1994"><span class="linenos">1994</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> +</span><span id="Select-1995"><a href="#Select-1995"><span class="linenos">1995</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-1996"><a href="#Select-1996"><span class="linenos">1996</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-1997"><a href="#Select-1997"><span class="linenos">1997</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-1998"><a href="#Select-1998"><span class="linenos">1998</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-1999"><a href="#Select-1999"><span class="linenos">1999</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> </span><span id="Select-2000"><a href="#Select-2000"><span class="linenos">2000</span></a> -</span><span id="Select-2001"><a href="#Select-2001"><span class="linenos">2001</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2002"><a href="#Select-2002"><span class="linenos">2002</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2003"><a href="#Select-2003"><span class="linenos">2003</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="Select-2004"><a href="#Select-2004"><span class="linenos">2004</span></a> -</span><span id="Select-2005"><a href="#Select-2005"><span class="linenos">2005</span></a><span class="sd"> Example:</span> -</span><span id="Select-2006"><a href="#Select-2006"><span class="linenos">2006</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> -</span><span id="Select-2007"><a href="#Select-2007"><span class="linenos">2007</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="Select-2008"><a href="#Select-2008"><span class="linenos">2008</span></a> -</span><span id="Select-2009"><a href="#Select-2009"><span class="linenos">2009</span></a><span class="sd"> Args:</span> -</span><span id="Select-2010"><a href="#Select-2010"><span class="linenos">2010</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-2011"><a href="#Select-2011"><span class="linenos">2011</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select-2012"><a href="#Select-2012"><span class="linenos">2012</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> -</span><span id="Select-2013"><a href="#Select-2013"><span class="linenos">2013</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-2014"><a href="#Select-2014"><span class="linenos">2014</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select-2015"><a href="#Select-2015"><span class="linenos">2015</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-2016"><a href="#Select-2016"><span class="linenos">2016</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2017"><a href="#Select-2017"><span class="linenos">2017</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2018"><a href="#Select-2018"><span class="linenos">2018</span></a> -</span><span id="Select-2019"><a href="#Select-2019"><span class="linenos">2019</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2020"><a href="#Select-2020"><span class="linenos">2020</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2021"><a href="#Select-2021"><span class="linenos">2021</span></a><span class="sd"> """</span> -</span><span id="Select-2022"><a href="#Select-2022"><span class="linenos">2022</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select-2023"><a href="#Select-2023"><span class="linenos">2023</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2024"><a href="#Select-2024"><span class="linenos">2024</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2025"><a href="#Select-2025"><span class="linenos">2025</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> -</span><span id="Select-2026"><a href="#Select-2026"><span class="linenos">2026</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2027"><a href="#Select-2027"><span class="linenos">2027</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2028"><a href="#Select-2028"><span class="linenos">2028</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> -</span><span id="Select-2029"><a href="#Select-2029"><span class="linenos">2029</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> -</span><span id="Select-2030"><a href="#Select-2030"><span class="linenos">2030</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2031"><a href="#Select-2031"><span class="linenos">2031</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2032"><a href="#Select-2032"><span class="linenos">2032</span></a> <span class="p">)</span> +</span><span id="Select-2001"><a href="#Select-2001"><span class="linenos">2001</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2002"><a href="#Select-2002"><span class="linenos">2002</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2003"><a href="#Select-2003"><span class="linenos">2003</span></a><span class="sd"> """</span> +</span><span id="Select-2004"><a href="#Select-2004"><span class="linenos">2004</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2005"><a href="#Select-2005"><span class="linenos">2005</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2006"><a href="#Select-2006"><span class="linenos">2006</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2007"><a href="#Select-2007"><span class="linenos">2007</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> +</span><span id="Select-2008"><a href="#Select-2008"><span class="linenos">2008</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2009"><a href="#Select-2009"><span class="linenos">2009</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2010"><a href="#Select-2010"><span class="linenos">2010</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> +</span><span id="Select-2011"><a href="#Select-2011"><span class="linenos">2011</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> +</span><span id="Select-2012"><a href="#Select-2012"><span class="linenos">2012</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2013"><a href="#Select-2013"><span class="linenos">2013</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2014"><a href="#Select-2014"><span class="linenos">2014</span></a> <span class="p">)</span> +</span><span id="Select-2015"><a href="#Select-2015"><span class="linenos">2015</span></a> +</span><span id="Select-2016"><a href="#Select-2016"><span class="linenos">2016</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2017"><a href="#Select-2017"><span class="linenos">2017</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2018"><a href="#Select-2018"><span class="linenos">2018</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="Select-2019"><a href="#Select-2019"><span class="linenos">2019</span></a> +</span><span id="Select-2020"><a href="#Select-2020"><span class="linenos">2020</span></a><span class="sd"> Example:</span> +</span><span id="Select-2021"><a href="#Select-2021"><span class="linenos">2021</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> +</span><span id="Select-2022"><a href="#Select-2022"><span class="linenos">2022</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="Select-2023"><a href="#Select-2023"><span class="linenos">2023</span></a> +</span><span id="Select-2024"><a href="#Select-2024"><span class="linenos">2024</span></a><span class="sd"> Args:</span> +</span><span id="Select-2025"><a href="#Select-2025"><span class="linenos">2025</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-2026"><a href="#Select-2026"><span class="linenos">2026</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2027"><a href="#Select-2027"><span class="linenos">2027</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> +</span><span id="Select-2028"><a href="#Select-2028"><span class="linenos">2028</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-2029"><a href="#Select-2029"><span class="linenos">2029</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-2030"><a href="#Select-2030"><span class="linenos">2030</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-2031"><a href="#Select-2031"><span class="linenos">2031</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2032"><a href="#Select-2032"><span class="linenos">2032</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> </span><span id="Select-2033"><a href="#Select-2033"><span class="linenos">2033</span></a> -</span><span id="Select-2034"><a href="#Select-2034"><span class="linenos">2034</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2035"><a href="#Select-2035"><span class="linenos">2035</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2036"><a href="#Select-2036"><span class="linenos">2036</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Select-2037"><a href="#Select-2037"><span class="linenos">2037</span></a> -</span><span id="Select-2038"><a href="#Select-2038"><span class="linenos">2038</span></a><span class="sd"> Example:</span> -</span><span id="Select-2039"><a href="#Select-2039"><span class="linenos">2039</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="Select-2040"><a href="#Select-2040"><span class="linenos">2040</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> -</span><span id="Select-2041"><a href="#Select-2041"><span class="linenos">2041</span></a> -</span><span id="Select-2042"><a href="#Select-2042"><span class="linenos">2042</span></a><span class="sd"> Args:</span> -</span><span id="Select-2043"><a href="#Select-2043"><span class="linenos">2043</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Select-2044"><a href="#Select-2044"><span class="linenos">2044</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select-2045"><a href="#Select-2045"><span class="linenos">2045</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Select-2046"><a href="#Select-2046"><span class="linenos">2046</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Select-2047"><a href="#Select-2047"><span class="linenos">2047</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-2048"><a href="#Select-2048"><span class="linenos">2048</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2049"><a href="#Select-2049"><span class="linenos">2049</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2050"><a href="#Select-2050"><span class="linenos">2050</span></a> -</span><span id="Select-2051"><a href="#Select-2051"><span class="linenos">2051</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2052"><a href="#Select-2052"><span class="linenos">2052</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2053"><a href="#Select-2053"><span class="linenos">2053</span></a><span class="sd"> """</span> -</span><span id="Select-2054"><a href="#Select-2054"><span class="linenos">2054</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select-2055"><a href="#Select-2055"><span class="linenos">2055</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2056"><a href="#Select-2056"><span class="linenos">2056</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2057"><a href="#Select-2057"><span class="linenos">2057</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> -</span><span id="Select-2058"><a href="#Select-2058"><span class="linenos">2058</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> -</span><span id="Select-2059"><a href="#Select-2059"><span class="linenos">2059</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> -</span><span id="Select-2060"><a href="#Select-2060"><span class="linenos">2060</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2061"><a href="#Select-2061"><span class="linenos">2061</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2062"><a href="#Select-2062"><span class="linenos">2062</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2063"><a href="#Select-2063"><span class="linenos">2063</span></a> <span class="p">)</span> -</span><span id="Select-2064"><a href="#Select-2064"><span class="linenos">2064</span></a> -</span><span id="Select-2065"><a href="#Select-2065"><span class="linenos">2065</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2066"><a href="#Select-2066"><span class="linenos">2066</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2067"><a href="#Select-2067"><span class="linenos">2067</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select-2068"><a href="#Select-2068"><span class="linenos">2068</span></a> -</span><span id="Select-2069"><a href="#Select-2069"><span class="linenos">2069</span></a><span class="sd"> Example:</span> -</span><span id="Select-2070"><a href="#Select-2070"><span class="linenos">2070</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="Select-2071"><a href="#Select-2071"><span class="linenos">2071</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</span><span id="Select-2072"><a href="#Select-2072"><span class="linenos">2072</span></a> -</span><span id="Select-2073"><a href="#Select-2073"><span class="linenos">2073</span></a><span class="sd"> Args:</span> -</span><span id="Select-2074"><a href="#Select-2074"><span class="linenos">2074</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Select-2075"><a href="#Select-2075"><span class="linenos">2075</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select-2076"><a href="#Select-2076"><span class="linenos">2076</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="Select-2077"><a href="#Select-2077"><span class="linenos">2077</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="Select-2078"><a href="#Select-2078"><span class="linenos">2078</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select-2079"><a href="#Select-2079"><span class="linenos">2079</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2080"><a href="#Select-2080"><span class="linenos">2080</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2034"><a href="#Select-2034"><span class="linenos">2034</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2035"><a href="#Select-2035"><span class="linenos">2035</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2036"><a href="#Select-2036"><span class="linenos">2036</span></a><span class="sd"> """</span> +</span><span id="Select-2037"><a href="#Select-2037"><span class="linenos">2037</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2038"><a href="#Select-2038"><span class="linenos">2038</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2039"><a href="#Select-2039"><span class="linenos">2039</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2040"><a href="#Select-2040"><span class="linenos">2040</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> +</span><span id="Select-2041"><a href="#Select-2041"><span class="linenos">2041</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2042"><a href="#Select-2042"><span class="linenos">2042</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2043"><a href="#Select-2043"><span class="linenos">2043</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> +</span><span id="Select-2044"><a href="#Select-2044"><span class="linenos">2044</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> +</span><span id="Select-2045"><a href="#Select-2045"><span class="linenos">2045</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2046"><a href="#Select-2046"><span class="linenos">2046</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2047"><a href="#Select-2047"><span class="linenos">2047</span></a> <span class="p">)</span> +</span><span id="Select-2048"><a href="#Select-2048"><span class="linenos">2048</span></a> +</span><span id="Select-2049"><a href="#Select-2049"><span class="linenos">2049</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2050"><a href="#Select-2050"><span class="linenos">2050</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2051"><a href="#Select-2051"><span class="linenos">2051</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="Select-2052"><a href="#Select-2052"><span class="linenos">2052</span></a> +</span><span id="Select-2053"><a href="#Select-2053"><span class="linenos">2053</span></a><span class="sd"> Example:</span> +</span><span id="Select-2054"><a href="#Select-2054"><span class="linenos">2054</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> +</span><span id="Select-2055"><a href="#Select-2055"><span class="linenos">2055</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="Select-2056"><a href="#Select-2056"><span class="linenos">2056</span></a> +</span><span id="Select-2057"><a href="#Select-2057"><span class="linenos">2057</span></a><span class="sd"> Args:</span> +</span><span id="Select-2058"><a href="#Select-2058"><span class="linenos">2058</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-2059"><a href="#Select-2059"><span class="linenos">2059</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select-2060"><a href="#Select-2060"><span class="linenos">2060</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> +</span><span id="Select-2061"><a href="#Select-2061"><span class="linenos">2061</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-2062"><a href="#Select-2062"><span class="linenos">2062</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select-2063"><a href="#Select-2063"><span class="linenos">2063</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-2064"><a href="#Select-2064"><span class="linenos">2064</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2065"><a href="#Select-2065"><span class="linenos">2065</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2066"><a href="#Select-2066"><span class="linenos">2066</span></a> +</span><span id="Select-2067"><a href="#Select-2067"><span class="linenos">2067</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2068"><a href="#Select-2068"><span class="linenos">2068</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2069"><a href="#Select-2069"><span class="linenos">2069</span></a><span class="sd"> """</span> +</span><span id="Select-2070"><a href="#Select-2070"><span class="linenos">2070</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select-2071"><a href="#Select-2071"><span class="linenos">2071</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2072"><a href="#Select-2072"><span class="linenos">2072</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2073"><a href="#Select-2073"><span class="linenos">2073</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> +</span><span id="Select-2074"><a href="#Select-2074"><span class="linenos">2074</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2075"><a href="#Select-2075"><span class="linenos">2075</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2076"><a href="#Select-2076"><span class="linenos">2076</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> +</span><span id="Select-2077"><a href="#Select-2077"><span class="linenos">2077</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> +</span><span id="Select-2078"><a href="#Select-2078"><span class="linenos">2078</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2079"><a href="#Select-2079"><span class="linenos">2079</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2080"><a href="#Select-2080"><span class="linenos">2080</span></a> <span class="p">)</span> </span><span id="Select-2081"><a href="#Select-2081"><span class="linenos">2081</span></a> -</span><span id="Select-2082"><a href="#Select-2082"><span class="linenos">2082</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2083"><a href="#Select-2083"><span class="linenos">2083</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2084"><a href="#Select-2084"><span class="linenos">2084</span></a><span class="sd"> """</span> -</span><span id="Select-2085"><a href="#Select-2085"><span class="linenos">2085</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select-2086"><a href="#Select-2086"><span class="linenos">2086</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2087"><a href="#Select-2087"><span class="linenos">2087</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2088"><a href="#Select-2088"><span class="linenos">2088</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> -</span><span id="Select-2089"><a href="#Select-2089"><span class="linenos">2089</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> -</span><span id="Select-2090"><a href="#Select-2090"><span class="linenos">2090</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> -</span><span id="Select-2091"><a href="#Select-2091"><span class="linenos">2091</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2092"><a href="#Select-2092"><span class="linenos">2092</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2093"><a href="#Select-2093"><span class="linenos">2093</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2094"><a href="#Select-2094"><span class="linenos">2094</span></a> <span class="p">)</span> -</span><span id="Select-2095"><a href="#Select-2095"><span class="linenos">2095</span></a> -</span><span id="Select-2096"><a href="#Select-2096"><span class="linenos">2096</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Select-2097"><a href="#Select-2097"><span class="linenos">2097</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2098"><a href="#Select-2098"><span class="linenos">2098</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="Select-2099"><a href="#Select-2099"><span class="linenos">2099</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Select-2100"><a href="#Select-2100"><span class="linenos">2100</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2101"><a href="#Select-2101"><span class="linenos">2101</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Select-2102"><a href="#Select-2102"><span class="linenos">2102</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2103"><a href="#Select-2103"><span class="linenos">2103</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2104"><a href="#Select-2104"><span class="linenos">2104</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2105"><a href="#Select-2105"><span class="linenos">2105</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</span><span id="Select-2106"><a href="#Select-2106"><span class="linenos">2106</span></a> -</span><span id="Select-2107"><a href="#Select-2107"><span class="linenos">2107</span></a><span class="sd"> Example:</span> -</span><span id="Select-2108"><a href="#Select-2108"><span class="linenos">2108</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="Select-2109"><a href="#Select-2109"><span class="linenos">2109</span></a><span class="sd"> 'SELECT x, y'</span> -</span><span id="Select-2110"><a href="#Select-2110"><span class="linenos">2110</span></a> -</span><span id="Select-2111"><a href="#Select-2111"><span class="linenos">2111</span></a><span class="sd"> Args:</span> -</span><span id="Select-2112"><a href="#Select-2112"><span class="linenos">2112</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select-2113"><a href="#Select-2113"><span class="linenos">2113</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2114"><a href="#Select-2114"><span class="linenos">2114</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select-2115"><a href="#Select-2115"><span class="linenos">2115</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2116"><a href="#Select-2116"><span class="linenos">2116</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select-2117"><a href="#Select-2117"><span class="linenos">2117</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2118"><a href="#Select-2118"><span class="linenos">2118</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select-2119"><a href="#Select-2119"><span class="linenos">2119</span></a> -</span><span id="Select-2120"><a href="#Select-2120"><span class="linenos">2120</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2121"><a href="#Select-2121"><span class="linenos">2121</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2122"><a href="#Select-2122"><span class="linenos">2122</span></a><span class="sd"> """</span> -</span><span id="Select-2123"><a href="#Select-2123"><span class="linenos">2123</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2124"><a href="#Select-2124"><span class="linenos">2124</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2125"><a href="#Select-2125"><span class="linenos">2125</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2126"><a href="#Select-2126"><span class="linenos">2126</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="Select-2127"><a href="#Select-2127"><span class="linenos">2127</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2128"><a href="#Select-2128"><span class="linenos">2128</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2129"><a href="#Select-2129"><span class="linenos">2129</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2130"><a href="#Select-2130"><span class="linenos">2130</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2131"><a href="#Select-2131"><span class="linenos">2131</span></a> <span class="p">)</span> -</span><span id="Select-2132"><a href="#Select-2132"><span class="linenos">2132</span></a> -</span><span id="Select-2133"><a href="#Select-2133"><span class="linenos">2133</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2134"><a href="#Select-2134"><span class="linenos">2134</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2135"><a href="#Select-2135"><span class="linenos">2135</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</span><span id="Select-2136"><a href="#Select-2136"><span class="linenos">2136</span></a> -</span><span id="Select-2137"><a href="#Select-2137"><span class="linenos">2137</span></a><span class="sd"> Example:</span> -</span><span id="Select-2138"><a href="#Select-2138"><span class="linenos">2138</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="Select-2139"><a href="#Select-2139"><span class="linenos">2139</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</span><span id="Select-2140"><a href="#Select-2140"><span class="linenos">2140</span></a> -</span><span id="Select-2141"><a href="#Select-2141"><span class="linenos">2141</span></a><span class="sd"> Args:</span> -</span><span id="Select-2142"><a href="#Select-2142"><span class="linenos">2142</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-2143"><a href="#Select-2143"><span class="linenos">2143</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2144"><a href="#Select-2144"><span class="linenos">2144</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-2145"><a href="#Select-2145"><span class="linenos">2145</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2146"><a href="#Select-2146"><span class="linenos">2146</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select-2147"><a href="#Select-2147"><span class="linenos">2147</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2148"><a href="#Select-2148"><span class="linenos">2148</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2149"><a href="#Select-2149"><span class="linenos">2149</span></a> -</span><span id="Select-2150"><a href="#Select-2150"><span class="linenos">2150</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2151"><a href="#Select-2151"><span class="linenos">2151</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2152"><a href="#Select-2152"><span class="linenos">2152</span></a><span class="sd"> """</span> -</span><span id="Select-2153"><a href="#Select-2153"><span class="linenos">2153</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2154"><a href="#Select-2154"><span class="linenos">2154</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2155"><a href="#Select-2155"><span class="linenos">2155</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2156"><a href="#Select-2156"><span class="linenos">2156</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> -</span><span id="Select-2157"><a href="#Select-2157"><span class="linenos">2157</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2158"><a href="#Select-2158"><span class="linenos">2158</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> -</span><span id="Select-2159"><a href="#Select-2159"><span class="linenos">2159</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> -</span><span id="Select-2160"><a href="#Select-2160"><span class="linenos">2160</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2161"><a href="#Select-2161"><span class="linenos">2161</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2162"><a href="#Select-2162"><span class="linenos">2162</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2163"><a href="#Select-2163"><span class="linenos">2163</span></a> <span class="p">)</span> -</span><span id="Select-2164"><a href="#Select-2164"><span class="linenos">2164</span></a> -</span><span id="Select-2165"><a href="#Select-2165"><span class="linenos">2165</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="Select-2166"><a href="#Select-2166"><span class="linenos">2166</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2167"><a href="#Select-2167"><span class="linenos">2167</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="Select-2168"><a href="#Select-2168"><span class="linenos">2168</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2169"><a href="#Select-2169"><span class="linenos">2169</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2170"><a href="#Select-2170"><span class="linenos">2170</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Select-2171"><a href="#Select-2171"><span class="linenos">2171</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2172"><a href="#Select-2172"><span class="linenos">2172</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2173"><a href="#Select-2173"><span class="linenos">2173</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select-2174"><a href="#Select-2174"><span class="linenos">2174</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Select-2175"><a href="#Select-2175"><span class="linenos">2175</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2176"><a href="#Select-2176"><span class="linenos">2176</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2177"><a href="#Select-2177"><span class="linenos">2177</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2178"><a href="#Select-2178"><span class="linenos">2178</span></a><span class="sd"> Append to or set the JOIN expressions.</span> -</span><span id="Select-2179"><a href="#Select-2179"><span class="linenos">2179</span></a> -</span><span id="Select-2180"><a href="#Select-2180"><span class="linenos">2180</span></a><span class="sd"> Example:</span> -</span><span id="Select-2181"><a href="#Select-2181"><span class="linenos">2181</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="Select-2182"><a href="#Select-2182"><span class="linenos">2182</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select-2183"><a href="#Select-2183"><span class="linenos">2183</span></a> -</span><span id="Select-2184"><a href="#Select-2184"><span class="linenos">2184</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="Select-2185"><a href="#Select-2185"><span class="linenos">2185</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> -</span><span id="Select-2186"><a href="#Select-2186"><span class="linenos">2186</span></a> -</span><span id="Select-2187"><a href="#Select-2187"><span class="linenos">2187</span></a><span class="sd"> Use `join_type` to change the type of join:</span> +</span><span id="Select-2082"><a href="#Select-2082"><span class="linenos">2082</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2083"><a href="#Select-2083"><span class="linenos">2083</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2084"><a href="#Select-2084"><span class="linenos">2084</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Select-2085"><a href="#Select-2085"><span class="linenos">2085</span></a> +</span><span id="Select-2086"><a href="#Select-2086"><span class="linenos">2086</span></a><span class="sd"> Example:</span> +</span><span id="Select-2087"><a href="#Select-2087"><span class="linenos">2087</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="Select-2088"><a href="#Select-2088"><span class="linenos">2088</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> +</span><span id="Select-2089"><a href="#Select-2089"><span class="linenos">2089</span></a> +</span><span id="Select-2090"><a href="#Select-2090"><span class="linenos">2090</span></a><span class="sd"> Args:</span> +</span><span id="Select-2091"><a href="#Select-2091"><span class="linenos">2091</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Select-2092"><a href="#Select-2092"><span class="linenos">2092</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select-2093"><a href="#Select-2093"><span class="linenos">2093</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Select-2094"><a href="#Select-2094"><span class="linenos">2094</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Select-2095"><a href="#Select-2095"><span class="linenos">2095</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-2096"><a href="#Select-2096"><span class="linenos">2096</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2097"><a href="#Select-2097"><span class="linenos">2097</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2098"><a href="#Select-2098"><span class="linenos">2098</span></a> +</span><span id="Select-2099"><a href="#Select-2099"><span class="linenos">2099</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2100"><a href="#Select-2100"><span class="linenos">2100</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2101"><a href="#Select-2101"><span class="linenos">2101</span></a><span class="sd"> """</span> +</span><span id="Select-2102"><a href="#Select-2102"><span class="linenos">2102</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select-2103"><a href="#Select-2103"><span class="linenos">2103</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2104"><a href="#Select-2104"><span class="linenos">2104</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2105"><a href="#Select-2105"><span class="linenos">2105</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> +</span><span id="Select-2106"><a href="#Select-2106"><span class="linenos">2106</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> +</span><span id="Select-2107"><a href="#Select-2107"><span class="linenos">2107</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> +</span><span id="Select-2108"><a href="#Select-2108"><span class="linenos">2108</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2109"><a href="#Select-2109"><span class="linenos">2109</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2110"><a href="#Select-2110"><span class="linenos">2110</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2111"><a href="#Select-2111"><span class="linenos">2111</span></a> <span class="p">)</span> +</span><span id="Select-2112"><a href="#Select-2112"><span class="linenos">2112</span></a> +</span><span id="Select-2113"><a href="#Select-2113"><span class="linenos">2113</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2114"><a href="#Select-2114"><span class="linenos">2114</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2115"><a href="#Select-2115"><span class="linenos">2115</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select-2116"><a href="#Select-2116"><span class="linenos">2116</span></a> +</span><span id="Select-2117"><a href="#Select-2117"><span class="linenos">2117</span></a><span class="sd"> Example:</span> +</span><span id="Select-2118"><a href="#Select-2118"><span class="linenos">2118</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="Select-2119"><a href="#Select-2119"><span class="linenos">2119</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> +</span><span id="Select-2120"><a href="#Select-2120"><span class="linenos">2120</span></a> +</span><span id="Select-2121"><a href="#Select-2121"><span class="linenos">2121</span></a><span class="sd"> Args:</span> +</span><span id="Select-2122"><a href="#Select-2122"><span class="linenos">2122</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Select-2123"><a href="#Select-2123"><span class="linenos">2123</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select-2124"><a href="#Select-2124"><span class="linenos">2124</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="Select-2125"><a href="#Select-2125"><span class="linenos">2125</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="Select-2126"><a href="#Select-2126"><span class="linenos">2126</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select-2127"><a href="#Select-2127"><span class="linenos">2127</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2128"><a href="#Select-2128"><span class="linenos">2128</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2129"><a href="#Select-2129"><span class="linenos">2129</span></a> +</span><span id="Select-2130"><a href="#Select-2130"><span class="linenos">2130</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2131"><a href="#Select-2131"><span class="linenos">2131</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2132"><a href="#Select-2132"><span class="linenos">2132</span></a><span class="sd"> """</span> +</span><span id="Select-2133"><a href="#Select-2133"><span class="linenos">2133</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select-2134"><a href="#Select-2134"><span class="linenos">2134</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2135"><a href="#Select-2135"><span class="linenos">2135</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2136"><a href="#Select-2136"><span class="linenos">2136</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> +</span><span id="Select-2137"><a href="#Select-2137"><span class="linenos">2137</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> +</span><span id="Select-2138"><a href="#Select-2138"><span class="linenos">2138</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> +</span><span id="Select-2139"><a href="#Select-2139"><span class="linenos">2139</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2140"><a href="#Select-2140"><span class="linenos">2140</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2141"><a href="#Select-2141"><span class="linenos">2141</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2142"><a href="#Select-2142"><span class="linenos">2142</span></a> <span class="p">)</span> +</span><span id="Select-2143"><a href="#Select-2143"><span class="linenos">2143</span></a> +</span><span id="Select-2144"><a href="#Select-2144"><span class="linenos">2144</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Select-2145"><a href="#Select-2145"><span class="linenos">2145</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2146"><a href="#Select-2146"><span class="linenos">2146</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="Select-2147"><a href="#Select-2147"><span class="linenos">2147</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Select-2148"><a href="#Select-2148"><span class="linenos">2148</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2149"><a href="#Select-2149"><span class="linenos">2149</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Select-2150"><a href="#Select-2150"><span class="linenos">2150</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2151"><a href="#Select-2151"><span class="linenos">2151</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2152"><a href="#Select-2152"><span class="linenos">2152</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2153"><a href="#Select-2153"><span class="linenos">2153</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="Select-2154"><a href="#Select-2154"><span class="linenos">2154</span></a> +</span><span id="Select-2155"><a href="#Select-2155"><span class="linenos">2155</span></a><span class="sd"> Example:</span> +</span><span id="Select-2156"><a href="#Select-2156"><span class="linenos">2156</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="Select-2157"><a href="#Select-2157"><span class="linenos">2157</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="Select-2158"><a href="#Select-2158"><span class="linenos">2158</span></a> +</span><span id="Select-2159"><a href="#Select-2159"><span class="linenos">2159</span></a><span class="sd"> Args:</span> +</span><span id="Select-2160"><a href="#Select-2160"><span class="linenos">2160</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select-2161"><a href="#Select-2161"><span class="linenos">2161</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2162"><a href="#Select-2162"><span class="linenos">2162</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select-2163"><a href="#Select-2163"><span class="linenos">2163</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2164"><a href="#Select-2164"><span class="linenos">2164</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select-2165"><a href="#Select-2165"><span class="linenos">2165</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2166"><a href="#Select-2166"><span class="linenos">2166</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select-2167"><a href="#Select-2167"><span class="linenos">2167</span></a> +</span><span id="Select-2168"><a href="#Select-2168"><span class="linenos">2168</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2169"><a href="#Select-2169"><span class="linenos">2169</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2170"><a href="#Select-2170"><span class="linenos">2170</span></a><span class="sd"> """</span> +</span><span id="Select-2171"><a href="#Select-2171"><span class="linenos">2171</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2172"><a href="#Select-2172"><span class="linenos">2172</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2173"><a href="#Select-2173"><span class="linenos">2173</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2174"><a href="#Select-2174"><span class="linenos">2174</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="Select-2175"><a href="#Select-2175"><span class="linenos">2175</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2176"><a href="#Select-2176"><span class="linenos">2176</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2177"><a href="#Select-2177"><span class="linenos">2177</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2178"><a href="#Select-2178"><span class="linenos">2178</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2179"><a href="#Select-2179"><span class="linenos">2179</span></a> <span class="p">)</span> +</span><span id="Select-2180"><a href="#Select-2180"><span class="linenos">2180</span></a> +</span><span id="Select-2181"><a href="#Select-2181"><span class="linenos">2181</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2182"><a href="#Select-2182"><span class="linenos">2182</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2183"><a href="#Select-2183"><span class="linenos">2183</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="Select-2184"><a href="#Select-2184"><span class="linenos">2184</span></a> +</span><span id="Select-2185"><a href="#Select-2185"><span class="linenos">2185</span></a><span class="sd"> Example:</span> +</span><span id="Select-2186"><a href="#Select-2186"><span class="linenos">2186</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="Select-2187"><a href="#Select-2187"><span class="linenos">2187</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> </span><span id="Select-2188"><a href="#Select-2188"><span class="linenos">2188</span></a> -</span><span id="Select-2189"><a href="#Select-2189"><span class="linenos">2189</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> -</span><span id="Select-2190"><a href="#Select-2190"><span class="linenos">2190</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select-2191"><a href="#Select-2191"><span class="linenos">2191</span></a> -</span><span id="Select-2192"><a href="#Select-2192"><span class="linenos">2192</span></a><span class="sd"> Args:</span> -</span><span id="Select-2193"><a href="#Select-2193"><span class="linenos">2193</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> -</span><span id="Select-2194"><a href="#Select-2194"><span class="linenos">2194</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2195"><a href="#Select-2195"><span class="linenos">2195</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> -</span><span id="Select-2196"><a href="#Select-2196"><span class="linenos">2196</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2197"><a href="#Select-2197"><span class="linenos">2197</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="Select-2198"><a href="#Select-2198"><span class="linenos">2198</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2199"><a href="#Select-2199"><span class="linenos">2199</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select-2200"><a href="#Select-2200"><span class="linenos">2200</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select-2201"><a href="#Select-2201"><span class="linenos">2201</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> -</span><span id="Select-2202"><a href="#Select-2202"><span class="linenos">2202</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select-2203"><a href="#Select-2203"><span class="linenos">2203</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2204"><a href="#Select-2204"><span class="linenos">2204</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2205"><a href="#Select-2205"><span class="linenos">2205</span></a> -</span><span id="Select-2206"><a href="#Select-2206"><span class="linenos">2206</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2207"><a href="#Select-2207"><span class="linenos">2207</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2208"><a href="#Select-2208"><span class="linenos">2208</span></a><span class="sd"> """</span> -</span><span id="Select-2209"><a href="#Select-2209"><span class="linenos">2209</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> -</span><span id="Select-2210"><a href="#Select-2210"><span class="linenos">2210</span></a> -</span><span id="Select-2211"><a href="#Select-2211"><span class="linenos">2211</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Select-2212"><a href="#Select-2212"><span class="linenos">2212</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="Select-2213"><a href="#Select-2213"><span class="linenos">2213</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="Select-2214"><a href="#Select-2214"><span class="linenos">2214</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="Select-2215"><a href="#Select-2215"><span class="linenos">2215</span></a> -</span><span id="Select-2216"><a href="#Select-2216"><span class="linenos">2216</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Select-2217"><a href="#Select-2217"><span class="linenos">2217</span></a> -</span><span id="Select-2218"><a href="#Select-2218"><span class="linenos">2218</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> -</span><span id="Select-2219"><a href="#Select-2219"><span class="linenos">2219</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> -</span><span id="Select-2220"><a href="#Select-2220"><span class="linenos">2220</span></a> -</span><span id="Select-2221"><a href="#Select-2221"><span class="linenos">2221</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="Select-2222"><a href="#Select-2222"><span class="linenos">2222</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select-2223"><a href="#Select-2223"><span class="linenos">2223</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select-2224"><a href="#Select-2224"><span class="linenos">2224</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select-2225"><a href="#Select-2225"><span class="linenos">2225</span></a> -</span><span id="Select-2226"><a href="#Select-2226"><span class="linenos">2226</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="Select-2189"><a href="#Select-2189"><span class="linenos">2189</span></a><span class="sd"> Args:</span> +</span><span id="Select-2190"><a href="#Select-2190"><span class="linenos">2190</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-2191"><a href="#Select-2191"><span class="linenos">2191</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2192"><a href="#Select-2192"><span class="linenos">2192</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-2193"><a href="#Select-2193"><span class="linenos">2193</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2194"><a href="#Select-2194"><span class="linenos">2194</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select-2195"><a href="#Select-2195"><span class="linenos">2195</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2196"><a href="#Select-2196"><span class="linenos">2196</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2197"><a href="#Select-2197"><span class="linenos">2197</span></a> +</span><span id="Select-2198"><a href="#Select-2198"><span class="linenos">2198</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2199"><a href="#Select-2199"><span class="linenos">2199</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2200"><a href="#Select-2200"><span class="linenos">2200</span></a><span class="sd"> """</span> +</span><span id="Select-2201"><a href="#Select-2201"><span class="linenos">2201</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2202"><a href="#Select-2202"><span class="linenos">2202</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2203"><a href="#Select-2203"><span class="linenos">2203</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2204"><a href="#Select-2204"><span class="linenos">2204</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> +</span><span id="Select-2205"><a href="#Select-2205"><span class="linenos">2205</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2206"><a href="#Select-2206"><span class="linenos">2206</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> +</span><span id="Select-2207"><a href="#Select-2207"><span class="linenos">2207</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> +</span><span id="Select-2208"><a href="#Select-2208"><span class="linenos">2208</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2209"><a href="#Select-2209"><span class="linenos">2209</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2210"><a href="#Select-2210"><span class="linenos">2210</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2211"><a href="#Select-2211"><span class="linenos">2211</span></a> <span class="p">)</span> +</span><span id="Select-2212"><a href="#Select-2212"><span class="linenos">2212</span></a> +</span><span id="Select-2213"><a href="#Select-2213"><span class="linenos">2213</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="Select-2214"><a href="#Select-2214"><span class="linenos">2214</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2215"><a href="#Select-2215"><span class="linenos">2215</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="Select-2216"><a href="#Select-2216"><span class="linenos">2216</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2217"><a href="#Select-2217"><span class="linenos">2217</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2218"><a href="#Select-2218"><span class="linenos">2218</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Select-2219"><a href="#Select-2219"><span class="linenos">2219</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2220"><a href="#Select-2220"><span class="linenos">2220</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2221"><a href="#Select-2221"><span class="linenos">2221</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select-2222"><a href="#Select-2222"><span class="linenos">2222</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Select-2223"><a href="#Select-2223"><span class="linenos">2223</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2224"><a href="#Select-2224"><span class="linenos">2224</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2225"><a href="#Select-2225"><span class="linenos">2225</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2226"><a href="#Select-2226"><span class="linenos">2226</span></a><span class="sd"> Append to or set the JOIN expressions.</span> </span><span id="Select-2227"><a href="#Select-2227"><span class="linenos">2227</span></a> -</span><span id="Select-2228"><a href="#Select-2228"><span class="linenos">2228</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> -</span><span id="Select-2229"><a href="#Select-2229"><span class="linenos">2229</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> -</span><span id="Select-2230"><a href="#Select-2230"><span class="linenos">2230</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="Select-2231"><a href="#Select-2231"><span class="linenos">2231</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="Select-2232"><a href="#Select-2232"><span class="linenos">2232</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="Select-2233"><a href="#Select-2233"><span class="linenos">2233</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select-2228"><a href="#Select-2228"><span class="linenos">2228</span></a><span class="sd"> Example:</span> +</span><span id="Select-2229"><a href="#Select-2229"><span class="linenos">2229</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="Select-2230"><a href="#Select-2230"><span class="linenos">2230</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select-2231"><a href="#Select-2231"><span class="linenos">2231</span></a> +</span><span id="Select-2232"><a href="#Select-2232"><span class="linenos">2232</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="Select-2233"><a href="#Select-2233"><span class="linenos">2233</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> </span><span id="Select-2234"><a href="#Select-2234"><span class="linenos">2234</span></a> -</span><span id="Select-2235"><a href="#Select-2235"><span class="linenos">2235</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="Select-2236"><a href="#Select-2236"><span class="linenos">2236</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Select-2237"><a href="#Select-2237"><span class="linenos">2237</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> -</span><span id="Select-2238"><a href="#Select-2238"><span class="linenos">2238</span></a> -</span><span id="Select-2239"><a href="#Select-2239"><span class="linenos">2239</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="Select-2240"><a href="#Select-2240"><span class="linenos">2240</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2241"><a href="#Select-2241"><span class="linenos">2241</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="Select-2242"><a href="#Select-2242"><span class="linenos">2242</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> -</span><span id="Select-2243"><a href="#Select-2243"><span class="linenos">2243</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Select-2244"><a href="#Select-2244"><span class="linenos">2244</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2245"><a href="#Select-2245"><span class="linenos">2245</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2246"><a href="#Select-2246"><span class="linenos">2246</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2247"><a href="#Select-2247"><span class="linenos">2247</span></a> <span class="p">)</span> -</span><span id="Select-2248"><a href="#Select-2248"><span class="linenos">2248</span></a> -</span><span id="Select-2249"><a href="#Select-2249"><span class="linenos">2249</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="Select-2250"><a href="#Select-2250"><span class="linenos">2250</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> -</span><span id="Select-2251"><a href="#Select-2251"><span class="linenos">2251</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2252"><a href="#Select-2252"><span class="linenos">2252</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="Select-2253"><a href="#Select-2253"><span class="linenos">2253</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2254"><a href="#Select-2254"><span class="linenos">2254</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> -</span><span id="Select-2255"><a href="#Select-2255"><span class="linenos">2255</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2256"><a href="#Select-2256"><span class="linenos">2256</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2257"><a href="#Select-2257"><span class="linenos">2257</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2258"><a href="#Select-2258"><span class="linenos">2258</span></a> <span class="p">)</span> -</span><span id="Select-2259"><a href="#Select-2259"><span class="linenos">2259</span></a> -</span><span id="Select-2260"><a href="#Select-2260"><span class="linenos">2260</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2261"><a href="#Select-2261"><span class="linenos">2261</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2262"><a href="#Select-2262"><span class="linenos">2262</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Select-2235"><a href="#Select-2235"><span class="linenos">2235</span></a><span class="sd"> Use `join_type` to change the type of join:</span> +</span><span id="Select-2236"><a href="#Select-2236"><span class="linenos">2236</span></a> +</span><span id="Select-2237"><a href="#Select-2237"><span class="linenos">2237</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> +</span><span id="Select-2238"><a href="#Select-2238"><span class="linenos">2238</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select-2239"><a href="#Select-2239"><span class="linenos">2239</span></a> +</span><span id="Select-2240"><a href="#Select-2240"><span class="linenos">2240</span></a><span class="sd"> Args:</span> +</span><span id="Select-2241"><a href="#Select-2241"><span class="linenos">2241</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> +</span><span id="Select-2242"><a href="#Select-2242"><span class="linenos">2242</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2243"><a href="#Select-2243"><span class="linenos">2243</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="Select-2244"><a href="#Select-2244"><span class="linenos">2244</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2245"><a href="#Select-2245"><span class="linenos">2245</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> +</span><span id="Select-2246"><a href="#Select-2246"><span class="linenos">2246</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2247"><a href="#Select-2247"><span class="linenos">2247</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select-2248"><a href="#Select-2248"><span class="linenos">2248</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select-2249"><a href="#Select-2249"><span class="linenos">2249</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> +</span><span id="Select-2250"><a href="#Select-2250"><span class="linenos">2250</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select-2251"><a href="#Select-2251"><span class="linenos">2251</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2252"><a href="#Select-2252"><span class="linenos">2252</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2253"><a href="#Select-2253"><span class="linenos">2253</span></a> +</span><span id="Select-2254"><a href="#Select-2254"><span class="linenos">2254</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2255"><a href="#Select-2255"><span class="linenos">2255</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2256"><a href="#Select-2256"><span class="linenos">2256</span></a><span class="sd"> """</span> +</span><span id="Select-2257"><a href="#Select-2257"><span class="linenos">2257</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> +</span><span id="Select-2258"><a href="#Select-2258"><span class="linenos">2258</span></a> +</span><span id="Select-2259"><a href="#Select-2259"><span class="linenos">2259</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Select-2260"><a href="#Select-2260"><span class="linenos">2260</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> +</span><span id="Select-2261"><a href="#Select-2261"><span class="linenos">2261</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="Select-2262"><a href="#Select-2262"><span class="linenos">2262</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> </span><span id="Select-2263"><a href="#Select-2263"><span class="linenos">2263</span></a> -</span><span id="Select-2264"><a href="#Select-2264"><span class="linenos">2264</span></a><span class="sd"> Example:</span> -</span><span id="Select-2265"><a href="#Select-2265"><span class="linenos">2265</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Select-2266"><a href="#Select-2266"><span class="linenos">2266</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Select-2267"><a href="#Select-2267"><span class="linenos">2267</span></a> -</span><span id="Select-2268"><a href="#Select-2268"><span class="linenos">2268</span></a><span class="sd"> Args:</span> -</span><span id="Select-2269"><a href="#Select-2269"><span class="linenos">2269</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-2270"><a href="#Select-2270"><span class="linenos">2270</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2271"><a href="#Select-2271"><span class="linenos">2271</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select-2272"><a href="#Select-2272"><span class="linenos">2272</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select-2273"><a href="#Select-2273"><span class="linenos">2273</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select-2274"><a href="#Select-2274"><span class="linenos">2274</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select-2275"><a href="#Select-2275"><span class="linenos">2275</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2276"><a href="#Select-2276"><span class="linenos">2276</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2277"><a href="#Select-2277"><span class="linenos">2277</span></a> -</span><span id="Select-2278"><a href="#Select-2278"><span class="linenos">2278</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2279"><a href="#Select-2279"><span class="linenos">2279</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2280"><a href="#Select-2280"><span class="linenos">2280</span></a><span class="sd"> """</span> -</span><span id="Select-2281"><a href="#Select-2281"><span class="linenos">2281</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select-2282"><a href="#Select-2282"><span class="linenos">2282</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2283"><a href="#Select-2283"><span class="linenos">2283</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2284"><a href="#Select-2284"><span class="linenos">2284</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="Select-2285"><a href="#Select-2285"><span class="linenos">2285</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2286"><a href="#Select-2286"><span class="linenos">2286</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="Select-2287"><a href="#Select-2287"><span class="linenos">2287</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2288"><a href="#Select-2288"><span class="linenos">2288</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2289"><a href="#Select-2289"><span class="linenos">2289</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2290"><a href="#Select-2290"><span class="linenos">2290</span></a> <span class="p">)</span> -</span><span id="Select-2291"><a href="#Select-2291"><span class="linenos">2291</span></a> -</span><span id="Select-2292"><a href="#Select-2292"><span class="linenos">2292</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2293"><a href="#Select-2293"><span class="linenos">2293</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2294"><a href="#Select-2294"><span class="linenos">2294</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="Select-2295"><a href="#Select-2295"><span class="linenos">2295</span></a> -</span><span id="Select-2296"><a href="#Select-2296"><span class="linenos">2296</span></a><span class="sd"> Example:</span> -</span><span id="Select-2297"><a href="#Select-2297"><span class="linenos">2297</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> -</span><span id="Select-2298"><a href="#Select-2298"><span class="linenos">2298</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="Select-2299"><a href="#Select-2299"><span class="linenos">2299</span></a> -</span><span id="Select-2300"><a href="#Select-2300"><span class="linenos">2300</span></a><span class="sd"> Args:</span> -</span><span id="Select-2301"><a href="#Select-2301"><span class="linenos">2301</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select-2302"><a href="#Select-2302"><span class="linenos">2302</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2303"><a href="#Select-2303"><span class="linenos">2303</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select-2304"><a href="#Select-2304"><span class="linenos">2304</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select-2305"><a href="#Select-2305"><span class="linenos">2305</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select-2306"><a href="#Select-2306"><span class="linenos">2306</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select-2307"><a href="#Select-2307"><span class="linenos">2307</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2308"><a href="#Select-2308"><span class="linenos">2308</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select-2309"><a href="#Select-2309"><span class="linenos">2309</span></a> -</span><span id="Select-2310"><a href="#Select-2310"><span class="linenos">2310</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2311"><a href="#Select-2311"><span class="linenos">2311</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2312"><a href="#Select-2312"><span class="linenos">2312</span></a><span class="sd"> """</span> -</span><span id="Select-2313"><a href="#Select-2313"><span class="linenos">2313</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select-2314"><a href="#Select-2314"><span class="linenos">2314</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2315"><a href="#Select-2315"><span class="linenos">2315</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2316"><a href="#Select-2316"><span class="linenos">2316</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> -</span><span id="Select-2317"><a href="#Select-2317"><span class="linenos">2317</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2318"><a href="#Select-2318"><span class="linenos">2318</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> -</span><span id="Select-2319"><a href="#Select-2319"><span class="linenos">2319</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2320"><a href="#Select-2320"><span class="linenos">2320</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2321"><a href="#Select-2321"><span class="linenos">2321</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2322"><a href="#Select-2322"><span class="linenos">2322</span></a> <span class="p">)</span> -</span><span id="Select-2323"><a href="#Select-2323"><span class="linenos">2323</span></a> -</span><span id="Select-2324"><a href="#Select-2324"><span class="linenos">2324</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2325"><a href="#Select-2325"><span class="linenos">2325</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select-2326"><a href="#Select-2326"><span class="linenos">2326</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select-2327"><a href="#Select-2327"><span class="linenos">2327</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select-2328"><a href="#Select-2328"><span class="linenos">2328</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> -</span><span id="Select-2329"><a href="#Select-2329"><span class="linenos">2329</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select-2330"><a href="#Select-2330"><span class="linenos">2330</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> -</span><span id="Select-2331"><a href="#Select-2331"><span class="linenos">2331</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2332"><a href="#Select-2332"><span class="linenos">2332</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select-2333"><a href="#Select-2333"><span class="linenos">2333</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2334"><a href="#Select-2334"><span class="linenos">2334</span></a> <span class="p">)</span> -</span><span id="Select-2335"><a href="#Select-2335"><span class="linenos">2335</span></a> -</span><span id="Select-2336"><a href="#Select-2336"><span class="linenos">2336</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2337"><a href="#Select-2337"><span class="linenos">2337</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2338"><a href="#Select-2338"><span class="linenos">2338</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select-2264"><a href="#Select-2264"><span class="linenos">2264</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Select-2265"><a href="#Select-2265"><span class="linenos">2265</span></a> +</span><span id="Select-2266"><a href="#Select-2266"><span class="linenos">2266</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> +</span><span id="Select-2267"><a href="#Select-2267"><span class="linenos">2267</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> +</span><span id="Select-2268"><a href="#Select-2268"><span class="linenos">2268</span></a> +</span><span id="Select-2269"><a href="#Select-2269"><span class="linenos">2269</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="Select-2270"><a href="#Select-2270"><span class="linenos">2270</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select-2271"><a href="#Select-2271"><span class="linenos">2271</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select-2272"><a href="#Select-2272"><span class="linenos">2272</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select-2273"><a href="#Select-2273"><span class="linenos">2273</span></a> +</span><span id="Select-2274"><a href="#Select-2274"><span class="linenos">2274</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="Select-2275"><a href="#Select-2275"><span class="linenos">2275</span></a> +</span><span id="Select-2276"><a href="#Select-2276"><span class="linenos">2276</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> +</span><span id="Select-2277"><a href="#Select-2277"><span class="linenos">2277</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> +</span><span id="Select-2278"><a href="#Select-2278"><span class="linenos">2278</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="Select-2279"><a href="#Select-2279"><span class="linenos">2279</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select-2280"><a href="#Select-2280"><span class="linenos">2280</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="Select-2281"><a href="#Select-2281"><span class="linenos">2281</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select-2282"><a href="#Select-2282"><span class="linenos">2282</span></a> +</span><span id="Select-2283"><a href="#Select-2283"><span class="linenos">2283</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="Select-2284"><a href="#Select-2284"><span class="linenos">2284</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Select-2285"><a href="#Select-2285"><span class="linenos">2285</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> +</span><span id="Select-2286"><a href="#Select-2286"><span class="linenos">2286</span></a> +</span><span id="Select-2287"><a href="#Select-2287"><span class="linenos">2287</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="Select-2288"><a href="#Select-2288"><span class="linenos">2288</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2289"><a href="#Select-2289"><span class="linenos">2289</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="Select-2290"><a href="#Select-2290"><span class="linenos">2290</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> +</span><span id="Select-2291"><a href="#Select-2291"><span class="linenos">2291</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Select-2292"><a href="#Select-2292"><span class="linenos">2292</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2293"><a href="#Select-2293"><span class="linenos">2293</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2294"><a href="#Select-2294"><span class="linenos">2294</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2295"><a href="#Select-2295"><span class="linenos">2295</span></a> <span class="p">)</span> +</span><span id="Select-2296"><a href="#Select-2296"><span class="linenos">2296</span></a> +</span><span id="Select-2297"><a href="#Select-2297"><span class="linenos">2297</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="Select-2298"><a href="#Select-2298"><span class="linenos">2298</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> +</span><span id="Select-2299"><a href="#Select-2299"><span class="linenos">2299</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2300"><a href="#Select-2300"><span class="linenos">2300</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="Select-2301"><a href="#Select-2301"><span class="linenos">2301</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2302"><a href="#Select-2302"><span class="linenos">2302</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> +</span><span id="Select-2303"><a href="#Select-2303"><span class="linenos">2303</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2304"><a href="#Select-2304"><span class="linenos">2304</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2305"><a href="#Select-2305"><span class="linenos">2305</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2306"><a href="#Select-2306"><span class="linenos">2306</span></a> <span class="p">)</span> +</span><span id="Select-2307"><a href="#Select-2307"><span class="linenos">2307</span></a> +</span><span id="Select-2308"><a href="#Select-2308"><span class="linenos">2308</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2309"><a href="#Select-2309"><span class="linenos">2309</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2310"><a href="#Select-2310"><span class="linenos">2310</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Select-2311"><a href="#Select-2311"><span class="linenos">2311</span></a> +</span><span id="Select-2312"><a href="#Select-2312"><span class="linenos">2312</span></a><span class="sd"> Example:</span> +</span><span id="Select-2313"><a href="#Select-2313"><span class="linenos">2313</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Select-2314"><a href="#Select-2314"><span class="linenos">2314</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Select-2315"><a href="#Select-2315"><span class="linenos">2315</span></a> +</span><span id="Select-2316"><a href="#Select-2316"><span class="linenos">2316</span></a><span class="sd"> Args:</span> +</span><span id="Select-2317"><a href="#Select-2317"><span class="linenos">2317</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-2318"><a href="#Select-2318"><span class="linenos">2318</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2319"><a href="#Select-2319"><span class="linenos">2319</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select-2320"><a href="#Select-2320"><span class="linenos">2320</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select-2321"><a href="#Select-2321"><span class="linenos">2321</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select-2322"><a href="#Select-2322"><span class="linenos">2322</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select-2323"><a href="#Select-2323"><span class="linenos">2323</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2324"><a href="#Select-2324"><span class="linenos">2324</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2325"><a href="#Select-2325"><span class="linenos">2325</span></a> +</span><span id="Select-2326"><a href="#Select-2326"><span class="linenos">2326</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2327"><a href="#Select-2327"><span class="linenos">2327</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2328"><a href="#Select-2328"><span class="linenos">2328</span></a><span class="sd"> """</span> +</span><span id="Select-2329"><a href="#Select-2329"><span class="linenos">2329</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select-2330"><a href="#Select-2330"><span class="linenos">2330</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2331"><a href="#Select-2331"><span class="linenos">2331</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2332"><a href="#Select-2332"><span class="linenos">2332</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="Select-2333"><a href="#Select-2333"><span class="linenos">2333</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2334"><a href="#Select-2334"><span class="linenos">2334</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="Select-2335"><a href="#Select-2335"><span class="linenos">2335</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2336"><a href="#Select-2336"><span class="linenos">2336</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2337"><a href="#Select-2337"><span class="linenos">2337</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2338"><a href="#Select-2338"><span class="linenos">2338</span></a> <span class="p">)</span> </span><span id="Select-2339"><a href="#Select-2339"><span class="linenos">2339</span></a> -</span><span id="Select-2340"><a href="#Select-2340"><span class="linenos">2340</span></a><span class="sd"> Example:</span> -</span><span id="Select-2341"><a href="#Select-2341"><span class="linenos">2341</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="Select-2342"><a href="#Select-2342"><span class="linenos">2342</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="Select-2340"><a href="#Select-2340"><span class="linenos">2340</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2341"><a href="#Select-2341"><span class="linenos">2341</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2342"><a href="#Select-2342"><span class="linenos">2342</span></a><span class="sd"> Append to or set the HAVING expressions.</span> </span><span id="Select-2343"><a href="#Select-2343"><span class="linenos">2343</span></a> -</span><span id="Select-2344"><a href="#Select-2344"><span class="linenos">2344</span></a><span class="sd"> Args:</span> -</span><span id="Select-2345"><a href="#Select-2345"><span class="linenos">2345</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> -</span><span id="Select-2346"><a href="#Select-2346"><span class="linenos">2346</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2344"><a href="#Select-2344"><span class="linenos">2344</span></a><span class="sd"> Example:</span> +</span><span id="Select-2345"><a href="#Select-2345"><span class="linenos">2345</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> +</span><span id="Select-2346"><a href="#Select-2346"><span class="linenos">2346</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> </span><span id="Select-2347"><a href="#Select-2347"><span class="linenos">2347</span></a> -</span><span id="Select-2348"><a href="#Select-2348"><span class="linenos">2348</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2349"><a href="#Select-2349"><span class="linenos">2349</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select-2350"><a href="#Select-2350"><span class="linenos">2350</span></a><span class="sd"> """</span> -</span><span id="Select-2351"><a href="#Select-2351"><span class="linenos">2351</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select-2352"><a href="#Select-2352"><span class="linenos">2352</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Select-2353"><a href="#Select-2353"><span class="linenos">2353</span></a> <span class="k">return</span> <span class="n">instance</span> -</span><span id="Select-2354"><a href="#Select-2354"><span class="linenos">2354</span></a> -</span><span id="Select-2355"><a href="#Select-2355"><span class="linenos">2355</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="Select-2356"><a href="#Select-2356"><span class="linenos">2356</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2357"><a href="#Select-2357"><span class="linenos">2357</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> -</span><span id="Select-2358"><a href="#Select-2358"><span class="linenos">2358</span></a> -</span><span id="Select-2359"><a href="#Select-2359"><span class="linenos">2359</span></a><span class="sd"> Example:</span> -</span><span id="Select-2360"><a href="#Select-2360"><span class="linenos">2360</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="Select-2361"><a href="#Select-2361"><span class="linenos">2361</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> -</span><span id="Select-2362"><a href="#Select-2362"><span class="linenos">2362</span></a> -</span><span id="Select-2363"><a href="#Select-2363"><span class="linenos">2363</span></a><span class="sd"> Args:</span> -</span><span id="Select-2364"><a href="#Select-2364"><span class="linenos">2364</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="Select-2365"><a href="#Select-2365"><span class="linenos">2365</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select-2366"><a href="#Select-2366"><span class="linenos">2366</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> -</span><span id="Select-2367"><a href="#Select-2367"><span class="linenos">2367</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> -</span><span id="Select-2368"><a href="#Select-2368"><span class="linenos">2368</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select-2369"><a href="#Select-2369"><span class="linenos">2369</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> -</span><span id="Select-2370"><a href="#Select-2370"><span class="linenos">2370</span></a> -</span><span id="Select-2371"><a href="#Select-2371"><span class="linenos">2371</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2372"><a href="#Select-2372"><span class="linenos">2372</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> -</span><span id="Select-2373"><a href="#Select-2373"><span class="linenos">2373</span></a><span class="sd"> """</span> -</span><span id="Select-2374"><a href="#Select-2374"><span class="linenos">2374</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select-2375"><a href="#Select-2375"><span class="linenos">2375</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Select-2376"><a href="#Select-2376"><span class="linenos">2376</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="Select-2377"><a href="#Select-2377"><span class="linenos">2377</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="Select-2378"><a href="#Select-2378"><span class="linenos">2378</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select-2379"><a href="#Select-2379"><span class="linenos">2379</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select-2380"><a href="#Select-2380"><span class="linenos">2380</span></a> <span class="p">)</span> -</span><span id="Select-2381"><a href="#Select-2381"><span class="linenos">2381</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Select-2382"><a href="#Select-2382"><span class="linenos">2382</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="Select-2383"><a href="#Select-2383"><span class="linenos">2383</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> -</span><span id="Select-2384"><a href="#Select-2384"><span class="linenos">2384</span></a> -</span><span id="Select-2385"><a href="#Select-2385"><span class="linenos">2385</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="Select-2386"><a href="#Select-2386"><span class="linenos">2386</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> -</span><span id="Select-2387"><a href="#Select-2387"><span class="linenos">2387</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> -</span><span id="Select-2388"><a href="#Select-2388"><span class="linenos">2388</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="Select-2389"><a href="#Select-2389"><span class="linenos">2389</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> -</span><span id="Select-2390"><a href="#Select-2390"><span class="linenos">2390</span></a> <span class="p">)</span> +</span><span id="Select-2348"><a href="#Select-2348"><span class="linenos">2348</span></a><span class="sd"> Args:</span> +</span><span id="Select-2349"><a href="#Select-2349"><span class="linenos">2349</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select-2350"><a href="#Select-2350"><span class="linenos">2350</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2351"><a href="#Select-2351"><span class="linenos">2351</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select-2352"><a href="#Select-2352"><span class="linenos">2352</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select-2353"><a href="#Select-2353"><span class="linenos">2353</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select-2354"><a href="#Select-2354"><span class="linenos">2354</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select-2355"><a href="#Select-2355"><span class="linenos">2355</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2356"><a href="#Select-2356"><span class="linenos">2356</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select-2357"><a href="#Select-2357"><span class="linenos">2357</span></a> +</span><span id="Select-2358"><a href="#Select-2358"><span class="linenos">2358</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2359"><a href="#Select-2359"><span class="linenos">2359</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2360"><a href="#Select-2360"><span class="linenos">2360</span></a><span class="sd"> """</span> +</span><span id="Select-2361"><a href="#Select-2361"><span class="linenos">2361</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select-2362"><a href="#Select-2362"><span class="linenos">2362</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2363"><a href="#Select-2363"><span class="linenos">2363</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2364"><a href="#Select-2364"><span class="linenos">2364</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> +</span><span id="Select-2365"><a href="#Select-2365"><span class="linenos">2365</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2366"><a href="#Select-2366"><span class="linenos">2366</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> +</span><span id="Select-2367"><a href="#Select-2367"><span class="linenos">2367</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2368"><a href="#Select-2368"><span class="linenos">2368</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2369"><a href="#Select-2369"><span class="linenos">2369</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2370"><a href="#Select-2370"><span class="linenos">2370</span></a> <span class="p">)</span> +</span><span id="Select-2371"><a href="#Select-2371"><span class="linenos">2371</span></a> +</span><span id="Select-2372"><a href="#Select-2372"><span class="linenos">2372</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2373"><a href="#Select-2373"><span class="linenos">2373</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select-2374"><a href="#Select-2374"><span class="linenos">2374</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select-2375"><a href="#Select-2375"><span class="linenos">2375</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select-2376"><a href="#Select-2376"><span class="linenos">2376</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> +</span><span id="Select-2377"><a href="#Select-2377"><span class="linenos">2377</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select-2378"><a href="#Select-2378"><span class="linenos">2378</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> +</span><span id="Select-2379"><a href="#Select-2379"><span class="linenos">2379</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2380"><a href="#Select-2380"><span class="linenos">2380</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select-2381"><a href="#Select-2381"><span class="linenos">2381</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2382"><a href="#Select-2382"><span class="linenos">2382</span></a> <span class="p">)</span> +</span><span id="Select-2383"><a href="#Select-2383"><span class="linenos">2383</span></a> +</span><span id="Select-2384"><a href="#Select-2384"><span class="linenos">2384</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2385"><a href="#Select-2385"><span class="linenos">2385</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2386"><a href="#Select-2386"><span class="linenos">2386</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select-2387"><a href="#Select-2387"><span class="linenos">2387</span></a> +</span><span id="Select-2388"><a href="#Select-2388"><span class="linenos">2388</span></a><span class="sd"> Example:</span> +</span><span id="Select-2389"><a href="#Select-2389"><span class="linenos">2389</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="Select-2390"><a href="#Select-2390"><span class="linenos">2390</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> </span><span id="Select-2391"><a href="#Select-2391"><span class="linenos">2391</span></a> -</span><span id="Select-2392"><a href="#Select-2392"><span class="linenos">2392</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select-2393"><a href="#Select-2393"><span class="linenos">2393</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select-2394"><a href="#Select-2394"><span class="linenos">2394</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="Select-2392"><a href="#Select-2392"><span class="linenos">2392</span></a><span class="sd"> Args:</span> +</span><span id="Select-2393"><a href="#Select-2393"><span class="linenos">2393</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> +</span><span id="Select-2394"><a href="#Select-2394"><span class="linenos">2394</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> </span><span id="Select-2395"><a href="#Select-2395"><span class="linenos">2395</span></a> -</span><span id="Select-2396"><a href="#Select-2396"><span class="linenos">2396</span></a><span class="sd"> Examples:</span> -</span><span id="Select-2397"><a href="#Select-2397"><span class="linenos">2397</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="Select-2398"><a href="#Select-2398"><span class="linenos">2398</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="Select-2399"><a href="#Select-2399"><span class="linenos">2399</span></a> -</span><span id="Select-2400"><a href="#Select-2400"><span class="linenos">2400</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="Select-2401"><a href="#Select-2401"><span class="linenos">2401</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="Select-2396"><a href="#Select-2396"><span class="linenos">2396</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2397"><a href="#Select-2397"><span class="linenos">2397</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select-2398"><a href="#Select-2398"><span class="linenos">2398</span></a><span class="sd"> """</span> +</span><span id="Select-2399"><a href="#Select-2399"><span class="linenos">2399</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select-2400"><a href="#Select-2400"><span class="linenos">2400</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Select-2401"><a href="#Select-2401"><span class="linenos">2401</span></a> <span class="k">return</span> <span class="n">instance</span> </span><span id="Select-2402"><a href="#Select-2402"><span class="linenos">2402</span></a> -</span><span id="Select-2403"><a href="#Select-2403"><span class="linenos">2403</span></a><span class="sd"> Args:</span> -</span><span id="Select-2404"><a href="#Select-2404"><span class="linenos">2404</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> -</span><span id="Select-2405"><a href="#Select-2405"><span class="linenos">2405</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2403"><a href="#Select-2403"><span class="linenos">2403</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="Select-2404"><a href="#Select-2404"><span class="linenos">2404</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2405"><a href="#Select-2405"><span class="linenos">2405</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> </span><span id="Select-2406"><a href="#Select-2406"><span class="linenos">2406</span></a> -</span><span id="Select-2407"><a href="#Select-2407"><span class="linenos">2407</span></a><span class="sd"> Returns:</span> -</span><span id="Select-2408"><a href="#Select-2408"><span class="linenos">2408</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select-2409"><a href="#Select-2409"><span class="linenos">2409</span></a><span class="sd"> """</span> +</span><span id="Select-2407"><a href="#Select-2407"><span class="linenos">2407</span></a><span class="sd"> Example:</span> +</span><span id="Select-2408"><a href="#Select-2408"><span class="linenos">2408</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="Select-2409"><a href="#Select-2409"><span class="linenos">2409</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> </span><span id="Select-2410"><a href="#Select-2410"><span class="linenos">2410</span></a> -</span><span id="Select-2411"><a href="#Select-2411"><span class="linenos">2411</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select-2412"><a href="#Select-2412"><span class="linenos">2412</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> -</span><span id="Select-2413"><a href="#Select-2413"><span class="linenos">2413</span></a> -</span><span id="Select-2414"><a href="#Select-2414"><span class="linenos">2414</span></a> <span class="k">return</span> <span class="n">inst</span> -</span><span id="Select-2415"><a href="#Select-2415"><span class="linenos">2415</span></a> -</span><span id="Select-2416"><a href="#Select-2416"><span class="linenos">2416</span></a> <span class="nd">@property</span> -</span><span id="Select-2417"><a href="#Select-2417"><span class="linenos">2417</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> -</span><span id="Select-2418"><a href="#Select-2418"><span class="linenos">2418</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">alias_or_name</span><span class="p">]</span> -</span><span id="Select-2419"><a href="#Select-2419"><span class="linenos">2419</span></a> -</span><span id="Select-2420"><a href="#Select-2420"><span class="linenos">2420</span></a> <span class="nd">@property</span> -</span><span id="Select-2421"><a href="#Select-2421"><span class="linenos">2421</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">Expression</span><span class="p">]:</span> -</span><span id="Select-2422"><a href="#Select-2422"><span class="linenos">2422</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> +</span><span id="Select-2411"><a href="#Select-2411"><span class="linenos">2411</span></a><span class="sd"> Args:</span> +</span><span id="Select-2412"><a href="#Select-2412"><span class="linenos">2412</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="Select-2413"><a href="#Select-2413"><span class="linenos">2413</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select-2414"><a href="#Select-2414"><span class="linenos">2414</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> +</span><span id="Select-2415"><a href="#Select-2415"><span class="linenos">2415</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> +</span><span id="Select-2416"><a href="#Select-2416"><span class="linenos">2416</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2417"><a href="#Select-2417"><span class="linenos">2417</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> +</span><span id="Select-2418"><a href="#Select-2418"><span class="linenos">2418</span></a> +</span><span id="Select-2419"><a href="#Select-2419"><span class="linenos">2419</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2420"><a href="#Select-2420"><span class="linenos">2420</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> +</span><span id="Select-2421"><a href="#Select-2421"><span class="linenos">2421</span></a><span class="sd"> """</span> +</span><span id="Select-2422"><a href="#Select-2422"><span class="linenos">2422</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select-2423"><a href="#Select-2423"><span class="linenos">2423</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Select-2424"><a href="#Select-2424"><span class="linenos">2424</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="Select-2425"><a href="#Select-2425"><span class="linenos">2425</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="Select-2426"><a href="#Select-2426"><span class="linenos">2426</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select-2427"><a href="#Select-2427"><span class="linenos">2427</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select-2428"><a href="#Select-2428"><span class="linenos">2428</span></a> <span class="p">)</span> +</span><span id="Select-2429"><a href="#Select-2429"><span class="linenos">2429</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Select-2430"><a href="#Select-2430"><span class="linenos">2430</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="Select-2431"><a href="#Select-2431"><span class="linenos">2431</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> +</span><span id="Select-2432"><a href="#Select-2432"><span class="linenos">2432</span></a> +</span><span id="Select-2433"><a href="#Select-2433"><span class="linenos">2433</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="Select-2434"><a href="#Select-2434"><span class="linenos">2434</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> +</span><span id="Select-2435"><a href="#Select-2435"><span class="linenos">2435</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> +</span><span id="Select-2436"><a href="#Select-2436"><span class="linenos">2436</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="Select-2437"><a href="#Select-2437"><span class="linenos">2437</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> +</span><span id="Select-2438"><a href="#Select-2438"><span class="linenos">2438</span></a> <span class="p">)</span> +</span><span id="Select-2439"><a href="#Select-2439"><span class="linenos">2439</span></a> +</span><span id="Select-2440"><a href="#Select-2440"><span class="linenos">2440</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select-2441"><a href="#Select-2441"><span class="linenos">2441</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select-2442"><a href="#Select-2442"><span class="linenos">2442</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="Select-2443"><a href="#Select-2443"><span class="linenos">2443</span></a> +</span><span id="Select-2444"><a href="#Select-2444"><span class="linenos">2444</span></a><span class="sd"> Examples:</span> +</span><span id="Select-2445"><a href="#Select-2445"><span class="linenos">2445</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="Select-2446"><a href="#Select-2446"><span class="linenos">2446</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> +</span><span id="Select-2447"><a href="#Select-2447"><span class="linenos">2447</span></a> +</span><span id="Select-2448"><a href="#Select-2448"><span class="linenos">2448</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="Select-2449"><a href="#Select-2449"><span class="linenos">2449</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="Select-2450"><a href="#Select-2450"><span class="linenos">2450</span></a> +</span><span id="Select-2451"><a href="#Select-2451"><span class="linenos">2451</span></a><span class="sd"> Args:</span> +</span><span id="Select-2452"><a href="#Select-2452"><span class="linenos">2452</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> +</span><span id="Select-2453"><a href="#Select-2453"><span class="linenos">2453</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select-2454"><a href="#Select-2454"><span class="linenos">2454</span></a> +</span><span id="Select-2455"><a href="#Select-2455"><span class="linenos">2455</span></a><span class="sd"> Returns:</span> +</span><span id="Select-2456"><a href="#Select-2456"><span class="linenos">2456</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select-2457"><a href="#Select-2457"><span class="linenos">2457</span></a><span class="sd"> """</span> +</span><span id="Select-2458"><a href="#Select-2458"><span class="linenos">2458</span></a> +</span><span id="Select-2459"><a href="#Select-2459"><span class="linenos">2459</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select-2460"><a href="#Select-2460"><span class="linenos">2460</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> +</span><span id="Select-2461"><a href="#Select-2461"><span class="linenos">2461</span></a> +</span><span id="Select-2462"><a href="#Select-2462"><span class="linenos">2462</span></a> <span class="k">return</span> <span class="n">inst</span> +</span><span id="Select-2463"><a href="#Select-2463"><span class="linenos">2463</span></a> +</span><span id="Select-2464"><a href="#Select-2464"><span class="linenos">2464</span></a> <span class="nd">@property</span> +</span><span id="Select-2465"><a href="#Select-2465"><span class="linenos">2465</span></a> <span class="k">def</span> <span class="nf">named_selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]:</span> +</span><span id="Select-2466"><a href="#Select-2466"><span class="linenos">2466</span></a> <span class="k">return</span> <span class="p">[</span><span class="n">e</span><span class="o">.</span><span class="n">output_name</span> <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> <span class="k">if</span> <span class="n">e</span><span class="o">.</span><span class="n">alias_or_name</span><span class="p">]</span> +</span><span id="Select-2467"><a href="#Select-2467"><span class="linenos">2467</span></a> +</span><span id="Select-2468"><a href="#Select-2468"><span class="linenos">2468</span></a> <span class="nd">@property</span> +</span><span id="Select-2469"><a href="#Select-2469"><span class="linenos">2469</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Select-2470"><a href="#Select-2470"><span class="linenos">2470</span></a> <span class="k">return</span> <span class="nb">any</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">is_star</span> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span><span class="p">)</span> +</span><span id="Select-2471"><a href="#Select-2471"><span class="linenos">2471</span></a> +</span><span id="Select-2472"><a href="#Select-2472"><span class="linenos">2472</span></a> <span class="nd">@property</span> +</span><span id="Select-2473"><a href="#Select-2473"><span class="linenos">2473</span></a> <span class="k">def</span> <span class="nf">selects</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">List</span><span class="p">[</span><span class="n">Expression</span><span class="p">]:</span> +</span><span id="Select-2474"><a href="#Select-2474"><span class="linenos">2474</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> </span></pre></div> @@ -19844,38 +20632,38 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select.from_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.from_-1866"><a href="#Select.from_-1866"><span class="linenos">1866</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.from_-1867"><a href="#Select.from_-1867"><span class="linenos">1867</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.from_-1868"><a href="#Select.from_-1868"><span class="linenos">1868</span></a><span class="sd"> Set the FROM expression.</span> -</span><span id="Select.from_-1869"><a href="#Select.from_-1869"><span class="linenos">1869</span></a> -</span><span id="Select.from_-1870"><a href="#Select.from_-1870"><span class="linenos">1870</span></a><span class="sd"> Example:</span> -</span><span id="Select.from_-1871"><a href="#Select.from_-1871"><span class="linenos">1871</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> -</span><span id="Select.from_-1872"><a href="#Select.from_-1872"><span class="linenos">1872</span></a><span class="sd"> 'SELECT x FROM tbl'</span> -</span><span id="Select.from_-1873"><a href="#Select.from_-1873"><span class="linenos">1873</span></a> -</span><span id="Select.from_-1874"><a href="#Select.from_-1874"><span class="linenos">1874</span></a><span class="sd"> Args:</span> -</span><span id="Select.from_-1875"><a href="#Select.from_-1875"><span class="linenos">1875</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.from_-1876"><a href="#Select.from_-1876"><span class="linenos">1876</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> -</span><span id="Select.from_-1877"><a href="#Select.from_-1877"><span class="linenos">1877</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> -</span><span id="Select.from_-1878"><a href="#Select.from_-1878"><span class="linenos">1878</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.from_-1879"><a href="#Select.from_-1879"><span class="linenos">1879</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> -</span><span id="Select.from_-1880"><a href="#Select.from_-1880"><span class="linenos">1880</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.from_-1881"><a href="#Select.from_-1881"><span class="linenos">1881</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.from_-1882"><a href="#Select.from_-1882"><span class="linenos">1882</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.from_-1883"><a href="#Select.from_-1883"><span class="linenos">1883</span></a> -</span><span id="Select.from_-1884"><a href="#Select.from_-1884"><span class="linenos">1884</span></a><span class="sd"> Returns:</span> -</span><span id="Select.from_-1885"><a href="#Select.from_-1885"><span class="linenos">1885</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.from_-1886"><a href="#Select.from_-1886"><span class="linenos">1886</span></a><span class="sd"> """</span> -</span><span id="Select.from_-1887"><a href="#Select.from_-1887"><span class="linenos">1887</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select.from_-1888"><a href="#Select.from_-1888"><span class="linenos">1888</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.from_-1889"><a href="#Select.from_-1889"><span class="linenos">1889</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.from_-1890"><a href="#Select.from_-1890"><span class="linenos">1890</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> -</span><span id="Select.from_-1891"><a href="#Select.from_-1891"><span class="linenos">1891</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.from_-1892"><a href="#Select.from_-1892"><span class="linenos">1892</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.from_-1893"><a href="#Select.from_-1893"><span class="linenos">1893</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> -</span><span id="Select.from_-1894"><a href="#Select.from_-1894"><span class="linenos">1894</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> -</span><span id="Select.from_-1895"><a href="#Select.from_-1895"><span class="linenos">1895</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.from_-1896"><a href="#Select.from_-1896"><span class="linenos">1896</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.from_-1897"><a href="#Select.from_-1897"><span class="linenos">1897</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.from_-1914"><a href="#Select.from_-1914"><span class="linenos">1914</span></a> <span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.from_-1915"><a href="#Select.from_-1915"><span class="linenos">1915</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.from_-1916"><a href="#Select.from_-1916"><span class="linenos">1916</span></a><span class="sd"> Set the FROM expression.</span> +</span><span id="Select.from_-1917"><a href="#Select.from_-1917"><span class="linenos">1917</span></a> +</span><span id="Select.from_-1918"><a href="#Select.from_-1918"><span class="linenos">1918</span></a><span class="sd"> Example:</span> +</span><span id="Select.from_-1919"><a href="#Select.from_-1919"><span class="linenos">1919</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sql()</span> +</span><span id="Select.from_-1920"><a href="#Select.from_-1920"><span class="linenos">1920</span></a><span class="sd"> 'SELECT x FROM tbl'</span> +</span><span id="Select.from_-1921"><a href="#Select.from_-1921"><span class="linenos">1921</span></a> +</span><span id="Select.from_-1922"><a href="#Select.from_-1922"><span class="linenos">1922</span></a><span class="sd"> Args:</span> +</span><span id="Select.from_-1923"><a href="#Select.from_-1923"><span class="linenos">1923</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.from_-1924"><a href="#Select.from_-1924"><span class="linenos">1924</span></a><span class="sd"> If a `From` instance is passed, this is used as-is.</span> +</span><span id="Select.from_-1925"><a href="#Select.from_-1925"><span class="linenos">1925</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `From`.</span> +</span><span id="Select.from_-1926"><a href="#Select.from_-1926"><span class="linenos">1926</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.from_-1927"><a href="#Select.from_-1927"><span class="linenos">1927</span></a><span class="sd"> Otherwise, this flattens all the `From` expression into a single expression.</span> +</span><span id="Select.from_-1928"><a href="#Select.from_-1928"><span class="linenos">1928</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.from_-1929"><a href="#Select.from_-1929"><span class="linenos">1929</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.from_-1930"><a href="#Select.from_-1930"><span class="linenos">1930</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.from_-1931"><a href="#Select.from_-1931"><span class="linenos">1931</span></a> +</span><span id="Select.from_-1932"><a href="#Select.from_-1932"><span class="linenos">1932</span></a><span class="sd"> Returns:</span> +</span><span id="Select.from_-1933"><a href="#Select.from_-1933"><span class="linenos">1933</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.from_-1934"><a href="#Select.from_-1934"><span class="linenos">1934</span></a><span class="sd"> """</span> +</span><span id="Select.from_-1935"><a href="#Select.from_-1935"><span class="linenos">1935</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select.from_-1936"><a href="#Select.from_-1936"><span class="linenos">1936</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.from_-1937"><a href="#Select.from_-1937"><span class="linenos">1937</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.from_-1938"><a href="#Select.from_-1938"><span class="linenos">1938</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"from"</span><span class="p">,</span> +</span><span id="Select.from_-1939"><a href="#Select.from_-1939"><span class="linenos">1939</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.from_-1940"><a href="#Select.from_-1940"><span class="linenos">1940</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.from_-1941"><a href="#Select.from_-1941"><span class="linenos">1941</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> +</span><span id="Select.from_-1942"><a href="#Select.from_-1942"><span class="linenos">1942</span></a> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> +</span><span id="Select.from_-1943"><a href="#Select.from_-1943"><span class="linenos">1943</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.from_-1944"><a href="#Select.from_-1944"><span class="linenos">1944</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.from_-1945"><a href="#Select.from_-1945"><span class="linenos">1945</span></a> <span class="p">)</span> </span></pre></div> @@ -19924,41 +20712,41 @@ Otherwise, this flattens all the <code><a href="#From">From</a></code> expressio </div> <a class="headerlink" href="#Select.group_by"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.group_by-1899"><a href="#Select.group_by-1899"><span class="linenos">1899</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.group_by-1900"><a href="#Select.group_by-1900"><span class="linenos">1900</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.group_by-1901"><a href="#Select.group_by-1901"><span class="linenos">1901</span></a><span class="sd"> Set the GROUP BY expression.</span> -</span><span id="Select.group_by-1902"><a href="#Select.group_by-1902"><span class="linenos">1902</span></a> -</span><span id="Select.group_by-1903"><a href="#Select.group_by-1903"><span class="linenos">1903</span></a><span class="sd"> Example:</span> -</span><span id="Select.group_by-1904"><a href="#Select.group_by-1904"><span class="linenos">1904</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> -</span><span id="Select.group_by-1905"><a href="#Select.group_by-1905"><span class="linenos">1905</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> -</span><span id="Select.group_by-1906"><a href="#Select.group_by-1906"><span class="linenos">1906</span></a> -</span><span id="Select.group_by-1907"><a href="#Select.group_by-1907"><span class="linenos">1907</span></a><span class="sd"> Args:</span> -</span><span id="Select.group_by-1908"><a href="#Select.group_by-1908"><span class="linenos">1908</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.group_by-1909"><a href="#Select.group_by-1909"><span class="linenos">1909</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.group_by-1910"><a href="#Select.group_by-1910"><span class="linenos">1910</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> -</span><span id="Select.group_by-1911"><a href="#Select.group_by-1911"><span class="linenos">1911</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> -</span><span id="Select.group_by-1912"><a href="#Select.group_by-1912"><span class="linenos">1912</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.group_by-1913"><a href="#Select.group_by-1913"><span class="linenos">1913</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> -</span><span id="Select.group_by-1914"><a href="#Select.group_by-1914"><span class="linenos">1914</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.group_by-1915"><a href="#Select.group_by-1915"><span class="linenos">1915</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.group_by-1916"><a href="#Select.group_by-1916"><span class="linenos">1916</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.group_by-1917"><a href="#Select.group_by-1917"><span class="linenos">1917</span></a> -</span><span id="Select.group_by-1918"><a href="#Select.group_by-1918"><span class="linenos">1918</span></a><span class="sd"> Returns:</span> -</span><span id="Select.group_by-1919"><a href="#Select.group_by-1919"><span class="linenos">1919</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.group_by-1920"><a href="#Select.group_by-1920"><span class="linenos">1920</span></a><span class="sd"> """</span> -</span><span id="Select.group_by-1921"><a href="#Select.group_by-1921"><span class="linenos">1921</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> -</span><span id="Select.group_by-1922"><a href="#Select.group_by-1922"><span class="linenos">1922</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="Select.group_by-1923"><a href="#Select.group_by-1923"><span class="linenos">1923</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select.group_by-1924"><a href="#Select.group_by-1924"><span class="linenos">1924</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.group_by-1925"><a href="#Select.group_by-1925"><span class="linenos">1925</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.group_by-1926"><a href="#Select.group_by-1926"><span class="linenos">1926</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> -</span><span id="Select.group_by-1927"><a href="#Select.group_by-1927"><span class="linenos">1927</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.group_by-1928"><a href="#Select.group_by-1928"><span class="linenos">1928</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.group_by-1929"><a href="#Select.group_by-1929"><span class="linenos">1929</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> -</span><span id="Select.group_by-1930"><a href="#Select.group_by-1930"><span class="linenos">1930</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> -</span><span id="Select.group_by-1931"><a href="#Select.group_by-1931"><span class="linenos">1931</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.group_by-1932"><a href="#Select.group_by-1932"><span class="linenos">1932</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.group_by-1933"><a href="#Select.group_by-1933"><span class="linenos">1933</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.group_by-1947"><a href="#Select.group_by-1947"><span class="linenos">1947</span></a> <span class="k">def</span> <span class="nf">group_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.group_by-1948"><a href="#Select.group_by-1948"><span class="linenos">1948</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.group_by-1949"><a href="#Select.group_by-1949"><span class="linenos">1949</span></a><span class="sd"> Set the GROUP BY expression.</span> +</span><span id="Select.group_by-1950"><a href="#Select.group_by-1950"><span class="linenos">1950</span></a> +</span><span id="Select.group_by-1951"><a href="#Select.group_by-1951"><span class="linenos">1951</span></a><span class="sd"> Example:</span> +</span><span id="Select.group_by-1952"><a href="#Select.group_by-1952"><span class="linenos">1952</span></a><span class="sd"> >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()</span> +</span><span id="Select.group_by-1953"><a href="#Select.group_by-1953"><span class="linenos">1953</span></a><span class="sd"> 'SELECT x, COUNT(1) FROM tbl GROUP BY x'</span> +</span><span id="Select.group_by-1954"><a href="#Select.group_by-1954"><span class="linenos">1954</span></a> +</span><span id="Select.group_by-1955"><a href="#Select.group_by-1955"><span class="linenos">1955</span></a><span class="sd"> Args:</span> +</span><span id="Select.group_by-1956"><a href="#Select.group_by-1956"><span class="linenos">1956</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.group_by-1957"><a href="#Select.group_by-1957"><span class="linenos">1957</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.group_by-1958"><a href="#Select.group_by-1958"><span class="linenos">1958</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Group`.</span> +</span><span id="Select.group_by-1959"><a href="#Select.group_by-1959"><span class="linenos">1959</span></a><span class="sd"> If nothing is passed in then a group by is not applied to the expression</span> +</span><span id="Select.group_by-1960"><a href="#Select.group_by-1960"><span class="linenos">1960</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.group_by-1961"><a href="#Select.group_by-1961"><span class="linenos">1961</span></a><span class="sd"> Otherwise, this flattens all the `Group` expression into a single expression.</span> +</span><span id="Select.group_by-1962"><a href="#Select.group_by-1962"><span class="linenos">1962</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.group_by-1963"><a href="#Select.group_by-1963"><span class="linenos">1963</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.group_by-1964"><a href="#Select.group_by-1964"><span class="linenos">1964</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.group_by-1965"><a href="#Select.group_by-1965"><span class="linenos">1965</span></a> +</span><span id="Select.group_by-1966"><a href="#Select.group_by-1966"><span class="linenos">1966</span></a><span class="sd"> Returns:</span> +</span><span id="Select.group_by-1967"><a href="#Select.group_by-1967"><span class="linenos">1967</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.group_by-1968"><a href="#Select.group_by-1968"><span class="linenos">1968</span></a><span class="sd"> """</span> +</span><span id="Select.group_by-1969"><a href="#Select.group_by-1969"><span class="linenos">1969</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">expressions</span><span class="p">:</span> +</span><span id="Select.group_by-1970"><a href="#Select.group_by-1970"><span class="linenos">1970</span></a> <span class="k">return</span> <span class="bp">self</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">copy</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="Select.group_by-1971"><a href="#Select.group_by-1971"><span class="linenos">1971</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select.group_by-1972"><a href="#Select.group_by-1972"><span class="linenos">1972</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.group_by-1973"><a href="#Select.group_by-1973"><span class="linenos">1973</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.group_by-1974"><a href="#Select.group_by-1974"><span class="linenos">1974</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"group"</span><span class="p">,</span> +</span><span id="Select.group_by-1975"><a href="#Select.group_by-1975"><span class="linenos">1975</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.group_by-1976"><a href="#Select.group_by-1976"><span class="linenos">1976</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.group_by-1977"><a href="#Select.group_by-1977"><span class="linenos">1977</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"GROUP BY"</span><span class="p">,</span> +</span><span id="Select.group_by-1978"><a href="#Select.group_by-1978"><span class="linenos">1978</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Group</span><span class="p">,</span> +</span><span id="Select.group_by-1979"><a href="#Select.group_by-1979"><span class="linenos">1979</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.group_by-1980"><a href="#Select.group_by-1980"><span class="linenos">1980</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.group_by-1981"><a href="#Select.group_by-1981"><span class="linenos">1981</span></a> <span class="p">)</span> </span></pre></div> @@ -20008,38 +20796,38 @@ Otherwise, this flattens all the <code><a href="#Group">Group</a></code> express </div> <a class="headerlink" href="#Select.order_by"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.order_by-1935"><a href="#Select.order_by-1935"><span class="linenos">1935</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.order_by-1936"><a href="#Select.order_by-1936"><span class="linenos">1936</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.order_by-1937"><a href="#Select.order_by-1937"><span class="linenos">1937</span></a><span class="sd"> Set the ORDER BY expression.</span> -</span><span id="Select.order_by-1938"><a href="#Select.order_by-1938"><span class="linenos">1938</span></a> -</span><span id="Select.order_by-1939"><a href="#Select.order_by-1939"><span class="linenos">1939</span></a><span class="sd"> Example:</span> -</span><span id="Select.order_by-1940"><a href="#Select.order_by-1940"><span class="linenos">1940</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> -</span><span id="Select.order_by-1941"><a href="#Select.order_by-1941"><span class="linenos">1941</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> -</span><span id="Select.order_by-1942"><a href="#Select.order_by-1942"><span class="linenos">1942</span></a> -</span><span id="Select.order_by-1943"><a href="#Select.order_by-1943"><span class="linenos">1943</span></a><span class="sd"> Args:</span> -</span><span id="Select.order_by-1944"><a href="#Select.order_by-1944"><span class="linenos">1944</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.order_by-1945"><a href="#Select.order_by-1945"><span class="linenos">1945</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.order_by-1946"><a href="#Select.order_by-1946"><span class="linenos">1946</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> -</span><span id="Select.order_by-1947"><a href="#Select.order_by-1947"><span class="linenos">1947</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.order_by-1948"><a href="#Select.order_by-1948"><span class="linenos">1948</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.order_by-1949"><a href="#Select.order_by-1949"><span class="linenos">1949</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.order_by-1950"><a href="#Select.order_by-1950"><span class="linenos">1950</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.order_by-1951"><a href="#Select.order_by-1951"><span class="linenos">1951</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.order_by-1952"><a href="#Select.order_by-1952"><span class="linenos">1952</span></a> -</span><span id="Select.order_by-1953"><a href="#Select.order_by-1953"><span class="linenos">1953</span></a><span class="sd"> Returns:</span> -</span><span id="Select.order_by-1954"><a href="#Select.order_by-1954"><span class="linenos">1954</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.order_by-1955"><a href="#Select.order_by-1955"><span class="linenos">1955</span></a><span class="sd"> """</span> -</span><span id="Select.order_by-1956"><a href="#Select.order_by-1956"><span class="linenos">1956</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select.order_by-1957"><a href="#Select.order_by-1957"><span class="linenos">1957</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.order_by-1958"><a href="#Select.order_by-1958"><span class="linenos">1958</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.order_by-1959"><a href="#Select.order_by-1959"><span class="linenos">1959</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> -</span><span id="Select.order_by-1960"><a href="#Select.order_by-1960"><span class="linenos">1960</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.order_by-1961"><a href="#Select.order_by-1961"><span class="linenos">1961</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.order_by-1962"><a href="#Select.order_by-1962"><span class="linenos">1962</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> -</span><span id="Select.order_by-1963"><a href="#Select.order_by-1963"><span class="linenos">1963</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> -</span><span id="Select.order_by-1964"><a href="#Select.order_by-1964"><span class="linenos">1964</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.order_by-1965"><a href="#Select.order_by-1965"><span class="linenos">1965</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.order_by-1966"><a href="#Select.order_by-1966"><span class="linenos">1966</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.order_by-1983"><a href="#Select.order_by-1983"><span class="linenos">1983</span></a> <span class="k">def</span> <span class="nf">order_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.order_by-1984"><a href="#Select.order_by-1984"><span class="linenos">1984</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.order_by-1985"><a href="#Select.order_by-1985"><span class="linenos">1985</span></a><span class="sd"> Set the ORDER BY expression.</span> +</span><span id="Select.order_by-1986"><a href="#Select.order_by-1986"><span class="linenos">1986</span></a> +</span><span id="Select.order_by-1987"><a href="#Select.order_by-1987"><span class="linenos">1987</span></a><span class="sd"> Example:</span> +</span><span id="Select.order_by-1988"><a href="#Select.order_by-1988"><span class="linenos">1988</span></a><span class="sd"> >>> Select().from_("tbl").select("x").order_by("x DESC").sql()</span> +</span><span id="Select.order_by-1989"><a href="#Select.order_by-1989"><span class="linenos">1989</span></a><span class="sd"> 'SELECT x FROM tbl ORDER BY x DESC'</span> +</span><span id="Select.order_by-1990"><a href="#Select.order_by-1990"><span class="linenos">1990</span></a> +</span><span id="Select.order_by-1991"><a href="#Select.order_by-1991"><span class="linenos">1991</span></a><span class="sd"> Args:</span> +</span><span id="Select.order_by-1992"><a href="#Select.order_by-1992"><span class="linenos">1992</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.order_by-1993"><a href="#Select.order_by-1993"><span class="linenos">1993</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.order_by-1994"><a href="#Select.order_by-1994"><span class="linenos">1994</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Order`.</span> +</span><span id="Select.order_by-1995"><a href="#Select.order_by-1995"><span class="linenos">1995</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.order_by-1996"><a href="#Select.order_by-1996"><span class="linenos">1996</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.order_by-1997"><a href="#Select.order_by-1997"><span class="linenos">1997</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.order_by-1998"><a href="#Select.order_by-1998"><span class="linenos">1998</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.order_by-1999"><a href="#Select.order_by-1999"><span class="linenos">1999</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.order_by-2000"><a href="#Select.order_by-2000"><span class="linenos">2000</span></a> +</span><span id="Select.order_by-2001"><a href="#Select.order_by-2001"><span class="linenos">2001</span></a><span class="sd"> Returns:</span> +</span><span id="Select.order_by-2002"><a href="#Select.order_by-2002"><span class="linenos">2002</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.order_by-2003"><a href="#Select.order_by-2003"><span class="linenos">2003</span></a><span class="sd"> """</span> +</span><span id="Select.order_by-2004"><a href="#Select.order_by-2004"><span class="linenos">2004</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select.order_by-2005"><a href="#Select.order_by-2005"><span class="linenos">2005</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.order_by-2006"><a href="#Select.order_by-2006"><span class="linenos">2006</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.order_by-2007"><a href="#Select.order_by-2007"><span class="linenos">2007</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"order"</span><span class="p">,</span> +</span><span id="Select.order_by-2008"><a href="#Select.order_by-2008"><span class="linenos">2008</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.order_by-2009"><a href="#Select.order_by-2009"><span class="linenos">2009</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.order_by-2010"><a href="#Select.order_by-2010"><span class="linenos">2010</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"ORDER BY"</span><span class="p">,</span> +</span><span id="Select.order_by-2011"><a href="#Select.order_by-2011"><span class="linenos">2011</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Order</span><span class="p">,</span> +</span><span id="Select.order_by-2012"><a href="#Select.order_by-2012"><span class="linenos">2012</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.order_by-2013"><a href="#Select.order_by-2013"><span class="linenos">2013</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.order_by-2014"><a href="#Select.order_by-2014"><span class="linenos">2014</span></a> <span class="p">)</span> </span></pre></div> @@ -20088,38 +20876,38 @@ Otherwise, this flattens all the <code><a href="#Order">Order</a></code> express </div> <a class="headerlink" href="#Select.sort_by"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.sort_by-1968"><a href="#Select.sort_by-1968"><span class="linenos">1968</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.sort_by-1969"><a href="#Select.sort_by-1969"><span class="linenos">1969</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.sort_by-1970"><a href="#Select.sort_by-1970"><span class="linenos">1970</span></a><span class="sd"> Set the SORT BY expression.</span> -</span><span id="Select.sort_by-1971"><a href="#Select.sort_by-1971"><span class="linenos">1971</span></a> -</span><span id="Select.sort_by-1972"><a href="#Select.sort_by-1972"><span class="linenos">1972</span></a><span class="sd"> Example:</span> -</span><span id="Select.sort_by-1973"><a href="#Select.sort_by-1973"><span class="linenos">1973</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> -</span><span id="Select.sort_by-1974"><a href="#Select.sort_by-1974"><span class="linenos">1974</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> -</span><span id="Select.sort_by-1975"><a href="#Select.sort_by-1975"><span class="linenos">1975</span></a> -</span><span id="Select.sort_by-1976"><a href="#Select.sort_by-1976"><span class="linenos">1976</span></a><span class="sd"> Args:</span> -</span><span id="Select.sort_by-1977"><a href="#Select.sort_by-1977"><span class="linenos">1977</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.sort_by-1978"><a href="#Select.sort_by-1978"><span class="linenos">1978</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.sort_by-1979"><a href="#Select.sort_by-1979"><span class="linenos">1979</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> -</span><span id="Select.sort_by-1980"><a href="#Select.sort_by-1980"><span class="linenos">1980</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.sort_by-1981"><a href="#Select.sort_by-1981"><span class="linenos">1981</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.sort_by-1982"><a href="#Select.sort_by-1982"><span class="linenos">1982</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.sort_by-1983"><a href="#Select.sort_by-1983"><span class="linenos">1983</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.sort_by-1984"><a href="#Select.sort_by-1984"><span class="linenos">1984</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.sort_by-1985"><a href="#Select.sort_by-1985"><span class="linenos">1985</span></a> -</span><span id="Select.sort_by-1986"><a href="#Select.sort_by-1986"><span class="linenos">1986</span></a><span class="sd"> Returns:</span> -</span><span id="Select.sort_by-1987"><a href="#Select.sort_by-1987"><span class="linenos">1987</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.sort_by-1988"><a href="#Select.sort_by-1988"><span class="linenos">1988</span></a><span class="sd"> """</span> -</span><span id="Select.sort_by-1989"><a href="#Select.sort_by-1989"><span class="linenos">1989</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select.sort_by-1990"><a href="#Select.sort_by-1990"><span class="linenos">1990</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.sort_by-1991"><a href="#Select.sort_by-1991"><span class="linenos">1991</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.sort_by-1992"><a href="#Select.sort_by-1992"><span class="linenos">1992</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> -</span><span id="Select.sort_by-1993"><a href="#Select.sort_by-1993"><span class="linenos">1993</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.sort_by-1994"><a href="#Select.sort_by-1994"><span class="linenos">1994</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.sort_by-1995"><a href="#Select.sort_by-1995"><span class="linenos">1995</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> -</span><span id="Select.sort_by-1996"><a href="#Select.sort_by-1996"><span class="linenos">1996</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> -</span><span id="Select.sort_by-1997"><a href="#Select.sort_by-1997"><span class="linenos">1997</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.sort_by-1998"><a href="#Select.sort_by-1998"><span class="linenos">1998</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.sort_by-1999"><a href="#Select.sort_by-1999"><span class="linenos">1999</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.sort_by-2016"><a href="#Select.sort_by-2016"><span class="linenos">2016</span></a> <span class="k">def</span> <span class="nf">sort_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.sort_by-2017"><a href="#Select.sort_by-2017"><span class="linenos">2017</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.sort_by-2018"><a href="#Select.sort_by-2018"><span class="linenos">2018</span></a><span class="sd"> Set the SORT BY expression.</span> +</span><span id="Select.sort_by-2019"><a href="#Select.sort_by-2019"><span class="linenos">2019</span></a> +</span><span id="Select.sort_by-2020"><a href="#Select.sort_by-2020"><span class="linenos">2020</span></a><span class="sd"> Example:</span> +</span><span id="Select.sort_by-2021"><a href="#Select.sort_by-2021"><span class="linenos">2021</span></a><span class="sd"> >>> Select().from_("tbl").select("x").sort_by("x DESC").sql()</span> +</span><span id="Select.sort_by-2022"><a href="#Select.sort_by-2022"><span class="linenos">2022</span></a><span class="sd"> 'SELECT x FROM tbl SORT BY x DESC'</span> +</span><span id="Select.sort_by-2023"><a href="#Select.sort_by-2023"><span class="linenos">2023</span></a> +</span><span id="Select.sort_by-2024"><a href="#Select.sort_by-2024"><span class="linenos">2024</span></a><span class="sd"> Args:</span> +</span><span id="Select.sort_by-2025"><a href="#Select.sort_by-2025"><span class="linenos">2025</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.sort_by-2026"><a href="#Select.sort_by-2026"><span class="linenos">2026</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.sort_by-2027"><a href="#Select.sort_by-2027"><span class="linenos">2027</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `SORT`.</span> +</span><span id="Select.sort_by-2028"><a href="#Select.sort_by-2028"><span class="linenos">2028</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.sort_by-2029"><a href="#Select.sort_by-2029"><span class="linenos">2029</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.sort_by-2030"><a href="#Select.sort_by-2030"><span class="linenos">2030</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.sort_by-2031"><a href="#Select.sort_by-2031"><span class="linenos">2031</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.sort_by-2032"><a href="#Select.sort_by-2032"><span class="linenos">2032</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.sort_by-2033"><a href="#Select.sort_by-2033"><span class="linenos">2033</span></a> +</span><span id="Select.sort_by-2034"><a href="#Select.sort_by-2034"><span class="linenos">2034</span></a><span class="sd"> Returns:</span> +</span><span id="Select.sort_by-2035"><a href="#Select.sort_by-2035"><span class="linenos">2035</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.sort_by-2036"><a href="#Select.sort_by-2036"><span class="linenos">2036</span></a><span class="sd"> """</span> +</span><span id="Select.sort_by-2037"><a href="#Select.sort_by-2037"><span class="linenos">2037</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select.sort_by-2038"><a href="#Select.sort_by-2038"><span class="linenos">2038</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.sort_by-2039"><a href="#Select.sort_by-2039"><span class="linenos">2039</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.sort_by-2040"><a href="#Select.sort_by-2040"><span class="linenos">2040</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"sort"</span><span class="p">,</span> +</span><span id="Select.sort_by-2041"><a href="#Select.sort_by-2041"><span class="linenos">2041</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.sort_by-2042"><a href="#Select.sort_by-2042"><span class="linenos">2042</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.sort_by-2043"><a href="#Select.sort_by-2043"><span class="linenos">2043</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"SORT BY"</span><span class="p">,</span> +</span><span id="Select.sort_by-2044"><a href="#Select.sort_by-2044"><span class="linenos">2044</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Sort</span><span class="p">,</span> +</span><span id="Select.sort_by-2045"><a href="#Select.sort_by-2045"><span class="linenos">2045</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.sort_by-2046"><a href="#Select.sort_by-2046"><span class="linenos">2046</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.sort_by-2047"><a href="#Select.sort_by-2047"><span class="linenos">2047</span></a> <span class="p">)</span> </span></pre></div> @@ -20168,38 +20956,38 @@ Otherwise, this flattens all the <code><a href="#Order">Order</a></code> express </div> <a class="headerlink" href="#Select.cluster_by"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.cluster_by-2001"><a href="#Select.cluster_by-2001"><span class="linenos">2001</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.cluster_by-2002"><a href="#Select.cluster_by-2002"><span class="linenos">2002</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.cluster_by-2003"><a href="#Select.cluster_by-2003"><span class="linenos">2003</span></a><span class="sd"> Set the CLUSTER BY expression.</span> -</span><span id="Select.cluster_by-2004"><a href="#Select.cluster_by-2004"><span class="linenos">2004</span></a> -</span><span id="Select.cluster_by-2005"><a href="#Select.cluster_by-2005"><span class="linenos">2005</span></a><span class="sd"> Example:</span> -</span><span id="Select.cluster_by-2006"><a href="#Select.cluster_by-2006"><span class="linenos">2006</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> -</span><span id="Select.cluster_by-2007"><a href="#Select.cluster_by-2007"><span class="linenos">2007</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> -</span><span id="Select.cluster_by-2008"><a href="#Select.cluster_by-2008"><span class="linenos">2008</span></a> -</span><span id="Select.cluster_by-2009"><a href="#Select.cluster_by-2009"><span class="linenos">2009</span></a><span class="sd"> Args:</span> -</span><span id="Select.cluster_by-2010"><a href="#Select.cluster_by-2010"><span class="linenos">2010</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.cluster_by-2011"><a href="#Select.cluster_by-2011"><span class="linenos">2011</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> -</span><span id="Select.cluster_by-2012"><a href="#Select.cluster_by-2012"><span class="linenos">2012</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> -</span><span id="Select.cluster_by-2013"><a href="#Select.cluster_by-2013"><span class="linenos">2013</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.cluster_by-2014"><a href="#Select.cluster_by-2014"><span class="linenos">2014</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> -</span><span id="Select.cluster_by-2015"><a href="#Select.cluster_by-2015"><span class="linenos">2015</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.cluster_by-2016"><a href="#Select.cluster_by-2016"><span class="linenos">2016</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.cluster_by-2017"><a href="#Select.cluster_by-2017"><span class="linenos">2017</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.cluster_by-2018"><a href="#Select.cluster_by-2018"><span class="linenos">2018</span></a> -</span><span id="Select.cluster_by-2019"><a href="#Select.cluster_by-2019"><span class="linenos">2019</span></a><span class="sd"> Returns:</span> -</span><span id="Select.cluster_by-2020"><a href="#Select.cluster_by-2020"><span class="linenos">2020</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.cluster_by-2021"><a href="#Select.cluster_by-2021"><span class="linenos">2021</span></a><span class="sd"> """</span> -</span><span id="Select.cluster_by-2022"><a href="#Select.cluster_by-2022"><span class="linenos">2022</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> -</span><span id="Select.cluster_by-2023"><a href="#Select.cluster_by-2023"><span class="linenos">2023</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.cluster_by-2024"><a href="#Select.cluster_by-2024"><span class="linenos">2024</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.cluster_by-2025"><a href="#Select.cluster_by-2025"><span class="linenos">2025</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> -</span><span id="Select.cluster_by-2026"><a href="#Select.cluster_by-2026"><span class="linenos">2026</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.cluster_by-2027"><a href="#Select.cluster_by-2027"><span class="linenos">2027</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.cluster_by-2028"><a href="#Select.cluster_by-2028"><span class="linenos">2028</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> -</span><span id="Select.cluster_by-2029"><a href="#Select.cluster_by-2029"><span class="linenos">2029</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> -</span><span id="Select.cluster_by-2030"><a href="#Select.cluster_by-2030"><span class="linenos">2030</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.cluster_by-2031"><a href="#Select.cluster_by-2031"><span class="linenos">2031</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.cluster_by-2032"><a href="#Select.cluster_by-2032"><span class="linenos">2032</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.cluster_by-2049"><a href="#Select.cluster_by-2049"><span class="linenos">2049</span></a> <span class="k">def</span> <span class="nf">cluster_by</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.cluster_by-2050"><a href="#Select.cluster_by-2050"><span class="linenos">2050</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.cluster_by-2051"><a href="#Select.cluster_by-2051"><span class="linenos">2051</span></a><span class="sd"> Set the CLUSTER BY expression.</span> +</span><span id="Select.cluster_by-2052"><a href="#Select.cluster_by-2052"><span class="linenos">2052</span></a> +</span><span id="Select.cluster_by-2053"><a href="#Select.cluster_by-2053"><span class="linenos">2053</span></a><span class="sd"> Example:</span> +</span><span id="Select.cluster_by-2054"><a href="#Select.cluster_by-2054"><span class="linenos">2054</span></a><span class="sd"> >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql()</span> +</span><span id="Select.cluster_by-2055"><a href="#Select.cluster_by-2055"><span class="linenos">2055</span></a><span class="sd"> 'SELECT x FROM tbl CLUSTER BY x DESC'</span> +</span><span id="Select.cluster_by-2056"><a href="#Select.cluster_by-2056"><span class="linenos">2056</span></a> +</span><span id="Select.cluster_by-2057"><a href="#Select.cluster_by-2057"><span class="linenos">2057</span></a><span class="sd"> Args:</span> +</span><span id="Select.cluster_by-2058"><a href="#Select.cluster_by-2058"><span class="linenos">2058</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.cluster_by-2059"><a href="#Select.cluster_by-2059"><span class="linenos">2059</span></a><span class="sd"> If a `Group` instance is passed, this is used as-is.</span> +</span><span id="Select.cluster_by-2060"><a href="#Select.cluster_by-2060"><span class="linenos">2060</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Cluster`.</span> +</span><span id="Select.cluster_by-2061"><a href="#Select.cluster_by-2061"><span class="linenos">2061</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.cluster_by-2062"><a href="#Select.cluster_by-2062"><span class="linenos">2062</span></a><span class="sd"> Otherwise, this flattens all the `Order` expression into a single expression.</span> +</span><span id="Select.cluster_by-2063"><a href="#Select.cluster_by-2063"><span class="linenos">2063</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.cluster_by-2064"><a href="#Select.cluster_by-2064"><span class="linenos">2064</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.cluster_by-2065"><a href="#Select.cluster_by-2065"><span class="linenos">2065</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.cluster_by-2066"><a href="#Select.cluster_by-2066"><span class="linenos">2066</span></a> +</span><span id="Select.cluster_by-2067"><a href="#Select.cluster_by-2067"><span class="linenos">2067</span></a><span class="sd"> Returns:</span> +</span><span id="Select.cluster_by-2068"><a href="#Select.cluster_by-2068"><span class="linenos">2068</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.cluster_by-2069"><a href="#Select.cluster_by-2069"><span class="linenos">2069</span></a><span class="sd"> """</span> +</span><span id="Select.cluster_by-2070"><a href="#Select.cluster_by-2070"><span class="linenos">2070</span></a> <span class="k">return</span> <span class="n">_apply_child_list_builder</span><span class="p">(</span> +</span><span id="Select.cluster_by-2071"><a href="#Select.cluster_by-2071"><span class="linenos">2071</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.cluster_by-2072"><a href="#Select.cluster_by-2072"><span class="linenos">2072</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.cluster_by-2073"><a href="#Select.cluster_by-2073"><span class="linenos">2073</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"cluster"</span><span class="p">,</span> +</span><span id="Select.cluster_by-2074"><a href="#Select.cluster_by-2074"><span class="linenos">2074</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.cluster_by-2075"><a href="#Select.cluster_by-2075"><span class="linenos">2075</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.cluster_by-2076"><a href="#Select.cluster_by-2076"><span class="linenos">2076</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"CLUSTER BY"</span><span class="p">,</span> +</span><span id="Select.cluster_by-2077"><a href="#Select.cluster_by-2077"><span class="linenos">2077</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Cluster</span><span class="p">,</span> +</span><span id="Select.cluster_by-2078"><a href="#Select.cluster_by-2078"><span class="linenos">2078</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.cluster_by-2079"><a href="#Select.cluster_by-2079"><span class="linenos">2079</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.cluster_by-2080"><a href="#Select.cluster_by-2080"><span class="linenos">2080</span></a> <span class="p">)</span> </span></pre></div> @@ -20248,36 +21036,36 @@ Otherwise, this flattens all the <code><a href="#Order">Order</a></code> express </div> <a class="headerlink" href="#Select.limit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.limit-2034"><a href="#Select.limit-2034"><span class="linenos">2034</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.limit-2035"><a href="#Select.limit-2035"><span class="linenos">2035</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.limit-2036"><a href="#Select.limit-2036"><span class="linenos">2036</span></a><span class="sd"> Set the LIMIT expression.</span> -</span><span id="Select.limit-2037"><a href="#Select.limit-2037"><span class="linenos">2037</span></a> -</span><span id="Select.limit-2038"><a href="#Select.limit-2038"><span class="linenos">2038</span></a><span class="sd"> Example:</span> -</span><span id="Select.limit-2039"><a href="#Select.limit-2039"><span class="linenos">2039</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> -</span><span id="Select.limit-2040"><a href="#Select.limit-2040"><span class="linenos">2040</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> -</span><span id="Select.limit-2041"><a href="#Select.limit-2041"><span class="linenos">2041</span></a> -</span><span id="Select.limit-2042"><a href="#Select.limit-2042"><span class="linenos">2042</span></a><span class="sd"> Args:</span> -</span><span id="Select.limit-2043"><a href="#Select.limit-2043"><span class="linenos">2043</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Select.limit-2044"><a href="#Select.limit-2044"><span class="linenos">2044</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select.limit-2045"><a href="#Select.limit-2045"><span class="linenos">2045</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> -</span><span id="Select.limit-2046"><a href="#Select.limit-2046"><span class="linenos">2046</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> -</span><span id="Select.limit-2047"><a href="#Select.limit-2047"><span class="linenos">2047</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.limit-2048"><a href="#Select.limit-2048"><span class="linenos">2048</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.limit-2049"><a href="#Select.limit-2049"><span class="linenos">2049</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.limit-2050"><a href="#Select.limit-2050"><span class="linenos">2050</span></a> -</span><span id="Select.limit-2051"><a href="#Select.limit-2051"><span class="linenos">2051</span></a><span class="sd"> Returns:</span> -</span><span id="Select.limit-2052"><a href="#Select.limit-2052"><span class="linenos">2052</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.limit-2053"><a href="#Select.limit-2053"><span class="linenos">2053</span></a><span class="sd"> """</span> -</span><span id="Select.limit-2054"><a href="#Select.limit-2054"><span class="linenos">2054</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select.limit-2055"><a href="#Select.limit-2055"><span class="linenos">2055</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select.limit-2056"><a href="#Select.limit-2056"><span class="linenos">2056</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.limit-2057"><a href="#Select.limit-2057"><span class="linenos">2057</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> -</span><span id="Select.limit-2058"><a href="#Select.limit-2058"><span class="linenos">2058</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> -</span><span id="Select.limit-2059"><a href="#Select.limit-2059"><span class="linenos">2059</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> -</span><span id="Select.limit-2060"><a href="#Select.limit-2060"><span class="linenos">2060</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.limit-2061"><a href="#Select.limit-2061"><span class="linenos">2061</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.limit-2062"><a href="#Select.limit-2062"><span class="linenos">2062</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.limit-2063"><a href="#Select.limit-2063"><span class="linenos">2063</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.limit-2082"><a href="#Select.limit-2082"><span class="linenos">2082</span></a> <span class="k">def</span> <span class="nf">limit</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.limit-2083"><a href="#Select.limit-2083"><span class="linenos">2083</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.limit-2084"><a href="#Select.limit-2084"><span class="linenos">2084</span></a><span class="sd"> Set the LIMIT expression.</span> +</span><span id="Select.limit-2085"><a href="#Select.limit-2085"><span class="linenos">2085</span></a> +</span><span id="Select.limit-2086"><a href="#Select.limit-2086"><span class="linenos">2086</span></a><span class="sd"> Example:</span> +</span><span id="Select.limit-2087"><a href="#Select.limit-2087"><span class="linenos">2087</span></a><span class="sd"> >>> Select().from_("tbl").select("x").limit(10).sql()</span> +</span><span id="Select.limit-2088"><a href="#Select.limit-2088"><span class="linenos">2088</span></a><span class="sd"> 'SELECT x FROM tbl LIMIT 10'</span> +</span><span id="Select.limit-2089"><a href="#Select.limit-2089"><span class="linenos">2089</span></a> +</span><span id="Select.limit-2090"><a href="#Select.limit-2090"><span class="linenos">2090</span></a><span class="sd"> Args:</span> +</span><span id="Select.limit-2091"><a href="#Select.limit-2091"><span class="linenos">2091</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Select.limit-2092"><a href="#Select.limit-2092"><span class="linenos">2092</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select.limit-2093"><a href="#Select.limit-2093"><span class="linenos">2093</span></a><span class="sd"> If a `Limit` instance is passed, this is used as-is.</span> +</span><span id="Select.limit-2094"><a href="#Select.limit-2094"><span class="linenos">2094</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Limit`.</span> +</span><span id="Select.limit-2095"><a href="#Select.limit-2095"><span class="linenos">2095</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.limit-2096"><a href="#Select.limit-2096"><span class="linenos">2096</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.limit-2097"><a href="#Select.limit-2097"><span class="linenos">2097</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.limit-2098"><a href="#Select.limit-2098"><span class="linenos">2098</span></a> +</span><span id="Select.limit-2099"><a href="#Select.limit-2099"><span class="linenos">2099</span></a><span class="sd"> Returns:</span> +</span><span id="Select.limit-2100"><a href="#Select.limit-2100"><span class="linenos">2100</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.limit-2101"><a href="#Select.limit-2101"><span class="linenos">2101</span></a><span class="sd"> """</span> +</span><span id="Select.limit-2102"><a href="#Select.limit-2102"><span class="linenos">2102</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select.limit-2103"><a href="#Select.limit-2103"><span class="linenos">2103</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select.limit-2104"><a href="#Select.limit-2104"><span class="linenos">2104</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.limit-2105"><a href="#Select.limit-2105"><span class="linenos">2105</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"limit"</span><span class="p">,</span> +</span><span id="Select.limit-2106"><a href="#Select.limit-2106"><span class="linenos">2106</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Limit</span><span class="p">,</span> +</span><span id="Select.limit-2107"><a href="#Select.limit-2107"><span class="linenos">2107</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LIMIT"</span><span class="p">,</span> +</span><span id="Select.limit-2108"><a href="#Select.limit-2108"><span class="linenos">2108</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.limit-2109"><a href="#Select.limit-2109"><span class="linenos">2109</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.limit-2110"><a href="#Select.limit-2110"><span class="linenos">2110</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.limit-2111"><a href="#Select.limit-2111"><span class="linenos">2111</span></a> <span class="p">)</span> </span></pre></div> @@ -20325,36 +21113,36 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Select.offset"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.offset-2065"><a href="#Select.offset-2065"><span class="linenos">2065</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.offset-2066"><a href="#Select.offset-2066"><span class="linenos">2066</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.offset-2067"><a href="#Select.offset-2067"><span class="linenos">2067</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select.offset-2068"><a href="#Select.offset-2068"><span class="linenos">2068</span></a> -</span><span id="Select.offset-2069"><a href="#Select.offset-2069"><span class="linenos">2069</span></a><span class="sd"> Example:</span> -</span><span id="Select.offset-2070"><a href="#Select.offset-2070"><span class="linenos">2070</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> -</span><span id="Select.offset-2071"><a href="#Select.offset-2071"><span class="linenos">2071</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> -</span><span id="Select.offset-2072"><a href="#Select.offset-2072"><span class="linenos">2072</span></a> -</span><span id="Select.offset-2073"><a href="#Select.offset-2073"><span class="linenos">2073</span></a><span class="sd"> Args:</span> -</span><span id="Select.offset-2074"><a href="#Select.offset-2074"><span class="linenos">2074</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> -</span><span id="Select.offset-2075"><a href="#Select.offset-2075"><span class="linenos">2075</span></a><span class="sd"> This can also be an integer.</span> -</span><span id="Select.offset-2076"><a href="#Select.offset-2076"><span class="linenos">2076</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> -</span><span id="Select.offset-2077"><a href="#Select.offset-2077"><span class="linenos">2077</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> -</span><span id="Select.offset-2078"><a href="#Select.offset-2078"><span class="linenos">2078</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="Select.offset-2079"><a href="#Select.offset-2079"><span class="linenos">2079</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.offset-2080"><a href="#Select.offset-2080"><span class="linenos">2080</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.offset-2081"><a href="#Select.offset-2081"><span class="linenos">2081</span></a> -</span><span id="Select.offset-2082"><a href="#Select.offset-2082"><span class="linenos">2082</span></a><span class="sd"> Returns:</span> -</span><span id="Select.offset-2083"><a href="#Select.offset-2083"><span class="linenos">2083</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.offset-2084"><a href="#Select.offset-2084"><span class="linenos">2084</span></a><span class="sd"> """</span> -</span><span id="Select.offset-2085"><a href="#Select.offset-2085"><span class="linenos">2085</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> -</span><span id="Select.offset-2086"><a href="#Select.offset-2086"><span class="linenos">2086</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> -</span><span id="Select.offset-2087"><a href="#Select.offset-2087"><span class="linenos">2087</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.offset-2088"><a href="#Select.offset-2088"><span class="linenos">2088</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> -</span><span id="Select.offset-2089"><a href="#Select.offset-2089"><span class="linenos">2089</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> -</span><span id="Select.offset-2090"><a href="#Select.offset-2090"><span class="linenos">2090</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> -</span><span id="Select.offset-2091"><a href="#Select.offset-2091"><span class="linenos">2091</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.offset-2092"><a href="#Select.offset-2092"><span class="linenos">2092</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.offset-2093"><a href="#Select.offset-2093"><span class="linenos">2093</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.offset-2094"><a href="#Select.offset-2094"><span class="linenos">2094</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.offset-2113"><a href="#Select.offset-2113"><span class="linenos">2113</span></a> <span class="k">def</span> <span class="nf">offset</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.offset-2114"><a href="#Select.offset-2114"><span class="linenos">2114</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.offset-2115"><a href="#Select.offset-2115"><span class="linenos">2115</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select.offset-2116"><a href="#Select.offset-2116"><span class="linenos">2116</span></a> +</span><span id="Select.offset-2117"><a href="#Select.offset-2117"><span class="linenos">2117</span></a><span class="sd"> Example:</span> +</span><span id="Select.offset-2118"><a href="#Select.offset-2118"><span class="linenos">2118</span></a><span class="sd"> >>> Select().from_("tbl").select("x").offset(10).sql()</span> +</span><span id="Select.offset-2119"><a href="#Select.offset-2119"><span class="linenos">2119</span></a><span class="sd"> 'SELECT x FROM tbl OFFSET 10'</span> +</span><span id="Select.offset-2120"><a href="#Select.offset-2120"><span class="linenos">2120</span></a> +</span><span id="Select.offset-2121"><a href="#Select.offset-2121"><span class="linenos">2121</span></a><span class="sd"> Args:</span> +</span><span id="Select.offset-2122"><a href="#Select.offset-2122"><span class="linenos">2122</span></a><span class="sd"> expression (str | int | Expression): the SQL code string to parse.</span> +</span><span id="Select.offset-2123"><a href="#Select.offset-2123"><span class="linenos">2123</span></a><span class="sd"> This can also be an integer.</span> +</span><span id="Select.offset-2124"><a href="#Select.offset-2124"><span class="linenos">2124</span></a><span class="sd"> If a `Offset` instance is passed, this is used as-is.</span> +</span><span id="Select.offset-2125"><a href="#Select.offset-2125"><span class="linenos">2125</span></a><span class="sd"> If another `Expression` instance is passed, it will be wrapped in a `Offset`.</span> +</span><span id="Select.offset-2126"><a href="#Select.offset-2126"><span class="linenos">2126</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="Select.offset-2127"><a href="#Select.offset-2127"><span class="linenos">2127</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.offset-2128"><a href="#Select.offset-2128"><span class="linenos">2128</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.offset-2129"><a href="#Select.offset-2129"><span class="linenos">2129</span></a> +</span><span id="Select.offset-2130"><a href="#Select.offset-2130"><span class="linenos">2130</span></a><span class="sd"> Returns:</span> +</span><span id="Select.offset-2131"><a href="#Select.offset-2131"><span class="linenos">2131</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.offset-2132"><a href="#Select.offset-2132"><span class="linenos">2132</span></a><span class="sd"> """</span> +</span><span id="Select.offset-2133"><a href="#Select.offset-2133"><span class="linenos">2133</span></a> <span class="k">return</span> <span class="n">_apply_builder</span><span class="p">(</span> +</span><span id="Select.offset-2134"><a href="#Select.offset-2134"><span class="linenos">2134</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> +</span><span id="Select.offset-2135"><a href="#Select.offset-2135"><span class="linenos">2135</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.offset-2136"><a href="#Select.offset-2136"><span class="linenos">2136</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"offset"</span><span class="p">,</span> +</span><span id="Select.offset-2137"><a href="#Select.offset-2137"><span class="linenos">2137</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Offset</span><span class="p">,</span> +</span><span id="Select.offset-2138"><a href="#Select.offset-2138"><span class="linenos">2138</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"OFFSET"</span><span class="p">,</span> +</span><span id="Select.offset-2139"><a href="#Select.offset-2139"><span class="linenos">2139</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.offset-2140"><a href="#Select.offset-2140"><span class="linenos">2140</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.offset-2141"><a href="#Select.offset-2141"><span class="linenos">2141</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.offset-2142"><a href="#Select.offset-2142"><span class="linenos">2142</span></a> <span class="p">)</span> </span></pre></div> @@ -20402,42 +21190,42 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Select.select"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.select-2096"><a href="#Select.select-2096"><span class="linenos">2096</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> -</span><span id="Select.select-2097"><a href="#Select.select-2097"><span class="linenos">2097</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.select-2098"><a href="#Select.select-2098"><span class="linenos">2098</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="Select.select-2099"><a href="#Select.select-2099"><span class="linenos">2099</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Select.select-2100"><a href="#Select.select-2100"><span class="linenos">2100</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="Select.select-2101"><a href="#Select.select-2101"><span class="linenos">2101</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Select.select-2102"><a href="#Select.select-2102"><span class="linenos">2102</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.select-2103"><a href="#Select.select-2103"><span class="linenos">2103</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.select-2104"><a href="#Select.select-2104"><span class="linenos">2104</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.select-2105"><a href="#Select.select-2105"><span class="linenos">2105</span></a><span class="sd"> Append to or set the SELECT expressions.</span> -</span><span id="Select.select-2106"><a href="#Select.select-2106"><span class="linenos">2106</span></a> -</span><span id="Select.select-2107"><a href="#Select.select-2107"><span class="linenos">2107</span></a><span class="sd"> Example:</span> -</span><span id="Select.select-2108"><a href="#Select.select-2108"><span class="linenos">2108</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> -</span><span id="Select.select-2109"><a href="#Select.select-2109"><span class="linenos">2109</span></a><span class="sd"> 'SELECT x, y'</span> -</span><span id="Select.select-2110"><a href="#Select.select-2110"><span class="linenos">2110</span></a> -</span><span id="Select.select-2111"><a href="#Select.select-2111"><span class="linenos">2111</span></a><span class="sd"> Args:</span> -</span><span id="Select.select-2112"><a href="#Select.select-2112"><span class="linenos">2112</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> -</span><span id="Select.select-2113"><a href="#Select.select-2113"><span class="linenos">2113</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.select-2114"><a href="#Select.select-2114"><span class="linenos">2114</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> -</span><span id="Select.select-2115"><a href="#Select.select-2115"><span class="linenos">2115</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.select-2116"><a href="#Select.select-2116"><span class="linenos">2116</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> -</span><span id="Select.select-2117"><a href="#Select.select-2117"><span class="linenos">2117</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.select-2118"><a href="#Select.select-2118"><span class="linenos">2118</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> -</span><span id="Select.select-2119"><a href="#Select.select-2119"><span class="linenos">2119</span></a> -</span><span id="Select.select-2120"><a href="#Select.select-2120"><span class="linenos">2120</span></a><span class="sd"> Returns:</span> -</span><span id="Select.select-2121"><a href="#Select.select-2121"><span class="linenos">2121</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.select-2122"><a href="#Select.select-2122"><span class="linenos">2122</span></a><span class="sd"> """</span> -</span><span id="Select.select-2123"><a href="#Select.select-2123"><span class="linenos">2123</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.select-2124"><a href="#Select.select-2124"><span class="linenos">2124</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.select-2125"><a href="#Select.select-2125"><span class="linenos">2125</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.select-2126"><a href="#Select.select-2126"><span class="linenos">2126</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="Select.select-2127"><a href="#Select.select-2127"><span class="linenos">2127</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.select-2128"><a href="#Select.select-2128"><span class="linenos">2128</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.select-2129"><a href="#Select.select-2129"><span class="linenos">2129</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.select-2130"><a href="#Select.select-2130"><span class="linenos">2130</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.select-2131"><a href="#Select.select-2131"><span class="linenos">2131</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.select-2144"><a href="#Select.select-2144"><span class="linenos">2144</span></a> <span class="k">def</span> <span class="nf">select</span><span class="p">(</span> +</span><span id="Select.select-2145"><a href="#Select.select-2145"><span class="linenos">2145</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.select-2146"><a href="#Select.select-2146"><span class="linenos">2146</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="Select.select-2147"><a href="#Select.select-2147"><span class="linenos">2147</span></a> <span class="n">append</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Select.select-2148"><a href="#Select.select-2148"><span class="linenos">2148</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="Select.select-2149"><a href="#Select.select-2149"><span class="linenos">2149</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Select.select-2150"><a href="#Select.select-2150"><span class="linenos">2150</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.select-2151"><a href="#Select.select-2151"><span class="linenos">2151</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.select-2152"><a href="#Select.select-2152"><span class="linenos">2152</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.select-2153"><a href="#Select.select-2153"><span class="linenos">2153</span></a><span class="sd"> Append to or set the SELECT expressions.</span> +</span><span id="Select.select-2154"><a href="#Select.select-2154"><span class="linenos">2154</span></a> +</span><span id="Select.select-2155"><a href="#Select.select-2155"><span class="linenos">2155</span></a><span class="sd"> Example:</span> +</span><span id="Select.select-2156"><a href="#Select.select-2156"><span class="linenos">2156</span></a><span class="sd"> >>> Select().select("x", "y").sql()</span> +</span><span id="Select.select-2157"><a href="#Select.select-2157"><span class="linenos">2157</span></a><span class="sd"> 'SELECT x, y'</span> +</span><span id="Select.select-2158"><a href="#Select.select-2158"><span class="linenos">2158</span></a> +</span><span id="Select.select-2159"><a href="#Select.select-2159"><span class="linenos">2159</span></a><span class="sd"> Args:</span> +</span><span id="Select.select-2160"><a href="#Select.select-2160"><span class="linenos">2160</span></a><span class="sd"> *expressions: the SQL code strings to parse.</span> +</span><span id="Select.select-2161"><a href="#Select.select-2161"><span class="linenos">2161</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.select-2162"><a href="#Select.select-2162"><span class="linenos">2162</span></a><span class="sd"> append: if `True`, add to any existing expressions.</span> +</span><span id="Select.select-2163"><a href="#Select.select-2163"><span class="linenos">2163</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.select-2164"><a href="#Select.select-2164"><span class="linenos">2164</span></a><span class="sd"> dialect: the dialect used to parse the input expressions.</span> +</span><span id="Select.select-2165"><a href="#Select.select-2165"><span class="linenos">2165</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.select-2166"><a href="#Select.select-2166"><span class="linenos">2166</span></a><span class="sd"> opts: other options to use to parse the input expressions.</span> +</span><span id="Select.select-2167"><a href="#Select.select-2167"><span class="linenos">2167</span></a> +</span><span id="Select.select-2168"><a href="#Select.select-2168"><span class="linenos">2168</span></a><span class="sd"> Returns:</span> +</span><span id="Select.select-2169"><a href="#Select.select-2169"><span class="linenos">2169</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.select-2170"><a href="#Select.select-2170"><span class="linenos">2170</span></a><span class="sd"> """</span> +</span><span id="Select.select-2171"><a href="#Select.select-2171"><span class="linenos">2171</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.select-2172"><a href="#Select.select-2172"><span class="linenos">2172</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.select-2173"><a href="#Select.select-2173"><span class="linenos">2173</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.select-2174"><a href="#Select.select-2174"><span class="linenos">2174</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="Select.select-2175"><a href="#Select.select-2175"><span class="linenos">2175</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.select-2176"><a href="#Select.select-2176"><span class="linenos">2176</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.select-2177"><a href="#Select.select-2177"><span class="linenos">2177</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.select-2178"><a href="#Select.select-2178"><span class="linenos">2178</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.select-2179"><a href="#Select.select-2179"><span class="linenos">2179</span></a> <span class="p">)</span> </span></pre></div> @@ -20485,37 +21273,37 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select.lateral"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lateral-2133"><a href="#Select.lateral-2133"><span class="linenos">2133</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.lateral-2134"><a href="#Select.lateral-2134"><span class="linenos">2134</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.lateral-2135"><a href="#Select.lateral-2135"><span class="linenos">2135</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> -</span><span id="Select.lateral-2136"><a href="#Select.lateral-2136"><span class="linenos">2136</span></a> -</span><span id="Select.lateral-2137"><a href="#Select.lateral-2137"><span class="linenos">2137</span></a><span class="sd"> Example:</span> -</span><span id="Select.lateral-2138"><a href="#Select.lateral-2138"><span class="linenos">2138</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> -</span><span id="Select.lateral-2139"><a href="#Select.lateral-2139"><span class="linenos">2139</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> -</span><span id="Select.lateral-2140"><a href="#Select.lateral-2140"><span class="linenos">2140</span></a> -</span><span id="Select.lateral-2141"><a href="#Select.lateral-2141"><span class="linenos">2141</span></a><span class="sd"> Args:</span> -</span><span id="Select.lateral-2142"><a href="#Select.lateral-2142"><span class="linenos">2142</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.lateral-2143"><a href="#Select.lateral-2143"><span class="linenos">2143</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.lateral-2144"><a href="#Select.lateral-2144"><span class="linenos">2144</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.lateral-2145"><a href="#Select.lateral-2145"><span class="linenos">2145</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.lateral-2146"><a href="#Select.lateral-2146"><span class="linenos">2146</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select.lateral-2147"><a href="#Select.lateral-2147"><span class="linenos">2147</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.lateral-2148"><a href="#Select.lateral-2148"><span class="linenos">2148</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.lateral-2149"><a href="#Select.lateral-2149"><span class="linenos">2149</span></a> -</span><span id="Select.lateral-2150"><a href="#Select.lateral-2150"><span class="linenos">2150</span></a><span class="sd"> Returns:</span> -</span><span id="Select.lateral-2151"><a href="#Select.lateral-2151"><span class="linenos">2151</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.lateral-2152"><a href="#Select.lateral-2152"><span class="linenos">2152</span></a><span class="sd"> """</span> -</span><span id="Select.lateral-2153"><a href="#Select.lateral-2153"><span class="linenos">2153</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.lateral-2154"><a href="#Select.lateral-2154"><span class="linenos">2154</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.lateral-2155"><a href="#Select.lateral-2155"><span class="linenos">2155</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.lateral-2156"><a href="#Select.lateral-2156"><span class="linenos">2156</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> -</span><span id="Select.lateral-2157"><a href="#Select.lateral-2157"><span class="linenos">2157</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.lateral-2158"><a href="#Select.lateral-2158"><span class="linenos">2158</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> -</span><span id="Select.lateral-2159"><a href="#Select.lateral-2159"><span class="linenos">2159</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> -</span><span id="Select.lateral-2160"><a href="#Select.lateral-2160"><span class="linenos">2160</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.lateral-2161"><a href="#Select.lateral-2161"><span class="linenos">2161</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.lateral-2162"><a href="#Select.lateral-2162"><span class="linenos">2162</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.lateral-2163"><a href="#Select.lateral-2163"><span class="linenos">2163</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lateral-2181"><a href="#Select.lateral-2181"><span class="linenos">2181</span></a> <span class="k">def</span> <span class="nf">lateral</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.lateral-2182"><a href="#Select.lateral-2182"><span class="linenos">2182</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.lateral-2183"><a href="#Select.lateral-2183"><span class="linenos">2183</span></a><span class="sd"> Append to or set the LATERAL expressions.</span> +</span><span id="Select.lateral-2184"><a href="#Select.lateral-2184"><span class="linenos">2184</span></a> +</span><span id="Select.lateral-2185"><a href="#Select.lateral-2185"><span class="linenos">2185</span></a><span class="sd"> Example:</span> +</span><span id="Select.lateral-2186"><a href="#Select.lateral-2186"><span class="linenos">2186</span></a><span class="sd"> >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()</span> +</span><span id="Select.lateral-2187"><a href="#Select.lateral-2187"><span class="linenos">2187</span></a><span class="sd"> 'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'</span> +</span><span id="Select.lateral-2188"><a href="#Select.lateral-2188"><span class="linenos">2188</span></a> +</span><span id="Select.lateral-2189"><a href="#Select.lateral-2189"><span class="linenos">2189</span></a><span class="sd"> Args:</span> +</span><span id="Select.lateral-2190"><a href="#Select.lateral-2190"><span class="linenos">2190</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.lateral-2191"><a href="#Select.lateral-2191"><span class="linenos">2191</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.lateral-2192"><a href="#Select.lateral-2192"><span class="linenos">2192</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.lateral-2193"><a href="#Select.lateral-2193"><span class="linenos">2193</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.lateral-2194"><a href="#Select.lateral-2194"><span class="linenos">2194</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select.lateral-2195"><a href="#Select.lateral-2195"><span class="linenos">2195</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.lateral-2196"><a href="#Select.lateral-2196"><span class="linenos">2196</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.lateral-2197"><a href="#Select.lateral-2197"><span class="linenos">2197</span></a> +</span><span id="Select.lateral-2198"><a href="#Select.lateral-2198"><span class="linenos">2198</span></a><span class="sd"> Returns:</span> +</span><span id="Select.lateral-2199"><a href="#Select.lateral-2199"><span class="linenos">2199</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.lateral-2200"><a href="#Select.lateral-2200"><span class="linenos">2200</span></a><span class="sd"> """</span> +</span><span id="Select.lateral-2201"><a href="#Select.lateral-2201"><span class="linenos">2201</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.lateral-2202"><a href="#Select.lateral-2202"><span class="linenos">2202</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.lateral-2203"><a href="#Select.lateral-2203"><span class="linenos">2203</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.lateral-2204"><a href="#Select.lateral-2204"><span class="linenos">2204</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"laterals"</span><span class="p">,</span> +</span><span id="Select.lateral-2205"><a href="#Select.lateral-2205"><span class="linenos">2205</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.lateral-2206"><a href="#Select.lateral-2206"><span class="linenos">2206</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Lateral</span><span class="p">,</span> +</span><span id="Select.lateral-2207"><a href="#Select.lateral-2207"><span class="linenos">2207</span></a> <span class="n">prefix</span><span class="o">=</span><span class="s2">"LATERAL VIEW"</span><span class="p">,</span> +</span><span id="Select.lateral-2208"><a href="#Select.lateral-2208"><span class="linenos">2208</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.lateral-2209"><a href="#Select.lateral-2209"><span class="linenos">2209</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.lateral-2210"><a href="#Select.lateral-2210"><span class="linenos">2210</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.lateral-2211"><a href="#Select.lateral-2211"><span class="linenos">2211</span></a> <span class="p">)</span> </span></pre></div> @@ -20563,100 +21351,100 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select.join"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.join-2165"><a href="#Select.join-2165"><span class="linenos">2165</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> -</span><span id="Select.join-2166"><a href="#Select.join-2166"><span class="linenos">2166</span></a> <span class="bp">self</span><span class="p">,</span> -</span><span id="Select.join-2167"><a href="#Select.join-2167"><span class="linenos">2167</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="Select.join-2168"><a href="#Select.join-2168"><span class="linenos">2168</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2169"><a href="#Select.join-2169"><span class="linenos">2169</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2170"><a href="#Select.join-2170"><span class="linenos">2170</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Select.join-2171"><a href="#Select.join-2171"><span class="linenos">2171</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2172"><a href="#Select.join-2172"><span class="linenos">2172</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2173"><a href="#Select.join-2173"><span class="linenos">2173</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> -</span><span id="Select.join-2174"><a href="#Select.join-2174"><span class="linenos">2174</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> -</span><span id="Select.join-2175"><a href="#Select.join-2175"><span class="linenos">2175</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2176"><a href="#Select.join-2176"><span class="linenos">2176</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.join-2177"><a href="#Select.join-2177"><span class="linenos">2177</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.join-2178"><a href="#Select.join-2178"><span class="linenos">2178</span></a><span class="sd"> Append to or set the JOIN expressions.</span> -</span><span id="Select.join-2179"><a href="#Select.join-2179"><span class="linenos">2179</span></a> -</span><span id="Select.join-2180"><a href="#Select.join-2180"><span class="linenos">2180</span></a><span class="sd"> Example:</span> -</span><span id="Select.join-2181"><a href="#Select.join-2181"><span class="linenos">2181</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> -</span><span id="Select.join-2182"><a href="#Select.join-2182"><span class="linenos">2182</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select.join-2183"><a href="#Select.join-2183"><span class="linenos">2183</span></a> -</span><span id="Select.join-2184"><a href="#Select.join-2184"><span class="linenos">2184</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> -</span><span id="Select.join-2185"><a href="#Select.join-2185"><span class="linenos">2185</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> -</span><span id="Select.join-2186"><a href="#Select.join-2186"><span class="linenos">2186</span></a> -</span><span id="Select.join-2187"><a href="#Select.join-2187"><span class="linenos">2187</span></a><span class="sd"> Use `join_type` to change the type of join:</span> -</span><span id="Select.join-2188"><a href="#Select.join-2188"><span class="linenos">2188</span></a> -</span><span id="Select.join-2189"><a href="#Select.join-2189"><span class="linenos">2189</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> -</span><span id="Select.join-2190"><a href="#Select.join-2190"><span class="linenos">2190</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> -</span><span id="Select.join-2191"><a href="#Select.join-2191"><span class="linenos">2191</span></a> -</span><span id="Select.join-2192"><a href="#Select.join-2192"><span class="linenos">2192</span></a><span class="sd"> Args:</span> -</span><span id="Select.join-2193"><a href="#Select.join-2193"><span class="linenos">2193</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> -</span><span id="Select.join-2194"><a href="#Select.join-2194"><span class="linenos">2194</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2195"><a href="#Select.join-2195"><span class="linenos">2195</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> -</span><span id="Select.join-2196"><a href="#Select.join-2196"><span class="linenos">2196</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2197"><a href="#Select.join-2197"><span class="linenos">2197</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> -</span><span id="Select.join-2198"><a href="#Select.join-2198"><span class="linenos">2198</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.join-2199"><a href="#Select.join-2199"><span class="linenos">2199</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> -</span><span id="Select.join-2200"><a href="#Select.join-2200"><span class="linenos">2200</span></a><span class="sd"> Otherwise, this resets the expressions.</span> -</span><span id="Select.join-2201"><a href="#Select.join-2201"><span class="linenos">2201</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> -</span><span id="Select.join-2202"><a href="#Select.join-2202"><span class="linenos">2202</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select.join-2203"><a href="#Select.join-2203"><span class="linenos">2203</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.join-2204"><a href="#Select.join-2204"><span class="linenos">2204</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.join-2205"><a href="#Select.join-2205"><span class="linenos">2205</span></a> -</span><span id="Select.join-2206"><a href="#Select.join-2206"><span class="linenos">2206</span></a><span class="sd"> Returns:</span> -</span><span id="Select.join-2207"><a href="#Select.join-2207"><span class="linenos">2207</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.join-2208"><a href="#Select.join-2208"><span class="linenos">2208</span></a><span class="sd"> """</span> -</span><span id="Select.join-2209"><a href="#Select.join-2209"><span class="linenos">2209</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> -</span><span id="Select.join-2210"><a href="#Select.join-2210"><span class="linenos">2210</span></a> -</span><span id="Select.join-2211"><a href="#Select.join-2211"><span class="linenos">2211</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="Select.join-2212"><a href="#Select.join-2212"><span class="linenos">2212</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="Select.join-2213"><a href="#Select.join-2213"><span class="linenos">2213</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> -</span><span id="Select.join-2214"><a href="#Select.join-2214"><span class="linenos">2214</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> -</span><span id="Select.join-2215"><a href="#Select.join-2215"><span class="linenos">2215</span></a> -</span><span id="Select.join-2216"><a href="#Select.join-2216"><span class="linenos">2216</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> -</span><span id="Select.join-2217"><a href="#Select.join-2217"><span class="linenos">2217</span></a> -</span><span id="Select.join-2218"><a href="#Select.join-2218"><span class="linenos">2218</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> -</span><span id="Select.join-2219"><a href="#Select.join-2219"><span class="linenos">2219</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> -</span><span id="Select.join-2220"><a href="#Select.join-2220"><span class="linenos">2220</span></a> -</span><span id="Select.join-2221"><a href="#Select.join-2221"><span class="linenos">2221</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> -</span><span id="Select.join-2222"><a href="#Select.join-2222"><span class="linenos">2222</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select.join-2223"><a href="#Select.join-2223"><span class="linenos">2223</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select.join-2224"><a href="#Select.join-2224"><span class="linenos">2224</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> -</span><span id="Select.join-2225"><a href="#Select.join-2225"><span class="linenos">2225</span></a> -</span><span id="Select.join-2226"><a href="#Select.join-2226"><span class="linenos">2226</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.join-2213"><a href="#Select.join-2213"><span class="linenos">2213</span></a> <span class="k">def</span> <span class="nf">join</span><span class="p">(</span> +</span><span id="Select.join-2214"><a href="#Select.join-2214"><span class="linenos">2214</span></a> <span class="bp">self</span><span class="p">,</span> +</span><span id="Select.join-2215"><a href="#Select.join-2215"><span class="linenos">2215</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="Select.join-2216"><a href="#Select.join-2216"><span class="linenos">2216</span></a> <span class="n">on</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2217"><a href="#Select.join-2217"><span class="linenos">2217</span></a> <span class="n">using</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2218"><a href="#Select.join-2218"><span class="linenos">2218</span></a> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Select.join-2219"><a href="#Select.join-2219"><span class="linenos">2219</span></a> <span class="n">join_type</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2220"><a href="#Select.join-2220"><span class="linenos">2220</span></a> <span class="n">join_alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2221"><a href="#Select.join-2221"><span class="linenos">2221</span></a> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> +</span><span id="Select.join-2222"><a href="#Select.join-2222"><span class="linenos">2222</span></a> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> +</span><span id="Select.join-2223"><a href="#Select.join-2223"><span class="linenos">2223</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2224"><a href="#Select.join-2224"><span class="linenos">2224</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.join-2225"><a href="#Select.join-2225"><span class="linenos">2225</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.join-2226"><a href="#Select.join-2226"><span class="linenos">2226</span></a><span class="sd"> Append to or set the JOIN expressions.</span> </span><span id="Select.join-2227"><a href="#Select.join-2227"><span class="linenos">2227</span></a> -</span><span id="Select.join-2228"><a href="#Select.join-2228"><span class="linenos">2228</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> -</span><span id="Select.join-2229"><a href="#Select.join-2229"><span class="linenos">2229</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> -</span><span id="Select.join-2230"><a href="#Select.join-2230"><span class="linenos">2230</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> -</span><span id="Select.join-2231"><a href="#Select.join-2231"><span class="linenos">2231</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> -</span><span id="Select.join-2232"><a href="#Select.join-2232"><span class="linenos">2232</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> -</span><span id="Select.join-2233"><a href="#Select.join-2233"><span class="linenos">2233</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select.join-2228"><a href="#Select.join-2228"><span class="linenos">2228</span></a><span class="sd"> Example:</span> +</span><span id="Select.join-2229"><a href="#Select.join-2229"><span class="linenos">2229</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()</span> +</span><span id="Select.join-2230"><a href="#Select.join-2230"><span class="linenos">2230</span></a><span class="sd"> 'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select.join-2231"><a href="#Select.join-2231"><span class="linenos">2231</span></a> +</span><span id="Select.join-2232"><a href="#Select.join-2232"><span class="linenos">2232</span></a><span class="sd"> >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()</span> +</span><span id="Select.join-2233"><a href="#Select.join-2233"><span class="linenos">2233</span></a><span class="sd"> 'SELECT 1 FROM a JOIN b USING (x, y, z)'</span> </span><span id="Select.join-2234"><a href="#Select.join-2234"><span class="linenos">2234</span></a> -</span><span id="Select.join-2235"><a href="#Select.join-2235"><span class="linenos">2235</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> -</span><span id="Select.join-2236"><a href="#Select.join-2236"><span class="linenos">2236</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="Select.join-2237"><a href="#Select.join-2237"><span class="linenos">2237</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> -</span><span id="Select.join-2238"><a href="#Select.join-2238"><span class="linenos">2238</span></a> -</span><span id="Select.join-2239"><a href="#Select.join-2239"><span class="linenos">2239</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> -</span><span id="Select.join-2240"><a href="#Select.join-2240"><span class="linenos">2240</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.join-2241"><a href="#Select.join-2241"><span class="linenos">2241</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> -</span><span id="Select.join-2242"><a href="#Select.join-2242"><span class="linenos">2242</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> -</span><span id="Select.join-2243"><a href="#Select.join-2243"><span class="linenos">2243</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> -</span><span id="Select.join-2244"><a href="#Select.join-2244"><span class="linenos">2244</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.join-2245"><a href="#Select.join-2245"><span class="linenos">2245</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.join-2246"><a href="#Select.join-2246"><span class="linenos">2246</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2247"><a href="#Select.join-2247"><span class="linenos">2247</span></a> <span class="p">)</span> -</span><span id="Select.join-2248"><a href="#Select.join-2248"><span class="linenos">2248</span></a> -</span><span id="Select.join-2249"><a href="#Select.join-2249"><span class="linenos">2249</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> -</span><span id="Select.join-2250"><a href="#Select.join-2250"><span class="linenos">2250</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> -</span><span id="Select.join-2251"><a href="#Select.join-2251"><span class="linenos">2251</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.join-2252"><a href="#Select.join-2252"><span class="linenos">2252</span></a> <span class="n">join</span><span class="p">,</span> -</span><span id="Select.join-2253"><a href="#Select.join-2253"><span class="linenos">2253</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.join-2254"><a href="#Select.join-2254"><span class="linenos">2254</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> -</span><span id="Select.join-2255"><a href="#Select.join-2255"><span class="linenos">2255</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.join-2256"><a href="#Select.join-2256"><span class="linenos">2256</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.join-2257"><a href="#Select.join-2257"><span class="linenos">2257</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.join-2258"><a href="#Select.join-2258"><span class="linenos">2258</span></a> <span class="p">)</span> +</span><span id="Select.join-2235"><a href="#Select.join-2235"><span class="linenos">2235</span></a><span class="sd"> Use `join_type` to change the type of join:</span> +</span><span id="Select.join-2236"><a href="#Select.join-2236"><span class="linenos">2236</span></a> +</span><span id="Select.join-2237"><a href="#Select.join-2237"><span class="linenos">2237</span></a><span class="sd"> >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()</span> +</span><span id="Select.join-2238"><a href="#Select.join-2238"><span class="linenos">2238</span></a><span class="sd"> 'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'</span> +</span><span id="Select.join-2239"><a href="#Select.join-2239"><span class="linenos">2239</span></a> +</span><span id="Select.join-2240"><a href="#Select.join-2240"><span class="linenos">2240</span></a><span class="sd"> Args:</span> +</span><span id="Select.join-2241"><a href="#Select.join-2241"><span class="linenos">2241</span></a><span class="sd"> expression (str | Expression): the SQL code string to parse.</span> +</span><span id="Select.join-2242"><a href="#Select.join-2242"><span class="linenos">2242</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.join-2243"><a href="#Select.join-2243"><span class="linenos">2243</span></a><span class="sd"> on (str | Expression): optionally specify the join "on" criteria as a SQL string.</span> +</span><span id="Select.join-2244"><a href="#Select.join-2244"><span class="linenos">2244</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.join-2245"><a href="#Select.join-2245"><span class="linenos">2245</span></a><span class="sd"> using (str | Expression): optionally specify the join "using" criteria as a SQL string.</span> +</span><span id="Select.join-2246"><a href="#Select.join-2246"><span class="linenos">2246</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.join-2247"><a href="#Select.join-2247"><span class="linenos">2247</span></a><span class="sd"> append (bool): if `True`, add to any existing expressions.</span> +</span><span id="Select.join-2248"><a href="#Select.join-2248"><span class="linenos">2248</span></a><span class="sd"> Otherwise, this resets the expressions.</span> +</span><span id="Select.join-2249"><a href="#Select.join-2249"><span class="linenos">2249</span></a><span class="sd"> join_type (str): If set, alter the parsed join type</span> +</span><span id="Select.join-2250"><a href="#Select.join-2250"><span class="linenos">2250</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select.join-2251"><a href="#Select.join-2251"><span class="linenos">2251</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.join-2252"><a href="#Select.join-2252"><span class="linenos">2252</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.join-2253"><a href="#Select.join-2253"><span class="linenos">2253</span></a> +</span><span id="Select.join-2254"><a href="#Select.join-2254"><span class="linenos">2254</span></a><span class="sd"> Returns:</span> +</span><span id="Select.join-2255"><a href="#Select.join-2255"><span class="linenos">2255</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.join-2256"><a href="#Select.join-2256"><span class="linenos">2256</span></a><span class="sd"> """</span> +</span><span id="Select.join-2257"><a href="#Select.join-2257"><span class="linenos">2257</span></a> <span class="n">parse_args</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"dialect"</span><span class="p">:</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">}</span> +</span><span id="Select.join-2258"><a href="#Select.join-2258"><span class="linenos">2258</span></a> +</span><span id="Select.join-2259"><a href="#Select.join-2259"><span class="linenos">2259</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="Select.join-2260"><a href="#Select.join-2260"><span class="linenos">2260</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Join</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"JOIN"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> +</span><span id="Select.join-2261"><a href="#Select.join-2261"><span class="linenos">2261</span></a> <span class="k">except</span> <span class="n">ParseError</span><span class="p">:</span> +</span><span id="Select.join-2262"><a href="#Select.join-2262"><span class="linenos">2262</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="p">(</span><span class="n">Join</span><span class="p">,</span> <span class="n">Expression</span><span class="p">),</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> +</span><span id="Select.join-2263"><a href="#Select.join-2263"><span class="linenos">2263</span></a> +</span><span id="Select.join-2264"><a href="#Select.join-2264"><span class="linenos">2264</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">expression</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Join</span><span class="p">)</span> <span class="k">else</span> <span class="n">Join</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> +</span><span id="Select.join-2265"><a href="#Select.join-2265"><span class="linenos">2265</span></a> +</span><span id="Select.join-2266"><a href="#Select.join-2266"><span class="linenos">2266</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">Select</span><span class="p">):</span> +</span><span id="Select.join-2267"><a href="#Select.join-2267"><span class="linenos">2267</span></a> <span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">subquery</span><span class="p">())</span> +</span><span id="Select.join-2268"><a href="#Select.join-2268"><span class="linenos">2268</span></a> +</span><span id="Select.join-2269"><a href="#Select.join-2269"><span class="linenos">2269</span></a> <span class="k">if</span> <span class="n">join_type</span><span class="p">:</span> +</span><span id="Select.join-2270"><a href="#Select.join-2270"><span class="linenos">2270</span></a> <span class="n">natural</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select.join-2271"><a href="#Select.join-2271"><span class="linenos">2271</span></a> <span class="n">side</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select.join-2272"><a href="#Select.join-2272"><span class="linenos">2272</span></a> <span class="n">kind</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Token</span><span class="p">]</span> +</span><span id="Select.join-2273"><a href="#Select.join-2273"><span class="linenos">2273</span></a> +</span><span id="Select.join-2274"><a href="#Select.join-2274"><span class="linenos">2274</span></a> <span class="n">natural</span><span class="p">,</span> <span class="n">side</span><span class="p">,</span> <span class="n">kind</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">join_type</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="s2">"JOIN_TYPE"</span><span class="p">,</span> <span class="o">**</span><span class="n">parse_args</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="Select.join-2275"><a href="#Select.join-2275"><span class="linenos">2275</span></a> +</span><span id="Select.join-2276"><a href="#Select.join-2276"><span class="linenos">2276</span></a> <span class="k">if</span> <span class="n">natural</span><span class="p">:</span> +</span><span id="Select.join-2277"><a href="#Select.join-2277"><span class="linenos">2277</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"natural"</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span> +</span><span id="Select.join-2278"><a href="#Select.join-2278"><span class="linenos">2278</span></a> <span class="k">if</span> <span class="n">side</span><span class="p">:</span> +</span><span id="Select.join-2279"><a href="#Select.join-2279"><span class="linenos">2279</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"side"</span><span class="p">,</span> <span class="n">side</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select.join-2280"><a href="#Select.join-2280"><span class="linenos">2280</span></a> <span class="k">if</span> <span class="n">kind</span><span class="p">:</span> +</span><span id="Select.join-2281"><a href="#Select.join-2281"><span class="linenos">2281</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"kind"</span><span class="p">,</span> <span class="n">kind</span><span class="o">.</span><span class="n">text</span><span class="p">)</span> +</span><span id="Select.join-2282"><a href="#Select.join-2282"><span class="linenos">2282</span></a> +</span><span id="Select.join-2283"><a href="#Select.join-2283"><span class="linenos">2283</span></a> <span class="k">if</span> <span class="n">on</span><span class="p">:</span> +</span><span id="Select.join-2284"><a href="#Select.join-2284"><span class="linenos">2284</span></a> <span class="n">on</span> <span class="o">=</span> <span class="n">and_</span><span class="p">(</span><span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">on</span><span class="p">),</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="Select.join-2285"><a href="#Select.join-2285"><span class="linenos">2285</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"on"</span><span class="p">,</span> <span class="n">on</span><span class="p">)</span> +</span><span id="Select.join-2286"><a href="#Select.join-2286"><span class="linenos">2286</span></a> +</span><span id="Select.join-2287"><a href="#Select.join-2287"><span class="linenos">2287</span></a> <span class="k">if</span> <span class="n">using</span><span class="p">:</span> +</span><span id="Select.join-2288"><a href="#Select.join-2288"><span class="linenos">2288</span></a> <span class="n">join</span> <span class="o">=</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.join-2289"><a href="#Select.join-2289"><span class="linenos">2289</span></a> <span class="o">*</span><span class="n">ensure_collection</span><span class="p">(</span><span class="n">using</span><span class="p">),</span> +</span><span id="Select.join-2290"><a href="#Select.join-2290"><span class="linenos">2290</span></a> <span class="n">instance</span><span class="o">=</span><span class="n">join</span><span class="p">,</span> +</span><span id="Select.join-2291"><a href="#Select.join-2291"><span class="linenos">2291</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"using"</span><span class="p">,</span> +</span><span id="Select.join-2292"><a href="#Select.join-2292"><span class="linenos">2292</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.join-2293"><a href="#Select.join-2293"><span class="linenos">2293</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.join-2294"><a href="#Select.join-2294"><span class="linenos">2294</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2295"><a href="#Select.join-2295"><span class="linenos">2295</span></a> <span class="p">)</span> +</span><span id="Select.join-2296"><a href="#Select.join-2296"><span class="linenos">2296</span></a> +</span><span id="Select.join-2297"><a href="#Select.join-2297"><span class="linenos">2297</span></a> <span class="k">if</span> <span class="n">join_alias</span><span class="p">:</span> +</span><span id="Select.join-2298"><a href="#Select.join-2298"><span class="linenos">2298</span></a> <span class="n">join</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">alias_</span><span class="p">(</span><span class="n">join</span><span class="o">.</span><span class="n">this</span><span class="p">,</span> <span class="n">join_alias</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> +</span><span id="Select.join-2299"><a href="#Select.join-2299"><span class="linenos">2299</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.join-2300"><a href="#Select.join-2300"><span class="linenos">2300</span></a> <span class="n">join</span><span class="p">,</span> +</span><span id="Select.join-2301"><a href="#Select.join-2301"><span class="linenos">2301</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.join-2302"><a href="#Select.join-2302"><span class="linenos">2302</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"joins"</span><span class="p">,</span> +</span><span id="Select.join-2303"><a href="#Select.join-2303"><span class="linenos">2303</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.join-2304"><a href="#Select.join-2304"><span class="linenos">2304</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.join-2305"><a href="#Select.join-2305"><span class="linenos">2305</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.join-2306"><a href="#Select.join-2306"><span class="linenos">2306</span></a> <span class="p">)</span> </span></pre></div> @@ -20723,37 +21511,37 @@ Otherwise, this resets the expressions.</li> </div> <a class="headerlink" href="#Select.where"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.where-2260"><a href="#Select.where-2260"><span class="linenos">2260</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.where-2261"><a href="#Select.where-2261"><span class="linenos">2261</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.where-2262"><a href="#Select.where-2262"><span class="linenos">2262</span></a><span class="sd"> Append to or set the WHERE expressions.</span> -</span><span id="Select.where-2263"><a href="#Select.where-2263"><span class="linenos">2263</span></a> -</span><span id="Select.where-2264"><a href="#Select.where-2264"><span class="linenos">2264</span></a><span class="sd"> Example:</span> -</span><span id="Select.where-2265"><a href="#Select.where-2265"><span class="linenos">2265</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> -</span><span id="Select.where-2266"><a href="#Select.where-2266"><span class="linenos">2266</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> -</span><span id="Select.where-2267"><a href="#Select.where-2267"><span class="linenos">2267</span></a> -</span><span id="Select.where-2268"><a href="#Select.where-2268"><span class="linenos">2268</span></a><span class="sd"> Args:</span> -</span><span id="Select.where-2269"><a href="#Select.where-2269"><span class="linenos">2269</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.where-2270"><a href="#Select.where-2270"><span class="linenos">2270</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.where-2271"><a href="#Select.where-2271"><span class="linenos">2271</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select.where-2272"><a href="#Select.where-2272"><span class="linenos">2272</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select.where-2273"><a href="#Select.where-2273"><span class="linenos">2273</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select.where-2274"><a href="#Select.where-2274"><span class="linenos">2274</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select.where-2275"><a href="#Select.where-2275"><span class="linenos">2275</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.where-2276"><a href="#Select.where-2276"><span class="linenos">2276</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.where-2277"><a href="#Select.where-2277"><span class="linenos">2277</span></a> -</span><span id="Select.where-2278"><a href="#Select.where-2278"><span class="linenos">2278</span></a><span class="sd"> Returns:</span> -</span><span id="Select.where-2279"><a href="#Select.where-2279"><span class="linenos">2279</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.where-2280"><a href="#Select.where-2280"><span class="linenos">2280</span></a><span class="sd"> """</span> -</span><span id="Select.where-2281"><a href="#Select.where-2281"><span class="linenos">2281</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select.where-2282"><a href="#Select.where-2282"><span class="linenos">2282</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.where-2283"><a href="#Select.where-2283"><span class="linenos">2283</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.where-2284"><a href="#Select.where-2284"><span class="linenos">2284</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> -</span><span id="Select.where-2285"><a href="#Select.where-2285"><span class="linenos">2285</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.where-2286"><a href="#Select.where-2286"><span class="linenos">2286</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> -</span><span id="Select.where-2287"><a href="#Select.where-2287"><span class="linenos">2287</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.where-2288"><a href="#Select.where-2288"><span class="linenos">2288</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.where-2289"><a href="#Select.where-2289"><span class="linenos">2289</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.where-2290"><a href="#Select.where-2290"><span class="linenos">2290</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.where-2308"><a href="#Select.where-2308"><span class="linenos">2308</span></a> <span class="k">def</span> <span class="nf">where</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.where-2309"><a href="#Select.where-2309"><span class="linenos">2309</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.where-2310"><a href="#Select.where-2310"><span class="linenos">2310</span></a><span class="sd"> Append to or set the WHERE expressions.</span> +</span><span id="Select.where-2311"><a href="#Select.where-2311"><span class="linenos">2311</span></a> +</span><span id="Select.where-2312"><a href="#Select.where-2312"><span class="linenos">2312</span></a><span class="sd"> Example:</span> +</span><span id="Select.where-2313"><a href="#Select.where-2313"><span class="linenos">2313</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()</span> +</span><span id="Select.where-2314"><a href="#Select.where-2314"><span class="linenos">2314</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"</span> +</span><span id="Select.where-2315"><a href="#Select.where-2315"><span class="linenos">2315</span></a> +</span><span id="Select.where-2316"><a href="#Select.where-2316"><span class="linenos">2316</span></a><span class="sd"> Args:</span> +</span><span id="Select.where-2317"><a href="#Select.where-2317"><span class="linenos">2317</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.where-2318"><a href="#Select.where-2318"><span class="linenos">2318</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.where-2319"><a href="#Select.where-2319"><span class="linenos">2319</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select.where-2320"><a href="#Select.where-2320"><span class="linenos">2320</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select.where-2321"><a href="#Select.where-2321"><span class="linenos">2321</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select.where-2322"><a href="#Select.where-2322"><span class="linenos">2322</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select.where-2323"><a href="#Select.where-2323"><span class="linenos">2323</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.where-2324"><a href="#Select.where-2324"><span class="linenos">2324</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.where-2325"><a href="#Select.where-2325"><span class="linenos">2325</span></a> +</span><span id="Select.where-2326"><a href="#Select.where-2326"><span class="linenos">2326</span></a><span class="sd"> Returns:</span> +</span><span id="Select.where-2327"><a href="#Select.where-2327"><span class="linenos">2327</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.where-2328"><a href="#Select.where-2328"><span class="linenos">2328</span></a><span class="sd"> """</span> +</span><span id="Select.where-2329"><a href="#Select.where-2329"><span class="linenos">2329</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select.where-2330"><a href="#Select.where-2330"><span class="linenos">2330</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.where-2331"><a href="#Select.where-2331"><span class="linenos">2331</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.where-2332"><a href="#Select.where-2332"><span class="linenos">2332</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"where"</span><span class="p">,</span> +</span><span id="Select.where-2333"><a href="#Select.where-2333"><span class="linenos">2333</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.where-2334"><a href="#Select.where-2334"><span class="linenos">2334</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> +</span><span id="Select.where-2335"><a href="#Select.where-2335"><span class="linenos">2335</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.where-2336"><a href="#Select.where-2336"><span class="linenos">2336</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.where-2337"><a href="#Select.where-2337"><span class="linenos">2337</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.where-2338"><a href="#Select.where-2338"><span class="linenos">2338</span></a> <span class="p">)</span> </span></pre></div> @@ -20802,37 +21590,37 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Select.having"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.having-2292"><a href="#Select.having-2292"><span class="linenos">2292</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.having-2293"><a href="#Select.having-2293"><span class="linenos">2293</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.having-2294"><a href="#Select.having-2294"><span class="linenos">2294</span></a><span class="sd"> Append to or set the HAVING expressions.</span> -</span><span id="Select.having-2295"><a href="#Select.having-2295"><span class="linenos">2295</span></a> -</span><span id="Select.having-2296"><a href="#Select.having-2296"><span class="linenos">2296</span></a><span class="sd"> Example:</span> -</span><span id="Select.having-2297"><a href="#Select.having-2297"><span class="linenos">2297</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> -</span><span id="Select.having-2298"><a href="#Select.having-2298"><span class="linenos">2298</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> -</span><span id="Select.having-2299"><a href="#Select.having-2299"><span class="linenos">2299</span></a> -</span><span id="Select.having-2300"><a href="#Select.having-2300"><span class="linenos">2300</span></a><span class="sd"> Args:</span> -</span><span id="Select.having-2301"><a href="#Select.having-2301"><span class="linenos">2301</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="Select.having-2302"><a href="#Select.having-2302"><span class="linenos">2302</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.having-2303"><a href="#Select.having-2303"><span class="linenos">2303</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> -</span><span id="Select.having-2304"><a href="#Select.having-2304"><span class="linenos">2304</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> -</span><span id="Select.having-2305"><a href="#Select.having-2305"><span class="linenos">2305</span></a><span class="sd"> Otherwise, this resets the expression.</span> -</span><span id="Select.having-2306"><a href="#Select.having-2306"><span class="linenos">2306</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="Select.having-2307"><a href="#Select.having-2307"><span class="linenos">2307</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.having-2308"><a href="#Select.having-2308"><span class="linenos">2308</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="Select.having-2309"><a href="#Select.having-2309"><span class="linenos">2309</span></a> -</span><span id="Select.having-2310"><a href="#Select.having-2310"><span class="linenos">2310</span></a><span class="sd"> Returns:</span> -</span><span id="Select.having-2311"><a href="#Select.having-2311"><span class="linenos">2311</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.having-2312"><a href="#Select.having-2312"><span class="linenos">2312</span></a><span class="sd"> """</span> -</span><span id="Select.having-2313"><a href="#Select.having-2313"><span class="linenos">2313</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> -</span><span id="Select.having-2314"><a href="#Select.having-2314"><span class="linenos">2314</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.having-2315"><a href="#Select.having-2315"><span class="linenos">2315</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.having-2316"><a href="#Select.having-2316"><span class="linenos">2316</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> -</span><span id="Select.having-2317"><a href="#Select.having-2317"><span class="linenos">2317</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.having-2318"><a href="#Select.having-2318"><span class="linenos">2318</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> -</span><span id="Select.having-2319"><a href="#Select.having-2319"><span class="linenos">2319</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.having-2320"><a href="#Select.having-2320"><span class="linenos">2320</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.having-2321"><a href="#Select.having-2321"><span class="linenos">2321</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.having-2322"><a href="#Select.having-2322"><span class="linenos">2322</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.having-2340"><a href="#Select.having-2340"><span class="linenos">2340</span></a> <span class="k">def</span> <span class="nf">having</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.having-2341"><a href="#Select.having-2341"><span class="linenos">2341</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.having-2342"><a href="#Select.having-2342"><span class="linenos">2342</span></a><span class="sd"> Append to or set the HAVING expressions.</span> +</span><span id="Select.having-2343"><a href="#Select.having-2343"><span class="linenos">2343</span></a> +</span><span id="Select.having-2344"><a href="#Select.having-2344"><span class="linenos">2344</span></a><span class="sd"> Example:</span> +</span><span id="Select.having-2345"><a href="#Select.having-2345"><span class="linenos">2345</span></a><span class="sd"> >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()</span> +</span><span id="Select.having-2346"><a href="#Select.having-2346"><span class="linenos">2346</span></a><span class="sd"> 'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'</span> +</span><span id="Select.having-2347"><a href="#Select.having-2347"><span class="linenos">2347</span></a> +</span><span id="Select.having-2348"><a href="#Select.having-2348"><span class="linenos">2348</span></a><span class="sd"> Args:</span> +</span><span id="Select.having-2349"><a href="#Select.having-2349"><span class="linenos">2349</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="Select.having-2350"><a href="#Select.having-2350"><span class="linenos">2350</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.having-2351"><a href="#Select.having-2351"><span class="linenos">2351</span></a><span class="sd"> Multiple expressions are combined with an AND operator.</span> +</span><span id="Select.having-2352"><a href="#Select.having-2352"><span class="linenos">2352</span></a><span class="sd"> append (bool): if `True`, AND the new expressions to any existing expression.</span> +</span><span id="Select.having-2353"><a href="#Select.having-2353"><span class="linenos">2353</span></a><span class="sd"> Otherwise, this resets the expression.</span> +</span><span id="Select.having-2354"><a href="#Select.having-2354"><span class="linenos">2354</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="Select.having-2355"><a href="#Select.having-2355"><span class="linenos">2355</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.having-2356"><a href="#Select.having-2356"><span class="linenos">2356</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="Select.having-2357"><a href="#Select.having-2357"><span class="linenos">2357</span></a> +</span><span id="Select.having-2358"><a href="#Select.having-2358"><span class="linenos">2358</span></a><span class="sd"> Returns:</span> +</span><span id="Select.having-2359"><a href="#Select.having-2359"><span class="linenos">2359</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.having-2360"><a href="#Select.having-2360"><span class="linenos">2360</span></a><span class="sd"> """</span> +</span><span id="Select.having-2361"><a href="#Select.having-2361"><span class="linenos">2361</span></a> <span class="k">return</span> <span class="n">_apply_conjunction_builder</span><span class="p">(</span> +</span><span id="Select.having-2362"><a href="#Select.having-2362"><span class="linenos">2362</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.having-2363"><a href="#Select.having-2363"><span class="linenos">2363</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.having-2364"><a href="#Select.having-2364"><span class="linenos">2364</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"having"</span><span class="p">,</span> +</span><span id="Select.having-2365"><a href="#Select.having-2365"><span class="linenos">2365</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.having-2366"><a href="#Select.having-2366"><span class="linenos">2366</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Having</span><span class="p">,</span> +</span><span id="Select.having-2367"><a href="#Select.having-2367"><span class="linenos">2367</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.having-2368"><a href="#Select.having-2368"><span class="linenos">2368</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.having-2369"><a href="#Select.having-2369"><span class="linenos">2369</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.having-2370"><a href="#Select.having-2370"><span class="linenos">2370</span></a> <span class="p">)</span> </span></pre></div> @@ -20881,17 +21669,17 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Select.window"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.window-2324"><a href="#Select.window-2324"><span class="linenos">2324</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.window-2325"><a href="#Select.window-2325"><span class="linenos">2325</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> -</span><span id="Select.window-2326"><a href="#Select.window-2326"><span class="linenos">2326</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="Select.window-2327"><a href="#Select.window-2327"><span class="linenos">2327</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> -</span><span id="Select.window-2328"><a href="#Select.window-2328"><span class="linenos">2328</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> -</span><span id="Select.window-2329"><a href="#Select.window-2329"><span class="linenos">2329</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> -</span><span id="Select.window-2330"><a href="#Select.window-2330"><span class="linenos">2330</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> -</span><span id="Select.window-2331"><a href="#Select.window-2331"><span class="linenos">2331</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.window-2332"><a href="#Select.window-2332"><span class="linenos">2332</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> -</span><span id="Select.window-2333"><a href="#Select.window-2333"><span class="linenos">2333</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.window-2334"><a href="#Select.window-2334"><span class="linenos">2334</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.window-2372"><a href="#Select.window-2372"><span class="linenos">2372</span></a> <span class="k">def</span> <span class="nf">window</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">append</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.window-2373"><a href="#Select.window-2373"><span class="linenos">2373</span></a> <span class="k">return</span> <span class="n">_apply_list_builder</span><span class="p">(</span> +</span><span id="Select.window-2374"><a href="#Select.window-2374"><span class="linenos">2374</span></a> <span class="o">*</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="Select.window-2375"><a href="#Select.window-2375"><span class="linenos">2375</span></a> <span class="n">instance</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> +</span><span id="Select.window-2376"><a href="#Select.window-2376"><span class="linenos">2376</span></a> <span class="n">arg</span><span class="o">=</span><span class="s2">"windows"</span><span class="p">,</span> +</span><span id="Select.window-2377"><a href="#Select.window-2377"><span class="linenos">2377</span></a> <span class="n">append</span><span class="o">=</span><span class="n">append</span><span class="p">,</span> +</span><span id="Select.window-2378"><a href="#Select.window-2378"><span class="linenos">2378</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Window</span><span class="p">,</span> +</span><span id="Select.window-2379"><a href="#Select.window-2379"><span class="linenos">2379</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.window-2380"><a href="#Select.window-2380"><span class="linenos">2380</span></a> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">,</span> +</span><span id="Select.window-2381"><a href="#Select.window-2381"><span class="linenos">2381</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.window-2382"><a href="#Select.window-2382"><span class="linenos">2382</span></a> <span class="p">)</span> </span></pre></div> @@ -20909,24 +21697,24 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Select.distinct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.distinct-2336"><a href="#Select.distinct-2336"><span class="linenos">2336</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.distinct-2337"><a href="#Select.distinct-2337"><span class="linenos">2337</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.distinct-2338"><a href="#Select.distinct-2338"><span class="linenos">2338</span></a><span class="sd"> Set the OFFSET expression.</span> -</span><span id="Select.distinct-2339"><a href="#Select.distinct-2339"><span class="linenos">2339</span></a> -</span><span id="Select.distinct-2340"><a href="#Select.distinct-2340"><span class="linenos">2340</span></a><span class="sd"> Example:</span> -</span><span id="Select.distinct-2341"><a href="#Select.distinct-2341"><span class="linenos">2341</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> -</span><span id="Select.distinct-2342"><a href="#Select.distinct-2342"><span class="linenos">2342</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> -</span><span id="Select.distinct-2343"><a href="#Select.distinct-2343"><span class="linenos">2343</span></a> -</span><span id="Select.distinct-2344"><a href="#Select.distinct-2344"><span class="linenos">2344</span></a><span class="sd"> Args:</span> -</span><span id="Select.distinct-2345"><a href="#Select.distinct-2345"><span class="linenos">2345</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> -</span><span id="Select.distinct-2346"><a href="#Select.distinct-2346"><span class="linenos">2346</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.distinct-2347"><a href="#Select.distinct-2347"><span class="linenos">2347</span></a> -</span><span id="Select.distinct-2348"><a href="#Select.distinct-2348"><span class="linenos">2348</span></a><span class="sd"> Returns:</span> -</span><span id="Select.distinct-2349"><a href="#Select.distinct-2349"><span class="linenos">2349</span></a><span class="sd"> Select: the modified expression.</span> -</span><span id="Select.distinct-2350"><a href="#Select.distinct-2350"><span class="linenos">2350</span></a><span class="sd"> """</span> -</span><span id="Select.distinct-2351"><a href="#Select.distinct-2351"><span class="linenos">2351</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select.distinct-2352"><a href="#Select.distinct-2352"><span class="linenos">2352</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="Select.distinct-2353"><a href="#Select.distinct-2353"><span class="linenos">2353</span></a> <span class="k">return</span> <span class="n">instance</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.distinct-2384"><a href="#Select.distinct-2384"><span class="linenos">2384</span></a> <span class="k">def</span> <span class="nf">distinct</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.distinct-2385"><a href="#Select.distinct-2385"><span class="linenos">2385</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.distinct-2386"><a href="#Select.distinct-2386"><span class="linenos">2386</span></a><span class="sd"> Set the OFFSET expression.</span> +</span><span id="Select.distinct-2387"><a href="#Select.distinct-2387"><span class="linenos">2387</span></a> +</span><span id="Select.distinct-2388"><a href="#Select.distinct-2388"><span class="linenos">2388</span></a><span class="sd"> Example:</span> +</span><span id="Select.distinct-2389"><a href="#Select.distinct-2389"><span class="linenos">2389</span></a><span class="sd"> >>> Select().from_("tbl").select("x").distinct().sql()</span> +</span><span id="Select.distinct-2390"><a href="#Select.distinct-2390"><span class="linenos">2390</span></a><span class="sd"> 'SELECT DISTINCT x FROM tbl'</span> +</span><span id="Select.distinct-2391"><a href="#Select.distinct-2391"><span class="linenos">2391</span></a> +</span><span id="Select.distinct-2392"><a href="#Select.distinct-2392"><span class="linenos">2392</span></a><span class="sd"> Args:</span> +</span><span id="Select.distinct-2393"><a href="#Select.distinct-2393"><span class="linenos">2393</span></a><span class="sd"> distinct (bool): whether the Select should be distinct</span> +</span><span id="Select.distinct-2394"><a href="#Select.distinct-2394"><span class="linenos">2394</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.distinct-2395"><a href="#Select.distinct-2395"><span class="linenos">2395</span></a> +</span><span id="Select.distinct-2396"><a href="#Select.distinct-2396"><span class="linenos">2396</span></a><span class="sd"> Returns:</span> +</span><span id="Select.distinct-2397"><a href="#Select.distinct-2397"><span class="linenos">2397</span></a><span class="sd"> Select: the modified expression.</span> +</span><span id="Select.distinct-2398"><a href="#Select.distinct-2398"><span class="linenos">2398</span></a><span class="sd"> """</span> +</span><span id="Select.distinct-2399"><a href="#Select.distinct-2399"><span class="linenos">2399</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select.distinct-2400"><a href="#Select.distinct-2400"><span class="linenos">2400</span></a> <span class="n">instance</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"distinct"</span><span class="p">,</span> <span class="n">Distinct</span><span class="p">()</span> <span class="k">if</span> <span class="n">distinct</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="Select.distinct-2401"><a href="#Select.distinct-2401"><span class="linenos">2401</span></a> <span class="k">return</span> <span class="n">instance</span> </span></pre></div> @@ -20969,42 +21757,42 @@ Otherwise, this resets the expression.</li> </div> <a class="headerlink" href="#Select.ctas"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.ctas-2355"><a href="#Select.ctas-2355"><span class="linenos">2355</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> -</span><span id="Select.ctas-2356"><a href="#Select.ctas-2356"><span class="linenos">2356</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.ctas-2357"><a href="#Select.ctas-2357"><span class="linenos">2357</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> -</span><span id="Select.ctas-2358"><a href="#Select.ctas-2358"><span class="linenos">2358</span></a> -</span><span id="Select.ctas-2359"><a href="#Select.ctas-2359"><span class="linenos">2359</span></a><span class="sd"> Example:</span> -</span><span id="Select.ctas-2360"><a href="#Select.ctas-2360"><span class="linenos">2360</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> -</span><span id="Select.ctas-2361"><a href="#Select.ctas-2361"><span class="linenos">2361</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> -</span><span id="Select.ctas-2362"><a href="#Select.ctas-2362"><span class="linenos">2362</span></a> -</span><span id="Select.ctas-2363"><a href="#Select.ctas-2363"><span class="linenos">2363</span></a><span class="sd"> Args:</span> -</span><span id="Select.ctas-2364"><a href="#Select.ctas-2364"><span class="linenos">2364</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> -</span><span id="Select.ctas-2365"><a href="#Select.ctas-2365"><span class="linenos">2365</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> -</span><span id="Select.ctas-2366"><a href="#Select.ctas-2366"><span class="linenos">2366</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> -</span><span id="Select.ctas-2367"><a href="#Select.ctas-2367"><span class="linenos">2367</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> -</span><span id="Select.ctas-2368"><a href="#Select.ctas-2368"><span class="linenos">2368</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> -</span><span id="Select.ctas-2369"><a href="#Select.ctas-2369"><span class="linenos">2369</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> -</span><span id="Select.ctas-2370"><a href="#Select.ctas-2370"><span class="linenos">2370</span></a> -</span><span id="Select.ctas-2371"><a href="#Select.ctas-2371"><span class="linenos">2371</span></a><span class="sd"> Returns:</span> -</span><span id="Select.ctas-2372"><a href="#Select.ctas-2372"><span class="linenos">2372</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> -</span><span id="Select.ctas-2373"><a href="#Select.ctas-2373"><span class="linenos">2373</span></a><span class="sd"> """</span> -</span><span id="Select.ctas-2374"><a href="#Select.ctas-2374"><span class="linenos">2374</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select.ctas-2375"><a href="#Select.ctas-2375"><span class="linenos">2375</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> -</span><span id="Select.ctas-2376"><a href="#Select.ctas-2376"><span class="linenos">2376</span></a> <span class="n">table</span><span class="p">,</span> -</span><span id="Select.ctas-2377"><a href="#Select.ctas-2377"><span class="linenos">2377</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> -</span><span id="Select.ctas-2378"><a href="#Select.ctas-2378"><span class="linenos">2378</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="Select.ctas-2379"><a href="#Select.ctas-2379"><span class="linenos">2379</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="Select.ctas-2380"><a href="#Select.ctas-2380"><span class="linenos">2380</span></a> <span class="p">)</span> -</span><span id="Select.ctas-2381"><a href="#Select.ctas-2381"><span class="linenos">2381</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> -</span><span id="Select.ctas-2382"><a href="#Select.ctas-2382"><span class="linenos">2382</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> -</span><span id="Select.ctas-2383"><a href="#Select.ctas-2383"><span class="linenos">2383</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> -</span><span id="Select.ctas-2384"><a href="#Select.ctas-2384"><span class="linenos">2384</span></a> -</span><span id="Select.ctas-2385"><a href="#Select.ctas-2385"><span class="linenos">2385</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> -</span><span id="Select.ctas-2386"><a href="#Select.ctas-2386"><span class="linenos">2386</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> -</span><span id="Select.ctas-2387"><a href="#Select.ctas-2387"><span class="linenos">2387</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> -</span><span id="Select.ctas-2388"><a href="#Select.ctas-2388"><span class="linenos">2388</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> -</span><span id="Select.ctas-2389"><a href="#Select.ctas-2389"><span class="linenos">2389</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> -</span><span id="Select.ctas-2390"><a href="#Select.ctas-2390"><span class="linenos">2390</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.ctas-2403"><a href="#Select.ctas-2403"><span class="linenos">2403</span></a> <span class="k">def</span> <span class="nf">ctas</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Create</span><span class="p">:</span> +</span><span id="Select.ctas-2404"><a href="#Select.ctas-2404"><span class="linenos">2404</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.ctas-2405"><a href="#Select.ctas-2405"><span class="linenos">2405</span></a><span class="sd"> Convert this expression to a CREATE TABLE AS statement.</span> +</span><span id="Select.ctas-2406"><a href="#Select.ctas-2406"><span class="linenos">2406</span></a> +</span><span id="Select.ctas-2407"><a href="#Select.ctas-2407"><span class="linenos">2407</span></a><span class="sd"> Example:</span> +</span><span id="Select.ctas-2408"><a href="#Select.ctas-2408"><span class="linenos">2408</span></a><span class="sd"> >>> Select().select("*").from_("tbl").ctas("x").sql()</span> +</span><span id="Select.ctas-2409"><a href="#Select.ctas-2409"><span class="linenos">2409</span></a><span class="sd"> 'CREATE TABLE x AS SELECT * FROM tbl'</span> +</span><span id="Select.ctas-2410"><a href="#Select.ctas-2410"><span class="linenos">2410</span></a> +</span><span id="Select.ctas-2411"><a href="#Select.ctas-2411"><span class="linenos">2411</span></a><span class="sd"> Args:</span> +</span><span id="Select.ctas-2412"><a href="#Select.ctas-2412"><span class="linenos">2412</span></a><span class="sd"> table (str | Expression): the SQL code string to parse as the table name.</span> +</span><span id="Select.ctas-2413"><a href="#Select.ctas-2413"><span class="linenos">2413</span></a><span class="sd"> If another `Expression` instance is passed, it will be used as-is.</span> +</span><span id="Select.ctas-2414"><a href="#Select.ctas-2414"><span class="linenos">2414</span></a><span class="sd"> properties (dict): an optional mapping of table properties</span> +</span><span id="Select.ctas-2415"><a href="#Select.ctas-2415"><span class="linenos">2415</span></a><span class="sd"> dialect (str): the dialect used to parse the input table.</span> +</span><span id="Select.ctas-2416"><a href="#Select.ctas-2416"><span class="linenos">2416</span></a><span class="sd"> copy (bool): if `False`, modify this expression instance in-place.</span> +</span><span id="Select.ctas-2417"><a href="#Select.ctas-2417"><span class="linenos">2417</span></a><span class="sd"> opts (kwargs): other options to use to parse the input table.</span> +</span><span id="Select.ctas-2418"><a href="#Select.ctas-2418"><span class="linenos">2418</span></a> +</span><span id="Select.ctas-2419"><a href="#Select.ctas-2419"><span class="linenos">2419</span></a><span class="sd"> Returns:</span> +</span><span id="Select.ctas-2420"><a href="#Select.ctas-2420"><span class="linenos">2420</span></a><span class="sd"> Create: the CREATE TABLE AS expression</span> +</span><span id="Select.ctas-2421"><a href="#Select.ctas-2421"><span class="linenos">2421</span></a><span class="sd"> """</span> +</span><span id="Select.ctas-2422"><a href="#Select.ctas-2422"><span class="linenos">2422</span></a> <span class="n">instance</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select.ctas-2423"><a href="#Select.ctas-2423"><span class="linenos">2423</span></a> <span class="n">table_expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span> +</span><span id="Select.ctas-2424"><a href="#Select.ctas-2424"><span class="linenos">2424</span></a> <span class="n">table</span><span class="p">,</span> +</span><span id="Select.ctas-2425"><a href="#Select.ctas-2425"><span class="linenos">2425</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> +</span><span id="Select.ctas-2426"><a href="#Select.ctas-2426"><span class="linenos">2426</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="Select.ctas-2427"><a href="#Select.ctas-2427"><span class="linenos">2427</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="Select.ctas-2428"><a href="#Select.ctas-2428"><span class="linenos">2428</span></a> <span class="p">)</span> +</span><span id="Select.ctas-2429"><a href="#Select.ctas-2429"><span class="linenos">2429</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="kc">None</span> +</span><span id="Select.ctas-2430"><a href="#Select.ctas-2430"><span class="linenos">2430</span></a> <span class="k">if</span> <span class="n">properties</span><span class="p">:</span> +</span><span id="Select.ctas-2431"><a href="#Select.ctas-2431"><span class="linenos">2431</span></a> <span class="n">properties_expression</span> <span class="o">=</span> <span class="n">Properties</span><span class="o">.</span><span class="n">from_dict</span><span class="p">(</span><span class="n">properties</span><span class="p">)</span> +</span><span id="Select.ctas-2432"><a href="#Select.ctas-2432"><span class="linenos">2432</span></a> +</span><span id="Select.ctas-2433"><a href="#Select.ctas-2433"><span class="linenos">2433</span></a> <span class="k">return</span> <span class="n">Create</span><span class="p">(</span> +</span><span id="Select.ctas-2434"><a href="#Select.ctas-2434"><span class="linenos">2434</span></a> <span class="n">this</span><span class="o">=</span><span class="n">table_expression</span><span class="p">,</span> +</span><span id="Select.ctas-2435"><a href="#Select.ctas-2435"><span class="linenos">2435</span></a> <span class="n">kind</span><span class="o">=</span><span class="s2">"table"</span><span class="p">,</span> +</span><span id="Select.ctas-2436"><a href="#Select.ctas-2436"><span class="linenos">2436</span></a> <span class="n">expression</span><span class="o">=</span><span class="n">instance</span><span class="p">,</span> +</span><span id="Select.ctas-2437"><a href="#Select.ctas-2437"><span class="linenos">2437</span></a> <span class="n">properties</span><span class="o">=</span><span class="n">properties_expression</span><span class="p">,</span> +</span><span id="Select.ctas-2438"><a href="#Select.ctas-2438"><span class="linenos">2438</span></a> <span class="p">)</span> </span></pre></div> @@ -21051,29 +21839,29 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Select.lock"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lock-2392"><a href="#Select.lock-2392"><span class="linenos">2392</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="Select.lock-2393"><a href="#Select.lock-2393"><span class="linenos">2393</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Select.lock-2394"><a href="#Select.lock-2394"><span class="linenos">2394</span></a><span class="sd"> Set the locking read mode for this expression.</span> -</span><span id="Select.lock-2395"><a href="#Select.lock-2395"><span class="linenos">2395</span></a> -</span><span id="Select.lock-2396"><a href="#Select.lock-2396"><span class="linenos">2396</span></a><span class="sd"> Examples:</span> -</span><span id="Select.lock-2397"><a href="#Select.lock-2397"><span class="linenos">2397</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> -</span><span id="Select.lock-2398"><a href="#Select.lock-2398"><span class="linenos">2398</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> -</span><span id="Select.lock-2399"><a href="#Select.lock-2399"><span class="linenos">2399</span></a> -</span><span id="Select.lock-2400"><a href="#Select.lock-2400"><span class="linenos">2400</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> -</span><span id="Select.lock-2401"><a href="#Select.lock-2401"><span class="linenos">2401</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> -</span><span id="Select.lock-2402"><a href="#Select.lock-2402"><span class="linenos">2402</span></a> -</span><span id="Select.lock-2403"><a href="#Select.lock-2403"><span class="linenos">2403</span></a><span class="sd"> Args:</span> -</span><span id="Select.lock-2404"><a href="#Select.lock-2404"><span class="linenos">2404</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> -</span><span id="Select.lock-2405"><a href="#Select.lock-2405"><span class="linenos">2405</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> -</span><span id="Select.lock-2406"><a href="#Select.lock-2406"><span class="linenos">2406</span></a> -</span><span id="Select.lock-2407"><a href="#Select.lock-2407"><span class="linenos">2407</span></a><span class="sd"> Returns:</span> -</span><span id="Select.lock-2408"><a href="#Select.lock-2408"><span class="linenos">2408</span></a><span class="sd"> The modified expression.</span> -</span><span id="Select.lock-2409"><a href="#Select.lock-2409"><span class="linenos">2409</span></a><span class="sd"> """</span> -</span><span id="Select.lock-2410"><a href="#Select.lock-2410"><span class="linenos">2410</span></a> -</span><span id="Select.lock-2411"><a href="#Select.lock-2411"><span class="linenos">2411</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> -</span><span id="Select.lock-2412"><a href="#Select.lock-2412"><span class="linenos">2412</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> -</span><span id="Select.lock-2413"><a href="#Select.lock-2413"><span class="linenos">2413</span></a> -</span><span id="Select.lock-2414"><a href="#Select.lock-2414"><span class="linenos">2414</span></a> <span class="k">return</span> <span class="n">inst</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Select.lock-2440"><a href="#Select.lock-2440"><span class="linenos">2440</span></a> <span class="k">def</span> <span class="nf">lock</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">update</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="Select.lock-2441"><a href="#Select.lock-2441"><span class="linenos">2441</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Select.lock-2442"><a href="#Select.lock-2442"><span class="linenos">2442</span></a><span class="sd"> Set the locking read mode for this expression.</span> +</span><span id="Select.lock-2443"><a href="#Select.lock-2443"><span class="linenos">2443</span></a> +</span><span id="Select.lock-2444"><a href="#Select.lock-2444"><span class="linenos">2444</span></a><span class="sd"> Examples:</span> +</span><span id="Select.lock-2445"><a href="#Select.lock-2445"><span class="linenos">2445</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")</span> +</span><span id="Select.lock-2446"><a href="#Select.lock-2446"><span class="linenos">2446</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"</span> +</span><span id="Select.lock-2447"><a href="#Select.lock-2447"><span class="linenos">2447</span></a> +</span><span id="Select.lock-2448"><a href="#Select.lock-2448"><span class="linenos">2448</span></a><span class="sd"> >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")</span> +</span><span id="Select.lock-2449"><a href="#Select.lock-2449"><span class="linenos">2449</span></a><span class="sd"> "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"</span> +</span><span id="Select.lock-2450"><a href="#Select.lock-2450"><span class="linenos">2450</span></a> +</span><span id="Select.lock-2451"><a href="#Select.lock-2451"><span class="linenos">2451</span></a><span class="sd"> Args:</span> +</span><span id="Select.lock-2452"><a href="#Select.lock-2452"><span class="linenos">2452</span></a><span class="sd"> update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.</span> +</span><span id="Select.lock-2453"><a href="#Select.lock-2453"><span class="linenos">2453</span></a><span class="sd"> copy: if `False`, modify this expression instance in-place.</span> +</span><span id="Select.lock-2454"><a href="#Select.lock-2454"><span class="linenos">2454</span></a> +</span><span id="Select.lock-2455"><a href="#Select.lock-2455"><span class="linenos">2455</span></a><span class="sd"> Returns:</span> +</span><span id="Select.lock-2456"><a href="#Select.lock-2456"><span class="linenos">2456</span></a><span class="sd"> The modified expression.</span> +</span><span id="Select.lock-2457"><a href="#Select.lock-2457"><span class="linenos">2457</span></a><span class="sd"> """</span> +</span><span id="Select.lock-2458"><a href="#Select.lock-2458"><span class="linenos">2458</span></a> +</span><span id="Select.lock-2459"><a href="#Select.lock-2459"><span class="linenos">2459</span></a> <span class="n">inst</span> <span class="o">=</span> <span class="n">_maybe_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">copy</span><span class="p">)</span> +</span><span id="Select.lock-2460"><a href="#Select.lock-2460"><span class="linenos">2460</span></a> <span class="n">inst</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"lock"</span><span class="p">,</span> <span class="n">Lock</span><span class="p">(</span><span class="n">update</span><span class="o">=</span><span class="n">update</span><span class="p">))</span> +</span><span id="Select.lock-2461"><a href="#Select.lock-2461"><span class="linenos">2461</span></a> +</span><span id="Select.lock-2462"><a href="#Select.lock-2462"><span class="linenos">2462</span></a> <span class="k">return</span> <span class="n">inst</span> </span></pre></div> @@ -21111,6 +21899,19 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> + <div id="Select.is_star" class="classattr"> + <div class="attr variable"> + <span class="name">is_star</span><span class="annotation">: bool</span> + + + </div> + <a class="headerlink" href="#Select.is_star"></a> + + <div class="docstring"><p>Checks whether an expression is a star.</p> +</div> + + + </div> <div class="inherited"> <h5>Inherited Members</h5> <dl> @@ -21123,7 +21924,6 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, <dd id="Select.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> <dd id="Select.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> <dd id="Select.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="Select.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> <dd id="Select.alias" class="variable"><a href="#Expression.alias">alias</a></dd> <dd id="Select.output_name" class="variable"><a href="#Expression.output_name">output_name</a></dd> <dd id="Select.copy" class="function"><a href="#Expression.copy">copy</a></dd> @@ -21176,26 +21976,30 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Subquery"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery-2425"><a href="#Subquery-2425"><span class="linenos">2425</span></a><span class="k">class</span> <span class="nc">Subquery</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> -</span><span id="Subquery-2426"><a href="#Subquery-2426"><span class="linenos">2426</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Subquery-2427"><a href="#Subquery-2427"><span class="linenos">2427</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Subquery-2428"><a href="#Subquery-2428"><span class="linenos">2428</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Subquery-2429"><a href="#Subquery-2429"><span class="linenos">2429</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Subquery-2430"><a href="#Subquery-2430"><span class="linenos">2430</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> -</span><span id="Subquery-2431"><a href="#Subquery-2431"><span class="linenos">2431</span></a> <span class="p">}</span> -</span><span id="Subquery-2432"><a href="#Subquery-2432"><span class="linenos">2432</span></a> -</span><span id="Subquery-2433"><a href="#Subquery-2433"><span class="linenos">2433</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subquery-2434"><a href="#Subquery-2434"><span class="linenos">2434</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subquery-2435"><a href="#Subquery-2435"><span class="linenos">2435</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="Subquery-2436"><a href="#Subquery-2436"><span class="linenos">2436</span></a><span class="sd"> """</span> -</span><span id="Subquery-2437"><a href="#Subquery-2437"><span class="linenos">2437</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Subquery-2438"><a href="#Subquery-2438"><span class="linenos">2438</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> -</span><span id="Subquery-2439"><a href="#Subquery-2439"><span class="linenos">2439</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="Subquery-2440"><a href="#Subquery-2440"><span class="linenos">2440</span></a> <span class="k">return</span> <span class="n">expression</span> -</span><span id="Subquery-2441"><a href="#Subquery-2441"><span class="linenos">2441</span></a> -</span><span id="Subquery-2442"><a href="#Subquery-2442"><span class="linenos">2442</span></a> <span class="nd">@property</span> -</span><span id="Subquery-2443"><a href="#Subquery-2443"><span class="linenos">2443</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subquery-2444"><a href="#Subquery-2444"><span class="linenos">2444</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery-2477"><a href="#Subquery-2477"><span class="linenos">2477</span></a><span class="k">class</span> <span class="nc">Subquery</span><span class="p">(</span><span class="n">DerivedTable</span><span class="p">,</span> <span class="n">Unionable</span><span class="p">):</span> +</span><span id="Subquery-2478"><a href="#Subquery-2478"><span class="linenos">2478</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Subquery-2479"><a href="#Subquery-2479"><span class="linenos">2479</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Subquery-2480"><a href="#Subquery-2480"><span class="linenos">2480</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Subquery-2481"><a href="#Subquery-2481"><span class="linenos">2481</span></a> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Subquery-2482"><a href="#Subquery-2482"><span class="linenos">2482</span></a> <span class="o">**</span><span class="n">QUERY_MODIFIERS</span><span class="p">,</span> +</span><span id="Subquery-2483"><a href="#Subquery-2483"><span class="linenos">2483</span></a> <span class="p">}</span> +</span><span id="Subquery-2484"><a href="#Subquery-2484"><span class="linenos">2484</span></a> +</span><span id="Subquery-2485"><a href="#Subquery-2485"><span class="linenos">2485</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subquery-2486"><a href="#Subquery-2486"><span class="linenos">2486</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subquery-2487"><a href="#Subquery-2487"><span class="linenos">2487</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="Subquery-2488"><a href="#Subquery-2488"><span class="linenos">2488</span></a><span class="sd"> """</span> +</span><span id="Subquery-2489"><a href="#Subquery-2489"><span class="linenos">2489</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Subquery-2490"><a href="#Subquery-2490"><span class="linenos">2490</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> +</span><span id="Subquery-2491"><a href="#Subquery-2491"><span class="linenos">2491</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="Subquery-2492"><a href="#Subquery-2492"><span class="linenos">2492</span></a> <span class="k">return</span> <span class="n">expression</span> +</span><span id="Subquery-2493"><a href="#Subquery-2493"><span class="linenos">2493</span></a> +</span><span id="Subquery-2494"><a href="#Subquery-2494"><span class="linenos">2494</span></a> <span class="nd">@property</span> +</span><span id="Subquery-2495"><a href="#Subquery-2495"><span class="linenos">2495</span></a> <span class="k">def</span> <span class="nf">is_star</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Subquery-2496"><a href="#Subquery-2496"><span class="linenos">2496</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">is_star</span> +</span><span id="Subquery-2497"><a href="#Subquery-2497"><span class="linenos">2497</span></a> +</span><span id="Subquery-2498"><a href="#Subquery-2498"><span class="linenos">2498</span></a> <span class="nd">@property</span> +</span><span id="Subquery-2499"><a href="#Subquery-2499"><span class="linenos">2499</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subquery-2500"><a href="#Subquery-2500"><span class="linenos">2500</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> </span></pre></div> @@ -21212,14 +22016,14 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Subquery.unnest"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery.unnest-2433"><a href="#Subquery.unnest-2433"><span class="linenos">2433</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Subquery.unnest-2434"><a href="#Subquery.unnest-2434"><span class="linenos">2434</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Subquery.unnest-2435"><a href="#Subquery.unnest-2435"><span class="linenos">2435</span></a><span class="sd"> Returns the first non subquery.</span> -</span><span id="Subquery.unnest-2436"><a href="#Subquery.unnest-2436"><span class="linenos">2436</span></a><span class="sd"> """</span> -</span><span id="Subquery.unnest-2437"><a href="#Subquery.unnest-2437"><span class="linenos">2437</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> -</span><span id="Subquery.unnest-2438"><a href="#Subquery.unnest-2438"><span class="linenos">2438</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> -</span><span id="Subquery.unnest-2439"><a href="#Subquery.unnest-2439"><span class="linenos">2439</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> -</span><span id="Subquery.unnest-2440"><a href="#Subquery.unnest-2440"><span class="linenos">2440</span></a> <span class="k">return</span> <span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Subquery.unnest-2485"><a href="#Subquery.unnest-2485"><span class="linenos">2485</span></a> <span class="k">def</span> <span class="nf">unnest</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Subquery.unnest-2486"><a href="#Subquery.unnest-2486"><span class="linenos">2486</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Subquery.unnest-2487"><a href="#Subquery.unnest-2487"><span class="linenos">2487</span></a><span class="sd"> Returns the first non subquery.</span> +</span><span id="Subquery.unnest-2488"><a href="#Subquery.unnest-2488"><span class="linenos">2488</span></a><span class="sd"> """</span> +</span><span id="Subquery.unnest-2489"><a href="#Subquery.unnest-2489"><span class="linenos">2489</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="bp">self</span> +</span><span id="Subquery.unnest-2490"><a href="#Subquery.unnest-2490"><span class="linenos">2490</span></a> <span class="k">while</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">Subquery</span><span class="p">):</span> +</span><span id="Subquery.unnest-2491"><a href="#Subquery.unnest-2491"><span class="linenos">2491</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">expression</span><span class="o">.</span><span class="n">this</span> +</span><span id="Subquery.unnest-2492"><a href="#Subquery.unnest-2492"><span class="linenos">2492</span></a> <span class="k">return</span> <span class="n">expression</span> </span></pre></div> @@ -21228,6 +22032,19 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> + <div id="Subquery.is_star" class="classattr"> + <div class="attr variable"> + <span class="name">is_star</span><span class="annotation">: bool</span> + + + </div> + <a class="headerlink" href="#Subquery.is_star"></a> + + <div class="docstring"><p>Checks whether an expression is a star.</p> +</div> + + + </div> <div id="Subquery.output_name" class="classattr"> <div class="attr variable"> <span class="name">output_name</span> @@ -21270,7 +22087,6 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, <dd id="Subquery.is_string" class="variable"><a href="#Expression.is_string">is_string</a></dd> <dd id="Subquery.is_number" class="variable"><a href="#Expression.is_number">is_number</a></dd> <dd id="Subquery.is_int" class="variable"><a href="#Expression.is_int">is_int</a></dd> - <dd id="Subquery.is_star" class="variable"><a href="#Expression.is_star">is_star</a></dd> <dd id="Subquery.alias" class="variable"><a href="#Expression.alias">alias</a></dd> <dd id="Subquery.copy" class="function"><a href="#Expression.copy">copy</a></dd> <dd id="Subquery.append" class="function"><a href="#Expression.append">append</a></dd> @@ -21316,18 +22132,18 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#TableSample"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TableSample-2447"><a href="#TableSample-2447"><span class="linenos">2447</span></a><span class="k">class</span> <span class="nc">TableSample</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="TableSample-2448"><a href="#TableSample-2448"><span class="linenos">2448</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="TableSample-2449"><a href="#TableSample-2449"><span class="linenos">2449</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2450"><a href="#TableSample-2450"><span class="linenos">2450</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2451"><a href="#TableSample-2451"><span class="linenos">2451</span></a> <span class="s2">"bucket_numerator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2452"><a href="#TableSample-2452"><span class="linenos">2452</span></a> <span class="s2">"bucket_denominator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2453"><a href="#TableSample-2453"><span class="linenos">2453</span></a> <span class="s2">"bucket_field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2454"><a href="#TableSample-2454"><span class="linenos">2454</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2455"><a href="#TableSample-2455"><span class="linenos">2455</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2456"><a href="#TableSample-2456"><span class="linenos">2456</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2457"><a href="#TableSample-2457"><span class="linenos">2457</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="TableSample-2458"><a href="#TableSample-2458"><span class="linenos">2458</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TableSample-2503"><a href="#TableSample-2503"><span class="linenos">2503</span></a><span class="k">class</span> <span class="nc">TableSample</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="TableSample-2504"><a href="#TableSample-2504"><span class="linenos">2504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="TableSample-2505"><a href="#TableSample-2505"><span class="linenos">2505</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2506"><a href="#TableSample-2506"><span class="linenos">2506</span></a> <span class="s2">"method"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2507"><a href="#TableSample-2507"><span class="linenos">2507</span></a> <span class="s2">"bucket_numerator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2508"><a href="#TableSample-2508"><span class="linenos">2508</span></a> <span class="s2">"bucket_denominator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2509"><a href="#TableSample-2509"><span class="linenos">2509</span></a> <span class="s2">"bucket_field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2510"><a href="#TableSample-2510"><span class="linenos">2510</span></a> <span class="s2">"percent"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2511"><a href="#TableSample-2511"><span class="linenos">2511</span></a> <span class="s2">"rows"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2512"><a href="#TableSample-2512"><span class="linenos">2512</span></a> <span class="s2">"size"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2513"><a href="#TableSample-2513"><span class="linenos">2513</span></a> <span class="s2">"seed"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="TableSample-2514"><a href="#TableSample-2514"><span class="linenos">2514</span></a> <span class="p">}</span> </span></pre></div> @@ -21387,14 +22203,14 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Tag"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Tag-2461"><a href="#Tag-2461"><span class="linenos">2461</span></a><span class="k">class</span> <span class="nc">Tag</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Tag-2462"><a href="#Tag-2462"><span class="linenos">2462</span></a><span class="w"> </span><span class="sd">"""Tags are used for generating arbitrary sql like SELECT <span>x</span>."""</span> -</span><span id="Tag-2463"><a href="#Tag-2463"><span class="linenos">2463</span></a> -</span><span id="Tag-2464"><a href="#Tag-2464"><span class="linenos">2464</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Tag-2465"><a href="#Tag-2465"><span class="linenos">2465</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-2466"><a href="#Tag-2466"><span class="linenos">2466</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-2467"><a href="#Tag-2467"><span class="linenos">2467</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Tag-2468"><a href="#Tag-2468"><span class="linenos">2468</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Tag-2517"><a href="#Tag-2517"><span class="linenos">2517</span></a><span class="k">class</span> <span class="nc">Tag</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Tag-2518"><a href="#Tag-2518"><span class="linenos">2518</span></a><span class="w"> </span><span class="sd">"""Tags are used for generating arbitrary sql like SELECT <span>x</span>."""</span> +</span><span id="Tag-2519"><a href="#Tag-2519"><span class="linenos">2519</span></a> +</span><span id="Tag-2520"><a href="#Tag-2520"><span class="linenos">2520</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Tag-2521"><a href="#Tag-2521"><span class="linenos">2521</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-2522"><a href="#Tag-2522"><span class="linenos">2522</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-2523"><a href="#Tag-2523"><span class="linenos">2523</span></a> <span class="s2">"postfix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Tag-2524"><a href="#Tag-2524"><span class="linenos">2524</span></a> <span class="p">}</span> </span></pre></div> @@ -21456,13 +22272,14 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Pivot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Pivot-2471"><a href="#Pivot-2471"><span class="linenos">2471</span></a><span class="k">class</span> <span class="nc">Pivot</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Pivot-2472"><a href="#Pivot-2472"><span class="linenos">2472</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Pivot-2473"><a href="#Pivot-2473"><span class="linenos">2473</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Pivot-2474"><a href="#Pivot-2474"><span class="linenos">2474</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Pivot-2475"><a href="#Pivot-2475"><span class="linenos">2475</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Pivot-2476"><a href="#Pivot-2476"><span class="linenos">2476</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Pivot-2477"><a href="#Pivot-2477"><span class="linenos">2477</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Pivot-2527"><a href="#Pivot-2527"><span class="linenos">2527</span></a><span class="k">class</span> <span class="nc">Pivot</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Pivot-2528"><a href="#Pivot-2528"><span class="linenos">2528</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Pivot-2529"><a href="#Pivot-2529"><span class="linenos">2529</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-2530"><a href="#Pivot-2530"><span class="linenos">2530</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Pivot-2531"><a href="#Pivot-2531"><span class="linenos">2531</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Pivot-2532"><a href="#Pivot-2532"><span class="linenos">2532</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Pivot-2533"><a href="#Pivot-2533"><span class="linenos">2533</span></a> <span class="s2">"unpivot"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Pivot-2534"><a href="#Pivot-2534"><span class="linenos">2534</span></a> <span class="p">}</span> </span></pre></div> @@ -21522,14 +22339,14 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Window"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Window-2480"><a href="#Window-2480"><span class="linenos">2480</span></a><span class="k">class</span> <span class="nc">Window</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Window-2481"><a href="#Window-2481"><span class="linenos">2481</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Window-2482"><a href="#Window-2482"><span class="linenos">2482</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Window-2483"><a href="#Window-2483"><span class="linenos">2483</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-2484"><a href="#Window-2484"><span class="linenos">2484</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-2485"><a href="#Window-2485"><span class="linenos">2485</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-2486"><a href="#Window-2486"><span class="linenos">2486</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Window-2487"><a href="#Window-2487"><span class="linenos">2487</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Window-2537"><a href="#Window-2537"><span class="linenos">2537</span></a><span class="k">class</span> <span class="nc">Window</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Window-2538"><a href="#Window-2538"><span class="linenos">2538</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Window-2539"><a href="#Window-2539"><span class="linenos">2539</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Window-2540"><a href="#Window-2540"><span class="linenos">2540</span></a> <span class="s2">"partition_by"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-2541"><a href="#Window-2541"><span class="linenos">2541</span></a> <span class="s2">"order"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-2542"><a href="#Window-2542"><span class="linenos">2542</span></a> <span class="s2">"spec"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-2543"><a href="#Window-2543"><span class="linenos">2543</span></a> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Window-2544"><a href="#Window-2544"><span class="linenos">2544</span></a> <span class="p">}</span> </span></pre></div> @@ -21589,14 +22406,14 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#WindowSpec"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WindowSpec-2490"><a href="#WindowSpec-2490"><span class="linenos">2490</span></a><span class="k">class</span> <span class="nc">WindowSpec</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="WindowSpec-2491"><a href="#WindowSpec-2491"><span class="linenos">2491</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="WindowSpec-2492"><a href="#WindowSpec-2492"><span class="linenos">2492</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-2493"><a href="#WindowSpec-2493"><span class="linenos">2493</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-2494"><a href="#WindowSpec-2494"><span class="linenos">2494</span></a> <span class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-2495"><a href="#WindowSpec-2495"><span class="linenos">2495</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-2496"><a href="#WindowSpec-2496"><span class="linenos">2496</span></a> <span class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="WindowSpec-2497"><a href="#WindowSpec-2497"><span class="linenos">2497</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="WindowSpec-2547"><a href="#WindowSpec-2547"><span class="linenos">2547</span></a><span class="k">class</span> <span class="nc">WindowSpec</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="WindowSpec-2548"><a href="#WindowSpec-2548"><span class="linenos">2548</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="WindowSpec-2549"><a href="#WindowSpec-2549"><span class="linenos">2549</span></a> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-2550"><a href="#WindowSpec-2550"><span class="linenos">2550</span></a> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-2551"><a href="#WindowSpec-2551"><span class="linenos">2551</span></a> <span class="s2">"start_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-2552"><a href="#WindowSpec-2552"><span class="linenos">2552</span></a> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-2553"><a href="#WindowSpec-2553"><span class="linenos">2553</span></a> <span class="s2">"end_side"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="WindowSpec-2554"><a href="#WindowSpec-2554"><span class="linenos">2554</span></a> <span class="p">}</span> </span></pre></div> @@ -21656,8 +22473,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Where"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Where-2500"><a href="#Where-2500"><span class="linenos">2500</span></a><span class="k">class</span> <span class="nc">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Where-2501"><a href="#Where-2501"><span class="linenos">2501</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Where-2557"><a href="#Where-2557"><span class="linenos">2557</span></a><span class="k">class</span> <span class="nc">Where</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Where-2558"><a href="#Where-2558"><span class="linenos">2558</span></a> <span class="k">pass</span> </span></pre></div> @@ -21717,16 +22534,16 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Star"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Star-2504"><a href="#Star-2504"><span class="linenos">2504</span></a><span class="k">class</span> <span class="nc">Star</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Star-2505"><a href="#Star-2505"><span class="linenos">2505</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"except"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Star-2506"><a href="#Star-2506"><span class="linenos">2506</span></a> -</span><span id="Star-2507"><a href="#Star-2507"><span class="linenos">2507</span></a> <span class="nd">@property</span> -</span><span id="Star-2508"><a href="#Star-2508"><span class="linenos">2508</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Star-2509"><a href="#Star-2509"><span class="linenos">2509</span></a> <span class="k">return</span> <span class="s2">"*"</span> -</span><span id="Star-2510"><a href="#Star-2510"><span class="linenos">2510</span></a> -</span><span id="Star-2511"><a href="#Star-2511"><span class="linenos">2511</span></a> <span class="nd">@property</span> -</span><span id="Star-2512"><a href="#Star-2512"><span class="linenos">2512</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Star-2513"><a href="#Star-2513"><span class="linenos">2513</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Star-2561"><a href="#Star-2561"><span class="linenos">2561</span></a><span class="k">class</span> <span class="nc">Star</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Star-2562"><a href="#Star-2562"><span class="linenos">2562</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"except"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Star-2563"><a href="#Star-2563"><span class="linenos">2563</span></a> +</span><span id="Star-2564"><a href="#Star-2564"><span class="linenos">2564</span></a> <span class="nd">@property</span> +</span><span id="Star-2565"><a href="#Star-2565"><span class="linenos">2565</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Star-2566"><a href="#Star-2566"><span class="linenos">2566</span></a> <span class="k">return</span> <span class="s2">"*"</span> +</span><span id="Star-2567"><a href="#Star-2567"><span class="linenos">2567</span></a> +</span><span id="Star-2568"><a href="#Star-2568"><span class="linenos">2568</span></a> <span class="nd">@property</span> +</span><span id="Star-2569"><a href="#Star-2569"><span class="linenos">2569</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Star-2570"><a href="#Star-2570"><span class="linenos">2570</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -21815,8 +22632,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Parameter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Parameter-2516"><a href="#Parameter-2516"><span class="linenos">2516</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Parameter-2517"><a href="#Parameter-2517"><span class="linenos">2517</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Parameter-2573"><a href="#Parameter-2573"><span class="linenos">2573</span></a><span class="k">class</span> <span class="nc">Parameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Parameter-2574"><a href="#Parameter-2574"><span class="linenos">2574</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"wrapped"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -21876,8 +22693,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#SessionParameter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SessionParameter-2520"><a href="#SessionParameter-2520"><span class="linenos">2520</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="SessionParameter-2521"><a href="#SessionParameter-2521"><span class="linenos">2521</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SessionParameter-2577"><a href="#SessionParameter-2577"><span class="linenos">2577</span></a><span class="k">class</span> <span class="nc">SessionParameter</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="SessionParameter-2578"><a href="#SessionParameter-2578"><span class="linenos">2578</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -21937,8 +22754,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Placeholder"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Placeholder-2524"><a href="#Placeholder-2524"><span class="linenos">2524</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Placeholder-2525"><a href="#Placeholder-2525"><span class="linenos">2525</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Placeholder-2581"><a href="#Placeholder-2581"><span class="linenos">2581</span></a><span class="k">class</span> <span class="nc">Placeholder</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Placeholder-2582"><a href="#Placeholder-2582"><span class="linenos">2582</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -21998,12 +22815,12 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Null"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Null-2528"><a href="#Null-2528"><span class="linenos">2528</span></a><span class="k">class</span> <span class="nc">Null</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Null-2529"><a href="#Null-2529"><span class="linenos">2529</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> -</span><span id="Null-2530"><a href="#Null-2530"><span class="linenos">2530</span></a> -</span><span id="Null-2531"><a href="#Null-2531"><span class="linenos">2531</span></a> <span class="nd">@property</span> -</span><span id="Null-2532"><a href="#Null-2532"><span class="linenos">2532</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Null-2533"><a href="#Null-2533"><span class="linenos">2533</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Null-2585"><a href="#Null-2585"><span class="linenos">2585</span></a><span class="k">class</span> <span class="nc">Null</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Null-2586"><a href="#Null-2586"><span class="linenos">2586</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> +</span><span id="Null-2587"><a href="#Null-2587"><span class="linenos">2587</span></a> +</span><span id="Null-2588"><a href="#Null-2588"><span class="linenos">2588</span></a> <span class="nd">@property</span> +</span><span id="Null-2589"><a href="#Null-2589"><span class="linenos">2589</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Null-2590"><a href="#Null-2590"><span class="linenos">2590</span></a> <span class="k">return</span> <span class="s2">"NULL"</span> </span></pre></div> @@ -22069,8 +22886,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Boolean"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Boolean-2536"><a href="#Boolean-2536"><span class="linenos">2536</span></a><span class="k">class</span> <span class="nc">Boolean</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Boolean-2537"><a href="#Boolean-2537"><span class="linenos">2537</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Boolean-2593"><a href="#Boolean-2593"><span class="linenos">2593</span></a><span class="k">class</span> <span class="nc">Boolean</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Boolean-2594"><a href="#Boolean-2594"><span class="linenos">2594</span></a> <span class="k">pass</span> </span></pre></div> @@ -22136,121 +22953,122 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DataType"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType-2540"><a href="#DataType-2540"><span class="linenos">2540</span></a><span class="k">class</span> <span class="nc">DataType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="DataType-2541"><a href="#DataType-2541"><span class="linenos">2541</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-2542"><a href="#DataType-2542"><span class="linenos">2542</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="DataType-2543"><a href="#DataType-2543"><span class="linenos">2543</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-2544"><a href="#DataType-2544"><span class="linenos">2544</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-2545"><a href="#DataType-2545"><span class="linenos">2545</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-2546"><a href="#DataType-2546"><span class="linenos">2546</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="DataType-2547"><a href="#DataType-2547"><span class="linenos">2547</span></a> <span class="p">}</span> -</span><span id="DataType-2548"><a href="#DataType-2548"><span class="linenos">2548</span></a> -</span><span id="DataType-2549"><a href="#DataType-2549"><span class="linenos">2549</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="DataType-2550"><a href="#DataType-2550"><span class="linenos">2550</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2551"><a href="#DataType-2551"><span class="linenos">2551</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2552"><a href="#DataType-2552"><span class="linenos">2552</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2553"><a href="#DataType-2553"><span class="linenos">2553</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2554"><a href="#DataType-2554"><span class="linenos">2554</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2555"><a href="#DataType-2555"><span class="linenos">2555</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2556"><a href="#DataType-2556"><span class="linenos">2556</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2557"><a href="#DataType-2557"><span class="linenos">2557</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2558"><a href="#DataType-2558"><span class="linenos">2558</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2559"><a href="#DataType-2559"><span class="linenos">2559</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2560"><a href="#DataType-2560"><span class="linenos">2560</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2561"><a href="#DataType-2561"><span class="linenos">2561</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2562"><a href="#DataType-2562"><span class="linenos">2562</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2563"><a href="#DataType-2563"><span class="linenos">2563</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2564"><a href="#DataType-2564"><span class="linenos">2564</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2565"><a href="#DataType-2565"><span class="linenos">2565</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2566"><a href="#DataType-2566"><span class="linenos">2566</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2567"><a href="#DataType-2567"><span class="linenos">2567</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2568"><a href="#DataType-2568"><span class="linenos">2568</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2569"><a href="#DataType-2569"><span class="linenos">2569</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2570"><a href="#DataType-2570"><span class="linenos">2570</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2571"><a href="#DataType-2571"><span class="linenos">2571</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2572"><a href="#DataType-2572"><span class="linenos">2572</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2573"><a href="#DataType-2573"><span class="linenos">2573</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2574"><a href="#DataType-2574"><span class="linenos">2574</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2575"><a href="#DataType-2575"><span class="linenos">2575</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2576"><a href="#DataType-2576"><span class="linenos">2576</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2577"><a href="#DataType-2577"><span class="linenos">2577</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2578"><a href="#DataType-2578"><span class="linenos">2578</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2579"><a href="#DataType-2579"><span class="linenos">2579</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2580"><a href="#DataType-2580"><span class="linenos">2580</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2581"><a href="#DataType-2581"><span class="linenos">2581</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2582"><a href="#DataType-2582"><span class="linenos">2582</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2583"><a href="#DataType-2583"><span class="linenos">2583</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2584"><a href="#DataType-2584"><span class="linenos">2584</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2585"><a href="#DataType-2585"><span class="linenos">2585</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2586"><a href="#DataType-2586"><span class="linenos">2586</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2587"><a href="#DataType-2587"><span class="linenos">2587</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2588"><a href="#DataType-2588"><span class="linenos">2588</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2589"><a href="#DataType-2589"><span class="linenos">2589</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2590"><a href="#DataType-2590"><span class="linenos">2590</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2591"><a href="#DataType-2591"><span class="linenos">2591</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2592"><a href="#DataType-2592"><span class="linenos">2592</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2593"><a href="#DataType-2593"><span class="linenos">2593</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2594"><a href="#DataType-2594"><span class="linenos">2594</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2595"><a href="#DataType-2595"><span class="linenos">2595</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2596"><a href="#DataType-2596"><span class="linenos">2596</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2597"><a href="#DataType-2597"><span class="linenos">2597</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2598"><a href="#DataType-2598"><span class="linenos">2598</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2599"><a href="#DataType-2599"><span class="linenos">2599</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType-2600"><a href="#DataType-2600"><span class="linenos">2600</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> -</span><span id="DataType-2601"><a href="#DataType-2601"><span class="linenos">2601</span></a> -</span><span id="DataType-2602"><a href="#DataType-2602"><span class="linenos">2602</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-2603"><a href="#DataType-2603"><span class="linenos">2603</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> -</span><span id="DataType-2604"><a href="#DataType-2604"><span class="linenos">2604</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> -</span><span id="DataType-2605"><a href="#DataType-2605"><span class="linenos">2605</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> -</span><span id="DataType-2606"><a href="#DataType-2606"><span class="linenos">2606</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> -</span><span id="DataType-2607"><a href="#DataType-2607"><span class="linenos">2607</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> -</span><span id="DataType-2608"><a href="#DataType-2608"><span class="linenos">2608</span></a> <span class="p">}</span> -</span><span id="DataType-2609"><a href="#DataType-2609"><span class="linenos">2609</span></a> -</span><span id="DataType-2610"><a href="#DataType-2610"><span class="linenos">2610</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-2611"><a href="#DataType-2611"><span class="linenos">2611</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> -</span><span id="DataType-2612"><a href="#DataType-2612"><span class="linenos">2612</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> -</span><span id="DataType-2613"><a href="#DataType-2613"><span class="linenos">2613</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> -</span><span id="DataType-2614"><a href="#DataType-2614"><span class="linenos">2614</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> -</span><span id="DataType-2615"><a href="#DataType-2615"><span class="linenos">2615</span></a> <span class="p">}</span> -</span><span id="DataType-2616"><a href="#DataType-2616"><span class="linenos">2616</span></a> -</span><span id="DataType-2617"><a href="#DataType-2617"><span class="linenos">2617</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-2618"><a href="#DataType-2618"><span class="linenos">2618</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> -</span><span id="DataType-2619"><a href="#DataType-2619"><span class="linenos">2619</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> -</span><span id="DataType-2620"><a href="#DataType-2620"><span class="linenos">2620</span></a> <span class="p">}</span> -</span><span id="DataType-2621"><a href="#DataType-2621"><span class="linenos">2621</span></a> -</span><span id="DataType-2622"><a href="#DataType-2622"><span class="linenos">2622</span></a> <span class="n">NUMERIC_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">INTEGER_TYPES</span><span class="p">,</span> <span class="o">*</span><span class="n">FLOAT_TYPES</span><span class="p">}</span> -</span><span id="DataType-2623"><a href="#DataType-2623"><span class="linenos">2623</span></a> -</span><span id="DataType-2624"><a href="#DataType-2624"><span class="linenos">2624</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="DataType-2625"><a href="#DataType-2625"><span class="linenos">2625</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> -</span><span id="DataType-2626"><a href="#DataType-2626"><span class="linenos">2626</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> -</span><span id="DataType-2627"><a href="#DataType-2627"><span class="linenos">2627</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> -</span><span id="DataType-2628"><a href="#DataType-2628"><span class="linenos">2628</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> -</span><span id="DataType-2629"><a href="#DataType-2629"><span class="linenos">2629</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> -</span><span id="DataType-2630"><a href="#DataType-2630"><span class="linenos">2630</span></a> <span class="p">}</span> -</span><span id="DataType-2631"><a href="#DataType-2631"><span class="linenos">2631</span></a> -</span><span id="DataType-2632"><a href="#DataType-2632"><span class="linenos">2632</span></a> <span class="nd">@classmethod</span> -</span><span id="DataType-2633"><a href="#DataType-2633"><span class="linenos">2633</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="DataType-2634"><a href="#DataType-2634"><span class="linenos">2634</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> -</span><span id="DataType-2635"><a href="#DataType-2635"><span class="linenos">2635</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="DataType-2636"><a href="#DataType-2636"><span class="linenos">2636</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> -</span><span id="DataType-2637"><a href="#DataType-2637"><span class="linenos">2637</span></a> -</span><span id="DataType-2638"><a href="#DataType-2638"><span class="linenos">2638</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="DataType-2639"><a href="#DataType-2639"><span class="linenos">2639</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> -</span><span id="DataType-2640"><a href="#DataType-2640"><span class="linenos">2640</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> -</span><span id="DataType-2641"><a href="#DataType-2641"><span class="linenos">2641</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType-2642"><a href="#DataType-2642"><span class="linenos">2642</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> -</span><span id="DataType-2643"><a href="#DataType-2643"><span class="linenos">2643</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="DataType-2644"><a href="#DataType-2644"><span class="linenos">2644</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="DataType-2645"><a href="#DataType-2645"><span class="linenos">2645</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> -</span><span id="DataType-2646"><a href="#DataType-2646"><span class="linenos">2646</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="DataType-2647"><a href="#DataType-2647"><span class="linenos">2647</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> -</span><span id="DataType-2648"><a href="#DataType-2648"><span class="linenos">2648</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="DataType-2649"><a href="#DataType-2649"><span class="linenos">2649</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType-2650"><a href="#DataType-2650"><span class="linenos">2650</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> -</span><span id="DataType-2651"><a href="#DataType-2651"><span class="linenos">2651</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> -</span><span id="DataType-2652"><a href="#DataType-2652"><span class="linenos">2652</span></a> -</span><span id="DataType-2653"><a href="#DataType-2653"><span class="linenos">2653</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="DataType-2654"><a href="#DataType-2654"><span class="linenos">2654</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType-2597"><a href="#DataType-2597"><span class="linenos">2597</span></a><span class="k">class</span> <span class="nc">DataType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="DataType-2598"><a href="#DataType-2598"><span class="linenos">2598</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-2599"><a href="#DataType-2599"><span class="linenos">2599</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="DataType-2600"><a href="#DataType-2600"><span class="linenos">2600</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-2601"><a href="#DataType-2601"><span class="linenos">2601</span></a> <span class="s2">"nested"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-2602"><a href="#DataType-2602"><span class="linenos">2602</span></a> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-2603"><a href="#DataType-2603"><span class="linenos">2603</span></a> <span class="s2">"prefix"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="DataType-2604"><a href="#DataType-2604"><span class="linenos">2604</span></a> <span class="p">}</span> +</span><span id="DataType-2605"><a href="#DataType-2605"><span class="linenos">2605</span></a> +</span><span id="DataType-2606"><a href="#DataType-2606"><span class="linenos">2606</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="DataType-2607"><a href="#DataType-2607"><span class="linenos">2607</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2608"><a href="#DataType-2608"><span class="linenos">2608</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2609"><a href="#DataType-2609"><span class="linenos">2609</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2610"><a href="#DataType-2610"><span class="linenos">2610</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2611"><a href="#DataType-2611"><span class="linenos">2611</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2612"><a href="#DataType-2612"><span class="linenos">2612</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2613"><a href="#DataType-2613"><span class="linenos">2613</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2614"><a href="#DataType-2614"><span class="linenos">2614</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2615"><a href="#DataType-2615"><span class="linenos">2615</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2616"><a href="#DataType-2616"><span class="linenos">2616</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2617"><a href="#DataType-2617"><span class="linenos">2617</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2618"><a href="#DataType-2618"><span class="linenos">2618</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2619"><a href="#DataType-2619"><span class="linenos">2619</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2620"><a href="#DataType-2620"><span class="linenos">2620</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2621"><a href="#DataType-2621"><span class="linenos">2621</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2622"><a href="#DataType-2622"><span class="linenos">2622</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2623"><a href="#DataType-2623"><span class="linenos">2623</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2624"><a href="#DataType-2624"><span class="linenos">2624</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2625"><a href="#DataType-2625"><span class="linenos">2625</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2626"><a href="#DataType-2626"><span class="linenos">2626</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2627"><a href="#DataType-2627"><span class="linenos">2627</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2628"><a href="#DataType-2628"><span class="linenos">2628</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2629"><a href="#DataType-2629"><span class="linenos">2629</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2630"><a href="#DataType-2630"><span class="linenos">2630</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2631"><a href="#DataType-2631"><span class="linenos">2631</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2632"><a href="#DataType-2632"><span class="linenos">2632</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2633"><a href="#DataType-2633"><span class="linenos">2633</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2634"><a href="#DataType-2634"><span class="linenos">2634</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2635"><a href="#DataType-2635"><span class="linenos">2635</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2636"><a href="#DataType-2636"><span class="linenos">2636</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2637"><a href="#DataType-2637"><span class="linenos">2637</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2638"><a href="#DataType-2638"><span class="linenos">2638</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2639"><a href="#DataType-2639"><span class="linenos">2639</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2640"><a href="#DataType-2640"><span class="linenos">2640</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2641"><a href="#DataType-2641"><span class="linenos">2641</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2642"><a href="#DataType-2642"><span class="linenos">2642</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2643"><a href="#DataType-2643"><span class="linenos">2643</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2644"><a href="#DataType-2644"><span class="linenos">2644</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2645"><a href="#DataType-2645"><span class="linenos">2645</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2646"><a href="#DataType-2646"><span class="linenos">2646</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2647"><a href="#DataType-2647"><span class="linenos">2647</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2648"><a href="#DataType-2648"><span class="linenos">2648</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2649"><a href="#DataType-2649"><span class="linenos">2649</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2650"><a href="#DataType-2650"><span class="linenos">2650</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2651"><a href="#DataType-2651"><span class="linenos">2651</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2652"><a href="#DataType-2652"><span class="linenos">2652</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2653"><a href="#DataType-2653"><span class="linenos">2653</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2654"><a href="#DataType-2654"><span class="linenos">2654</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2655"><a href="#DataType-2655"><span class="linenos">2655</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2656"><a href="#DataType-2656"><span class="linenos">2656</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2657"><a href="#DataType-2657"><span class="linenos">2657</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType-2658"><a href="#DataType-2658"><span class="linenos">2658</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> +</span><span id="DataType-2659"><a href="#DataType-2659"><span class="linenos">2659</span></a> +</span><span id="DataType-2660"><a href="#DataType-2660"><span class="linenos">2660</span></a> <span class="n">TEXT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-2661"><a href="#DataType-2661"><span class="linenos">2661</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">CHAR</span><span class="p">,</span> +</span><span id="DataType-2662"><a href="#DataType-2662"><span class="linenos">2662</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NCHAR</span><span class="p">,</span> +</span><span id="DataType-2663"><a href="#DataType-2663"><span class="linenos">2663</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">VARCHAR</span><span class="p">,</span> +</span><span id="DataType-2664"><a href="#DataType-2664"><span class="linenos">2664</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">NVARCHAR</span><span class="p">,</span> +</span><span id="DataType-2665"><a href="#DataType-2665"><span class="linenos">2665</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TEXT</span><span class="p">,</span> +</span><span id="DataType-2666"><a href="#DataType-2666"><span class="linenos">2666</span></a> <span class="p">}</span> +</span><span id="DataType-2667"><a href="#DataType-2667"><span class="linenos">2667</span></a> +</span><span id="DataType-2668"><a href="#DataType-2668"><span class="linenos">2668</span></a> <span class="n">INTEGER_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-2669"><a href="#DataType-2669"><span class="linenos">2669</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">INT</span><span class="p">,</span> +</span><span id="DataType-2670"><a href="#DataType-2670"><span class="linenos">2670</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TINYINT</span><span class="p">,</span> +</span><span id="DataType-2671"><a href="#DataType-2671"><span class="linenos">2671</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">SMALLINT</span><span class="p">,</span> +</span><span id="DataType-2672"><a href="#DataType-2672"><span class="linenos">2672</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">BIGINT</span><span class="p">,</span> +</span><span id="DataType-2673"><a href="#DataType-2673"><span class="linenos">2673</span></a> <span class="p">}</span> +</span><span id="DataType-2674"><a href="#DataType-2674"><span class="linenos">2674</span></a> +</span><span id="DataType-2675"><a href="#DataType-2675"><span class="linenos">2675</span></a> <span class="n">FLOAT_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-2676"><a href="#DataType-2676"><span class="linenos">2676</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">FLOAT</span><span class="p">,</span> +</span><span id="DataType-2677"><a href="#DataType-2677"><span class="linenos">2677</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DOUBLE</span><span class="p">,</span> +</span><span id="DataType-2678"><a href="#DataType-2678"><span class="linenos">2678</span></a> <span class="p">}</span> +</span><span id="DataType-2679"><a href="#DataType-2679"><span class="linenos">2679</span></a> +</span><span id="DataType-2680"><a href="#DataType-2680"><span class="linenos">2680</span></a> <span class="n">NUMERIC_TYPES</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">INTEGER_TYPES</span><span class="p">,</span> <span class="o">*</span><span class="n">FLOAT_TYPES</span><span class="p">}</span> +</span><span id="DataType-2681"><a href="#DataType-2681"><span class="linenos">2681</span></a> +</span><span id="DataType-2682"><a href="#DataType-2682"><span class="linenos">2682</span></a> <span class="n">TEMPORAL_TYPES</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="DataType-2683"><a href="#DataType-2683"><span class="linenos">2683</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMP</span><span class="p">,</span> +</span><span id="DataType-2684"><a href="#DataType-2684"><span class="linenos">2684</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPTZ</span><span class="p">,</span> +</span><span id="DataType-2685"><a href="#DataType-2685"><span class="linenos">2685</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">TIMESTAMPLTZ</span><span class="p">,</span> +</span><span id="DataType-2686"><a href="#DataType-2686"><span class="linenos">2686</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATE</span><span class="p">,</span> +</span><span id="DataType-2687"><a href="#DataType-2687"><span class="linenos">2687</span></a> <span class="n">Type</span><span class="o">.</span><span class="n">DATETIME</span><span class="p">,</span> +</span><span id="DataType-2688"><a href="#DataType-2688"><span class="linenos">2688</span></a> <span class="p">}</span> +</span><span id="DataType-2689"><a href="#DataType-2689"><span class="linenos">2689</span></a> +</span><span id="DataType-2690"><a href="#DataType-2690"><span class="linenos">2690</span></a> <span class="nd">@classmethod</span> +</span><span id="DataType-2691"><a href="#DataType-2691"><span class="linenos">2691</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="DataType-2692"><a href="#DataType-2692"><span class="linenos">2692</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> +</span><span id="DataType-2693"><a href="#DataType-2693"><span class="linenos">2693</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="DataType-2694"><a href="#DataType-2694"><span class="linenos">2694</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> +</span><span id="DataType-2695"><a href="#DataType-2695"><span class="linenos">2695</span></a> +</span><span id="DataType-2696"><a href="#DataType-2696"><span class="linenos">2696</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="DataType-2697"><a href="#DataType-2697"><span class="linenos">2697</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> +</span><span id="DataType-2698"><a href="#DataType-2698"><span class="linenos">2698</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> +</span><span id="DataType-2699"><a href="#DataType-2699"><span class="linenos">2699</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType-2700"><a href="#DataType-2700"><span class="linenos">2700</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> +</span><span id="DataType-2701"><a href="#DataType-2701"><span class="linenos">2701</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="DataType-2702"><a href="#DataType-2702"><span class="linenos">2702</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="DataType-2703"><a href="#DataType-2703"><span class="linenos">2703</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> +</span><span id="DataType-2704"><a href="#DataType-2704"><span class="linenos">2704</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="DataType-2705"><a href="#DataType-2705"><span class="linenos">2705</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> +</span><span id="DataType-2706"><a href="#DataType-2706"><span class="linenos">2706</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="DataType-2707"><a href="#DataType-2707"><span class="linenos">2707</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType-2708"><a href="#DataType-2708"><span class="linenos">2708</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> +</span><span id="DataType-2709"><a href="#DataType-2709"><span class="linenos">2709</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> +</span><span id="DataType-2710"><a href="#DataType-2710"><span class="linenos">2710</span></a> +</span><span id="DataType-2711"><a href="#DataType-2711"><span class="linenos">2711</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="DataType-2712"><a href="#DataType-2712"><span class="linenos">2712</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> </span></pre></div> @@ -22268,26 +23086,26 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DataType.build"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.build-2632"><a href="#DataType.build-2632"><span class="linenos">2632</span></a> <span class="nd">@classmethod</span> -</span><span id="DataType.build-2633"><a href="#DataType.build-2633"><span class="linenos">2633</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> -</span><span id="DataType.build-2634"><a href="#DataType.build-2634"><span class="linenos">2634</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> -</span><span id="DataType.build-2635"><a href="#DataType.build-2635"><span class="linenos">2635</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> -</span><span id="DataType.build-2636"><a href="#DataType.build-2636"><span class="linenos">2636</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> -</span><span id="DataType.build-2637"><a href="#DataType.build-2637"><span class="linenos">2637</span></a> -</span><span id="DataType.build-2638"><a href="#DataType.build-2638"><span class="linenos">2638</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="DataType.build-2639"><a href="#DataType.build-2639"><span class="linenos">2639</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> -</span><span id="DataType.build-2640"><a href="#DataType.build-2640"><span class="linenos">2640</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> -</span><span id="DataType.build-2641"><a href="#DataType.build-2641"><span class="linenos">2641</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType.build-2642"><a href="#DataType.build-2642"><span class="linenos">2642</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> -</span><span id="DataType.build-2643"><a href="#DataType.build-2643"><span class="linenos">2643</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="DataType.build-2644"><a href="#DataType.build-2644"><span class="linenos">2644</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="DataType.build-2645"><a href="#DataType.build-2645"><span class="linenos">2645</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> -</span><span id="DataType.build-2646"><a href="#DataType.build-2646"><span class="linenos">2646</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> -</span><span id="DataType.build-2647"><a href="#DataType.build-2647"><span class="linenos">2647</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> -</span><span id="DataType.build-2648"><a href="#DataType.build-2648"><span class="linenos">2648</span></a> <span class="k">return</span> <span class="n">dtype</span> -</span><span id="DataType.build-2649"><a href="#DataType.build-2649"><span class="linenos">2649</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="DataType.build-2650"><a href="#DataType.build-2650"><span class="linenos">2650</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> -</span><span id="DataType.build-2651"><a href="#DataType.build-2651"><span class="linenos">2651</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.build-2690"><a href="#DataType.build-2690"><span class="linenos">2690</span></a> <span class="nd">@classmethod</span> +</span><span id="DataType.build-2691"><a href="#DataType.build-2691"><span class="linenos">2691</span></a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span> +</span><span id="DataType.build-2692"><a href="#DataType.build-2692"><span class="linenos">2692</span></a> <span class="bp">cls</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> +</span><span id="DataType.build-2693"><a href="#DataType.build-2693"><span class="linenos">2693</span></a> <span class="p">)</span> <span class="o">-></span> <span class="n">DataType</span><span class="p">:</span> +</span><span id="DataType.build-2694"><a href="#DataType.build-2694"><span class="linenos">2694</span></a> <span class="kn">from</span> <span class="nn">sqlglot</span> <span class="kn">import</span> <span class="n">parse_one</span> +</span><span id="DataType.build-2695"><a href="#DataType.build-2695"><span class="linenos">2695</span></a> +</span><span id="DataType.build-2696"><a href="#DataType.build-2696"><span class="linenos">2696</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="DataType.build-2697"><a href="#DataType.build-2697"><span class="linenos">2697</span></a> <span class="k">if</span> <span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">Type</span><span class="o">.</span><span class="n">__members__</span><span class="p">:</span> +</span><span id="DataType.build-2698"><a href="#DataType.build-2698"><span class="linenos">2698</span></a> <span class="n">data_type_exp</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Expression</span><span class="p">]</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">[</span><span class="n">dtype</span><span class="o">.</span><span class="n">upper</span><span class="p">()])</span> +</span><span id="DataType.build-2699"><a href="#DataType.build-2699"><span class="linenos">2699</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType.build-2700"><a href="#DataType.build-2700"><span class="linenos">2700</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">parse_one</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">DataType</span><span class="p">)</span> +</span><span id="DataType.build-2701"><a href="#DataType.build-2701"><span class="linenos">2701</span></a> <span class="k">if</span> <span class="n">data_type_exp</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="DataType.build-2702"><a href="#DataType.build-2702"><span class="linenos">2702</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Unparsable data type value: </span><span class="si">{</span><span class="n">dtype</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="DataType.build-2703"><a href="#DataType.build-2703"><span class="linenos">2703</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">):</span> +</span><span id="DataType.build-2704"><a href="#DataType.build-2704"><span class="linenos">2704</span></a> <span class="n">data_type_exp</span> <span class="o">=</span> <span class="n">DataType</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">dtype</span><span class="p">)</span> +</span><span id="DataType.build-2705"><a href="#DataType.build-2705"><span class="linenos">2705</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">dtype</span><span class="p">,</span> <span class="n">DataType</span><span class="p">):</span> +</span><span id="DataType.build-2706"><a href="#DataType.build-2706"><span class="linenos">2706</span></a> <span class="k">return</span> <span class="n">dtype</span> +</span><span id="DataType.build-2707"><a href="#DataType.build-2707"><span class="linenos">2707</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="DataType.build-2708"><a href="#DataType.build-2708"><span class="linenos">2708</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid data type: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span><span class="si">}</span><span class="s2">. Expected str or DataType.Type"</span><span class="p">)</span> +</span><span id="DataType.build-2709"><a href="#DataType.build-2709"><span class="linenos">2709</span></a> <span class="k">return</span> <span class="n">DataType</span><span class="p">(</span><span class="o">**</span><span class="p">{</span><span class="o">**</span><span class="n">data_type_exp</span><span class="o">.</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">})</span> </span></pre></div> @@ -22305,8 +23123,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DataType.is_type"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.is_type-2653"><a href="#DataType.is_type-2653"><span class="linenos">2653</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="DataType.is_type-2654"><a href="#DataType.is_type-2654"><span class="linenos">2654</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.is_type-2711"><a href="#DataType.is_type-2711"><span class="linenos">2711</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="DataType.is_type-2712"><a href="#DataType.is_type-2712"><span class="linenos">2712</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> <span class="o">==</span> <span class="n">dtype</span> </span></pre></div> @@ -22367,58 +23185,59 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DataType.Type"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.Type-2549"><a href="#DataType.Type-2549"><span class="linenos">2549</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> -</span><span id="DataType.Type-2550"><a href="#DataType.Type-2550"><span class="linenos">2550</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2551"><a href="#DataType.Type-2551"><span class="linenos">2551</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2552"><a href="#DataType.Type-2552"><span class="linenos">2552</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2553"><a href="#DataType.Type-2553"><span class="linenos">2553</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2554"><a href="#DataType.Type-2554"><span class="linenos">2554</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2555"><a href="#DataType.Type-2555"><span class="linenos">2555</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2556"><a href="#DataType.Type-2556"><span class="linenos">2556</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2557"><a href="#DataType.Type-2557"><span class="linenos">2557</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2558"><a href="#DataType.Type-2558"><span class="linenos">2558</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2559"><a href="#DataType.Type-2559"><span class="linenos">2559</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2560"><a href="#DataType.Type-2560"><span class="linenos">2560</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2561"><a href="#DataType.Type-2561"><span class="linenos">2561</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2562"><a href="#DataType.Type-2562"><span class="linenos">2562</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2563"><a href="#DataType.Type-2563"><span class="linenos">2563</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2564"><a href="#DataType.Type-2564"><span class="linenos">2564</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2565"><a href="#DataType.Type-2565"><span class="linenos">2565</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2566"><a href="#DataType.Type-2566"><span class="linenos">2566</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2567"><a href="#DataType.Type-2567"><span class="linenos">2567</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2568"><a href="#DataType.Type-2568"><span class="linenos">2568</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2569"><a href="#DataType.Type-2569"><span class="linenos">2569</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2570"><a href="#DataType.Type-2570"><span class="linenos">2570</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2571"><a href="#DataType.Type-2571"><span class="linenos">2571</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2572"><a href="#DataType.Type-2572"><span class="linenos">2572</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2573"><a href="#DataType.Type-2573"><span class="linenos">2573</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2574"><a href="#DataType.Type-2574"><span class="linenos">2574</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2575"><a href="#DataType.Type-2575"><span class="linenos">2575</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2576"><a href="#DataType.Type-2576"><span class="linenos">2576</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2577"><a href="#DataType.Type-2577"><span class="linenos">2577</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2578"><a href="#DataType.Type-2578"><span class="linenos">2578</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2579"><a href="#DataType.Type-2579"><span class="linenos">2579</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2580"><a href="#DataType.Type-2580"><span class="linenos">2580</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2581"><a href="#DataType.Type-2581"><span class="linenos">2581</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2582"><a href="#DataType.Type-2582"><span class="linenos">2582</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2583"><a href="#DataType.Type-2583"><span class="linenos">2583</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2584"><a href="#DataType.Type-2584"><span class="linenos">2584</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2585"><a href="#DataType.Type-2585"><span class="linenos">2585</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2586"><a href="#DataType.Type-2586"><span class="linenos">2586</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2587"><a href="#DataType.Type-2587"><span class="linenos">2587</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2588"><a href="#DataType.Type-2588"><span class="linenos">2588</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2589"><a href="#DataType.Type-2589"><span class="linenos">2589</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2590"><a href="#DataType.Type-2590"><span class="linenos">2590</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2591"><a href="#DataType.Type-2591"><span class="linenos">2591</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2592"><a href="#DataType.Type-2592"><span class="linenos">2592</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2593"><a href="#DataType.Type-2593"><span class="linenos">2593</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2594"><a href="#DataType.Type-2594"><span class="linenos">2594</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2595"><a href="#DataType.Type-2595"><span class="linenos">2595</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2596"><a href="#DataType.Type-2596"><span class="linenos">2596</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2597"><a href="#DataType.Type-2597"><span class="linenos">2597</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2598"><a href="#DataType.Type-2598"><span class="linenos">2598</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2599"><a href="#DataType.Type-2599"><span class="linenos">2599</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> -</span><span id="DataType.Type-2600"><a href="#DataType.Type-2600"><span class="linenos">2600</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DataType.Type-2606"><a href="#DataType.Type-2606"><span class="linenos">2606</span></a> <span class="k">class</span> <span class="nc">Type</span><span class="p">(</span><span class="n">AutoName</span><span class="p">):</span> +</span><span id="DataType.Type-2607"><a href="#DataType.Type-2607"><span class="linenos">2607</span></a> <span class="n">CHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2608"><a href="#DataType.Type-2608"><span class="linenos">2608</span></a> <span class="n">NCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2609"><a href="#DataType.Type-2609"><span class="linenos">2609</span></a> <span class="n">VARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2610"><a href="#DataType.Type-2610"><span class="linenos">2610</span></a> <span class="n">NVARCHAR</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2611"><a href="#DataType.Type-2611"><span class="linenos">2611</span></a> <span class="n">TEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2612"><a href="#DataType.Type-2612"><span class="linenos">2612</span></a> <span class="n">MEDIUMTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2613"><a href="#DataType.Type-2613"><span class="linenos">2613</span></a> <span class="n">LONGTEXT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2614"><a href="#DataType.Type-2614"><span class="linenos">2614</span></a> <span class="n">MEDIUMBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2615"><a href="#DataType.Type-2615"><span class="linenos">2615</span></a> <span class="n">LONGBLOB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2616"><a href="#DataType.Type-2616"><span class="linenos">2616</span></a> <span class="n">BINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2617"><a href="#DataType.Type-2617"><span class="linenos">2617</span></a> <span class="n">VARBINARY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2618"><a href="#DataType.Type-2618"><span class="linenos">2618</span></a> <span class="n">INT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2619"><a href="#DataType.Type-2619"><span class="linenos">2619</span></a> <span class="n">TINYINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2620"><a href="#DataType.Type-2620"><span class="linenos">2620</span></a> <span class="n">SMALLINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2621"><a href="#DataType.Type-2621"><span class="linenos">2621</span></a> <span class="n">BIGINT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2622"><a href="#DataType.Type-2622"><span class="linenos">2622</span></a> <span class="n">FLOAT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2623"><a href="#DataType.Type-2623"><span class="linenos">2623</span></a> <span class="n">DOUBLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2624"><a href="#DataType.Type-2624"><span class="linenos">2624</span></a> <span class="n">DECIMAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2625"><a href="#DataType.Type-2625"><span class="linenos">2625</span></a> <span class="n">BOOLEAN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2626"><a href="#DataType.Type-2626"><span class="linenos">2626</span></a> <span class="n">JSON</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2627"><a href="#DataType.Type-2627"><span class="linenos">2627</span></a> <span class="n">JSONB</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2628"><a href="#DataType.Type-2628"><span class="linenos">2628</span></a> <span class="n">INTERVAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2629"><a href="#DataType.Type-2629"><span class="linenos">2629</span></a> <span class="n">TIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2630"><a href="#DataType.Type-2630"><span class="linenos">2630</span></a> <span class="n">TIMESTAMP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2631"><a href="#DataType.Type-2631"><span class="linenos">2631</span></a> <span class="n">TIMESTAMPTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2632"><a href="#DataType.Type-2632"><span class="linenos">2632</span></a> <span class="n">TIMESTAMPLTZ</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2633"><a href="#DataType.Type-2633"><span class="linenos">2633</span></a> <span class="n">DATE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2634"><a href="#DataType.Type-2634"><span class="linenos">2634</span></a> <span class="n">DATETIME</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2635"><a href="#DataType.Type-2635"><span class="linenos">2635</span></a> <span class="n">ARRAY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2636"><a href="#DataType.Type-2636"><span class="linenos">2636</span></a> <span class="n">MAP</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2637"><a href="#DataType.Type-2637"><span class="linenos">2637</span></a> <span class="n">UUID</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2638"><a href="#DataType.Type-2638"><span class="linenos">2638</span></a> <span class="n">GEOGRAPHY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2639"><a href="#DataType.Type-2639"><span class="linenos">2639</span></a> <span class="n">GEOMETRY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2640"><a href="#DataType.Type-2640"><span class="linenos">2640</span></a> <span class="n">STRUCT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2641"><a href="#DataType.Type-2641"><span class="linenos">2641</span></a> <span class="n">NULLABLE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2642"><a href="#DataType.Type-2642"><span class="linenos">2642</span></a> <span class="n">HLLSKETCH</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2643"><a href="#DataType.Type-2643"><span class="linenos">2643</span></a> <span class="n">HSTORE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2644"><a href="#DataType.Type-2644"><span class="linenos">2644</span></a> <span class="n">SUPER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2645"><a href="#DataType.Type-2645"><span class="linenos">2645</span></a> <span class="n">SERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2646"><a href="#DataType.Type-2646"><span class="linenos">2646</span></a> <span class="n">SMALLSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2647"><a href="#DataType.Type-2647"><span class="linenos">2647</span></a> <span class="n">BIGSERIAL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2648"><a href="#DataType.Type-2648"><span class="linenos">2648</span></a> <span class="n">XML</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2649"><a href="#DataType.Type-2649"><span class="linenos">2649</span></a> <span class="n">UNIQUEIDENTIFIER</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2650"><a href="#DataType.Type-2650"><span class="linenos">2650</span></a> <span class="n">MONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2651"><a href="#DataType.Type-2651"><span class="linenos">2651</span></a> <span class="n">SMALLMONEY</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2652"><a href="#DataType.Type-2652"><span class="linenos">2652</span></a> <span class="n">ROWVERSION</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2653"><a href="#DataType.Type-2653"><span class="linenos">2653</span></a> <span class="n">IMAGE</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2654"><a href="#DataType.Type-2654"><span class="linenos">2654</span></a> <span class="n">VARIANT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2655"><a href="#DataType.Type-2655"><span class="linenos">2655</span></a> <span class="n">OBJECT</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2656"><a href="#DataType.Type-2656"><span class="linenos">2656</span></a> <span class="n">INET</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2657"><a href="#DataType.Type-2657"><span class="linenos">2657</span></a> <span class="n">NULL</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> +</span><span id="DataType.Type-2658"><a href="#DataType.Type-2658"><span class="linenos">2658</span></a> <span class="n">UNKNOWN</span> <span class="o">=</span> <span class="n">auto</span><span class="p">()</span> <span class="c1"># Sentinel value, useful for type annotation</span> </span></pre></div> @@ -22428,7 +23247,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, <div id="DataType.Type.CHAR" class="classattr"> <div class="attr variable"> - <span class="name">CHAR</span><span class="default_value"> = <Type.CHAR: 'CHAR'></span> + <span class="name">CHAR</span> = +<span class="default_value"><Type.CHAR: 'CHAR'></span> </div> @@ -22439,7 +23259,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.NCHAR" class="classattr"> <div class="attr variable"> - <span class="name">NCHAR</span><span class="default_value"> = <Type.NCHAR: 'NCHAR'></span> + <span class="name">NCHAR</span> = +<span class="default_value"><Type.NCHAR: 'NCHAR'></span> </div> @@ -22450,7 +23271,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.VARCHAR" class="classattr"> <div class="attr variable"> - <span class="name">VARCHAR</span><span class="default_value"> = <Type.VARCHAR: 'VARCHAR'></span> + <span class="name">VARCHAR</span> = +<span class="default_value"><Type.VARCHAR: 'VARCHAR'></span> </div> @@ -22461,7 +23283,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.NVARCHAR" class="classattr"> <div class="attr variable"> - <span class="name">NVARCHAR</span><span class="default_value"> = <Type.NVARCHAR: 'NVARCHAR'></span> + <span class="name">NVARCHAR</span> = +<span class="default_value"><Type.NVARCHAR: 'NVARCHAR'></span> </div> @@ -22472,7 +23295,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TEXT" class="classattr"> <div class="attr variable"> - <span class="name">TEXT</span><span class="default_value"> = <Type.TEXT: 'TEXT'></span> + <span class="name">TEXT</span> = +<span class="default_value"><Type.TEXT: 'TEXT'></span> </div> @@ -22483,7 +23307,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.MEDIUMTEXT" class="classattr"> <div class="attr variable"> - <span class="name">MEDIUMTEXT</span><span class="default_value"> = <Type.MEDIUMTEXT: 'MEDIUMTEXT'></span> + <span class="name">MEDIUMTEXT</span> = +<span class="default_value"><Type.MEDIUMTEXT: 'MEDIUMTEXT'></span> </div> @@ -22494,7 +23319,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.LONGTEXT" class="classattr"> <div class="attr variable"> - <span class="name">LONGTEXT</span><span class="default_value"> = <Type.LONGTEXT: 'LONGTEXT'></span> + <span class="name">LONGTEXT</span> = +<span class="default_value"><Type.LONGTEXT: 'LONGTEXT'></span> </div> @@ -22505,7 +23331,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.MEDIUMBLOB" class="classattr"> <div class="attr variable"> - <span class="name">MEDIUMBLOB</span><span class="default_value"> = <Type.MEDIUMBLOB: 'MEDIUMBLOB'></span> + <span class="name">MEDIUMBLOB</span> = +<span class="default_value"><Type.MEDIUMBLOB: 'MEDIUMBLOB'></span> </div> @@ -22516,7 +23343,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.LONGBLOB" class="classattr"> <div class="attr variable"> - <span class="name">LONGBLOB</span><span class="default_value"> = <Type.LONGBLOB: 'LONGBLOB'></span> + <span class="name">LONGBLOB</span> = +<span class="default_value"><Type.LONGBLOB: 'LONGBLOB'></span> </div> @@ -22527,7 +23355,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.BINARY" class="classattr"> <div class="attr variable"> - <span class="name">BINARY</span><span class="default_value"> = <Type.BINARY: 'BINARY'></span> + <span class="name">BINARY</span> = +<span class="default_value"><Type.BINARY: 'BINARY'></span> </div> @@ -22538,7 +23367,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.VARBINARY" class="classattr"> <div class="attr variable"> - <span class="name">VARBINARY</span><span class="default_value"> = <Type.VARBINARY: 'VARBINARY'></span> + <span class="name">VARBINARY</span> = +<span class="default_value"><Type.VARBINARY: 'VARBINARY'></span> </div> @@ -22549,7 +23379,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.INT" class="classattr"> <div class="attr variable"> - <span class="name">INT</span><span class="default_value"> = <Type.INT: 'INT'></span> + <span class="name">INT</span> = +<span class="default_value"><Type.INT: 'INT'></span> </div> @@ -22560,7 +23391,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TINYINT" class="classattr"> <div class="attr variable"> - <span class="name">TINYINT</span><span class="default_value"> = <Type.TINYINT: 'TINYINT'></span> + <span class="name">TINYINT</span> = +<span class="default_value"><Type.TINYINT: 'TINYINT'></span> </div> @@ -22571,7 +23403,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.SMALLINT" class="classattr"> <div class="attr variable"> - <span class="name">SMALLINT</span><span class="default_value"> = <Type.SMALLINT: 'SMALLINT'></span> + <span class="name">SMALLINT</span> = +<span class="default_value"><Type.SMALLINT: 'SMALLINT'></span> </div> @@ -22582,7 +23415,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.BIGINT" class="classattr"> <div class="attr variable"> - <span class="name">BIGINT</span><span class="default_value"> = <Type.BIGINT: 'BIGINT'></span> + <span class="name">BIGINT</span> = +<span class="default_value"><Type.BIGINT: 'BIGINT'></span> </div> @@ -22593,7 +23427,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.FLOAT" class="classattr"> <div class="attr variable"> - <span class="name">FLOAT</span><span class="default_value"> = <Type.FLOAT: 'FLOAT'></span> + <span class="name">FLOAT</span> = +<span class="default_value"><Type.FLOAT: 'FLOAT'></span> </div> @@ -22604,7 +23439,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.DOUBLE" class="classattr"> <div class="attr variable"> - <span class="name">DOUBLE</span><span class="default_value"> = <Type.DOUBLE: 'DOUBLE'></span> + <span class="name">DOUBLE</span> = +<span class="default_value"><Type.DOUBLE: 'DOUBLE'></span> </div> @@ -22615,7 +23451,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.DECIMAL" class="classattr"> <div class="attr variable"> - <span class="name">DECIMAL</span><span class="default_value"> = <Type.DECIMAL: 'DECIMAL'></span> + <span class="name">DECIMAL</span> = +<span class="default_value"><Type.DECIMAL: 'DECIMAL'></span> </div> @@ -22626,7 +23463,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.BOOLEAN" class="classattr"> <div class="attr variable"> - <span class="name">BOOLEAN</span><span class="default_value"> = <Type.BOOLEAN: 'BOOLEAN'></span> + <span class="name">BOOLEAN</span> = +<span class="default_value"><Type.BOOLEAN: 'BOOLEAN'></span> </div> @@ -22637,7 +23475,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.JSON" class="classattr"> <div class="attr variable"> - <span class="name">JSON</span><span class="default_value"> = <Type.JSON: 'JSON'></span> + <span class="name">JSON</span> = +<span class="default_value"><Type.JSON: 'JSON'></span> </div> @@ -22648,7 +23487,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.JSONB" class="classattr"> <div class="attr variable"> - <span class="name">JSONB</span><span class="default_value"> = <Type.JSONB: 'JSONB'></span> + <span class="name">JSONB</span> = +<span class="default_value"><Type.JSONB: 'JSONB'></span> </div> @@ -22659,7 +23499,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.INTERVAL" class="classattr"> <div class="attr variable"> - <span class="name">INTERVAL</span><span class="default_value"> = <Type.INTERVAL: 'INTERVAL'></span> + <span class="name">INTERVAL</span> = +<span class="default_value"><Type.INTERVAL: 'INTERVAL'></span> </div> @@ -22670,7 +23511,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TIME" class="classattr"> <div class="attr variable"> - <span class="name">TIME</span><span class="default_value"> = <Type.TIME: 'TIME'></span> + <span class="name">TIME</span> = +<span class="default_value"><Type.TIME: 'TIME'></span> </div> @@ -22681,7 +23523,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TIMESTAMP" class="classattr"> <div class="attr variable"> - <span class="name">TIMESTAMP</span><span class="default_value"> = <Type.TIMESTAMP: 'TIMESTAMP'></span> + <span class="name">TIMESTAMP</span> = +<span class="default_value"><Type.TIMESTAMP: 'TIMESTAMP'></span> </div> @@ -22692,7 +23535,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TIMESTAMPTZ" class="classattr"> <div class="attr variable"> - <span class="name">TIMESTAMPTZ</span><span class="default_value"> = <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'></span> + <span class="name">TIMESTAMPTZ</span> = +<span class="default_value"><Type.TIMESTAMPTZ: 'TIMESTAMPTZ'></span> </div> @@ -22703,7 +23547,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.TIMESTAMPLTZ" class="classattr"> <div class="attr variable"> - <span class="name">TIMESTAMPLTZ</span><span class="default_value"> = <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'></span> + <span class="name">TIMESTAMPLTZ</span> = +<span class="default_value"><Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'></span> </div> @@ -22714,7 +23559,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.DATE" class="classattr"> <div class="attr variable"> - <span class="name">DATE</span><span class="default_value"> = <Type.DATE: 'DATE'></span> + <span class="name">DATE</span> = +<span class="default_value"><Type.DATE: 'DATE'></span> </div> @@ -22725,7 +23571,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.DATETIME" class="classattr"> <div class="attr variable"> - <span class="name">DATETIME</span><span class="default_value"> = <Type.DATETIME: 'DATETIME'></span> + <span class="name">DATETIME</span> = +<span class="default_value"><Type.DATETIME: 'DATETIME'></span> </div> @@ -22736,7 +23583,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.ARRAY" class="classattr"> <div class="attr variable"> - <span class="name">ARRAY</span><span class="default_value"> = <Type.ARRAY: 'ARRAY'></span> + <span class="name">ARRAY</span> = +<span class="default_value"><Type.ARRAY: 'ARRAY'></span> </div> @@ -22747,7 +23595,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.MAP" class="classattr"> <div class="attr variable"> - <span class="name">MAP</span><span class="default_value"> = <Type.MAP: 'MAP'></span> + <span class="name">MAP</span> = +<span class="default_value"><Type.MAP: 'MAP'></span> </div> @@ -22758,7 +23607,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.UUID" class="classattr"> <div class="attr variable"> - <span class="name">UUID</span><span class="default_value"> = <Type.UUID: 'UUID'></span> + <span class="name">UUID</span> = +<span class="default_value"><Type.UUID: 'UUID'></span> </div> @@ -22769,7 +23619,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.GEOGRAPHY" class="classattr"> <div class="attr variable"> - <span class="name">GEOGRAPHY</span><span class="default_value"> = <Type.GEOGRAPHY: 'GEOGRAPHY'></span> + <span class="name">GEOGRAPHY</span> = +<span class="default_value"><Type.GEOGRAPHY: 'GEOGRAPHY'></span> </div> @@ -22780,7 +23631,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.GEOMETRY" class="classattr"> <div class="attr variable"> - <span class="name">GEOMETRY</span><span class="default_value"> = <Type.GEOMETRY: 'GEOMETRY'></span> + <span class="name">GEOMETRY</span> = +<span class="default_value"><Type.GEOMETRY: 'GEOMETRY'></span> </div> @@ -22791,7 +23643,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.STRUCT" class="classattr"> <div class="attr variable"> - <span class="name">STRUCT</span><span class="default_value"> = <Type.STRUCT: 'STRUCT'></span> + <span class="name">STRUCT</span> = +<span class="default_value"><Type.STRUCT: 'STRUCT'></span> </div> @@ -22802,7 +23655,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.NULLABLE" class="classattr"> <div class="attr variable"> - <span class="name">NULLABLE</span><span class="default_value"> = <Type.NULLABLE: 'NULLABLE'></span> + <span class="name">NULLABLE</span> = +<span class="default_value"><Type.NULLABLE: 'NULLABLE'></span> </div> @@ -22813,7 +23667,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.HLLSKETCH" class="classattr"> <div class="attr variable"> - <span class="name">HLLSKETCH</span><span class="default_value"> = <Type.HLLSKETCH: 'HLLSKETCH'></span> + <span class="name">HLLSKETCH</span> = +<span class="default_value"><Type.HLLSKETCH: 'HLLSKETCH'></span> </div> @@ -22824,7 +23679,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.HSTORE" class="classattr"> <div class="attr variable"> - <span class="name">HSTORE</span><span class="default_value"> = <Type.HSTORE: 'HSTORE'></span> + <span class="name">HSTORE</span> = +<span class="default_value"><Type.HSTORE: 'HSTORE'></span> </div> @@ -22835,7 +23691,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.SUPER" class="classattr"> <div class="attr variable"> - <span class="name">SUPER</span><span class="default_value"> = <Type.SUPER: 'SUPER'></span> + <span class="name">SUPER</span> = +<span class="default_value"><Type.SUPER: 'SUPER'></span> </div> @@ -22846,7 +23703,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.SERIAL" class="classattr"> <div class="attr variable"> - <span class="name">SERIAL</span><span class="default_value"> = <Type.SERIAL: 'SERIAL'></span> + <span class="name">SERIAL</span> = +<span class="default_value"><Type.SERIAL: 'SERIAL'></span> </div> @@ -22857,7 +23715,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.SMALLSERIAL" class="classattr"> <div class="attr variable"> - <span class="name">SMALLSERIAL</span><span class="default_value"> = <Type.SMALLSERIAL: 'SMALLSERIAL'></span> + <span class="name">SMALLSERIAL</span> = +<span class="default_value"><Type.SMALLSERIAL: 'SMALLSERIAL'></span> </div> @@ -22868,7 +23727,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.BIGSERIAL" class="classattr"> <div class="attr variable"> - <span class="name">BIGSERIAL</span><span class="default_value"> = <Type.BIGSERIAL: 'BIGSERIAL'></span> + <span class="name">BIGSERIAL</span> = +<span class="default_value"><Type.BIGSERIAL: 'BIGSERIAL'></span> </div> @@ -22879,7 +23739,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.XML" class="classattr"> <div class="attr variable"> - <span class="name">XML</span><span class="default_value"> = <Type.XML: 'XML'></span> + <span class="name">XML</span> = +<span class="default_value"><Type.XML: 'XML'></span> </div> @@ -22890,7 +23751,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.UNIQUEIDENTIFIER" class="classattr"> <div class="attr variable"> - <span class="name">UNIQUEIDENTIFIER</span><span class="default_value"> = <Type.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'></span> + <span class="name">UNIQUEIDENTIFIER</span> = +<span class="default_value"><Type.UNIQUEIDENTIFIER: 'UNIQUEIDENTIFIER'></span> </div> @@ -22901,7 +23763,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.MONEY" class="classattr"> <div class="attr variable"> - <span class="name">MONEY</span><span class="default_value"> = <Type.MONEY: 'MONEY'></span> + <span class="name">MONEY</span> = +<span class="default_value"><Type.MONEY: 'MONEY'></span> </div> @@ -22912,7 +23775,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.SMALLMONEY" class="classattr"> <div class="attr variable"> - <span class="name">SMALLMONEY</span><span class="default_value"> = <Type.SMALLMONEY: 'SMALLMONEY'></span> + <span class="name">SMALLMONEY</span> = +<span class="default_value"><Type.SMALLMONEY: 'SMALLMONEY'></span> </div> @@ -22923,7 +23787,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.ROWVERSION" class="classattr"> <div class="attr variable"> - <span class="name">ROWVERSION</span><span class="default_value"> = <Type.ROWVERSION: 'ROWVERSION'></span> + <span class="name">ROWVERSION</span> = +<span class="default_value"><Type.ROWVERSION: 'ROWVERSION'></span> </div> @@ -22934,7 +23799,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.IMAGE" class="classattr"> <div class="attr variable"> - <span class="name">IMAGE</span><span class="default_value"> = <Type.IMAGE: 'IMAGE'></span> + <span class="name">IMAGE</span> = +<span class="default_value"><Type.IMAGE: 'IMAGE'></span> </div> @@ -22945,7 +23811,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.VARIANT" class="classattr"> <div class="attr variable"> - <span class="name">VARIANT</span><span class="default_value"> = <Type.VARIANT: 'VARIANT'></span> + <span class="name">VARIANT</span> = +<span class="default_value"><Type.VARIANT: 'VARIANT'></span> </div> @@ -22956,7 +23823,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.OBJECT" class="classattr"> <div class="attr variable"> - <span class="name">OBJECT</span><span class="default_value"> = <Type.OBJECT: 'OBJECT'></span> + <span class="name">OBJECT</span> = +<span class="default_value"><Type.OBJECT: 'OBJECT'></span> </div> @@ -22965,9 +23833,22 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> + <div id="DataType.Type.INET" class="classattr"> + <div class="attr variable"> + <span class="name">INET</span> = +<span class="default_value"><Type.INET: 'INET'></span> + + + </div> + <a class="headerlink" href="#DataType.Type.INET"></a> + + + + </div> <div id="DataType.Type.NULL" class="classattr"> <div class="attr variable"> - <span class="name">NULL</span><span class="default_value"> = <Type.NULL: 'NULL'></span> + <span class="name">NULL</span> = +<span class="default_value"><Type.NULL: 'NULL'></span> </div> @@ -22978,7 +23859,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <div id="DataType.Type.UNKNOWN" class="classattr"> <div class="attr variable"> - <span class="name">UNKNOWN</span><span class="default_value"> = <Type.UNKNOWN: 'UNKNOWN'></span> + <span class="name">UNKNOWN</span> = +<span class="default_value"><Type.UNKNOWN: 'UNKNOWN'></span> </div> @@ -23009,8 +23891,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#PseudoType"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PseudoType-2658"><a href="#PseudoType-2658"><span class="linenos">2658</span></a><span class="k">class</span> <span class="nc">PseudoType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="PseudoType-2659"><a href="#PseudoType-2659"><span class="linenos">2659</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PseudoType-2716"><a href="#PseudoType-2716"><span class="linenos">2716</span></a><span class="k">class</span> <span class="nc">PseudoType</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="PseudoType-2717"><a href="#PseudoType-2717"><span class="linenos">2717</span></a> <span class="k">pass</span> </span></pre></div> @@ -23070,8 +23952,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#StructKwarg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StructKwarg-2662"><a href="#StructKwarg-2662"><span class="linenos">2662</span></a><span class="k">class</span> <span class="nc">StructKwarg</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="StructKwarg-2663"><a href="#StructKwarg-2663"><span class="linenos">2663</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StructKwarg-2720"><a href="#StructKwarg-2720"><span class="linenos">2720</span></a><span class="k">class</span> <span class="nc">StructKwarg</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="StructKwarg-2721"><a href="#StructKwarg-2721"><span class="linenos">2721</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -23131,8 +24013,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#SubqueryPredicate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SubqueryPredicate-2667"><a href="#SubqueryPredicate-2667"><span class="linenos">2667</span></a><span class="k">class</span> <span class="nc">SubqueryPredicate</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="SubqueryPredicate-2668"><a href="#SubqueryPredicate-2668"><span class="linenos">2668</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SubqueryPredicate-2725"><a href="#SubqueryPredicate-2725"><span class="linenos">2725</span></a><span class="k">class</span> <span class="nc">SubqueryPredicate</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="SubqueryPredicate-2726"><a href="#SubqueryPredicate-2726"><span class="linenos">2726</span></a> <span class="k">pass</span> </span></pre></div> @@ -23198,8 +24080,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#All"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="All-2671"><a href="#All-2671"><span class="linenos">2671</span></a><span class="k">class</span> <span class="nc">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="All-2672"><a href="#All-2672"><span class="linenos">2672</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="All-2729"><a href="#All-2729"><span class="linenos">2729</span></a><span class="k">class</span> <span class="nc">All</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="All-2730"><a href="#All-2730"><span class="linenos">2730</span></a> <span class="k">pass</span> </span></pre></div> @@ -23265,8 +24147,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Any"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Any-2675"><a href="#Any-2675"><span class="linenos">2675</span></a><span class="k">class</span> <span class="nc">Any</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="Any-2676"><a href="#Any-2676"><span class="linenos">2676</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Any-2733"><a href="#Any-2733"><span class="linenos">2733</span></a><span class="k">class</span> <span class="nc">Any</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="Any-2734"><a href="#Any-2734"><span class="linenos">2734</span></a> <span class="k">pass</span> </span></pre></div> @@ -23332,8 +24214,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Exists"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Exists-2679"><a href="#Exists-2679"><span class="linenos">2679</span></a><span class="k">class</span> <span class="nc">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> -</span><span id="Exists-2680"><a href="#Exists-2680"><span class="linenos">2680</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Exists-2737"><a href="#Exists-2737"><span class="linenos">2737</span></a><span class="k">class</span> <span class="nc">Exists</span><span class="p">(</span><span class="n">SubqueryPredicate</span><span class="p">):</span> +</span><span id="Exists-2738"><a href="#Exists-2738"><span class="linenos">2738</span></a> <span class="k">pass</span> </span></pre></div> @@ -23399,8 +24281,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Command"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Command-2685"><a href="#Command-2685"><span class="linenos">2685</span></a><span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Command-2686"><a href="#Command-2686"><span class="linenos">2686</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Command-2743"><a href="#Command-2743"><span class="linenos">2743</span></a><span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Command-2744"><a href="#Command-2744"><span class="linenos">2744</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23460,8 +24342,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Transaction"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Transaction-2689"><a href="#Transaction-2689"><span class="linenos">2689</span></a><span class="k">class</span> <span class="nc">Transaction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Transaction-2690"><a href="#Transaction-2690"><span class="linenos">2690</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"modes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Transaction-2747"><a href="#Transaction-2747"><span class="linenos">2747</span></a><span class="k">class</span> <span class="nc">Transaction</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Transaction-2748"><a href="#Transaction-2748"><span class="linenos">2748</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"modes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23521,8 +24403,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Commit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Commit-2693"><a href="#Commit-2693"><span class="linenos">2693</span></a><span class="k">class</span> <span class="nc">Commit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Commit-2694"><a href="#Commit-2694"><span class="linenos">2694</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"chain"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Commit-2751"><a href="#Commit-2751"><span class="linenos">2751</span></a><span class="k">class</span> <span class="nc">Commit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Commit-2752"><a href="#Commit-2752"><span class="linenos">2752</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"chain"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23582,8 +24464,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Rollback"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Rollback-2697"><a href="#Rollback-2697"><span class="linenos">2697</span></a><span class="k">class</span> <span class="nc">Rollback</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Rollback-2698"><a href="#Rollback-2698"><span class="linenos">2698</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"savepoint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Rollback-2755"><a href="#Rollback-2755"><span class="linenos">2755</span></a><span class="k">class</span> <span class="nc">Rollback</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Rollback-2756"><a href="#Rollback-2756"><span class="linenos">2756</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"savepoint"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23643,8 +24525,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#AlterTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AlterTable-2701"><a href="#AlterTable-2701"><span class="linenos">2701</span></a><span class="k">class</span> <span class="nc">AlterTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="AlterTable-2702"><a href="#AlterTable-2702"><span class="linenos">2702</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"actions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AlterTable-2759"><a href="#AlterTable-2759"><span class="linenos">2759</span></a><span class="k">class</span> <span class="nc">AlterTable</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="AlterTable-2760"><a href="#AlterTable-2760"><span class="linenos">2760</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"actions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23704,8 +24586,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#AddConstraint"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AddConstraint-2705"><a href="#AddConstraint-2705"><span class="linenos">2705</span></a><span class="k">class</span> <span class="nc">AddConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="AddConstraint-2706"><a href="#AddConstraint-2706"><span class="linenos">2706</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"enforced"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AddConstraint-2763"><a href="#AddConstraint-2763"><span class="linenos">2763</span></a><span class="k">class</span> <span class="nc">AddConstraint</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="AddConstraint-2764"><a href="#AddConstraint-2764"><span class="linenos">2764</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"enforced"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23765,8 +24647,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DropPartition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DropPartition-2709"><a href="#DropPartition-2709"><span class="linenos">2709</span></a><span class="k">class</span> <span class="nc">DropPartition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="DropPartition-2710"><a href="#DropPartition-2710"><span class="linenos">2710</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DropPartition-2767"><a href="#DropPartition-2767"><span class="linenos">2767</span></a><span class="k">class</span> <span class="nc">DropPartition</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="DropPartition-2768"><a href="#DropPartition-2768"><span class="linenos">2768</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"exists"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -23826,16 +24708,16 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Binary"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Binary-2714"><a href="#Binary-2714"><span class="linenos">2714</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Binary-2715"><a href="#Binary-2715"><span class="linenos">2715</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Binary-2716"><a href="#Binary-2716"><span class="linenos">2716</span></a> -</span><span id="Binary-2717"><a href="#Binary-2717"><span class="linenos">2717</span></a> <span class="nd">@property</span> -</span><span id="Binary-2718"><a href="#Binary-2718"><span class="linenos">2718</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Binary-2719"><a href="#Binary-2719"><span class="linenos">2719</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> -</span><span id="Binary-2720"><a href="#Binary-2720"><span class="linenos">2720</span></a> -</span><span id="Binary-2721"><a href="#Binary-2721"><span class="linenos">2721</span></a> <span class="nd">@property</span> -</span><span id="Binary-2722"><a href="#Binary-2722"><span class="linenos">2722</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Binary-2723"><a href="#Binary-2723"><span class="linenos">2723</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Binary-2772"><a href="#Binary-2772"><span class="linenos">2772</span></a><span class="k">class</span> <span class="nc">Binary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Binary-2773"><a href="#Binary-2773"><span class="linenos">2773</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Binary-2774"><a href="#Binary-2774"><span class="linenos">2774</span></a> +</span><span id="Binary-2775"><a href="#Binary-2775"><span class="linenos">2775</span></a> <span class="nd">@property</span> +</span><span id="Binary-2776"><a href="#Binary-2776"><span class="linenos">2776</span></a> <span class="k">def</span> <span class="nf">left</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Binary-2777"><a href="#Binary-2777"><span class="linenos">2777</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span> +</span><span id="Binary-2778"><a href="#Binary-2778"><span class="linenos">2778</span></a> +</span><span id="Binary-2779"><a href="#Binary-2779"><span class="linenos">2779</span></a> <span class="nd">@property</span> +</span><span id="Binary-2780"><a href="#Binary-2780"><span class="linenos">2780</span></a> <span class="k">def</span> <span class="nf">right</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Binary-2781"><a href="#Binary-2781"><span class="linenos">2781</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span> </span></pre></div> @@ -23895,8 +24777,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Add"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Add-2726"><a href="#Add-2726"><span class="linenos">2726</span></a><span class="k">class</span> <span class="nc">Add</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Add-2727"><a href="#Add-2727"><span class="linenos">2727</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Add-2784"><a href="#Add-2784"><span class="linenos">2784</span></a><span class="k">class</span> <span class="nc">Add</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Add-2785"><a href="#Add-2785"><span class="linenos">2785</span></a> <span class="k">pass</span> </span></pre></div> @@ -23956,8 +24838,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Connector"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Connector-2730"><a href="#Connector-2730"><span class="linenos">2730</span></a><span class="k">class</span> <span class="nc">Connector</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="Connector-2731"><a href="#Connector-2731"><span class="linenos">2731</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Connector-2788"><a href="#Connector-2788"><span class="linenos">2788</span></a><span class="k">class</span> <span class="nc">Connector</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="Connector-2789"><a href="#Connector-2789"><span class="linenos">2789</span></a> <span class="k">pass</span> </span></pre></div> @@ -24023,8 +24905,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#And"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="And-2734"><a href="#And-2734"><span class="linenos">2734</span></a><span class="k">class</span> <span class="nc">And</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> -</span><span id="And-2735"><a href="#And-2735"><span class="linenos">2735</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="And-2792"><a href="#And-2792"><span class="linenos">2792</span></a><span class="k">class</span> <span class="nc">And</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> +</span><span id="And-2793"><a href="#And-2793"><span class="linenos">2793</span></a> <span class="k">pass</span> </span></pre></div> @@ -24090,8 +24972,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Or"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Or-2738"><a href="#Or-2738"><span class="linenos">2738</span></a><span class="k">class</span> <span class="nc">Or</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> -</span><span id="Or-2739"><a href="#Or-2739"><span class="linenos">2739</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Or-2796"><a href="#Or-2796"><span class="linenos">2796</span></a><span class="k">class</span> <span class="nc">Or</span><span class="p">(</span><span class="n">Connector</span><span class="p">):</span> +</span><span id="Or-2797"><a href="#Or-2797"><span class="linenos">2797</span></a> <span class="k">pass</span> </span></pre></div> @@ -24157,8 +25039,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseAnd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseAnd-2742"><a href="#BitwiseAnd-2742"><span class="linenos">2742</span></a><span class="k">class</span> <span class="nc">BitwiseAnd</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="BitwiseAnd-2743"><a href="#BitwiseAnd-2743"><span class="linenos">2743</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseAnd-2800"><a href="#BitwiseAnd-2800"><span class="linenos">2800</span></a><span class="k">class</span> <span class="nc">BitwiseAnd</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="BitwiseAnd-2801"><a href="#BitwiseAnd-2801"><span class="linenos">2801</span></a> <span class="k">pass</span> </span></pre></div> @@ -24218,8 +25100,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseLeftShift"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseLeftShift-2746"><a href="#BitwiseLeftShift-2746"><span class="linenos">2746</span></a><span class="k">class</span> <span class="nc">BitwiseLeftShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="BitwiseLeftShift-2747"><a href="#BitwiseLeftShift-2747"><span class="linenos">2747</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseLeftShift-2804"><a href="#BitwiseLeftShift-2804"><span class="linenos">2804</span></a><span class="k">class</span> <span class="nc">BitwiseLeftShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="BitwiseLeftShift-2805"><a href="#BitwiseLeftShift-2805"><span class="linenos">2805</span></a> <span class="k">pass</span> </span></pre></div> @@ -24279,8 +25161,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseOr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseOr-2750"><a href="#BitwiseOr-2750"><span class="linenos">2750</span></a><span class="k">class</span> <span class="nc">BitwiseOr</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="BitwiseOr-2751"><a href="#BitwiseOr-2751"><span class="linenos">2751</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseOr-2808"><a href="#BitwiseOr-2808"><span class="linenos">2808</span></a><span class="k">class</span> <span class="nc">BitwiseOr</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="BitwiseOr-2809"><a href="#BitwiseOr-2809"><span class="linenos">2809</span></a> <span class="k">pass</span> </span></pre></div> @@ -24340,8 +25222,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseRightShift"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseRightShift-2754"><a href="#BitwiseRightShift-2754"><span class="linenos">2754</span></a><span class="k">class</span> <span class="nc">BitwiseRightShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="BitwiseRightShift-2755"><a href="#BitwiseRightShift-2755"><span class="linenos">2755</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseRightShift-2812"><a href="#BitwiseRightShift-2812"><span class="linenos">2812</span></a><span class="k">class</span> <span class="nc">BitwiseRightShift</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="BitwiseRightShift-2813"><a href="#BitwiseRightShift-2813"><span class="linenos">2813</span></a> <span class="k">pass</span> </span></pre></div> @@ -24401,8 +25283,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseXor"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseXor-2758"><a href="#BitwiseXor-2758"><span class="linenos">2758</span></a><span class="k">class</span> <span class="nc">BitwiseXor</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="BitwiseXor-2759"><a href="#BitwiseXor-2759"><span class="linenos">2759</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseXor-2816"><a href="#BitwiseXor-2816"><span class="linenos">2816</span></a><span class="k">class</span> <span class="nc">BitwiseXor</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="BitwiseXor-2817"><a href="#BitwiseXor-2817"><span class="linenos">2817</span></a> <span class="k">pass</span> </span></pre></div> @@ -24462,8 +25344,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Div"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Div-2762"><a href="#Div-2762"><span class="linenos">2762</span></a><span class="k">class</span> <span class="nc">Div</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Div-2763"><a href="#Div-2763"><span class="linenos">2763</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Div-2820"><a href="#Div-2820"><span class="linenos">2820</span></a><span class="k">class</span> <span class="nc">Div</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Div-2821"><a href="#Div-2821"><span class="linenos">2821</span></a> <span class="k">pass</span> </span></pre></div> @@ -24523,10 +25405,10 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Dot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Dot-2766"><a href="#Dot-2766"><span class="linenos">2766</span></a><span class="k">class</span> <span class="nc">Dot</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Dot-2767"><a href="#Dot-2767"><span class="linenos">2767</span></a> <span class="nd">@property</span> -</span><span id="Dot-2768"><a href="#Dot-2768"><span class="linenos">2768</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Dot-2769"><a href="#Dot-2769"><span class="linenos">2769</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">name</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Dot-2824"><a href="#Dot-2824"><span class="linenos">2824</span></a><span class="k">class</span> <span class="nc">Dot</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Dot-2825"><a href="#Dot-2825"><span class="linenos">2825</span></a> <span class="nd">@property</span> +</span><span id="Dot-2826"><a href="#Dot-2826"><span class="linenos">2826</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Dot-2827"><a href="#Dot-2827"><span class="linenos">2827</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expression</span><span class="o">.</span><span class="n">name</span> </span></pre></div> @@ -24586,8 +25468,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#DPipe"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DPipe-2772"><a href="#DPipe-2772"><span class="linenos">2772</span></a><span class="k">class</span> <span class="nc">DPipe</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="DPipe-2773"><a href="#DPipe-2773"><span class="linenos">2773</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DPipe-2830"><a href="#DPipe-2830"><span class="linenos">2830</span></a><span class="k">class</span> <span class="nc">DPipe</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="DPipe-2831"><a href="#DPipe-2831"><span class="linenos">2831</span></a> <span class="k">pass</span> </span></pre></div> @@ -24647,8 +25529,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#EQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="EQ-2776"><a href="#EQ-2776"><span class="linenos">2776</span></a><span class="k">class</span> <span class="nc">EQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="EQ-2777"><a href="#EQ-2777"><span class="linenos">2777</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="EQ-2834"><a href="#EQ-2834"><span class="linenos">2834</span></a><span class="k">class</span> <span class="nc">EQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="EQ-2835"><a href="#EQ-2835"><span class="linenos">2835</span></a> <span class="k">pass</span> </span></pre></div> @@ -24714,8 +25596,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#NullSafeEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeEQ-2780"><a href="#NullSafeEQ-2780"><span class="linenos">2780</span></a><span class="k">class</span> <span class="nc">NullSafeEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="NullSafeEQ-2781"><a href="#NullSafeEQ-2781"><span class="linenos">2781</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeEQ-2838"><a href="#NullSafeEQ-2838"><span class="linenos">2838</span></a><span class="k">class</span> <span class="nc">NullSafeEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="NullSafeEQ-2839"><a href="#NullSafeEQ-2839"><span class="linenos">2839</span></a> <span class="k">pass</span> </span></pre></div> @@ -24781,8 +25663,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#NullSafeNEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeNEQ-2784"><a href="#NullSafeNEQ-2784"><span class="linenos">2784</span></a><span class="k">class</span> <span class="nc">NullSafeNEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="NullSafeNEQ-2785"><a href="#NullSafeNEQ-2785"><span class="linenos">2785</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NullSafeNEQ-2842"><a href="#NullSafeNEQ-2842"><span class="linenos">2842</span></a><span class="k">class</span> <span class="nc">NullSafeNEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="NullSafeNEQ-2843"><a href="#NullSafeNEQ-2843"><span class="linenos">2843</span></a> <span class="k">pass</span> </span></pre></div> @@ -24848,8 +25730,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Distance"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Distance-2788"><a href="#Distance-2788"><span class="linenos">2788</span></a><span class="k">class</span> <span class="nc">Distance</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Distance-2789"><a href="#Distance-2789"><span class="linenos">2789</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Distance-2846"><a href="#Distance-2846"><span class="linenos">2846</span></a><span class="k">class</span> <span class="nc">Distance</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Distance-2847"><a href="#Distance-2847"><span class="linenos">2847</span></a> <span class="k">pass</span> </span></pre></div> @@ -24909,8 +25791,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Escape"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Escape-2792"><a href="#Escape-2792"><span class="linenos">2792</span></a><span class="k">class</span> <span class="nc">Escape</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Escape-2793"><a href="#Escape-2793"><span class="linenos">2793</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Escape-2850"><a href="#Escape-2850"><span class="linenos">2850</span></a><span class="k">class</span> <span class="nc">Escape</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Escape-2851"><a href="#Escape-2851"><span class="linenos">2851</span></a> <span class="k">pass</span> </span></pre></div> @@ -24970,8 +25852,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Glob"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Glob-2796"><a href="#Glob-2796"><span class="linenos">2796</span></a><span class="k">class</span> <span class="nc">Glob</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="Glob-2797"><a href="#Glob-2797"><span class="linenos">2797</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Glob-2854"><a href="#Glob-2854"><span class="linenos">2854</span></a><span class="k">class</span> <span class="nc">Glob</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="Glob-2855"><a href="#Glob-2855"><span class="linenos">2855</span></a> <span class="k">pass</span> </span></pre></div> @@ -25037,8 +25919,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#GT"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GT-2800"><a href="#GT-2800"><span class="linenos">2800</span></a><span class="k">class</span> <span class="nc">GT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="GT-2801"><a href="#GT-2801"><span class="linenos">2801</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GT-2858"><a href="#GT-2858"><span class="linenos">2858</span></a><span class="k">class</span> <span class="nc">GT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="GT-2859"><a href="#GT-2859"><span class="linenos">2859</span></a> <span class="k">pass</span> </span></pre></div> @@ -25104,8 +25986,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#GTE"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GTE-2804"><a href="#GTE-2804"><span class="linenos">2804</span></a><span class="k">class</span> <span class="nc">GTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="GTE-2805"><a href="#GTE-2805"><span class="linenos">2805</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GTE-2862"><a href="#GTE-2862"><span class="linenos">2862</span></a><span class="k">class</span> <span class="nc">GTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="GTE-2863"><a href="#GTE-2863"><span class="linenos">2863</span></a> <span class="k">pass</span> </span></pre></div> @@ -25171,8 +26053,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#ILike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ILike-2808"><a href="#ILike-2808"><span class="linenos">2808</span></a><span class="k">class</span> <span class="nc">ILike</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="ILike-2809"><a href="#ILike-2809"><span class="linenos">2809</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ILike-2866"><a href="#ILike-2866"><span class="linenos">2866</span></a><span class="k">class</span> <span class="nc">ILike</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="ILike-2867"><a href="#ILike-2867"><span class="linenos">2867</span></a> <span class="k">pass</span> </span></pre></div> @@ -25238,8 +26120,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#ILikeAny"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ILikeAny-2812"><a href="#ILikeAny-2812"><span class="linenos">2812</span></a><span class="k">class</span> <span class="nc">ILikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="ILikeAny-2813"><a href="#ILikeAny-2813"><span class="linenos">2813</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ILikeAny-2870"><a href="#ILikeAny-2870"><span class="linenos">2870</span></a><span class="k">class</span> <span class="nc">ILikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="ILikeAny-2871"><a href="#ILikeAny-2871"><span class="linenos">2871</span></a> <span class="k">pass</span> </span></pre></div> @@ -25305,8 +26187,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#IntDiv"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IntDiv-2816"><a href="#IntDiv-2816"><span class="linenos">2816</span></a><span class="k">class</span> <span class="nc">IntDiv</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="IntDiv-2817"><a href="#IntDiv-2817"><span class="linenos">2817</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IntDiv-2874"><a href="#IntDiv-2874"><span class="linenos">2874</span></a><span class="k">class</span> <span class="nc">IntDiv</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="IntDiv-2875"><a href="#IntDiv-2875"><span class="linenos">2875</span></a> <span class="k">pass</span> </span></pre></div> @@ -25366,8 +26248,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Is"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Is-2820"><a href="#Is-2820"><span class="linenos">2820</span></a><span class="k">class</span> <span class="nc">Is</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="Is-2821"><a href="#Is-2821"><span class="linenos">2821</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Is-2878"><a href="#Is-2878"><span class="linenos">2878</span></a><span class="k">class</span> <span class="nc">Is</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="Is-2879"><a href="#Is-2879"><span class="linenos">2879</span></a> <span class="k">pass</span> </span></pre></div> @@ -25433,8 +26315,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Kwarg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Kwarg-2824"><a href="#Kwarg-2824"><span class="linenos">2824</span></a><span class="k">class</span> <span class="nc">Kwarg</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Kwarg-2825"><a href="#Kwarg-2825"><span class="linenos">2825</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Kwarg-2882"><a href="#Kwarg-2882"><span class="linenos">2882</span></a><span class="k">class</span> <span class="nc">Kwarg</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Kwarg-2883"><a href="#Kwarg-2883"><span class="linenos">2883</span></a><span class="w"> </span><span class="sd">"""Kwarg in special functions like func(kwarg => y)."""</span> </span></pre></div> @@ -25496,8 +26378,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Like"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Like-2828"><a href="#Like-2828"><span class="linenos">2828</span></a><span class="k">class</span> <span class="nc">Like</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="Like-2829"><a href="#Like-2829"><span class="linenos">2829</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Like-2886"><a href="#Like-2886"><span class="linenos">2886</span></a><span class="k">class</span> <span class="nc">Like</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="Like-2887"><a href="#Like-2887"><span class="linenos">2887</span></a> <span class="k">pass</span> </span></pre></div> @@ -25563,8 +26445,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#LikeAny"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LikeAny-2832"><a href="#LikeAny-2832"><span class="linenos">2832</span></a><span class="k">class</span> <span class="nc">LikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="LikeAny-2833"><a href="#LikeAny-2833"><span class="linenos">2833</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LikeAny-2890"><a href="#LikeAny-2890"><span class="linenos">2890</span></a><span class="k">class</span> <span class="nc">LikeAny</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="LikeAny-2891"><a href="#LikeAny-2891"><span class="linenos">2891</span></a> <span class="k">pass</span> </span></pre></div> @@ -25630,8 +26512,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#LT"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LT-2836"><a href="#LT-2836"><span class="linenos">2836</span></a><span class="k">class</span> <span class="nc">LT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="LT-2837"><a href="#LT-2837"><span class="linenos">2837</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LT-2894"><a href="#LT-2894"><span class="linenos">2894</span></a><span class="k">class</span> <span class="nc">LT</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="LT-2895"><a href="#LT-2895"><span class="linenos">2895</span></a> <span class="k">pass</span> </span></pre></div> @@ -25697,8 +26579,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#LTE"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LTE-2840"><a href="#LTE-2840"><span class="linenos">2840</span></a><span class="k">class</span> <span class="nc">LTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="LTE-2841"><a href="#LTE-2841"><span class="linenos">2841</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LTE-2898"><a href="#LTE-2898"><span class="linenos">2898</span></a><span class="k">class</span> <span class="nc">LTE</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="LTE-2899"><a href="#LTE-2899"><span class="linenos">2899</span></a> <span class="k">pass</span> </span></pre></div> @@ -25764,8 +26646,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Mod"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Mod-2844"><a href="#Mod-2844"><span class="linenos">2844</span></a><span class="k">class</span> <span class="nc">Mod</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Mod-2845"><a href="#Mod-2845"><span class="linenos">2845</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Mod-2902"><a href="#Mod-2902"><span class="linenos">2902</span></a><span class="k">class</span> <span class="nc">Mod</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Mod-2903"><a href="#Mod-2903"><span class="linenos">2903</span></a> <span class="k">pass</span> </span></pre></div> @@ -25825,8 +26707,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Mul"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Mul-2848"><a href="#Mul-2848"><span class="linenos">2848</span></a><span class="k">class</span> <span class="nc">Mul</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Mul-2849"><a href="#Mul-2849"><span class="linenos">2849</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Mul-2906"><a href="#Mul-2906"><span class="linenos">2906</span></a><span class="k">class</span> <span class="nc">Mul</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Mul-2907"><a href="#Mul-2907"><span class="linenos">2907</span></a> <span class="k">pass</span> </span></pre></div> @@ -25886,8 +26768,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#NEQ"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NEQ-2852"><a href="#NEQ-2852"><span class="linenos">2852</span></a><span class="k">class</span> <span class="nc">NEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="NEQ-2853"><a href="#NEQ-2853"><span class="linenos">2853</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NEQ-2910"><a href="#NEQ-2910"><span class="linenos">2910</span></a><span class="k">class</span> <span class="nc">NEQ</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="NEQ-2911"><a href="#NEQ-2911"><span class="linenos">2911</span></a> <span class="k">pass</span> </span></pre></div> @@ -25953,8 +26835,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#SimilarTo"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SimilarTo-2856"><a href="#SimilarTo-2856"><span class="linenos">2856</span></a><span class="k">class</span> <span class="nc">SimilarTo</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> -</span><span id="SimilarTo-2857"><a href="#SimilarTo-2857"><span class="linenos">2857</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SimilarTo-2914"><a href="#SimilarTo-2914"><span class="linenos">2914</span></a><span class="k">class</span> <span class="nc">SimilarTo</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Predicate</span><span class="p">):</span> +</span><span id="SimilarTo-2915"><a href="#SimilarTo-2915"><span class="linenos">2915</span></a> <span class="k">pass</span> </span></pre></div> @@ -26020,8 +26902,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Slice"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Slice-2860"><a href="#Slice-2860"><span class="linenos">2860</span></a><span class="k">class</span> <span class="nc">Slice</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Slice-2861"><a href="#Slice-2861"><span class="linenos">2861</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Slice-2918"><a href="#Slice-2918"><span class="linenos">2918</span></a><span class="k">class</span> <span class="nc">Slice</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Slice-2919"><a href="#Slice-2919"><span class="linenos">2919</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -26081,8 +26963,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Sub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sub-2864"><a href="#Sub-2864"><span class="linenos">2864</span></a><span class="k">class</span> <span class="nc">Sub</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Sub-2865"><a href="#Sub-2865"><span class="linenos">2865</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sub-2922"><a href="#Sub-2922"><span class="linenos">2922</span></a><span class="k">class</span> <span class="nc">Sub</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Sub-2923"><a href="#Sub-2923"><span class="linenos">2923</span></a> <span class="k">pass</span> </span></pre></div> @@ -26142,8 +27024,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Unary"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unary-2870"><a href="#Unary-2870"><span class="linenos">2870</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Unary-2871"><a href="#Unary-2871"><span class="linenos">2871</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unary-2928"><a href="#Unary-2928"><span class="linenos">2928</span></a><span class="k">class</span> <span class="nc">Unary</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Unary-2929"><a href="#Unary-2929"><span class="linenos">2929</span></a> <span class="k">pass</span> </span></pre></div> @@ -26203,8 +27085,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#BitwiseNot"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseNot-2874"><a href="#BitwiseNot-2874"><span class="linenos">2874</span></a><span class="k">class</span> <span class="nc">BitwiseNot</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> -</span><span id="BitwiseNot-2875"><a href="#BitwiseNot-2875"><span class="linenos">2875</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="BitwiseNot-2932"><a href="#BitwiseNot-2932"><span class="linenos">2932</span></a><span class="k">class</span> <span class="nc">BitwiseNot</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="BitwiseNot-2933"><a href="#BitwiseNot-2933"><span class="linenos">2933</span></a> <span class="k">pass</span> </span></pre></div> @@ -26264,8 +27146,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Not"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Not-2878"><a href="#Not-2878"><span class="linenos">2878</span></a><span class="k">class</span> <span class="nc">Not</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="Not-2879"><a href="#Not-2879"><span class="linenos">2879</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Not-2936"><a href="#Not-2936"><span class="linenos">2936</span></a><span class="k">class</span> <span class="nc">Not</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="Not-2937"><a href="#Not-2937"><span class="linenos">2937</span></a> <span class="k">pass</span> </span></pre></div> @@ -26331,8 +27213,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Paren"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Paren-2882"><a href="#Paren-2882"><span class="linenos">2882</span></a><span class="k">class</span> <span class="nc">Paren</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="Paren-2883"><a href="#Paren-2883"><span class="linenos">2883</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Paren-2940"><a href="#Paren-2940"><span class="linenos">2940</span></a><span class="k">class</span> <span class="nc">Paren</span><span class="p">(</span><span class="n">Unary</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="Paren-2941"><a href="#Paren-2941"><span class="linenos">2941</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"with"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -26398,8 +27280,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Neg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Neg-2886"><a href="#Neg-2886"><span class="linenos">2886</span></a><span class="k">class</span> <span class="nc">Neg</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> -</span><span id="Neg-2887"><a href="#Neg-2887"><span class="linenos">2887</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Neg-2944"><a href="#Neg-2944"><span class="linenos">2944</span></a><span class="k">class</span> <span class="nc">Neg</span><span class="p">(</span><span class="n">Unary</span><span class="p">):</span> +</span><span id="Neg-2945"><a href="#Neg-2945"><span class="linenos">2945</span></a> <span class="k">pass</span> </span></pre></div> @@ -26459,12 +27341,12 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Alias"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Alias-2891"><a href="#Alias-2891"><span class="linenos">2891</span></a><span class="k">class</span> <span class="nc">Alias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Alias-2892"><a href="#Alias-2892"><span class="linenos">2892</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Alias-2893"><a href="#Alias-2893"><span class="linenos">2893</span></a> -</span><span id="Alias-2894"><a href="#Alias-2894"><span class="linenos">2894</span></a> <span class="nd">@property</span> -</span><span id="Alias-2895"><a href="#Alias-2895"><span class="linenos">2895</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Alias-2896"><a href="#Alias-2896"><span class="linenos">2896</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Alias-2949"><a href="#Alias-2949"><span class="linenos">2949</span></a><span class="k">class</span> <span class="nc">Alias</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Alias-2950"><a href="#Alias-2950"><span class="linenos">2950</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"alias"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Alias-2951"><a href="#Alias-2951"><span class="linenos">2951</span></a> +</span><span id="Alias-2952"><a href="#Alias-2952"><span class="linenos">2952</span></a> <span class="nd">@property</span> +</span><span id="Alias-2953"><a href="#Alias-2953"><span class="linenos">2953</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Alias-2954"><a href="#Alias-2954"><span class="linenos">2954</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">alias</span> </span></pre></div> @@ -26553,12 +27435,12 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Aliases"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Aliases-2899"><a href="#Aliases-2899"><span class="linenos">2899</span></a><span class="k">class</span> <span class="nc">Aliases</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Aliases-2900"><a href="#Aliases-2900"><span class="linenos">2900</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Aliases-2901"><a href="#Aliases-2901"><span class="linenos">2901</span></a> -</span><span id="Aliases-2902"><a href="#Aliases-2902"><span class="linenos">2902</span></a> <span class="nd">@property</span> -</span><span id="Aliases-2903"><a href="#Aliases-2903"><span class="linenos">2903</span></a> <span class="k">def</span> <span class="nf">aliases</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Aliases-2904"><a href="#Aliases-2904"><span class="linenos">2904</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Aliases-2957"><a href="#Aliases-2957"><span class="linenos">2957</span></a><span class="k">class</span> <span class="nc">Aliases</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Aliases-2958"><a href="#Aliases-2958"><span class="linenos">2958</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Aliases-2959"><a href="#Aliases-2959"><span class="linenos">2959</span></a> +</span><span id="Aliases-2960"><a href="#Aliases-2960"><span class="linenos">2960</span></a> <span class="nd">@property</span> +</span><span id="Aliases-2961"><a href="#Aliases-2961"><span class="linenos">2961</span></a> <span class="k">def</span> <span class="nf">aliases</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Aliases-2962"><a href="#Aliases-2962"><span class="linenos">2962</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">expressions</span> </span></pre></div> @@ -26618,8 +27500,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#AtTimeZone"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AtTimeZone-2907"><a href="#AtTimeZone-2907"><span class="linenos">2907</span></a><span class="k">class</span> <span class="nc">AtTimeZone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="AtTimeZone-2908"><a href="#AtTimeZone-2908"><span class="linenos">2908</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AtTimeZone-2965"><a href="#AtTimeZone-2965"><span class="linenos">2965</span></a><span class="k">class</span> <span class="nc">AtTimeZone</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="AtTimeZone-2966"><a href="#AtTimeZone-2966"><span class="linenos">2966</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -26679,8 +27561,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Between"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Between-2911"><a href="#Between-2911"><span class="linenos">2911</span></a><span class="k">class</span> <span class="nc">Between</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="Between-2912"><a href="#Between-2912"><span class="linenos">2912</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"low"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"high"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Between-2969"><a href="#Between-2969"><span class="linenos">2969</span></a><span class="k">class</span> <span class="nc">Between</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="Between-2970"><a href="#Between-2970"><span class="linenos">2970</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"low"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"high"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -26746,8 +27628,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Bracket"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Bracket-2915"><a href="#Bracket-2915"><span class="linenos">2915</span></a><span class="k">class</span> <span class="nc">Bracket</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Bracket-2916"><a href="#Bracket-2916"><span class="linenos">2916</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Bracket-2973"><a href="#Bracket-2973"><span class="linenos">2973</span></a><span class="k">class</span> <span class="nc">Bracket</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Bracket-2974"><a href="#Bracket-2974"><span class="linenos">2974</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -26813,8 +27695,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Distinct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Distinct-2919"><a href="#Distinct-2919"><span class="linenos">2919</span></a><span class="k">class</span> <span class="nc">Distinct</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Distinct-2920"><a href="#Distinct-2920"><span class="linenos">2920</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Distinct-2977"><a href="#Distinct-2977"><span class="linenos">2977</span></a><span class="k">class</span> <span class="nc">Distinct</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Distinct-2978"><a href="#Distinct-2978"><span class="linenos">2978</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -26874,15 +27756,15 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#In"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="In-2923"><a href="#In-2923"><span class="linenos">2923</span></a><span class="k">class</span> <span class="nc">In</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> -</span><span id="In-2924"><a href="#In-2924"><span class="linenos">2924</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="In-2925"><a href="#In-2925"><span class="linenos">2925</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="In-2926"><a href="#In-2926"><span class="linenos">2926</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-2927"><a href="#In-2927"><span class="linenos">2927</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-2928"><a href="#In-2928"><span class="linenos">2928</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-2929"><a href="#In-2929"><span class="linenos">2929</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-2930"><a href="#In-2930"><span class="linenos">2930</span></a> <span class="s2">"is_global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="In-2931"><a href="#In-2931"><span class="linenos">2931</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="In-2981"><a href="#In-2981"><span class="linenos">2981</span></a><span class="k">class</span> <span class="nc">In</span><span class="p">(</span><span class="n">Predicate</span><span class="p">):</span> +</span><span id="In-2982"><a href="#In-2982"><span class="linenos">2982</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="In-2983"><a href="#In-2983"><span class="linenos">2983</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="In-2984"><a href="#In-2984"><span class="linenos">2984</span></a> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-2985"><a href="#In-2985"><span class="linenos">2985</span></a> <span class="s2">"query"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-2986"><a href="#In-2986"><span class="linenos">2986</span></a> <span class="s2">"unnest"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-2987"><a href="#In-2987"><span class="linenos">2987</span></a> <span class="s2">"field"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-2988"><a href="#In-2988"><span class="linenos">2988</span></a> <span class="s2">"is_global"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="In-2989"><a href="#In-2989"><span class="linenos">2989</span></a> <span class="p">}</span> </span></pre></div> @@ -26948,18 +27830,18 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#TimeUnit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit-2934"><a href="#TimeUnit-2934"><span class="linenos">2934</span></a><span class="k">class</span> <span class="nc">TimeUnit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="TimeUnit-2935"><a href="#TimeUnit-2935"><span class="linenos">2935</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> -</span><span id="TimeUnit-2936"><a href="#TimeUnit-2936"><span class="linenos">2936</span></a> -</span><span id="TimeUnit-2937"><a href="#TimeUnit-2937"><span class="linenos">2937</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="TimeUnit-2938"><a href="#TimeUnit-2938"><span class="linenos">2938</span></a> -</span><span id="TimeUnit-2939"><a href="#TimeUnit-2939"><span class="linenos">2939</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> -</span><span id="TimeUnit-2940"><a href="#TimeUnit-2940"><span class="linenos">2940</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> -</span><span id="TimeUnit-2941"><a href="#TimeUnit-2941"><span class="linenos">2941</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> -</span><span id="TimeUnit-2942"><a href="#TimeUnit-2942"><span class="linenos">2942</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="TimeUnit-2943"><a href="#TimeUnit-2943"><span class="linenos">2943</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> -</span><span id="TimeUnit-2944"><a href="#TimeUnit-2944"><span class="linenos">2944</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> -</span><span id="TimeUnit-2945"><a href="#TimeUnit-2945"><span class="linenos">2945</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit-2992"><a href="#TimeUnit-2992"><span class="linenos">2992</span></a><span class="k">class</span> <span class="nc">TimeUnit</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="TimeUnit-2993"><a href="#TimeUnit-2993"><span class="linenos">2993</span></a><span class="w"> </span><span class="sd">"""Automatically converts unit arg into a var."""</span> +</span><span id="TimeUnit-2994"><a href="#TimeUnit-2994"><span class="linenos">2994</span></a> +</span><span id="TimeUnit-2995"><a href="#TimeUnit-2995"><span class="linenos">2995</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="TimeUnit-2996"><a href="#TimeUnit-2996"><span class="linenos">2996</span></a> +</span><span id="TimeUnit-2997"><a href="#TimeUnit-2997"><span class="linenos">2997</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> +</span><span id="TimeUnit-2998"><a href="#TimeUnit-2998"><span class="linenos">2998</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> +</span><span id="TimeUnit-2999"><a href="#TimeUnit-2999"><span class="linenos">2999</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> +</span><span id="TimeUnit-3000"><a href="#TimeUnit-3000"><span class="linenos">3000</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="TimeUnit-3001"><a href="#TimeUnit-3001"><span class="linenos">3001</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> +</span><span id="TimeUnit-3002"><a href="#TimeUnit-3002"><span class="linenos">3002</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> +</span><span id="TimeUnit-3003"><a href="#TimeUnit-3003"><span class="linenos">3003</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> </span></pre></div> @@ -26977,13 +27859,13 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#TimeUnit.__init__"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit.__init__-2939"><a href="#TimeUnit.__init__-2939"><span class="linenos">2939</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> -</span><span id="TimeUnit.__init__-2940"><a href="#TimeUnit.__init__-2940"><span class="linenos">2940</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> -</span><span id="TimeUnit.__init__-2941"><a href="#TimeUnit.__init__-2941"><span class="linenos">2941</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> -</span><span id="TimeUnit.__init__-2942"><a href="#TimeUnit.__init__-2942"><span class="linenos">2942</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="TimeUnit.__init__-2943"><a href="#TimeUnit.__init__-2943"><span class="linenos">2943</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> -</span><span id="TimeUnit.__init__-2944"><a href="#TimeUnit.__init__-2944"><span class="linenos">2944</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> -</span><span id="TimeUnit.__init__-2945"><a href="#TimeUnit.__init__-2945"><span class="linenos">2945</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeUnit.__init__-2997"><a href="#TimeUnit.__init__-2997"><span class="linenos">2997</span></a> <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">args</span><span class="p">):</span> +</span><span id="TimeUnit.__init__-2998"><a href="#TimeUnit.__init__-2998"><span class="linenos">2998</span></a> <span class="n">unit</span> <span class="o">=</span> <span class="n">args</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"unit"</span><span class="p">)</span> +</span><span id="TimeUnit.__init__-2999"><a href="#TimeUnit.__init__-2999"><span class="linenos">2999</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> +</span><span id="TimeUnit.__init__-3000"><a href="#TimeUnit.__init__-3000"><span class="linenos">3000</span></a> <span class="n">args</span><span class="p">[</span><span class="s2">"unit"</span><span class="p">]</span> <span class="o">=</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="TimeUnit.__init__-3001"><a href="#TimeUnit.__init__-3001"><span class="linenos">3001</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">unit</span><span class="p">,</span> <span class="n">Week</span><span class="p">):</span> +</span><span id="TimeUnit.__init__-3002"><a href="#TimeUnit.__init__-3002"><span class="linenos">3002</span></a> <span class="n">unit</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">unit</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> +</span><span id="TimeUnit.__init__-3003"><a href="#TimeUnit.__init__-3003"><span class="linenos">3003</span></a> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">args</span><span class="p">)</span> </span></pre></div> @@ -27043,8 +27925,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Interval"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Interval-2948"><a href="#Interval-2948"><span class="linenos">2948</span></a><span class="k">class</span> <span class="nc">Interval</span><span class="p">(</span><span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="Interval-2949"><a href="#Interval-2949"><span class="linenos">2949</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Interval-3006"><a href="#Interval-3006"><span class="linenos">3006</span></a><span class="k">class</span> <span class="nc">Interval</span><span class="p">(</span><span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="Interval-3007"><a href="#Interval-3007"><span class="linenos">3007</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -27107,8 +27989,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#IgnoreNulls"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IgnoreNulls-2952"><a href="#IgnoreNulls-2952"><span class="linenos">2952</span></a><span class="k">class</span> <span class="nc">IgnoreNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="IgnoreNulls-2953"><a href="#IgnoreNulls-2953"><span class="linenos">2953</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IgnoreNulls-3010"><a href="#IgnoreNulls-3010"><span class="linenos">3010</span></a><span class="k">class</span> <span class="nc">IgnoreNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="IgnoreNulls-3011"><a href="#IgnoreNulls-3011"><span class="linenos">3011</span></a> <span class="k">pass</span> </span></pre></div> @@ -27168,8 +28050,8 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#RespectNulls"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RespectNulls-2956"><a href="#RespectNulls-2956"><span class="linenos">2956</span></a><span class="k">class</span> <span class="nc">RespectNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="RespectNulls-2957"><a href="#RespectNulls-2957"><span class="linenos">2957</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RespectNulls-3014"><a href="#RespectNulls-3014"><span class="linenos">3014</span></a><span class="k">class</span> <span class="nc">RespectNulls</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="RespectNulls-3015"><a href="#RespectNulls-3015"><span class="linenos">3015</span></a> <span class="k">pass</span> </span></pre></div> @@ -27229,53 +28111,53 @@ If another <code><a href="#Expression">Expression</a></code> instance is passed, </div> <a class="headerlink" href="#Func"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func-2961"><a href="#Func-2961"><span class="linenos">2961</span></a><span class="k">class</span> <span class="nc">Func</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> -</span><span id="Func-2962"><a href="#Func-2962"><span class="linenos">2962</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="Func-2963"><a href="#Func-2963"><span class="linenos">2963</span></a><span class="sd"> The base class for all function expressions.</span> -</span><span id="Func-2964"><a href="#Func-2964"><span class="linenos">2964</span></a> -</span><span id="Func-2965"><a href="#Func-2965"><span class="linenos">2965</span></a><span class="sd"> Attributes:</span> -</span><span id="Func-2966"><a href="#Func-2966"><span class="linenos">2966</span></a><span class="sd"> is_var_len_args (bool): if set to True the last argument defined in arg_types will be</span> -</span><span id="Func-2967"><a href="#Func-2967"><span class="linenos">2967</span></a><span class="sd"> treated as a variable length argument and the argument's value will be stored as a list.</span> -</span><span id="Func-2968"><a href="#Func-2968"><span class="linenos">2968</span></a><span class="sd"> _sql_names (list): determines the SQL name (1st item in the list) and aliases (subsequent items)</span> -</span><span id="Func-2969"><a href="#Func-2969"><span class="linenos">2969</span></a><span class="sd"> for this function expression. These values are used to map this node to a name during parsing</span> -</span><span id="Func-2970"><a href="#Func-2970"><span class="linenos">2970</span></a><span class="sd"> as well as to provide the function's name during SQL string generation. By default the SQL</span> -</span><span id="Func-2971"><a href="#Func-2971"><span class="linenos">2971</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> -</span><span id="Func-2972"><a href="#Func-2972"><span class="linenos">2972</span></a><span class="sd"> """</span> -</span><span id="Func-2973"><a href="#Func-2973"><span class="linenos">2973</span></a> -</span><span id="Func-2974"><a href="#Func-2974"><span class="linenos">2974</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> -</span><span id="Func-2975"><a href="#Func-2975"><span class="linenos">2975</span></a> -</span><span id="Func-2976"><a href="#Func-2976"><span class="linenos">2976</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-2977"><a href="#Func-2977"><span class="linenos">2977</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> -</span><span id="Func-2978"><a href="#Func-2978"><span class="linenos">2978</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> -</span><span id="Func-2979"><a href="#Func-2979"><span class="linenos">2979</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="Func-2980"><a href="#Func-2980"><span class="linenos">2980</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> -</span><span id="Func-2981"><a href="#Func-2981"><span class="linenos">2981</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> -</span><span id="Func-2982"><a href="#Func-2982"><span class="linenos">2982</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> -</span><span id="Func-2983"><a href="#Func-2983"><span class="linenos">2983</span></a> -</span><span id="Func-2984"><a href="#Func-2984"><span class="linenos">2984</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> -</span><span id="Func-2985"><a href="#Func-2985"><span class="linenos">2985</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> -</span><span id="Func-2986"><a href="#Func-2986"><span class="linenos">2986</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Func-2987"><a href="#Func-2987"><span class="linenos">2987</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> -</span><span id="Func-2988"><a href="#Func-2988"><span class="linenos">2988</span></a> -</span><span id="Func-2989"><a href="#Func-2989"><span class="linenos">2989</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> -</span><span id="Func-2990"><a href="#Func-2990"><span class="linenos">2990</span></a> -</span><span id="Func-2991"><a href="#Func-2991"><span class="linenos">2991</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-2992"><a href="#Func-2992"><span class="linenos">2992</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func-2993"><a href="#Func-2993"><span class="linenos">2993</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> -</span><span id="Func-2994"><a href="#Func-2994"><span class="linenos">2994</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="Func-2995"><a href="#Func-2995"><span class="linenos">2995</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="Func-2996"><a href="#Func-2996"><span class="linenos">2996</span></a> <span class="p">)</span> -</span><span id="Func-2997"><a href="#Func-2997"><span class="linenos">2997</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> -</span><span id="Func-2998"><a href="#Func-2998"><span class="linenos">2998</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> -</span><span id="Func-2999"><a href="#Func-2999"><span class="linenos">2999</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> -</span><span id="Func-3000"><a href="#Func-3000"><span class="linenos">3000</span></a> -</span><span id="Func-3001"><a href="#Func-3001"><span class="linenos">3001</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3002"><a href="#Func-3002"><span class="linenos">3002</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func-3003"><a href="#Func-3003"><span class="linenos">3003</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> -</span><span id="Func-3004"><a href="#Func-3004"><span class="linenos">3004</span></a> -</span><span id="Func-3005"><a href="#Func-3005"><span class="linenos">3005</span></a> <span class="nd">@classmethod</span> -</span><span id="Func-3006"><a href="#Func-3006"><span class="linenos">3006</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func-3007"><a href="#Func-3007"><span class="linenos">3007</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func-3019"><a href="#Func-3019"><span class="linenos">3019</span></a><span class="k">class</span> <span class="nc">Func</span><span class="p">(</span><span class="n">Condition</span><span class="p">):</span> +</span><span id="Func-3020"><a href="#Func-3020"><span class="linenos">3020</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="Func-3021"><a href="#Func-3021"><span class="linenos">3021</span></a><span class="sd"> The base class for all function expressions.</span> +</span><span id="Func-3022"><a href="#Func-3022"><span class="linenos">3022</span></a> +</span><span id="Func-3023"><a href="#Func-3023"><span class="linenos">3023</span></a><span class="sd"> Attributes:</span> +</span><span id="Func-3024"><a href="#Func-3024"><span class="linenos">3024</span></a><span class="sd"> is_var_len_args (bool): if set to True the last argument defined in arg_types will be</span> +</span><span id="Func-3025"><a href="#Func-3025"><span class="linenos">3025</span></a><span class="sd"> treated as a variable length argument and the argument's value will be stored as a list.</span> +</span><span id="Func-3026"><a href="#Func-3026"><span class="linenos">3026</span></a><span class="sd"> _sql_names (list): determines the SQL name (1st item in the list) and aliases (subsequent items)</span> +</span><span id="Func-3027"><a href="#Func-3027"><span class="linenos">3027</span></a><span class="sd"> for this function expression. These values are used to map this node to a name during parsing</span> +</span><span id="Func-3028"><a href="#Func-3028"><span class="linenos">3028</span></a><span class="sd"> as well as to provide the function's name during SQL string generation. By default the SQL</span> +</span><span id="Func-3029"><a href="#Func-3029"><span class="linenos">3029</span></a><span class="sd"> name is set to the expression's class name transformed to snake case.</span> +</span><span id="Func-3030"><a href="#Func-3030"><span class="linenos">3030</span></a><span class="sd"> """</span> +</span><span id="Func-3031"><a href="#Func-3031"><span class="linenos">3031</span></a> +</span><span id="Func-3032"><a href="#Func-3032"><span class="linenos">3032</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">False</span> +</span><span id="Func-3033"><a href="#Func-3033"><span class="linenos">3033</span></a> +</span><span id="Func-3034"><a href="#Func-3034"><span class="linenos">3034</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3035"><a href="#Func-3035"><span class="linenos">3035</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> +</span><span id="Func-3036"><a href="#Func-3036"><span class="linenos">3036</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> +</span><span id="Func-3037"><a href="#Func-3037"><span class="linenos">3037</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="Func-3038"><a href="#Func-3038"><span class="linenos">3038</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> +</span><span id="Func-3039"><a href="#Func-3039"><span class="linenos">3039</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> +</span><span id="Func-3040"><a href="#Func-3040"><span class="linenos">3040</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> +</span><span id="Func-3041"><a href="#Func-3041"><span class="linenos">3041</span></a> +</span><span id="Func-3042"><a href="#Func-3042"><span class="linenos">3042</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> +</span><span id="Func-3043"><a href="#Func-3043"><span class="linenos">3043</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> +</span><span id="Func-3044"><a href="#Func-3044"><span class="linenos">3044</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Func-3045"><a href="#Func-3045"><span class="linenos">3045</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> +</span><span id="Func-3046"><a href="#Func-3046"><span class="linenos">3046</span></a> +</span><span id="Func-3047"><a href="#Func-3047"><span class="linenos">3047</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> +</span><span id="Func-3048"><a href="#Func-3048"><span class="linenos">3048</span></a> +</span><span id="Func-3049"><a href="#Func-3049"><span class="linenos">3049</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3050"><a href="#Func-3050"><span class="linenos">3050</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func-3051"><a href="#Func-3051"><span class="linenos">3051</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> +</span><span id="Func-3052"><a href="#Func-3052"><span class="linenos">3052</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="Func-3053"><a href="#Func-3053"><span class="linenos">3053</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="Func-3054"><a href="#Func-3054"><span class="linenos">3054</span></a> <span class="p">)</span> +</span><span id="Func-3055"><a href="#Func-3055"><span class="linenos">3055</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> +</span><span id="Func-3056"><a href="#Func-3056"><span class="linenos">3056</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> +</span><span id="Func-3057"><a href="#Func-3057"><span class="linenos">3057</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> +</span><span id="Func-3058"><a href="#Func-3058"><span class="linenos">3058</span></a> +</span><span id="Func-3059"><a href="#Func-3059"><span class="linenos">3059</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3060"><a href="#Func-3060"><span class="linenos">3060</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func-3061"><a href="#Func-3061"><span class="linenos">3061</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> +</span><span id="Func-3062"><a href="#Func-3062"><span class="linenos">3062</span></a> +</span><span id="Func-3063"><a href="#Func-3063"><span class="linenos">3063</span></a> <span class="nd">@classmethod</span> +</span><span id="Func-3064"><a href="#Func-3064"><span class="linenos">3064</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func-3065"><a href="#Func-3065"><span class="linenos">3065</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> </span></pre></div> @@ -27306,20 +28188,20 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Func.from_arg_list"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func.from_arg_list-2976"><a href="#Func.from_arg_list-2976"><span class="linenos">2976</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.from_arg_list-2977"><a href="#Func.from_arg_list-2977"><span class="linenos">2977</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> -</span><span id="Func.from_arg_list-2978"><a href="#Func.from_arg_list-2978"><span class="linenos">2978</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> -</span><span id="Func.from_arg_list-2979"><a href="#Func.from_arg_list-2979"><span class="linenos">2979</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> -</span><span id="Func.from_arg_list-2980"><a href="#Func.from_arg_list-2980"><span class="linenos">2980</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> -</span><span id="Func.from_arg_list-2981"><a href="#Func.from_arg_list-2981"><span class="linenos">2981</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> -</span><span id="Func.from_arg_list-2982"><a href="#Func.from_arg_list-2982"><span class="linenos">2982</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> -</span><span id="Func.from_arg_list-2983"><a href="#Func.from_arg_list-2983"><span class="linenos">2983</span></a> -</span><span id="Func.from_arg_list-2984"><a href="#Func.from_arg_list-2984"><span class="linenos">2984</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> -</span><span id="Func.from_arg_list-2985"><a href="#Func.from_arg_list-2985"><span class="linenos">2985</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> -</span><span id="Func.from_arg_list-2986"><a href="#Func.from_arg_list-2986"><span class="linenos">2986</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="Func.from_arg_list-2987"><a href="#Func.from_arg_list-2987"><span class="linenos">2987</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> -</span><span id="Func.from_arg_list-2988"><a href="#Func.from_arg_list-2988"><span class="linenos">2988</span></a> -</span><span id="Func.from_arg_list-2989"><a href="#Func.from_arg_list-2989"><span class="linenos">2989</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func.from_arg_list-3034"><a href="#Func.from_arg_list-3034"><span class="linenos">3034</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.from_arg_list-3035"><a href="#Func.from_arg_list-3035"><span class="linenos">3035</span></a> <span class="k">def</span> <span class="nf">from_arg_list</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span> +</span><span id="Func.from_arg_list-3036"><a href="#Func.from_arg_list-3036"><span class="linenos">3036</span></a> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span><span class="p">:</span> +</span><span id="Func.from_arg_list-3037"><a href="#Func.from_arg_list-3037"><span class="linenos">3037</span></a> <span class="n">all_arg_keys</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)</span> +</span><span id="Func.from_arg_list-3038"><a href="#Func.from_arg_list-3038"><span class="linenos">3038</span></a> <span class="c1"># If this function supports variable length argument treat the last argument as such.</span> +</span><span id="Func.from_arg_list-3039"><a href="#Func.from_arg_list-3039"><span class="linenos">3039</span></a> <span class="n">non_var_len_arg_keys</span> <span class="o">=</span> <span class="n">all_arg_keys</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="bp">cls</span><span class="o">.</span><span class="n">is_var_len_args</span> <span class="k">else</span> <span class="n">all_arg_keys</span> +</span><span id="Func.from_arg_list-3040"><a href="#Func.from_arg_list-3040"><span class="linenos">3040</span></a> <span class="n">num_non_var</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">non_var_len_arg_keys</span><span class="p">)</span> +</span><span id="Func.from_arg_list-3041"><a href="#Func.from_arg_list-3041"><span class="linenos">3041</span></a> +</span><span id="Func.from_arg_list-3042"><a href="#Func.from_arg_list-3042"><span class="linenos">3042</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">non_var_len_arg_keys</span><span class="p">)}</span> +</span><span id="Func.from_arg_list-3043"><a href="#Func.from_arg_list-3043"><span class="linenos">3043</span></a> <span class="n">args_dict</span><span class="p">[</span><span class="n">all_arg_keys</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">num_non_var</span><span class="p">:]</span> +</span><span id="Func.from_arg_list-3044"><a href="#Func.from_arg_list-3044"><span class="linenos">3044</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="Func.from_arg_list-3045"><a href="#Func.from_arg_list-3045"><span class="linenos">3045</span></a> <span class="n">args_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">arg_key</span><span class="p">:</span> <span class="n">arg</span> <span class="k">for</span> <span class="n">arg</span><span class="p">,</span> <span class="n">arg_key</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="bp">cls</span><span class="o">.</span><span class="n">arg_types</span><span class="p">)}</span> +</span><span id="Func.from_arg_list-3046"><a href="#Func.from_arg_list-3046"><span class="linenos">3046</span></a> +</span><span id="Func.from_arg_list-3047"><a href="#Func.from_arg_list-3047"><span class="linenos">3047</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="p">(</span><span class="o">**</span><span class="n">args_dict</span><span class="p">)</span> </span></pre></div> @@ -27338,15 +28220,15 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Func.sql_names"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func.sql_names-2991"><a href="#Func.sql_names-2991"><span class="linenos">2991</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.sql_names-2992"><a href="#Func.sql_names-2992"><span class="linenos">2992</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func.sql_names-2993"><a href="#Func.sql_names-2993"><span class="linenos">2993</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> -</span><span id="Func.sql_names-2994"><a href="#Func.sql_names-2994"><span class="linenos">2994</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> -</span><span id="Func.sql_names-2995"><a href="#Func.sql_names-2995"><span class="linenos">2995</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> -</span><span id="Func.sql_names-2996"><a href="#Func.sql_names-2996"><span class="linenos">2996</span></a> <span class="p">)</span> -</span><span id="Func.sql_names-2997"><a href="#Func.sql_names-2997"><span class="linenos">2997</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> -</span><span id="Func.sql_names-2998"><a href="#Func.sql_names-2998"><span class="linenos">2998</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> -</span><span id="Func.sql_names-2999"><a href="#Func.sql_names-2999"><span class="linenos">2999</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func.sql_names-3049"><a href="#Func.sql_names-3049"><span class="linenos">3049</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.sql_names-3050"><a href="#Func.sql_names-3050"><span class="linenos">3050</span></a> <span class="k">def</span> <span class="nf">sql_names</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func.sql_names-3051"><a href="#Func.sql_names-3051"><span class="linenos">3051</span></a> <span class="k">if</span> <span class="bp">cls</span> <span class="ow">is</span> <span class="n">Func</span><span class="p">:</span> +</span><span id="Func.sql_names-3052"><a href="#Func.sql_names-3052"><span class="linenos">3052</span></a> <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">(</span> +</span><span id="Func.sql_names-3053"><a href="#Func.sql_names-3053"><span class="linenos">3053</span></a> <span class="s2">"SQL name is only supported by concrete function implementations"</span> +</span><span id="Func.sql_names-3054"><a href="#Func.sql_names-3054"><span class="linenos">3054</span></a> <span class="p">)</span> +</span><span id="Func.sql_names-3055"><a href="#Func.sql_names-3055"><span class="linenos">3055</span></a> <span class="k">if</span> <span class="s2">"_sql_names"</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__dict__</span><span class="p">:</span> +</span><span id="Func.sql_names-3056"><a href="#Func.sql_names-3056"><span class="linenos">3056</span></a> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="n">camel_to_snake_case</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)]</span> +</span><span id="Func.sql_names-3057"><a href="#Func.sql_names-3057"><span class="linenos">3057</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">_sql_names</span> </span></pre></div> @@ -27365,9 +28247,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Func.sql_name"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func.sql_name-3001"><a href="#Func.sql_name-3001"><span class="linenos">3001</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.sql_name-3002"><a href="#Func.sql_name-3002"><span class="linenos">3002</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func.sql_name-3003"><a href="#Func.sql_name-3003"><span class="linenos">3003</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func.sql_name-3059"><a href="#Func.sql_name-3059"><span class="linenos">3059</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.sql_name-3060"><a href="#Func.sql_name-3060"><span class="linenos">3060</span></a> <span class="k">def</span> <span class="nf">sql_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func.sql_name-3061"><a href="#Func.sql_name-3061"><span class="linenos">3061</span></a> <span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> </span></pre></div> @@ -27386,9 +28268,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Func.default_parser_mappings"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Func.default_parser_mappings-3005"><a href="#Func.default_parser_mappings-3005"><span class="linenos">3005</span></a> <span class="nd">@classmethod</span> -</span><span id="Func.default_parser_mappings-3006"><a href="#Func.default_parser_mappings-3006"><span class="linenos">3006</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> -</span><span id="Func.default_parser_mappings-3007"><a href="#Func.default_parser_mappings-3007"><span class="linenos">3007</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Func.default_parser_mappings-3063"><a href="#Func.default_parser_mappings-3063"><span class="linenos">3063</span></a> <span class="nd">@classmethod</span> +</span><span id="Func.default_parser_mappings-3064"><a href="#Func.default_parser_mappings-3064"><span class="linenos">3064</span></a> <span class="k">def</span> <span class="nf">default_parser_mappings</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span> +</span><span id="Func.default_parser_mappings-3065"><a href="#Func.default_parser_mappings-3065"><span class="linenos">3065</span></a> <span class="k">return</span> <span class="p">{</span><span class="n">name</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">from_arg_list</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">cls</span><span class="o">.</span><span class="n">sql_names</span><span class="p">()}</span> </span></pre></div> @@ -27455,8 +28337,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#AggFunc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AggFunc-3010"><a href="#AggFunc-3010"><span class="linenos">3010</span></a><span class="k">class</span> <span class="nc">AggFunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="AggFunc-3011"><a href="#AggFunc-3011"><span class="linenos">3011</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AggFunc-3068"><a href="#AggFunc-3068"><span class="linenos">3068</span></a><span class="k">class</span> <span class="nc">AggFunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="AggFunc-3069"><a href="#AggFunc-3069"><span class="linenos">3069</span></a> <span class="k">pass</span> </span></pre></div> @@ -27529,8 +28411,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Abs"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Abs-3014"><a href="#Abs-3014"><span class="linenos">3014</span></a><span class="k">class</span> <span class="nc">Abs</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Abs-3015"><a href="#Abs-3015"><span class="linenos">3015</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Abs-3072"><a href="#Abs-3072"><span class="linenos">3072</span></a><span class="k">class</span> <span class="nc">Abs</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Abs-3073"><a href="#Abs-3073"><span class="linenos">3073</span></a> <span class="k">pass</span> </span></pre></div> @@ -27603,9 +28485,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Anonymous"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Anonymous-3018"><a href="#Anonymous-3018"><span class="linenos">3018</span></a><span class="k">class</span> <span class="nc">Anonymous</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Anonymous-3019"><a href="#Anonymous-3019"><span class="linenos">3019</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Anonymous-3020"><a href="#Anonymous-3020"><span class="linenos">3020</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Anonymous-3076"><a href="#Anonymous-3076"><span class="linenos">3076</span></a><span class="k">class</span> <span class="nc">Anonymous</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Anonymous-3077"><a href="#Anonymous-3077"><span class="linenos">3077</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Anonymous-3078"><a href="#Anonymous-3078"><span class="linenos">3078</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -27678,8 +28560,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ApproxDistinct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxDistinct-3023"><a href="#ApproxDistinct-3023"><span class="linenos">3023</span></a><span class="k">class</span> <span class="nc">ApproxDistinct</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="ApproxDistinct-3024"><a href="#ApproxDistinct-3024"><span class="linenos">3024</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxDistinct-3081"><a href="#ApproxDistinct-3081"><span class="linenos">3081</span></a><span class="k">class</span> <span class="nc">ApproxDistinct</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="ApproxDistinct-3082"><a href="#ApproxDistinct-3082"><span class="linenos">3082</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -27752,9 +28634,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Array"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Array-3027"><a href="#Array-3027"><span class="linenos">3027</span></a><span class="k">class</span> <span class="nc">Array</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Array-3028"><a href="#Array-3028"><span class="linenos">3028</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Array-3029"><a href="#Array-3029"><span class="linenos">3029</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Array-3085"><a href="#Array-3085"><span class="linenos">3085</span></a><span class="k">class</span> <span class="nc">Array</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Array-3086"><a href="#Array-3086"><span class="linenos">3086</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Array-3087"><a href="#Array-3087"><span class="linenos">3087</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -27827,8 +28709,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#GenerateSeries"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GenerateSeries-3032"><a href="#GenerateSeries-3032"><span class="linenos">3032</span></a><span class="k">class</span> <span class="nc">GenerateSeries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="GenerateSeries-3033"><a href="#GenerateSeries-3033"><span class="linenos">3033</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"start"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"step"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GenerateSeries-3090"><a href="#GenerateSeries-3090"><span class="linenos">3090</span></a><span class="k">class</span> <span class="nc">GenerateSeries</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="GenerateSeries-3091"><a href="#GenerateSeries-3091"><span class="linenos">3091</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"start"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"end"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"step"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -27901,8 +28783,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayAgg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAgg-3036"><a href="#ArrayAgg-3036"><span class="linenos">3036</span></a><span class="k">class</span> <span class="nc">ArrayAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="ArrayAgg-3037"><a href="#ArrayAgg-3037"><span class="linenos">3037</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAgg-3094"><a href="#ArrayAgg-3094"><span class="linenos">3094</span></a><span class="k">class</span> <span class="nc">ArrayAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="ArrayAgg-3095"><a href="#ArrayAgg-3095"><span class="linenos">3095</span></a> <span class="k">pass</span> </span></pre></div> @@ -27975,8 +28857,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayAll"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAll-3040"><a href="#ArrayAll-3040"><span class="linenos">3040</span></a><span class="k">class</span> <span class="nc">ArrayAll</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayAll-3041"><a href="#ArrayAll-3041"><span class="linenos">3041</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAll-3098"><a href="#ArrayAll-3098"><span class="linenos">3098</span></a><span class="k">class</span> <span class="nc">ArrayAll</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayAll-3099"><a href="#ArrayAll-3099"><span class="linenos">3099</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -28049,8 +28931,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayAny"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAny-3044"><a href="#ArrayAny-3044"><span class="linenos">3044</span></a><span class="k">class</span> <span class="nc">ArrayAny</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayAny-3045"><a href="#ArrayAny-3045"><span class="linenos">3045</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayAny-3102"><a href="#ArrayAny-3102"><span class="linenos">3102</span></a><span class="k">class</span> <span class="nc">ArrayAny</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayAny-3103"><a href="#ArrayAny-3103"><span class="linenos">3103</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -28123,9 +29005,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayConcat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayConcat-3048"><a href="#ArrayConcat-3048"><span class="linenos">3048</span></a><span class="k">class</span> <span class="nc">ArrayConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayConcat-3049"><a href="#ArrayConcat-3049"><span class="linenos">3049</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="ArrayConcat-3050"><a href="#ArrayConcat-3050"><span class="linenos">3050</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayConcat-3106"><a href="#ArrayConcat-3106"><span class="linenos">3106</span></a><span class="k">class</span> <span class="nc">ArrayConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayConcat-3107"><a href="#ArrayConcat-3107"><span class="linenos">3107</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="ArrayConcat-3108"><a href="#ArrayConcat-3108"><span class="linenos">3108</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -28198,8 +29080,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayContains"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayContains-3053"><a href="#ArrayContains-3053"><span class="linenos">3053</span></a><span class="k">class</span> <span class="nc">ArrayContains</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayContains-3054"><a href="#ArrayContains-3054"><span class="linenos">3054</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayContains-3111"><a href="#ArrayContains-3111"><span class="linenos">3111</span></a><span class="k">class</span> <span class="nc">ArrayContains</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayContains-3112"><a href="#ArrayContains-3112"><span class="linenos">3112</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -28272,9 +29154,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayFilter"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayFilter-3057"><a href="#ArrayFilter-3057"><span class="linenos">3057</span></a><span class="k">class</span> <span class="nc">ArrayFilter</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArrayFilter-3058"><a href="#ArrayFilter-3058"><span class="linenos">3058</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="ArrayFilter-3059"><a href="#ArrayFilter-3059"><span class="linenos">3059</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"FILTER"</span><span class="p">,</span> <span class="s2">"ARRAY_FILTER"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayFilter-3115"><a href="#ArrayFilter-3115"><span class="linenos">3115</span></a><span class="k">class</span> <span class="nc">ArrayFilter</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArrayFilter-3116"><a href="#ArrayFilter-3116"><span class="linenos">3116</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="ArrayFilter-3117"><a href="#ArrayFilter-3117"><span class="linenos">3117</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"FILTER"</span><span class="p">,</span> <span class="s2">"ARRAY_FILTER"</span><span class="p">]</span> </span></pre></div> @@ -28347,8 +29229,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArraySize"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySize-3062"><a href="#ArraySize-3062"><span class="linenos">3062</span></a><span class="k">class</span> <span class="nc">ArraySize</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArraySize-3063"><a href="#ArraySize-3063"><span class="linenos">3063</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySize-3120"><a href="#ArraySize-3120"><span class="linenos">3120</span></a><span class="k">class</span> <span class="nc">ArraySize</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArraySize-3121"><a href="#ArraySize-3121"><span class="linenos">3121</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -28421,8 +29303,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArraySort"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySort-3066"><a href="#ArraySort-3066"><span class="linenos">3066</span></a><span class="k">class</span> <span class="nc">ArraySort</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArraySort-3067"><a href="#ArraySort-3067"><span class="linenos">3067</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySort-3124"><a href="#ArraySort-3124"><span class="linenos">3124</span></a><span class="k">class</span> <span class="nc">ArraySort</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArraySort-3125"><a href="#ArraySort-3125"><span class="linenos">3125</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -28495,8 +29377,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArraySum"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySum-3070"><a href="#ArraySum-3070"><span class="linenos">3070</span></a><span class="k">class</span> <span class="nc">ArraySum</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ArraySum-3071"><a href="#ArraySum-3071"><span class="linenos">3071</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArraySum-3128"><a href="#ArraySum-3128"><span class="linenos">3128</span></a><span class="k">class</span> <span class="nc">ArraySum</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ArraySum-3129"><a href="#ArraySum-3129"><span class="linenos">3129</span></a> <span class="k">pass</span> </span></pre></div> @@ -28569,8 +29451,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ArrayUnionAgg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayUnionAgg-3074"><a href="#ArrayUnionAgg-3074"><span class="linenos">3074</span></a><span class="k">class</span> <span class="nc">ArrayUnionAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="ArrayUnionAgg-3075"><a href="#ArrayUnionAgg-3075"><span class="linenos">3075</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ArrayUnionAgg-3132"><a href="#ArrayUnionAgg-3132"><span class="linenos">3132</span></a><span class="k">class</span> <span class="nc">ArrayUnionAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="ArrayUnionAgg-3133"><a href="#ArrayUnionAgg-3133"><span class="linenos">3133</span></a> <span class="k">pass</span> </span></pre></div> @@ -28643,8 +29525,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Avg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Avg-3078"><a href="#Avg-3078"><span class="linenos">3078</span></a><span class="k">class</span> <span class="nc">Avg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Avg-3079"><a href="#Avg-3079"><span class="linenos">3079</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Avg-3136"><a href="#Avg-3136"><span class="linenos">3136</span></a><span class="k">class</span> <span class="nc">Avg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Avg-3137"><a href="#Avg-3137"><span class="linenos">3137</span></a> <span class="k">pass</span> </span></pre></div> @@ -28717,8 +29599,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#AnyValue"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="AnyValue-3082"><a href="#AnyValue-3082"><span class="linenos">3082</span></a><span class="k">class</span> <span class="nc">AnyValue</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="AnyValue-3083"><a href="#AnyValue-3083"><span class="linenos">3083</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="AnyValue-3140"><a href="#AnyValue-3140"><span class="linenos">3140</span></a><span class="k">class</span> <span class="nc">AnyValue</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="AnyValue-3141"><a href="#AnyValue-3141"><span class="linenos">3141</span></a> <span class="k">pass</span> </span></pre></div> @@ -28791,8 +29673,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Case"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Case-3086"><a href="#Case-3086"><span class="linenos">3086</span></a><span class="k">class</span> <span class="nc">Case</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Case-3087"><a href="#Case-3087"><span class="linenos">3087</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"ifs"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Case-3144"><a href="#Case-3144"><span class="linenos">3144</span></a><span class="k">class</span> <span class="nc">Case</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Case-3145"><a href="#Case-3145"><span class="linenos">3145</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"ifs"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"default"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -28865,23 +29747,23 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Cast"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Cast-3090"><a href="#Cast-3090"><span class="linenos">3090</span></a><span class="k">class</span> <span class="nc">Cast</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Cast-3091"><a href="#Cast-3091"><span class="linenos">3091</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"to"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Cast-3092"><a href="#Cast-3092"><span class="linenos">3092</span></a> -</span><span id="Cast-3093"><a href="#Cast-3093"><span class="linenos">3093</span></a> <span class="nd">@property</span> -</span><span id="Cast-3094"><a href="#Cast-3094"><span class="linenos">3094</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="Cast-3095"><a href="#Cast-3095"><span class="linenos">3095</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span> -</span><span id="Cast-3096"><a href="#Cast-3096"><span class="linenos">3096</span></a> -</span><span id="Cast-3097"><a href="#Cast-3097"><span class="linenos">3097</span></a> <span class="nd">@property</span> -</span><span id="Cast-3098"><a href="#Cast-3098"><span class="linenos">3098</span></a> <span class="k">def</span> <span class="nf">to</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Cast-3099"><a href="#Cast-3099"><span class="linenos">3099</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"to"</span><span class="p">]</span> -</span><span id="Cast-3100"><a href="#Cast-3100"><span class="linenos">3100</span></a> -</span><span id="Cast-3101"><a href="#Cast-3101"><span class="linenos">3101</span></a> <span class="nd">@property</span> -</span><span id="Cast-3102"><a href="#Cast-3102"><span class="linenos">3102</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> -</span><span id="Cast-3103"><a href="#Cast-3103"><span class="linenos">3103</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> -</span><span id="Cast-3104"><a href="#Cast-3104"><span class="linenos">3104</span></a> -</span><span id="Cast-3105"><a href="#Cast-3105"><span class="linenos">3105</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Cast-3106"><a href="#Cast-3106"><span class="linenos">3106</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cast-3148"><a href="#Cast-3148"><span class="linenos">3148</span></a><span class="k">class</span> <span class="nc">Cast</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Cast-3149"><a href="#Cast-3149"><span class="linenos">3149</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"to"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Cast-3150"><a href="#Cast-3150"><span class="linenos">3150</span></a> +</span><span id="Cast-3151"><a href="#Cast-3151"><span class="linenos">3151</span></a> <span class="nd">@property</span> +</span><span id="Cast-3152"><a href="#Cast-3152"><span class="linenos">3152</span></a> <span class="k">def</span> <span class="nf">name</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="Cast-3153"><a href="#Cast-3153"><span class="linenos">3153</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">this</span><span class="o">.</span><span class="n">name</span> +</span><span id="Cast-3154"><a href="#Cast-3154"><span class="linenos">3154</span></a> +</span><span id="Cast-3155"><a href="#Cast-3155"><span class="linenos">3155</span></a> <span class="nd">@property</span> +</span><span id="Cast-3156"><a href="#Cast-3156"><span class="linenos">3156</span></a> <span class="k">def</span> <span class="nf">to</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Cast-3157"><a href="#Cast-3157"><span class="linenos">3157</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="s2">"to"</span><span class="p">]</span> +</span><span id="Cast-3158"><a href="#Cast-3158"><span class="linenos">3158</span></a> +</span><span id="Cast-3159"><a href="#Cast-3159"><span class="linenos">3159</span></a> <span class="nd">@property</span> +</span><span id="Cast-3160"><a href="#Cast-3160"><span class="linenos">3160</span></a> <span class="k">def</span> <span class="nf">output_name</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +</span><span id="Cast-3161"><a href="#Cast-3161"><span class="linenos">3161</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> +</span><span id="Cast-3162"><a href="#Cast-3162"><span class="linenos">3162</span></a> +</span><span id="Cast-3163"><a href="#Cast-3163"><span class="linenos">3163</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Cast-3164"><a href="#Cast-3164"><span class="linenos">3164</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> </span></pre></div> @@ -28928,8 +29810,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Cast.is_type"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Cast.is_type-3105"><a href="#Cast.is_type-3105"><span class="linenos">3105</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> -</span><span id="Cast.is_type-3106"><a href="#Cast.is_type-3106"><span class="linenos">3106</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Cast.is_type-3163"><a href="#Cast.is_type-3163"><span class="linenos">3163</span></a> <span class="k">def</span> <span class="nf">is_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dtype</span><span class="p">:</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">)</span> <span class="o">-></span> <span class="nb">bool</span><span class="p">:</span> +</span><span id="Cast.is_type-3164"><a href="#Cast.is_type-3164"><span class="linenos">3164</span></a> <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">to</span><span class="o">.</span><span class="n">is_type</span><span class="p">(</span><span class="n">dtype</span><span class="p">)</span> </span></pre></div> @@ -29002,8 +29884,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Collate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Collate-3109"><a href="#Collate-3109"><span class="linenos">3109</span></a><span class="k">class</span> <span class="nc">Collate</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="Collate-3110"><a href="#Collate-3110"><span class="linenos">3110</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Collate-3167"><a href="#Collate-3167"><span class="linenos">3167</span></a><span class="k">class</span> <span class="nc">Collate</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="Collate-3168"><a href="#Collate-3168"><span class="linenos">3168</span></a> <span class="k">pass</span> </span></pre></div> @@ -29063,8 +29945,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TryCast"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TryCast-3113"><a href="#TryCast-3113"><span class="linenos">3113</span></a><span class="k">class</span> <span class="nc">TryCast</span><span class="p">(</span><span class="n">Cast</span><span class="p">):</span> -</span><span id="TryCast-3114"><a href="#TryCast-3114"><span class="linenos">3114</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TryCast-3171"><a href="#TryCast-3171"><span class="linenos">3171</span></a><span class="k">class</span> <span class="nc">TryCast</span><span class="p">(</span><span class="n">Cast</span><span class="p">):</span> +</span><span id="TryCast-3172"><a href="#TryCast-3172"><span class="linenos">3172</span></a> <span class="k">pass</span> </span></pre></div> @@ -29141,9 +30023,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Ceil"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Ceil-3117"><a href="#Ceil-3117"><span class="linenos">3117</span></a><span class="k">class</span> <span class="nc">Ceil</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Ceil-3118"><a href="#Ceil-3118"><span class="linenos">3118</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Ceil-3119"><a href="#Ceil-3119"><span class="linenos">3119</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CEIL"</span><span class="p">,</span> <span class="s2">"CEILING"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Ceil-3175"><a href="#Ceil-3175"><span class="linenos">3175</span></a><span class="k">class</span> <span class="nc">Ceil</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Ceil-3176"><a href="#Ceil-3176"><span class="linenos">3176</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Ceil-3177"><a href="#Ceil-3177"><span class="linenos">3177</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CEIL"</span><span class="p">,</span> <span class="s2">"CEILING"</span><span class="p">]</span> </span></pre></div> @@ -29216,9 +30098,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Coalesce"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Coalesce-3122"><a href="#Coalesce-3122"><span class="linenos">3122</span></a><span class="k">class</span> <span class="nc">Coalesce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Coalesce-3123"><a href="#Coalesce-3123"><span class="linenos">3123</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Coalesce-3124"><a href="#Coalesce-3124"><span class="linenos">3124</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Coalesce-3180"><a href="#Coalesce-3180"><span class="linenos">3180</span></a><span class="k">class</span> <span class="nc">Coalesce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Coalesce-3181"><a href="#Coalesce-3181"><span class="linenos">3181</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Coalesce-3182"><a href="#Coalesce-3182"><span class="linenos">3182</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -29291,9 +30173,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Concat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Concat-3127"><a href="#Concat-3127"><span class="linenos">3127</span></a><span class="k">class</span> <span class="nc">Concat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Concat-3128"><a href="#Concat-3128"><span class="linenos">3128</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Concat-3129"><a href="#Concat-3129"><span class="linenos">3129</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Concat-3185"><a href="#Concat-3185"><span class="linenos">3185</span></a><span class="k">class</span> <span class="nc">Concat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Concat-3186"><a href="#Concat-3186"><span class="linenos">3186</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Concat-3187"><a href="#Concat-3187"><span class="linenos">3187</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -29366,8 +30248,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#ConcatWs"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ConcatWs-3132"><a href="#ConcatWs-3132"><span class="linenos">3132</span></a><span class="k">class</span> <span class="nc">ConcatWs</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> -</span><span id="ConcatWs-3133"><a href="#ConcatWs-3133"><span class="linenos">3133</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CONCAT_WS"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ConcatWs-3190"><a href="#ConcatWs-3190"><span class="linenos">3190</span></a><span class="k">class</span> <span class="nc">ConcatWs</span><span class="p">(</span><span class="n">Concat</span><span class="p">):</span> +</span><span id="ConcatWs-3191"><a href="#ConcatWs-3191"><span class="linenos">3191</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"CONCAT_WS"</span><span class="p">]</span> </span></pre></div> @@ -29440,8 +30322,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Count"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Count-3136"><a href="#Count-3136"><span class="linenos">3136</span></a><span class="k">class</span> <span class="nc">Count</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Count-3137"><a href="#Count-3137"><span class="linenos">3137</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Count-3194"><a href="#Count-3194"><span class="linenos">3194</span></a><span class="k">class</span> <span class="nc">Count</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Count-3195"><a href="#Count-3195"><span class="linenos">3195</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29514,8 +30396,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CurrentDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentDate-3140"><a href="#CurrentDate-3140"><span class="linenos">3140</span></a><span class="k">class</span> <span class="nc">CurrentDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CurrentDate-3141"><a href="#CurrentDate-3141"><span class="linenos">3141</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentDate-3198"><a href="#CurrentDate-3198"><span class="linenos">3198</span></a><span class="k">class</span> <span class="nc">CurrentDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CurrentDate-3199"><a href="#CurrentDate-3199"><span class="linenos">3199</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29588,8 +30470,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CurrentDatetime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentDatetime-3144"><a href="#CurrentDatetime-3144"><span class="linenos">3144</span></a><span class="k">class</span> <span class="nc">CurrentDatetime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CurrentDatetime-3145"><a href="#CurrentDatetime-3145"><span class="linenos">3145</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentDatetime-3202"><a href="#CurrentDatetime-3202"><span class="linenos">3202</span></a><span class="k">class</span> <span class="nc">CurrentDatetime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CurrentDatetime-3203"><a href="#CurrentDatetime-3203"><span class="linenos">3203</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29662,8 +30544,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CurrentTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentTime-3148"><a href="#CurrentTime-3148"><span class="linenos">3148</span></a><span class="k">class</span> <span class="nc">CurrentTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CurrentTime-3149"><a href="#CurrentTime-3149"><span class="linenos">3149</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentTime-3206"><a href="#CurrentTime-3206"><span class="linenos">3206</span></a><span class="k">class</span> <span class="nc">CurrentTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CurrentTime-3207"><a href="#CurrentTime-3207"><span class="linenos">3207</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29736,8 +30618,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#CurrentTimestamp"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentTimestamp-3152"><a href="#CurrentTimestamp-3152"><span class="linenos">3152</span></a><span class="k">class</span> <span class="nc">CurrentTimestamp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="CurrentTimestamp-3153"><a href="#CurrentTimestamp-3153"><span class="linenos">3153</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="CurrentTimestamp-3210"><a href="#CurrentTimestamp-3210"><span class="linenos">3210</span></a><span class="k">class</span> <span class="nc">CurrentTimestamp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="CurrentTimestamp-3211"><a href="#CurrentTimestamp-3211"><span class="linenos">3211</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29810,8 +30692,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateAdd-3156"><a href="#DateAdd-3156"><span class="linenos">3156</span></a><span class="k">class</span> <span class="nc">DateAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DateAdd-3157"><a href="#DateAdd-3157"><span class="linenos">3157</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateAdd-3214"><a href="#DateAdd-3214"><span class="linenos">3214</span></a><span class="k">class</span> <span class="nc">DateAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DateAdd-3215"><a href="#DateAdd-3215"><span class="linenos">3215</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29887,8 +30769,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateSub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateSub-3160"><a href="#DateSub-3160"><span class="linenos">3160</span></a><span class="k">class</span> <span class="nc">DateSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DateSub-3161"><a href="#DateSub-3161"><span class="linenos">3161</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateSub-3218"><a href="#DateSub-3218"><span class="linenos">3218</span></a><span class="k">class</span> <span class="nc">DateSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DateSub-3219"><a href="#DateSub-3219"><span class="linenos">3219</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -29964,8 +30846,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateDiff"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateDiff-3164"><a href="#DateDiff-3164"><span class="linenos">3164</span></a><span class="k">class</span> <span class="nc">DateDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DateDiff-3165"><a href="#DateDiff-3165"><span class="linenos">3165</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateDiff-3222"><a href="#DateDiff-3222"><span class="linenos">3222</span></a><span class="k">class</span> <span class="nc">DateDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DateDiff-3223"><a href="#DateDiff-3223"><span class="linenos">3223</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30041,8 +30923,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateTrunc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateTrunc-3168"><a href="#DateTrunc-3168"><span class="linenos">3168</span></a><span class="k">class</span> <span class="nc">DateTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DateTrunc-3169"><a href="#DateTrunc-3169"><span class="linenos">3169</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateTrunc-3226"><a href="#DateTrunc-3226"><span class="linenos">3226</span></a><span class="k">class</span> <span class="nc">DateTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DateTrunc-3227"><a href="#DateTrunc-3227"><span class="linenos">3227</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30115,8 +30997,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DatetimeAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeAdd-3172"><a href="#DatetimeAdd-3172"><span class="linenos">3172</span></a><span class="k">class</span> <span class="nc">DatetimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DatetimeAdd-3173"><a href="#DatetimeAdd-3173"><span class="linenos">3173</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeAdd-3230"><a href="#DatetimeAdd-3230"><span class="linenos">3230</span></a><span class="k">class</span> <span class="nc">DatetimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DatetimeAdd-3231"><a href="#DatetimeAdd-3231"><span class="linenos">3231</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30192,8 +31074,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DatetimeSub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeSub-3176"><a href="#DatetimeSub-3176"><span class="linenos">3176</span></a><span class="k">class</span> <span class="nc">DatetimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DatetimeSub-3177"><a href="#DatetimeSub-3177"><span class="linenos">3177</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeSub-3234"><a href="#DatetimeSub-3234"><span class="linenos">3234</span></a><span class="k">class</span> <span class="nc">DatetimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DatetimeSub-3235"><a href="#DatetimeSub-3235"><span class="linenos">3235</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30269,8 +31151,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DatetimeDiff"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeDiff-3180"><a href="#DatetimeDiff-3180"><span class="linenos">3180</span></a><span class="k">class</span> <span class="nc">DatetimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DatetimeDiff-3181"><a href="#DatetimeDiff-3181"><span class="linenos">3181</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeDiff-3238"><a href="#DatetimeDiff-3238"><span class="linenos">3238</span></a><span class="k">class</span> <span class="nc">DatetimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DatetimeDiff-3239"><a href="#DatetimeDiff-3239"><span class="linenos">3239</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30346,8 +31228,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DatetimeTrunc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeTrunc-3184"><a href="#DatetimeTrunc-3184"><span class="linenos">3184</span></a><span class="k">class</span> <span class="nc">DatetimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="DatetimeTrunc-3185"><a href="#DatetimeTrunc-3185"><span class="linenos">3185</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DatetimeTrunc-3242"><a href="#DatetimeTrunc-3242"><span class="linenos">3242</span></a><span class="k">class</span> <span class="nc">DatetimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="DatetimeTrunc-3243"><a href="#DatetimeTrunc-3243"><span class="linenos">3243</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30423,8 +31305,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DayOfWeek"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfWeek-3188"><a href="#DayOfWeek-3188"><span class="linenos">3188</span></a><span class="k">class</span> <span class="nc">DayOfWeek</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DayOfWeek-3189"><a href="#DayOfWeek-3189"><span class="linenos">3189</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_WEEK"</span><span class="p">,</span> <span class="s2">"DAYOFWEEK"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfWeek-3246"><a href="#DayOfWeek-3246"><span class="linenos">3246</span></a><span class="k">class</span> <span class="nc">DayOfWeek</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DayOfWeek-3247"><a href="#DayOfWeek-3247"><span class="linenos">3247</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_WEEK"</span><span class="p">,</span> <span class="s2">"DAYOFWEEK"</span><span class="p">]</span> </span></pre></div> @@ -30497,8 +31379,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DayOfMonth"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfMonth-3192"><a href="#DayOfMonth-3192"><span class="linenos">3192</span></a><span class="k">class</span> <span class="nc">DayOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DayOfMonth-3193"><a href="#DayOfMonth-3193"><span class="linenos">3193</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_MONTH"</span><span class="p">,</span> <span class="s2">"DAYOFMONTH"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfMonth-3250"><a href="#DayOfMonth-3250"><span class="linenos">3250</span></a><span class="k">class</span> <span class="nc">DayOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DayOfMonth-3251"><a href="#DayOfMonth-3251"><span class="linenos">3251</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_MONTH"</span><span class="p">,</span> <span class="s2">"DAYOFMONTH"</span><span class="p">]</span> </span></pre></div> @@ -30571,8 +31453,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DayOfYear"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfYear-3196"><a href="#DayOfYear-3196"><span class="linenos">3196</span></a><span class="k">class</span> <span class="nc">DayOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DayOfYear-3197"><a href="#DayOfYear-3197"><span class="linenos">3197</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_YEAR"</span><span class="p">,</span> <span class="s2">"DAYOFYEAR"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DayOfYear-3254"><a href="#DayOfYear-3254"><span class="linenos">3254</span></a><span class="k">class</span> <span class="nc">DayOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DayOfYear-3255"><a href="#DayOfYear-3255"><span class="linenos">3255</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DAY_OF_YEAR"</span><span class="p">,</span> <span class="s2">"DAYOFYEAR"</span><span class="p">]</span> </span></pre></div> @@ -30645,8 +31527,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#WeekOfYear"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="WeekOfYear-3200"><a href="#WeekOfYear-3200"><span class="linenos">3200</span></a><span class="k">class</span> <span class="nc">WeekOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="WeekOfYear-3201"><a href="#WeekOfYear-3201"><span class="linenos">3201</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"WEEK_OF_YEAR"</span><span class="p">,</span> <span class="s2">"WEEKOFYEAR"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="WeekOfYear-3258"><a href="#WeekOfYear-3258"><span class="linenos">3258</span></a><span class="k">class</span> <span class="nc">WeekOfYear</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="WeekOfYear-3259"><a href="#WeekOfYear-3259"><span class="linenos">3259</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"WEEK_OF_YEAR"</span><span class="p">,</span> <span class="s2">"WEEKOFYEAR"</span><span class="p">]</span> </span></pre></div> @@ -30719,8 +31601,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#LastDateOfMonth"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LastDateOfMonth-3204"><a href="#LastDateOfMonth-3204"><span class="linenos">3204</span></a><span class="k">class</span> <span class="nc">LastDateOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="LastDateOfMonth-3205"><a href="#LastDateOfMonth-3205"><span class="linenos">3205</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LastDateOfMonth-3262"><a href="#LastDateOfMonth-3262"><span class="linenos">3262</span></a><span class="k">class</span> <span class="nc">LastDateOfMonth</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="LastDateOfMonth-3263"><a href="#LastDateOfMonth-3263"><span class="linenos">3263</span></a> <span class="k">pass</span> </span></pre></div> @@ -30793,8 +31675,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Extract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Extract-3208"><a href="#Extract-3208"><span class="linenos">3208</span></a><span class="k">class</span> <span class="nc">Extract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Extract-3209"><a href="#Extract-3209"><span class="linenos">3209</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Extract-3266"><a href="#Extract-3266"><span class="linenos">3266</span></a><span class="k">class</span> <span class="nc">Extract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Extract-3267"><a href="#Extract-3267"><span class="linenos">3267</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -30867,8 +31749,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimestampAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampAdd-3212"><a href="#TimestampAdd-3212"><span class="linenos">3212</span></a><span class="k">class</span> <span class="nc">TimestampAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimestampAdd-3213"><a href="#TimestampAdd-3213"><span class="linenos">3213</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampAdd-3270"><a href="#TimestampAdd-3270"><span class="linenos">3270</span></a><span class="k">class</span> <span class="nc">TimestampAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimestampAdd-3271"><a href="#TimestampAdd-3271"><span class="linenos">3271</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -30944,8 +31826,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimestampSub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampSub-3216"><a href="#TimestampSub-3216"><span class="linenos">3216</span></a><span class="k">class</span> <span class="nc">TimestampSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimestampSub-3217"><a href="#TimestampSub-3217"><span class="linenos">3217</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampSub-3274"><a href="#TimestampSub-3274"><span class="linenos">3274</span></a><span class="k">class</span> <span class="nc">TimestampSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimestampSub-3275"><a href="#TimestampSub-3275"><span class="linenos">3275</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31021,8 +31903,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimestampDiff"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampDiff-3220"><a href="#TimestampDiff-3220"><span class="linenos">3220</span></a><span class="k">class</span> <span class="nc">TimestampDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimestampDiff-3221"><a href="#TimestampDiff-3221"><span class="linenos">3221</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampDiff-3278"><a href="#TimestampDiff-3278"><span class="linenos">3278</span></a><span class="k">class</span> <span class="nc">TimestampDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimestampDiff-3279"><a href="#TimestampDiff-3279"><span class="linenos">3279</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31098,8 +31980,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimestampTrunc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampTrunc-3224"><a href="#TimestampTrunc-3224"><span class="linenos">3224</span></a><span class="k">class</span> <span class="nc">TimestampTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimestampTrunc-3225"><a href="#TimestampTrunc-3225"><span class="linenos">3225</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimestampTrunc-3282"><a href="#TimestampTrunc-3282"><span class="linenos">3282</span></a><span class="k">class</span> <span class="nc">TimestampTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimestampTrunc-3283"><a href="#TimestampTrunc-3283"><span class="linenos">3283</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31175,8 +32057,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeAdd-3228"><a href="#TimeAdd-3228"><span class="linenos">3228</span></a><span class="k">class</span> <span class="nc">TimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimeAdd-3229"><a href="#TimeAdd-3229"><span class="linenos">3229</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeAdd-3286"><a href="#TimeAdd-3286"><span class="linenos">3286</span></a><span class="k">class</span> <span class="nc">TimeAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimeAdd-3287"><a href="#TimeAdd-3287"><span class="linenos">3287</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31252,8 +32134,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeSub"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeSub-3232"><a href="#TimeSub-3232"><span class="linenos">3232</span></a><span class="k">class</span> <span class="nc">TimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimeSub-3233"><a href="#TimeSub-3233"><span class="linenos">3233</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeSub-3290"><a href="#TimeSub-3290"><span class="linenos">3290</span></a><span class="k">class</span> <span class="nc">TimeSub</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimeSub-3291"><a href="#TimeSub-3291"><span class="linenos">3291</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31329,8 +32211,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeDiff"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeDiff-3236"><a href="#TimeDiff-3236"><span class="linenos">3236</span></a><span class="k">class</span> <span class="nc">TimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimeDiff-3237"><a href="#TimeDiff-3237"><span class="linenos">3237</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeDiff-3294"><a href="#TimeDiff-3294"><span class="linenos">3294</span></a><span class="k">class</span> <span class="nc">TimeDiff</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimeDiff-3295"><a href="#TimeDiff-3295"><span class="linenos">3295</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31406,8 +32288,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#TimeTrunc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeTrunc-3240"><a href="#TimeTrunc-3240"><span class="linenos">3240</span></a><span class="k">class</span> <span class="nc">TimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TimeTrunc-3241"><a href="#TimeTrunc-3241"><span class="linenos">3241</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeTrunc-3298"><a href="#TimeTrunc-3298"><span class="linenos">3298</span></a><span class="k">class</span> <span class="nc">TimeTrunc</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TimeTrunc-3299"><a href="#TimeTrunc-3299"><span class="linenos">3299</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31483,9 +32365,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateFromParts"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateFromParts-3244"><a href="#DateFromParts-3244"><span class="linenos">3244</span></a><span class="k">class</span> <span class="nc">DateFromParts</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DateFromParts-3245"><a href="#DateFromParts-3245"><span class="linenos">3245</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEFROMPARTS"</span><span class="p">]</span> -</span><span id="DateFromParts-3246"><a href="#DateFromParts-3246"><span class="linenos">3246</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"year"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"month"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"day"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateFromParts-3302"><a href="#DateFromParts-3302"><span class="linenos">3302</span></a><span class="k">class</span> <span class="nc">DateFromParts</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DateFromParts-3303"><a href="#DateFromParts-3303"><span class="linenos">3303</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"DATEFROMPARTS"</span><span class="p">]</span> +</span><span id="DateFromParts-3304"><a href="#DateFromParts-3304"><span class="linenos">3304</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"year"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"month"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"day"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -31558,8 +32440,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateStrToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateStrToDate-3249"><a href="#DateStrToDate-3249"><span class="linenos">3249</span></a><span class="k">class</span> <span class="nc">DateStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DateStrToDate-3250"><a href="#DateStrToDate-3250"><span class="linenos">3250</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateStrToDate-3307"><a href="#DateStrToDate-3307"><span class="linenos">3307</span></a><span class="k">class</span> <span class="nc">DateStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DateStrToDate-3308"><a href="#DateStrToDate-3308"><span class="linenos">3308</span></a> <span class="k">pass</span> </span></pre></div> @@ -31632,8 +32514,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateToDateStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDateStr-3253"><a href="#DateToDateStr-3253"><span class="linenos">3253</span></a><span class="k">class</span> <span class="nc">DateToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DateToDateStr-3254"><a href="#DateToDateStr-3254"><span class="linenos">3254</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDateStr-3311"><a href="#DateToDateStr-3311"><span class="linenos">3311</span></a><span class="k">class</span> <span class="nc">DateToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DateToDateStr-3312"><a href="#DateToDateStr-3312"><span class="linenos">3312</span></a> <span class="k">pass</span> </span></pre></div> @@ -31706,8 +32588,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DateToDi"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDi-3257"><a href="#DateToDi-3257"><span class="linenos">3257</span></a><span class="k">class</span> <span class="nc">DateToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DateToDi-3258"><a href="#DateToDi-3258"><span class="linenos">3258</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DateToDi-3315"><a href="#DateToDi-3315"><span class="linenos">3315</span></a><span class="k">class</span> <span class="nc">DateToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DateToDi-3316"><a href="#DateToDi-3316"><span class="linenos">3316</span></a> <span class="k">pass</span> </span></pre></div> @@ -31780,8 +32662,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Day"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Day-3261"><a href="#Day-3261"><span class="linenos">3261</span></a><span class="k">class</span> <span class="nc">Day</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Day-3262"><a href="#Day-3262"><span class="linenos">3262</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Day-3319"><a href="#Day-3319"><span class="linenos">3319</span></a><span class="k">class</span> <span class="nc">Day</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Day-3320"><a href="#Day-3320"><span class="linenos">3320</span></a> <span class="k">pass</span> </span></pre></div> @@ -31854,8 +32736,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Decode"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Decode-3265"><a href="#Decode-3265"><span class="linenos">3265</span></a><span class="k">class</span> <span class="nc">Decode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Decode-3266"><a href="#Decode-3266"><span class="linenos">3266</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Decode-3323"><a href="#Decode-3323"><span class="linenos">3323</span></a><span class="k">class</span> <span class="nc">Decode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Decode-3324"><a href="#Decode-3324"><span class="linenos">3324</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"replace"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -31928,8 +32810,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#DiToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="DiToDate-3269"><a href="#DiToDate-3269"><span class="linenos">3269</span></a><span class="k">class</span> <span class="nc">DiToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="DiToDate-3270"><a href="#DiToDate-3270"><span class="linenos">3270</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="DiToDate-3327"><a href="#DiToDate-3327"><span class="linenos">3327</span></a><span class="k">class</span> <span class="nc">DiToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="DiToDate-3328"><a href="#DiToDate-3328"><span class="linenos">3328</span></a> <span class="k">pass</span> </span></pre></div> @@ -32002,8 +32884,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Encode"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Encode-3273"><a href="#Encode-3273"><span class="linenos">3273</span></a><span class="k">class</span> <span class="nc">Encode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Encode-3274"><a href="#Encode-3274"><span class="linenos">3274</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Encode-3331"><a href="#Encode-3331"><span class="linenos">3331</span></a><span class="k">class</span> <span class="nc">Encode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Encode-3332"><a href="#Encode-3332"><span class="linenos">3332</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"charset"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -32076,8 +32958,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Exp"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Exp-3277"><a href="#Exp-3277"><span class="linenos">3277</span></a><span class="k">class</span> <span class="nc">Exp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Exp-3278"><a href="#Exp-3278"><span class="linenos">3278</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Exp-3335"><a href="#Exp-3335"><span class="linenos">3335</span></a><span class="k">class</span> <span class="nc">Exp</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Exp-3336"><a href="#Exp-3336"><span class="linenos">3336</span></a> <span class="k">pass</span> </span></pre></div> @@ -32150,8 +33032,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Explode"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Explode-3281"><a href="#Explode-3281"><span class="linenos">3281</span></a><span class="k">class</span> <span class="nc">Explode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Explode-3282"><a href="#Explode-3282"><span class="linenos">3282</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Explode-3339"><a href="#Explode-3339"><span class="linenos">3339</span></a><span class="k">class</span> <span class="nc">Explode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Explode-3340"><a href="#Explode-3340"><span class="linenos">3340</span></a> <span class="k">pass</span> </span></pre></div> @@ -32224,8 +33106,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Floor"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Floor-3285"><a href="#Floor-3285"><span class="linenos">3285</span></a><span class="k">class</span> <span class="nc">Floor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Floor-3286"><a href="#Floor-3286"><span class="linenos">3286</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Floor-3343"><a href="#Floor-3343"><span class="linenos">3343</span></a><span class="k">class</span> <span class="nc">Floor</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Floor-3344"><a href="#Floor-3344"><span class="linenos">3344</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -32298,9 +33180,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Greatest"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Greatest-3289"><a href="#Greatest-3289"><span class="linenos">3289</span></a><span class="k">class</span> <span class="nc">Greatest</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Greatest-3290"><a href="#Greatest-3290"><span class="linenos">3290</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Greatest-3291"><a href="#Greatest-3291"><span class="linenos">3291</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Greatest-3347"><a href="#Greatest-3347"><span class="linenos">3347</span></a><span class="k">class</span> <span class="nc">Greatest</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Greatest-3348"><a href="#Greatest-3348"><span class="linenos">3348</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Greatest-3349"><a href="#Greatest-3349"><span class="linenos">3349</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -32373,8 +33255,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#GroupConcat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="GroupConcat-3294"><a href="#GroupConcat-3294"><span class="linenos">3294</span></a><span class="k">class</span> <span class="nc">GroupConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="GroupConcat-3295"><a href="#GroupConcat-3295"><span class="linenos">3295</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"separator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="GroupConcat-3352"><a href="#GroupConcat-3352"><span class="linenos">3352</span></a><span class="k">class</span> <span class="nc">GroupConcat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="GroupConcat-3353"><a href="#GroupConcat-3353"><span class="linenos">3353</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"separator"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -32447,8 +33329,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Hex"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Hex-3298"><a href="#Hex-3298"><span class="linenos">3298</span></a><span class="k">class</span> <span class="nc">Hex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Hex-3299"><a href="#Hex-3299"><span class="linenos">3299</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Hex-3356"><a href="#Hex-3356"><span class="linenos">3356</span></a><span class="k">class</span> <span class="nc">Hex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Hex-3357"><a href="#Hex-3357"><span class="linenos">3357</span></a> <span class="k">pass</span> </span></pre></div> @@ -32521,8 +33403,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#If"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="If-3302"><a href="#If-3302"><span class="linenos">3302</span></a><span class="k">class</span> <span class="nc">If</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="If-3303"><a href="#If-3303"><span class="linenos">3303</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="If-3360"><a href="#If-3360"><span class="linenos">3360</span></a><span class="k">class</span> <span class="nc">If</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="If-3361"><a href="#If-3361"><span class="linenos">3361</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -32595,9 +33477,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#IfNull"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="IfNull-3306"><a href="#IfNull-3306"><span class="linenos">3306</span></a><span class="k">class</span> <span class="nc">IfNull</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="IfNull-3307"><a href="#IfNull-3307"><span class="linenos">3307</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="IfNull-3308"><a href="#IfNull-3308"><span class="linenos">3308</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"IFNULL"</span><span class="p">,</span> <span class="s2">"NVL"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="IfNull-3364"><a href="#IfNull-3364"><span class="linenos">3364</span></a><span class="k">class</span> <span class="nc">IfNull</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="IfNull-3365"><a href="#IfNull-3365"><span class="linenos">3365</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="IfNull-3366"><a href="#IfNull-3366"><span class="linenos">3366</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"IFNULL"</span><span class="p">,</span> <span class="s2">"NVL"</span><span class="p">]</span> </span></pre></div> @@ -32670,8 +33552,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Initcap"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Initcap-3311"><a href="#Initcap-3311"><span class="linenos">3311</span></a><span class="k">class</span> <span class="nc">Initcap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Initcap-3312"><a href="#Initcap-3312"><span class="linenos">3312</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Initcap-3369"><a href="#Initcap-3369"><span class="linenos">3369</span></a><span class="k">class</span> <span class="nc">Initcap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Initcap-3370"><a href="#Initcap-3370"><span class="linenos">3370</span></a> <span class="k">pass</span> </span></pre></div> @@ -32744,8 +33626,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONBContains"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBContains-3315"><a href="#JSONBContains-3315"><span class="linenos">3315</span></a><span class="k">class</span> <span class="nc">JSONBContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> -</span><span id="JSONBContains-3316"><a href="#JSONBContains-3316"><span class="linenos">3316</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_CONTAINS"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBContains-3373"><a href="#JSONBContains-3373"><span class="linenos">3373</span></a><span class="k">class</span> <span class="nc">JSONBContains</span><span class="p">(</span><span class="n">Binary</span><span class="p">):</span> +</span><span id="JSONBContains-3374"><a href="#JSONBContains-3374"><span class="linenos">3374</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_CONTAINS"</span><span class="p">]</span> </span></pre></div> @@ -32805,8 +33687,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONExtract-3319"><a href="#JSONExtract-3319"><span class="linenos">3319</span></a><span class="k">class</span> <span class="nc">JSONExtract</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="JSONExtract-3320"><a href="#JSONExtract-3320"><span class="linenos">3320</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONExtract-3377"><a href="#JSONExtract-3377"><span class="linenos">3377</span></a><span class="k">class</span> <span class="nc">JSONExtract</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="JSONExtract-3378"><a href="#JSONExtract-3378"><span class="linenos">3378</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT"</span><span class="p">]</span> </span></pre></div> @@ -32879,8 +33761,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONExtractScalar"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONExtractScalar-3323"><a href="#JSONExtractScalar-3323"><span class="linenos">3323</span></a><span class="k">class</span> <span class="nc">JSONExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="JSONExtractScalar-3324"><a href="#JSONExtractScalar-3324"><span class="linenos">3324</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT_SCALAR"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONExtractScalar-3381"><a href="#JSONExtractScalar-3381"><span class="linenos">3381</span></a><span class="k">class</span> <span class="nc">JSONExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="JSONExtractScalar-3382"><a href="#JSONExtractScalar-3382"><span class="linenos">3382</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSON_EXTRACT_SCALAR"</span><span class="p">]</span> </span></pre></div> @@ -32953,8 +33835,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONBExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBExtract-3327"><a href="#JSONBExtract-3327"><span class="linenos">3327</span></a><span class="k">class</span> <span class="nc">JSONBExtract</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="JSONBExtract-3328"><a href="#JSONBExtract-3328"><span class="linenos">3328</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBExtract-3385"><a href="#JSONBExtract-3385"><span class="linenos">3385</span></a><span class="k">class</span> <span class="nc">JSONBExtract</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="JSONBExtract-3386"><a href="#JSONBExtract-3386"><span class="linenos">3386</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT"</span><span class="p">]</span> </span></pre></div> @@ -33027,8 +33909,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#JSONBExtractScalar"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBExtractScalar-3331"><a href="#JSONBExtractScalar-3331"><span class="linenos">3331</span></a><span class="k">class</span> <span class="nc">JSONBExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> -</span><span id="JSONBExtractScalar-3332"><a href="#JSONBExtractScalar-3332"><span class="linenos">3332</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT_SCALAR"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="JSONBExtractScalar-3389"><a href="#JSONBExtractScalar-3389"><span class="linenos">3389</span></a><span class="k">class</span> <span class="nc">JSONBExtractScalar</span><span class="p">(</span><span class="n">JSONExtract</span><span class="p">):</span> +</span><span id="JSONBExtractScalar-3390"><a href="#JSONBExtractScalar-3390"><span class="linenos">3390</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"JSONB_EXTRACT_SCALAR"</span><span class="p">]</span> </span></pre></div> @@ -33101,9 +33983,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Least"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Least-3335"><a href="#Least-3335"><span class="linenos">3335</span></a><span class="k">class</span> <span class="nc">Least</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Least-3336"><a href="#Least-3336"><span class="linenos">3336</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="Least-3337"><a href="#Least-3337"><span class="linenos">3337</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Least-3393"><a href="#Least-3393"><span class="linenos">3393</span></a><span class="k">class</span> <span class="nc">Least</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Least-3394"><a href="#Least-3394"><span class="linenos">3394</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="Least-3395"><a href="#Least-3395"><span class="linenos">3395</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -33176,8 +34058,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Length"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Length-3340"><a href="#Length-3340"><span class="linenos">3340</span></a><span class="k">class</span> <span class="nc">Length</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Length-3341"><a href="#Length-3341"><span class="linenos">3341</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Length-3398"><a href="#Length-3398"><span class="linenos">3398</span></a><span class="k">class</span> <span class="nc">Length</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Length-3399"><a href="#Length-3399"><span class="linenos">3399</span></a> <span class="k">pass</span> </span></pre></div> @@ -33250,14 +34132,14 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Levenshtein"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Levenshtein-3344"><a href="#Levenshtein-3344"><span class="linenos">3344</span></a><span class="k">class</span> <span class="nc">Levenshtein</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Levenshtein-3345"><a href="#Levenshtein-3345"><span class="linenos">3345</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Levenshtein-3346"><a href="#Levenshtein-3346"><span class="linenos">3346</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Levenshtein-3347"><a href="#Levenshtein-3347"><span class="linenos">3347</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Levenshtein-3348"><a href="#Levenshtein-3348"><span class="linenos">3348</span></a> <span class="s2">"ins_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Levenshtein-3349"><a href="#Levenshtein-3349"><span class="linenos">3349</span></a> <span class="s2">"del_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Levenshtein-3350"><a href="#Levenshtein-3350"><span class="linenos">3350</span></a> <span class="s2">"sub_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Levenshtein-3351"><a href="#Levenshtein-3351"><span class="linenos">3351</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Levenshtein-3402"><a href="#Levenshtein-3402"><span class="linenos">3402</span></a><span class="k">class</span> <span class="nc">Levenshtein</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Levenshtein-3403"><a href="#Levenshtein-3403"><span class="linenos">3403</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Levenshtein-3404"><a href="#Levenshtein-3404"><span class="linenos">3404</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Levenshtein-3405"><a href="#Levenshtein-3405"><span class="linenos">3405</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Levenshtein-3406"><a href="#Levenshtein-3406"><span class="linenos">3406</span></a> <span class="s2">"ins_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Levenshtein-3407"><a href="#Levenshtein-3407"><span class="linenos">3407</span></a> <span class="s2">"del_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Levenshtein-3408"><a href="#Levenshtein-3408"><span class="linenos">3408</span></a> <span class="s2">"sub_cost"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Levenshtein-3409"><a href="#Levenshtein-3409"><span class="linenos">3409</span></a> <span class="p">}</span> </span></pre></div> @@ -33330,8 +34212,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Ln"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Ln-3354"><a href="#Ln-3354"><span class="linenos">3354</span></a><span class="k">class</span> <span class="nc">Ln</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Ln-3355"><a href="#Ln-3355"><span class="linenos">3355</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Ln-3412"><a href="#Ln-3412"><span class="linenos">3412</span></a><span class="k">class</span> <span class="nc">Ln</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Ln-3413"><a href="#Ln-3413"><span class="linenos">3413</span></a> <span class="k">pass</span> </span></pre></div> @@ -33404,8 +34286,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Log"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Log-3358"><a href="#Log-3358"><span class="linenos">3358</span></a><span class="k">class</span> <span class="nc">Log</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Log-3359"><a href="#Log-3359"><span class="linenos">3359</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Log-3416"><a href="#Log-3416"><span class="linenos">3416</span></a><span class="k">class</span> <span class="nc">Log</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Log-3417"><a href="#Log-3417"><span class="linenos">3417</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -33478,8 +34360,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Log2"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Log2-3362"><a href="#Log2-3362"><span class="linenos">3362</span></a><span class="k">class</span> <span class="nc">Log2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Log2-3363"><a href="#Log2-3363"><span class="linenos">3363</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Log2-3420"><a href="#Log2-3420"><span class="linenos">3420</span></a><span class="k">class</span> <span class="nc">Log2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Log2-3421"><a href="#Log2-3421"><span class="linenos">3421</span></a> <span class="k">pass</span> </span></pre></div> @@ -33552,8 +34434,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Log10"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Log10-3366"><a href="#Log10-3366"><span class="linenos">3366</span></a><span class="k">class</span> <span class="nc">Log10</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Log10-3367"><a href="#Log10-3367"><span class="linenos">3367</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Log10-3424"><a href="#Log10-3424"><span class="linenos">3424</span></a><span class="k">class</span> <span class="nc">Log10</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Log10-3425"><a href="#Log10-3425"><span class="linenos">3425</span></a> <span class="k">pass</span> </span></pre></div> @@ -33626,8 +34508,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#LogicalOr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="LogicalOr-3370"><a href="#LogicalOr-3370"><span class="linenos">3370</span></a><span class="k">class</span> <span class="nc">LogicalOr</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="LogicalOr-3371"><a href="#LogicalOr-3371"><span class="linenos">3371</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_OR"</span><span class="p">,</span> <span class="s2">"BOOL_OR"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="LogicalOr-3428"><a href="#LogicalOr-3428"><span class="linenos">3428</span></a><span class="k">class</span> <span class="nc">LogicalOr</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="LogicalOr-3429"><a href="#LogicalOr-3429"><span class="linenos">3429</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOGICAL_OR"</span><span class="p">,</span> <span class="s2">"BOOL_OR"</span><span class="p">]</span> </span></pre></div> @@ -33700,8 +34582,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Lower"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Lower-3374"><a href="#Lower-3374"><span class="linenos">3374</span></a><span class="k">class</span> <span class="nc">Lower</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Lower-3375"><a href="#Lower-3375"><span class="linenos">3375</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOWER"</span><span class="p">,</span> <span class="s2">"LCASE"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Lower-3432"><a href="#Lower-3432"><span class="linenos">3432</span></a><span class="k">class</span> <span class="nc">Lower</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Lower-3433"><a href="#Lower-3433"><span class="linenos">3433</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"LOWER"</span><span class="p">,</span> <span class="s2">"LCASE"</span><span class="p">]</span> </span></pre></div> @@ -33774,8 +34656,8 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Map"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Map-3378"><a href="#Map-3378"><span class="linenos">3378</span></a><span class="k">class</span> <span class="nc">Map</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Map-3379"><a href="#Map-3379"><span class="linenos">3379</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Map-3436"><a href="#Map-3436"><span class="linenos">3436</span></a><span class="k">class</span> <span class="nc">Map</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Map-3437"><a href="#Map-3437"><span class="linenos">3437</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -33848,9 +34730,9 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#VarMap"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="VarMap-3382"><a href="#VarMap-3382"><span class="linenos">3382</span></a><span class="k">class</span> <span class="nc">VarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="VarMap-3383"><a href="#VarMap-3383"><span class="linenos">3383</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="VarMap-3384"><a href="#VarMap-3384"><span class="linenos">3384</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="VarMap-3440"><a href="#VarMap-3440"><span class="linenos">3440</span></a><span class="k">class</span> <span class="nc">VarMap</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="VarMap-3441"><a href="#VarMap-3441"><span class="linenos">3441</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"keys"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"values"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="VarMap-3442"><a href="#VarMap-3442"><span class="linenos">3442</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -33923,14 +34805,14 @@ name is set to the expression's class name transformed to snake case.</li> </div> <a class="headerlink" href="#Matches"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Matches-3387"><a href="#Matches-3387"><span class="linenos">3387</span></a><span class="k">class</span> <span class="nc">Matches</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Matches-3388"><a href="#Matches-3388"><span class="linenos">3388</span></a><span class="w"> </span><span class="sd">"""Oracle/Snowflake decode.</span> -</span><span id="Matches-3389"><a href="#Matches-3389"><span class="linenos">3389</span></a><span class="sd"> https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm</span> -</span><span id="Matches-3390"><a href="#Matches-3390"><span class="linenos">3390</span></a><span class="sd"> Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</span> -</span><span id="Matches-3391"><a href="#Matches-3391"><span class="linenos">3391</span></a><span class="sd"> """</span> -</span><span id="Matches-3392"><a href="#Matches-3392"><span class="linenos">3392</span></a> -</span><span id="Matches-3393"><a href="#Matches-3393"><span class="linenos">3393</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Matches-3394"><a href="#Matches-3394"><span class="linenos">3394</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Matches-3445"><a href="#Matches-3445"><span class="linenos">3445</span></a><span class="k">class</span> <span class="nc">Matches</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Matches-3446"><a href="#Matches-3446"><span class="linenos">3446</span></a><span class="w"> </span><span class="sd">"""Oracle/Snowflake decode.</span> +</span><span id="Matches-3447"><a href="#Matches-3447"><span class="linenos">3447</span></a><span class="sd"> https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions040.htm</span> +</span><span id="Matches-3448"><a href="#Matches-3448"><span class="linenos">3448</span></a><span class="sd"> Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</span> +</span><span id="Matches-3449"><a href="#Matches-3449"><span class="linenos">3449</span></a><span class="sd"> """</span> +</span><span id="Matches-3450"><a href="#Matches-3450"><span class="linenos">3450</span></a> +</span><span id="Matches-3451"><a href="#Matches-3451"><span class="linenos">3451</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Matches-3452"><a href="#Matches-3452"><span class="linenos">3452</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -34007,8 +34889,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Max"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Max-3397"><a href="#Max-3397"><span class="linenos">3397</span></a><span class="k">class</span> <span class="nc">Max</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Max-3398"><a href="#Max-3398"><span class="linenos">3398</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Max-3455"><a href="#Max-3455"><span class="linenos">3455</span></a><span class="k">class</span> <span class="nc">Max</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Max-3456"><a href="#Max-3456"><span class="linenos">3456</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -34081,8 +34963,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Min"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Min-3401"><a href="#Min-3401"><span class="linenos">3401</span></a><span class="k">class</span> <span class="nc">Min</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Min-3402"><a href="#Min-3402"><span class="linenos">3402</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Min-3459"><a href="#Min-3459"><span class="linenos">3459</span></a><span class="k">class</span> <span class="nc">Min</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Min-3460"><a href="#Min-3460"><span class="linenos">3460</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -34155,8 +35037,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Month"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Month-3405"><a href="#Month-3405"><span class="linenos">3405</span></a><span class="k">class</span> <span class="nc">Month</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Month-3406"><a href="#Month-3406"><span class="linenos">3406</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Month-3463"><a href="#Month-3463"><span class="linenos">3463</span></a><span class="k">class</span> <span class="nc">Month</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Month-3464"><a href="#Month-3464"><span class="linenos">3464</span></a> <span class="k">pass</span> </span></pre></div> @@ -34229,8 +35111,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Nvl2"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Nvl2-3409"><a href="#Nvl2-3409"><span class="linenos">3409</span></a><span class="k">class</span> <span class="nc">Nvl2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Nvl2-3410"><a href="#Nvl2-3410"><span class="linenos">3410</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Nvl2-3467"><a href="#Nvl2-3467"><span class="linenos">3467</span></a><span class="k">class</span> <span class="nc">Nvl2</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Nvl2-3468"><a href="#Nvl2-3468"><span class="linenos">3468</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"true"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"false"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -34303,8 +35185,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Posexplode"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Posexplode-3413"><a href="#Posexplode-3413"><span class="linenos">3413</span></a><span class="k">class</span> <span class="nc">Posexplode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Posexplode-3414"><a href="#Posexplode-3414"><span class="linenos">3414</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Posexplode-3471"><a href="#Posexplode-3471"><span class="linenos">3471</span></a><span class="k">class</span> <span class="nc">Posexplode</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Posexplode-3472"><a href="#Posexplode-3472"><span class="linenos">3472</span></a> <span class="k">pass</span> </span></pre></div> @@ -34377,8 +35259,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Pow"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Pow-3417"><a href="#Pow-3417"><span class="linenos">3417</span></a><span class="k">class</span> <span class="nc">Pow</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> -</span><span id="Pow-3418"><a href="#Pow-3418"><span class="linenos">3418</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"POWER"</span><span class="p">,</span> <span class="s2">"POW"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Pow-3475"><a href="#Pow-3475"><span class="linenos">3475</span></a><span class="k">class</span> <span class="nc">Pow</span><span class="p">(</span><span class="n">Binary</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span> +</span><span id="Pow-3476"><a href="#Pow-3476"><span class="linenos">3476</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"POWER"</span><span class="p">,</span> <span class="s2">"POW"</span><span class="p">]</span> </span></pre></div> @@ -34451,8 +35333,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#PercentileCont"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileCont-3421"><a href="#PercentileCont-3421"><span class="linenos">3421</span></a><span class="k">class</span> <span class="nc">PercentileCont</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="PercentileCont-3422"><a href="#PercentileCont-3422"><span class="linenos">3422</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileCont-3479"><a href="#PercentileCont-3479"><span class="linenos">3479</span></a><span class="k">class</span> <span class="nc">PercentileCont</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="PercentileCont-3480"><a href="#PercentileCont-3480"><span class="linenos">3480</span></a> <span class="k">pass</span> </span></pre></div> @@ -34525,8 +35407,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#PercentileDisc"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileDisc-3425"><a href="#PercentileDisc-3425"><span class="linenos">3425</span></a><span class="k">class</span> <span class="nc">PercentileDisc</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="PercentileDisc-3426"><a href="#PercentileDisc-3426"><span class="linenos">3426</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="PercentileDisc-3483"><a href="#PercentileDisc-3483"><span class="linenos">3483</span></a><span class="k">class</span> <span class="nc">PercentileDisc</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="PercentileDisc-3484"><a href="#PercentileDisc-3484"><span class="linenos">3484</span></a> <span class="k">pass</span> </span></pre></div> @@ -34599,8 +35481,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Quantile"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Quantile-3429"><a href="#Quantile-3429"><span class="linenos">3429</span></a><span class="k">class</span> <span class="nc">Quantile</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Quantile-3430"><a href="#Quantile-3430"><span class="linenos">3430</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Quantile-3487"><a href="#Quantile-3487"><span class="linenos">3487</span></a><span class="k">class</span> <span class="nc">Quantile</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Quantile-3488"><a href="#Quantile-3488"><span class="linenos">3488</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -34673,8 +35555,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Quantiles"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Quantiles-3435"><a href="#Quantiles-3435"><span class="linenos">3435</span></a><span class="k">class</span> <span class="nc">Quantiles</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Quantiles-3436"><a href="#Quantiles-3436"><span class="linenos">3436</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Quantiles-3493"><a href="#Quantiles-3493"><span class="linenos">3493</span></a><span class="k">class</span> <span class="nc">Quantiles</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Quantiles-3494"><a href="#Quantiles-3494"><span class="linenos">3494</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -34747,8 +35629,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#QuantileIf"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="QuantileIf-3439"><a href="#QuantileIf-3439"><span class="linenos">3439</span></a><span class="k">class</span> <span class="nc">QuantileIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="QuantileIf-3440"><a href="#QuantileIf-3440"><span class="linenos">3440</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="QuantileIf-3497"><a href="#QuantileIf-3497"><span class="linenos">3497</span></a><span class="k">class</span> <span class="nc">QuantileIf</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="QuantileIf-3498"><a href="#QuantileIf-3498"><span class="linenos">3498</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"parameters"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -34821,8 +35703,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#ApproxQuantile"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxQuantile-3443"><a href="#ApproxQuantile-3443"><span class="linenos">3443</span></a><span class="k">class</span> <span class="nc">ApproxQuantile</span><span class="p">(</span><span class="n">Quantile</span><span class="p">):</span> -</span><span id="ApproxQuantile-3444"><a href="#ApproxQuantile-3444"><span class="linenos">3444</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"weight"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ApproxQuantile-3501"><a href="#ApproxQuantile-3501"><span class="linenos">3501</span></a><span class="k">class</span> <span class="nc">ApproxQuantile</span><span class="p">(</span><span class="n">Quantile</span><span class="p">):</span> +</span><span id="ApproxQuantile-3502"><a href="#ApproxQuantile-3502"><span class="linenos">3502</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"quantile"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"accuracy"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"weight"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -34895,10 +35777,10 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#ReadCSV"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="ReadCSV-3447"><a href="#ReadCSV-3447"><span class="linenos">3447</span></a><span class="k">class</span> <span class="nc">ReadCSV</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="ReadCSV-3448"><a href="#ReadCSV-3448"><span class="linenos">3448</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"READ_CSV"</span><span class="p">]</span> -</span><span id="ReadCSV-3449"><a href="#ReadCSV-3449"><span class="linenos">3449</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> -</span><span id="ReadCSV-3450"><a href="#ReadCSV-3450"><span class="linenos">3450</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="ReadCSV-3505"><a href="#ReadCSV-3505"><span class="linenos">3505</span></a><span class="k">class</span> <span class="nc">ReadCSV</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="ReadCSV-3506"><a href="#ReadCSV-3506"><span class="linenos">3506</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"READ_CSV"</span><span class="p">]</span> +</span><span id="ReadCSV-3507"><a href="#ReadCSV-3507"><span class="linenos">3507</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> +</span><span id="ReadCSV-3508"><a href="#ReadCSV-3508"><span class="linenos">3508</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -34971,8 +35853,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Reduce"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Reduce-3453"><a href="#Reduce-3453"><span class="linenos">3453</span></a><span class="k">class</span> <span class="nc">Reduce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Reduce-3454"><a href="#Reduce-3454"><span class="linenos">3454</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"merge"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"finish"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Reduce-3511"><a href="#Reduce-3511"><span class="linenos">3511</span></a><span class="k">class</span> <span class="nc">Reduce</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Reduce-3512"><a href="#Reduce-3512"><span class="linenos">3512</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"initial"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"merge"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"finish"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35045,14 +35927,14 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#RegexpExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpExtract-3457"><a href="#RegexpExtract-3457"><span class="linenos">3457</span></a><span class="k">class</span> <span class="nc">RegexpExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RegexpExtract-3458"><a href="#RegexpExtract-3458"><span class="linenos">3458</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="RegexpExtract-3459"><a href="#RegexpExtract-3459"><span class="linenos">3459</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="RegexpExtract-3460"><a href="#RegexpExtract-3460"><span class="linenos">3460</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="RegexpExtract-3461"><a href="#RegexpExtract-3461"><span class="linenos">3461</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-3462"><a href="#RegexpExtract-3462"><span class="linenos">3462</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-3463"><a href="#RegexpExtract-3463"><span class="linenos">3463</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="RegexpExtract-3464"><a href="#RegexpExtract-3464"><span class="linenos">3464</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpExtract-3515"><a href="#RegexpExtract-3515"><span class="linenos">3515</span></a><span class="k">class</span> <span class="nc">RegexpExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RegexpExtract-3516"><a href="#RegexpExtract-3516"><span class="linenos">3516</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="RegexpExtract-3517"><a href="#RegexpExtract-3517"><span class="linenos">3517</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="RegexpExtract-3518"><a href="#RegexpExtract-3518"><span class="linenos">3518</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="RegexpExtract-3519"><a href="#RegexpExtract-3519"><span class="linenos">3519</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-3520"><a href="#RegexpExtract-3520"><span class="linenos">3520</span></a> <span class="s2">"occurrence"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-3521"><a href="#RegexpExtract-3521"><span class="linenos">3521</span></a> <span class="s2">"group"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="RegexpExtract-3522"><a href="#RegexpExtract-3522"><span class="linenos">3522</span></a> <span class="p">}</span> </span></pre></div> @@ -35125,8 +36007,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#RegexpLike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpLike-3467"><a href="#RegexpLike-3467"><span class="linenos">3467</span></a><span class="k">class</span> <span class="nc">RegexpLike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RegexpLike-3468"><a href="#RegexpLike-3468"><span class="linenos">3468</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpLike-3525"><a href="#RegexpLike-3525"><span class="linenos">3525</span></a><span class="k">class</span> <span class="nc">RegexpLike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RegexpLike-3526"><a href="#RegexpLike-3526"><span class="linenos">3526</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35199,8 +36081,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#RegexpILike"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpILike-3471"><a href="#RegexpILike-3471"><span class="linenos">3471</span></a><span class="k">class</span> <span class="nc">RegexpILike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RegexpILike-3472"><a href="#RegexpILike-3472"><span class="linenos">3472</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpILike-3529"><a href="#RegexpILike-3529"><span class="linenos">3529</span></a><span class="k">class</span> <span class="nc">RegexpILike</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RegexpILike-3530"><a href="#RegexpILike-3530"><span class="linenos">3530</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"flag"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35273,8 +36155,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#RegexpSplit"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpSplit-3475"><a href="#RegexpSplit-3475"><span class="linenos">3475</span></a><span class="k">class</span> <span class="nc">RegexpSplit</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RegexpSplit-3476"><a href="#RegexpSplit-3476"><span class="linenos">3476</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RegexpSplit-3533"><a href="#RegexpSplit-3533"><span class="linenos">3533</span></a><span class="k">class</span> <span class="nc">RegexpSplit</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RegexpSplit-3534"><a href="#RegexpSplit-3534"><span class="linenos">3534</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -35347,8 +36229,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Repeat"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Repeat-3479"><a href="#Repeat-3479"><span class="linenos">3479</span></a><span class="k">class</span> <span class="nc">Repeat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Repeat-3480"><a href="#Repeat-3480"><span class="linenos">3480</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"times"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Repeat-3537"><a href="#Repeat-3537"><span class="linenos">3537</span></a><span class="k">class</span> <span class="nc">Repeat</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Repeat-3538"><a href="#Repeat-3538"><span class="linenos">3538</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"times"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -35421,8 +36303,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Round"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Round-3483"><a href="#Round-3483"><span class="linenos">3483</span></a><span class="k">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Round-3484"><a href="#Round-3484"><span class="linenos">3484</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Round-3541"><a href="#Round-3541"><span class="linenos">3541</span></a><span class="k">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Round-3542"><a href="#Round-3542"><span class="linenos">3542</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"decimals"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35495,8 +36377,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#RowNumber"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="RowNumber-3487"><a href="#RowNumber-3487"><span class="linenos">3487</span></a><span class="k">class</span> <span class="nc">RowNumber</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="RowNumber-3488"><a href="#RowNumber-3488"><span class="linenos">3488</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="RowNumber-3545"><a href="#RowNumber-3545"><span class="linenos">3545</span></a><span class="k">class</span> <span class="nc">RowNumber</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="RowNumber-3546"><a href="#RowNumber-3546"><span class="linenos">3546</span></a> <span class="n">arg_types</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">]</span> <span class="o">=</span> <span class="p">{}</span> </span></pre></div> @@ -35569,8 +36451,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#SafeDivide"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SafeDivide-3491"><a href="#SafeDivide-3491"><span class="linenos">3491</span></a><span class="k">class</span> <span class="nc">SafeDivide</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="SafeDivide-3492"><a href="#SafeDivide-3492"><span class="linenos">3492</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SafeDivide-3549"><a href="#SafeDivide-3549"><span class="linenos">3549</span></a><span class="k">class</span> <span class="nc">SafeDivide</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="SafeDivide-3550"><a href="#SafeDivide-3550"><span class="linenos">3550</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -35643,8 +36525,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#SetAgg"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SetAgg-3495"><a href="#SetAgg-3495"><span class="linenos">3495</span></a><span class="k">class</span> <span class="nc">SetAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="SetAgg-3496"><a href="#SetAgg-3496"><span class="linenos">3496</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SetAgg-3553"><a href="#SetAgg-3553"><span class="linenos">3553</span></a><span class="k">class</span> <span class="nc">SetAgg</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="SetAgg-3554"><a href="#SetAgg-3554"><span class="linenos">3554</span></a> <span class="k">pass</span> </span></pre></div> @@ -35717,8 +36599,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#SortArray"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="SortArray-3499"><a href="#SortArray-3499"><span class="linenos">3499</span></a><span class="k">class</span> <span class="nc">SortArray</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="SortArray-3500"><a href="#SortArray-3500"><span class="linenos">3500</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"asc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="SortArray-3557"><a href="#SortArray-3557"><span class="linenos">3557</span></a><span class="k">class</span> <span class="nc">SortArray</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="SortArray-3558"><a href="#SortArray-3558"><span class="linenos">3558</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"asc"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35791,8 +36673,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Split"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Split-3503"><a href="#Split-3503"><span class="linenos">3503</span></a><span class="k">class</span> <span class="nc">Split</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Split-3504"><a href="#Split-3504"><span class="linenos">3504</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Split-3561"><a href="#Split-3561"><span class="linenos">3561</span></a><span class="k">class</span> <span class="nc">Split</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Split-3562"><a href="#Split-3562"><span class="linenos">3562</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"limit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35865,8 +36747,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Substring"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Substring-3509"><a href="#Substring-3509"><span class="linenos">3509</span></a><span class="k">class</span> <span class="nc">Substring</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Substring-3510"><a href="#Substring-3510"><span class="linenos">3510</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"length"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Substring-3567"><a href="#Substring-3567"><span class="linenos">3567</span></a><span class="k">class</span> <span class="nc">Substring</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Substring-3568"><a href="#Substring-3568"><span class="linenos">3568</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"start"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"length"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -35939,13 +36821,13 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StrPosition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrPosition-3513"><a href="#StrPosition-3513"><span class="linenos">3513</span></a><span class="k">class</span> <span class="nc">StrPosition</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StrPosition-3514"><a href="#StrPosition-3514"><span class="linenos">3514</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="StrPosition-3515"><a href="#StrPosition-3515"><span class="linenos">3515</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="StrPosition-3516"><a href="#StrPosition-3516"><span class="linenos">3516</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="StrPosition-3517"><a href="#StrPosition-3517"><span class="linenos">3517</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="StrPosition-3518"><a href="#StrPosition-3518"><span class="linenos">3518</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="StrPosition-3519"><a href="#StrPosition-3519"><span class="linenos">3519</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StrPosition-3571"><a href="#StrPosition-3571"><span class="linenos">3571</span></a><span class="k">class</span> <span class="nc">StrPosition</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StrPosition-3572"><a href="#StrPosition-3572"><span class="linenos">3572</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="StrPosition-3573"><a href="#StrPosition-3573"><span class="linenos">3573</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="StrPosition-3574"><a href="#StrPosition-3574"><span class="linenos">3574</span></a> <span class="s2">"substr"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="StrPosition-3575"><a href="#StrPosition-3575"><span class="linenos">3575</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="StrPosition-3576"><a href="#StrPosition-3576"><span class="linenos">3576</span></a> <span class="s2">"instance"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="StrPosition-3577"><a href="#StrPosition-3577"><span class="linenos">3577</span></a> <span class="p">}</span> </span></pre></div> @@ -36018,8 +36900,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StrToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToDate-3522"><a href="#StrToDate-3522"><span class="linenos">3522</span></a><span class="k">class</span> <span class="nc">StrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StrToDate-3523"><a href="#StrToDate-3523"><span class="linenos">3523</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StrToDate-3580"><a href="#StrToDate-3580"><span class="linenos">3580</span></a><span class="k">class</span> <span class="nc">StrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StrToDate-3581"><a href="#StrToDate-3581"><span class="linenos">3581</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -36092,8 +36974,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StrToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToTime-3526"><a href="#StrToTime-3526"><span class="linenos">3526</span></a><span class="k">class</span> <span class="nc">StrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StrToTime-3527"><a href="#StrToTime-3527"><span class="linenos">3527</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StrToTime-3584"><a href="#StrToTime-3584"><span class="linenos">3584</span></a><span class="k">class</span> <span class="nc">StrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StrToTime-3585"><a href="#StrToTime-3585"><span class="linenos">3585</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -36166,8 +37048,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StrToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StrToUnix-3532"><a href="#StrToUnix-3532"><span class="linenos">3532</span></a><span class="k">class</span> <span class="nc">StrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StrToUnix-3533"><a href="#StrToUnix-3533"><span class="linenos">3533</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StrToUnix-3590"><a href="#StrToUnix-3590"><span class="linenos">3590</span></a><span class="k">class</span> <span class="nc">StrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StrToUnix-3591"><a href="#StrToUnix-3591"><span class="linenos">3591</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -36240,8 +37122,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#NumberToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="NumberToStr-3536"><a href="#NumberToStr-3536"><span class="linenos">3536</span></a><span class="k">class</span> <span class="nc">NumberToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="NumberToStr-3537"><a href="#NumberToStr-3537"><span class="linenos">3537</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="NumberToStr-3594"><a href="#NumberToStr-3594"><span class="linenos">3594</span></a><span class="k">class</span> <span class="nc">NumberToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="NumberToStr-3595"><a href="#NumberToStr-3595"><span class="linenos">3595</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -36314,9 +37196,9 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Struct"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Struct-3540"><a href="#Struct-3540"><span class="linenos">3540</span></a><span class="k">class</span> <span class="nc">Struct</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Struct-3541"><a href="#Struct-3541"><span class="linenos">3541</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> -</span><span id="Struct-3542"><a href="#Struct-3542"><span class="linenos">3542</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Struct-3598"><a href="#Struct-3598"><span class="linenos">3598</span></a><span class="k">class</span> <span class="nc">Struct</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Struct-3599"><a href="#Struct-3599"><span class="linenos">3599</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> +</span><span id="Struct-3600"><a href="#Struct-3600"><span class="linenos">3600</span></a> <span class="n">is_var_len_args</span> <span class="o">=</span> <span class="kc">True</span> </span></pre></div> @@ -36389,8 +37271,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StructExtract"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StructExtract-3545"><a href="#StructExtract-3545"><span class="linenos">3545</span></a><span class="k">class</span> <span class="nc">StructExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="StructExtract-3546"><a href="#StructExtract-3546"><span class="linenos">3546</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StructExtract-3603"><a href="#StructExtract-3603"><span class="linenos">3603</span></a><span class="k">class</span> <span class="nc">StructExtract</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="StructExtract-3604"><a href="#StructExtract-3604"><span class="linenos">3604</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -36463,8 +37345,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Sum"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sum-3549"><a href="#Sum-3549"><span class="linenos">3549</span></a><span class="k">class</span> <span class="nc">Sum</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Sum-3550"><a href="#Sum-3550"><span class="linenos">3550</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sum-3607"><a href="#Sum-3607"><span class="linenos">3607</span></a><span class="k">class</span> <span class="nc">Sum</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Sum-3608"><a href="#Sum-3608"><span class="linenos">3608</span></a> <span class="k">pass</span> </span></pre></div> @@ -36537,8 +37419,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Sqrt"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Sqrt-3553"><a href="#Sqrt-3553"><span class="linenos">3553</span></a><span class="k">class</span> <span class="nc">Sqrt</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Sqrt-3554"><a href="#Sqrt-3554"><span class="linenos">3554</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Sqrt-3611"><a href="#Sqrt-3611"><span class="linenos">3611</span></a><span class="k">class</span> <span class="nc">Sqrt</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Sqrt-3612"><a href="#Sqrt-3612"><span class="linenos">3612</span></a> <span class="k">pass</span> </span></pre></div> @@ -36611,8 +37493,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Stddev"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Stddev-3557"><a href="#Stddev-3557"><span class="linenos">3557</span></a><span class="k">class</span> <span class="nc">Stddev</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Stddev-3558"><a href="#Stddev-3558"><span class="linenos">3558</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Stddev-3615"><a href="#Stddev-3615"><span class="linenos">3615</span></a><span class="k">class</span> <span class="nc">Stddev</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Stddev-3616"><a href="#Stddev-3616"><span class="linenos">3616</span></a> <span class="k">pass</span> </span></pre></div> @@ -36685,8 +37567,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StddevPop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StddevPop-3561"><a href="#StddevPop-3561"><span class="linenos">3561</span></a><span class="k">class</span> <span class="nc">StddevPop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="StddevPop-3562"><a href="#StddevPop-3562"><span class="linenos">3562</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StddevPop-3619"><a href="#StddevPop-3619"><span class="linenos">3619</span></a><span class="k">class</span> <span class="nc">StddevPop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="StddevPop-3620"><a href="#StddevPop-3620"><span class="linenos">3620</span></a> <span class="k">pass</span> </span></pre></div> @@ -36759,8 +37641,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#StddevSamp"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="StddevSamp-3565"><a href="#StddevSamp-3565"><span class="linenos">3565</span></a><span class="k">class</span> <span class="nc">StddevSamp</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="StddevSamp-3566"><a href="#StddevSamp-3566"><span class="linenos">3566</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="StddevSamp-3623"><a href="#StddevSamp-3623"><span class="linenos">3623</span></a><span class="k">class</span> <span class="nc">StddevSamp</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="StddevSamp-3624"><a href="#StddevSamp-3624"><span class="linenos">3624</span></a> <span class="k">pass</span> </span></pre></div> @@ -36833,8 +37715,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToStr-3569"><a href="#TimeToStr-3569"><span class="linenos">3569</span></a><span class="k">class</span> <span class="nc">TimeToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeToStr-3570"><a href="#TimeToStr-3570"><span class="linenos">3570</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToStr-3627"><a href="#TimeToStr-3627"><span class="linenos">3627</span></a><span class="k">class</span> <span class="nc">TimeToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeToStr-3628"><a href="#TimeToStr-3628"><span class="linenos">3628</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -36907,8 +37789,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeToTimeStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToTimeStr-3573"><a href="#TimeToTimeStr-3573"><span class="linenos">3573</span></a><span class="k">class</span> <span class="nc">TimeToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeToTimeStr-3574"><a href="#TimeToTimeStr-3574"><span class="linenos">3574</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToTimeStr-3631"><a href="#TimeToTimeStr-3631"><span class="linenos">3631</span></a><span class="k">class</span> <span class="nc">TimeToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeToTimeStr-3632"><a href="#TimeToTimeStr-3632"><span class="linenos">3632</span></a> <span class="k">pass</span> </span></pre></div> @@ -36981,8 +37863,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToUnix-3577"><a href="#TimeToUnix-3577"><span class="linenos">3577</span></a><span class="k">class</span> <span class="nc">TimeToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeToUnix-3578"><a href="#TimeToUnix-3578"><span class="linenos">3578</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeToUnix-3635"><a href="#TimeToUnix-3635"><span class="linenos">3635</span></a><span class="k">class</span> <span class="nc">TimeToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeToUnix-3636"><a href="#TimeToUnix-3636"><span class="linenos">3636</span></a> <span class="k">pass</span> </span></pre></div> @@ -37055,8 +37937,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeStrToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToDate-3581"><a href="#TimeStrToDate-3581"><span class="linenos">3581</span></a><span class="k">class</span> <span class="nc">TimeStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeStrToDate-3582"><a href="#TimeStrToDate-3582"><span class="linenos">3582</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToDate-3639"><a href="#TimeStrToDate-3639"><span class="linenos">3639</span></a><span class="k">class</span> <span class="nc">TimeStrToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeStrToDate-3640"><a href="#TimeStrToDate-3640"><span class="linenos">3640</span></a> <span class="k">pass</span> </span></pre></div> @@ -37129,8 +38011,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeStrToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToTime-3585"><a href="#TimeStrToTime-3585"><span class="linenos">3585</span></a><span class="k">class</span> <span class="nc">TimeStrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeStrToTime-3586"><a href="#TimeStrToTime-3586"><span class="linenos">3586</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToTime-3643"><a href="#TimeStrToTime-3643"><span class="linenos">3643</span></a><span class="k">class</span> <span class="nc">TimeStrToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeStrToTime-3644"><a href="#TimeStrToTime-3644"><span class="linenos">3644</span></a> <span class="k">pass</span> </span></pre></div> @@ -37203,8 +38085,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TimeStrToUnix"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToUnix-3589"><a href="#TimeStrToUnix-3589"><span class="linenos">3589</span></a><span class="k">class</span> <span class="nc">TimeStrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TimeStrToUnix-3590"><a href="#TimeStrToUnix-3590"><span class="linenos">3590</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TimeStrToUnix-3647"><a href="#TimeStrToUnix-3647"><span class="linenos">3647</span></a><span class="k">class</span> <span class="nc">TimeStrToUnix</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TimeStrToUnix-3648"><a href="#TimeStrToUnix-3648"><span class="linenos">3648</span></a> <span class="k">pass</span> </span></pre></div> @@ -37277,13 +38159,13 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Trim"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Trim-3593"><a href="#Trim-3593"><span class="linenos">3593</span></a><span class="k">class</span> <span class="nc">Trim</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Trim-3594"><a href="#Trim-3594"><span class="linenos">3594</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> -</span><span id="Trim-3595"><a href="#Trim-3595"><span class="linenos">3595</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> -</span><span id="Trim-3596"><a href="#Trim-3596"><span class="linenos">3596</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-3597"><a href="#Trim-3597"><span class="linenos">3597</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-3598"><a href="#Trim-3598"><span class="linenos">3598</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="Trim-3599"><a href="#Trim-3599"><span class="linenos">3599</span></a> <span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Trim-3651"><a href="#Trim-3651"><span class="linenos">3651</span></a><span class="k">class</span> <span class="nc">Trim</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Trim-3652"><a href="#Trim-3652"><span class="linenos">3652</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span> +</span><span id="Trim-3653"><a href="#Trim-3653"><span class="linenos">3653</span></a> <span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> +</span><span id="Trim-3654"><a href="#Trim-3654"><span class="linenos">3654</span></a> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-3655"><a href="#Trim-3655"><span class="linenos">3655</span></a> <span class="s2">"position"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-3656"><a href="#Trim-3656"><span class="linenos">3656</span></a> <span class="s2">"collation"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="Trim-3657"><a href="#Trim-3657"><span class="linenos">3657</span></a> <span class="p">}</span> </span></pre></div> @@ -37356,8 +38238,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TsOrDsAdd"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsAdd-3602"><a href="#TsOrDsAdd-3602"><span class="linenos">3602</span></a><span class="k">class</span> <span class="nc">TsOrDsAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> -</span><span id="TsOrDsAdd-3603"><a href="#TsOrDsAdd-3603"><span class="linenos">3603</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsAdd-3660"><a href="#TsOrDsAdd-3660"><span class="linenos">3660</span></a><span class="k">class</span> <span class="nc">TsOrDsAdd</span><span class="p">(</span><span class="n">Func</span><span class="p">,</span> <span class="n">TimeUnit</span><span class="p">):</span> +</span><span id="TsOrDsAdd-3661"><a href="#TsOrDsAdd-3661"><span class="linenos">3661</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expression"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"unit"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -37433,8 +38315,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TsOrDsToDateStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDateStr-3606"><a href="#TsOrDsToDateStr-3606"><span class="linenos">3606</span></a><span class="k">class</span> <span class="nc">TsOrDsToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TsOrDsToDateStr-3607"><a href="#TsOrDsToDateStr-3607"><span class="linenos">3607</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDateStr-3664"><a href="#TsOrDsToDateStr-3664"><span class="linenos">3664</span></a><span class="k">class</span> <span class="nc">TsOrDsToDateStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TsOrDsToDateStr-3665"><a href="#TsOrDsToDateStr-3665"><span class="linenos">3665</span></a> <span class="k">pass</span> </span></pre></div> @@ -37507,8 +38389,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TsOrDsToDate"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDate-3610"><a href="#TsOrDsToDate-3610"><span class="linenos">3610</span></a><span class="k">class</span> <span class="nc">TsOrDsToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TsOrDsToDate-3611"><a href="#TsOrDsToDate-3611"><span class="linenos">3611</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDsToDate-3668"><a href="#TsOrDsToDate-3668"><span class="linenos">3668</span></a><span class="k">class</span> <span class="nc">TsOrDsToDate</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TsOrDsToDate-3669"><a href="#TsOrDsToDate-3669"><span class="linenos">3669</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -37581,8 +38463,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#TsOrDiToDi"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDiToDi-3614"><a href="#TsOrDiToDi-3614"><span class="linenos">3614</span></a><span class="k">class</span> <span class="nc">TsOrDiToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="TsOrDiToDi-3615"><a href="#TsOrDiToDi-3615"><span class="linenos">3615</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="TsOrDiToDi-3672"><a href="#TsOrDiToDi-3672"><span class="linenos">3672</span></a><span class="k">class</span> <span class="nc">TsOrDiToDi</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="TsOrDiToDi-3673"><a href="#TsOrDiToDi-3673"><span class="linenos">3673</span></a> <span class="k">pass</span> </span></pre></div> @@ -37655,8 +38537,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Unhex"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Unhex-3618"><a href="#Unhex-3618"><span class="linenos">3618</span></a><span class="k">class</span> <span class="nc">Unhex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Unhex-3619"><a href="#Unhex-3619"><span class="linenos">3619</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Unhex-3676"><a href="#Unhex-3676"><span class="linenos">3676</span></a><span class="k">class</span> <span class="nc">Unhex</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Unhex-3677"><a href="#Unhex-3677"><span class="linenos">3677</span></a> <span class="k">pass</span> </span></pre></div> @@ -37729,8 +38611,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#UnixToStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToStr-3622"><a href="#UnixToStr-3622"><span class="linenos">3622</span></a><span class="k">class</span> <span class="nc">UnixToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="UnixToStr-3623"><a href="#UnixToStr-3623"><span class="linenos">3623</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToStr-3680"><a href="#UnixToStr-3680"><span class="linenos">3680</span></a><span class="k">class</span> <span class="nc">UnixToStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="UnixToStr-3681"><a href="#UnixToStr-3681"><span class="linenos">3681</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"format"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -37803,12 +38685,12 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#UnixToTime"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTime-3628"><a href="#UnixToTime-3628"><span class="linenos">3628</span></a><span class="k">class</span> <span class="nc">UnixToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="UnixToTime-3629"><a href="#UnixToTime-3629"><span class="linenos">3629</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"scale"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"hours"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"minutes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> -</span><span id="UnixToTime-3630"><a href="#UnixToTime-3630"><span class="linenos">3630</span></a> -</span><span id="UnixToTime-3631"><a href="#UnixToTime-3631"><span class="linenos">3631</span></a> <span class="n">SECONDS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"seconds"</span><span class="p">)</span> -</span><span id="UnixToTime-3632"><a href="#UnixToTime-3632"><span class="linenos">3632</span></a> <span class="n">MILLIS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"millis"</span><span class="p">)</span> -</span><span id="UnixToTime-3633"><a href="#UnixToTime-3633"><span class="linenos">3633</span></a> <span class="n">MICROS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"micros"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTime-3686"><a href="#UnixToTime-3686"><span class="linenos">3686</span></a><span class="k">class</span> <span class="nc">UnixToTime</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="UnixToTime-3687"><a href="#UnixToTime-3687"><span class="linenos">3687</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"scale"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"zone"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"hours"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"minutes"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> +</span><span id="UnixToTime-3688"><a href="#UnixToTime-3688"><span class="linenos">3688</span></a> +</span><span id="UnixToTime-3689"><a href="#UnixToTime-3689"><span class="linenos">3689</span></a> <span class="n">SECONDS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"seconds"</span><span class="p">)</span> +</span><span id="UnixToTime-3690"><a href="#UnixToTime-3690"><span class="linenos">3690</span></a> <span class="n">MILLIS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"millis"</span><span class="p">)</span> +</span><span id="UnixToTime-3691"><a href="#UnixToTime-3691"><span class="linenos">3691</span></a> <span class="n">MICROS</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="s2">"micros"</span><span class="p">)</span> </span></pre></div> @@ -37881,8 +38763,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#UnixToTimeStr"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTimeStr-3636"><a href="#UnixToTimeStr-3636"><span class="linenos">3636</span></a><span class="k">class</span> <span class="nc">UnixToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="UnixToTimeStr-3637"><a href="#UnixToTimeStr-3637"><span class="linenos">3637</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="UnixToTimeStr-3694"><a href="#UnixToTimeStr-3694"><span class="linenos">3694</span></a><span class="k">class</span> <span class="nc">UnixToTimeStr</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="UnixToTimeStr-3695"><a href="#UnixToTimeStr-3695"><span class="linenos">3695</span></a> <span class="k">pass</span> </span></pre></div> @@ -37955,8 +38837,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Upper"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Upper-3640"><a href="#Upper-3640"><span class="linenos">3640</span></a><span class="k">class</span> <span class="nc">Upper</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Upper-3641"><a href="#Upper-3641"><span class="linenos">3641</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"UPPER"</span><span class="p">,</span> <span class="s2">"UCASE"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Upper-3698"><a href="#Upper-3698"><span class="linenos">3698</span></a><span class="k">class</span> <span class="nc">Upper</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Upper-3699"><a href="#Upper-3699"><span class="linenos">3699</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"UPPER"</span><span class="p">,</span> <span class="s2">"UCASE"</span><span class="p">]</span> </span></pre></div> @@ -38029,8 +38911,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Variance"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Variance-3644"><a href="#Variance-3644"><span class="linenos">3644</span></a><span class="k">class</span> <span class="nc">Variance</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="Variance-3645"><a href="#Variance-3645"><span class="linenos">3645</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE"</span><span class="p">,</span> <span class="s2">"VARIANCE_SAMP"</span><span class="p">,</span> <span class="s2">"VAR_SAMP"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Variance-3702"><a href="#Variance-3702"><span class="linenos">3702</span></a><span class="k">class</span> <span class="nc">Variance</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="Variance-3703"><a href="#Variance-3703"><span class="linenos">3703</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE"</span><span class="p">,</span> <span class="s2">"VARIANCE_SAMP"</span><span class="p">,</span> <span class="s2">"VAR_SAMP"</span><span class="p">]</span> </span></pre></div> @@ -38103,8 +38985,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#VariancePop"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="VariancePop-3648"><a href="#VariancePop-3648"><span class="linenos">3648</span></a><span class="k">class</span> <span class="nc">VariancePop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> -</span><span id="VariancePop-3649"><a href="#VariancePop-3649"><span class="linenos">3649</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE_POP"</span><span class="p">,</span> <span class="s2">"VAR_POP"</span><span class="p">]</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="VariancePop-3706"><a href="#VariancePop-3706"><span class="linenos">3706</span></a><span class="k">class</span> <span class="nc">VariancePop</span><span class="p">(</span><span class="n">AggFunc</span><span class="p">):</span> +</span><span id="VariancePop-3707"><a href="#VariancePop-3707"><span class="linenos">3707</span></a> <span class="n">_sql_names</span> <span class="o">=</span> <span class="p">[</span><span class="s2">"VARIANCE_POP"</span><span class="p">,</span> <span class="s2">"VAR_POP"</span><span class="p">]</span> </span></pre></div> @@ -38177,8 +39059,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Week"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Week-3652"><a href="#Week-3652"><span class="linenos">3652</span></a><span class="k">class</span> <span class="nc">Week</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Week-3653"><a href="#Week-3653"><span class="linenos">3653</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"mode"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Week-3710"><a href="#Week-3710"><span class="linenos">3710</span></a><span class="k">class</span> <span class="nc">Week</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Week-3711"><a href="#Week-3711"><span class="linenos">3711</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"mode"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -38251,8 +39133,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#XMLTable"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="XMLTable-3656"><a href="#XMLTable-3656"><span class="linenos">3656</span></a><span class="k">class</span> <span class="nc">XMLTable</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="XMLTable-3657"><a href="#XMLTable-3657"><span class="linenos">3657</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"passing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"by_ref"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="XMLTable-3714"><a href="#XMLTable-3714"><span class="linenos">3714</span></a><span class="k">class</span> <span class="nc">XMLTable</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="XMLTable-3715"><a href="#XMLTable-3715"><span class="linenos">3715</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"passing"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"columns"</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">"by_ref"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -38325,8 +39207,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Year"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Year-3660"><a href="#Year-3660"><span class="linenos">3660</span></a><span class="k">class</span> <span class="nc">Year</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="Year-3661"><a href="#Year-3661"><span class="linenos">3661</span></a> <span class="k">pass</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Year-3718"><a href="#Year-3718"><span class="linenos">3718</span></a><span class="k">class</span> <span class="nc">Year</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="Year-3719"><a href="#Year-3719"><span class="linenos">3719</span></a> <span class="k">pass</span> </span></pre></div> @@ -38399,8 +39281,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Use"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Use-3664"><a href="#Use-3664"><span class="linenos">3664</span></a><span class="k">class</span> <span class="nc">Use</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Use-3665"><a href="#Use-3665"><span class="linenos">3665</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Use-3722"><a href="#Use-3722"><span class="linenos">3722</span></a><span class="k">class</span> <span class="nc">Use</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Use-3723"><a href="#Use-3723"><span class="linenos">3723</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"kind"</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span> </span></pre></div> @@ -38460,8 +39342,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#Merge"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="Merge-3668"><a href="#Merge-3668"><span class="linenos">3668</span></a><span class="k">class</span> <span class="nc">Merge</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> -</span><span id="Merge-3669"><a href="#Merge-3669"><span class="linenos">3669</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="Merge-3726"><a href="#Merge-3726"><span class="linenos">3726</span></a><span class="k">class</span> <span class="nc">Merge</span><span class="p">(</span><span class="n">Expression</span><span class="p">):</span> +</span><span id="Merge-3727"><a href="#Merge-3727"><span class="linenos">3727</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"using"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"on"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"expressions"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -38521,8 +39403,8 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#When"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="When-3672"><a href="#When-3672"><span class="linenos">3672</span></a><span class="k">class</span> <span class="nc">When</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> -</span><span id="When-3673"><a href="#When-3673"><span class="linenos">3673</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"then"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="When-3730"><a href="#When-3730"><span class="linenos">3730</span></a><span class="k">class</span> <span class="nc">When</span><span class="p">(</span><span class="n">Func</span><span class="p">):</span> +</span><span id="When-3731"><a href="#When-3731"><span class="linenos">3731</span></a> <span class="n">arg_types</span> <span class="o">=</span> <span class="p">{</span><span class="s2">"this"</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">"then"</span><span class="p">:</span> <span class="kc">True</span><span class="p">}</span> </span></pre></div> @@ -38595,48 +39477,48 @@ Pattern matching MATCHES(value, search1, result1, ...searchN, resultN, else)</p> </div> <a class="headerlink" href="#maybe_parse"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="maybe_parse-3701"><a href="#maybe_parse-3701"><span class="linenos">3701</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> -</span><span id="maybe_parse-3702"><a href="#maybe_parse-3702"><span class="linenos">3702</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="maybe_parse-3703"><a href="#maybe_parse-3703"><span class="linenos">3703</span></a> <span class="o">*</span><span class="p">,</span> -</span><span id="maybe_parse-3704"><a href="#maybe_parse-3704"><span class="linenos">3704</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">IntoType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="maybe_parse-3705"><a href="#maybe_parse-3705"><span class="linenos">3705</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="maybe_parse-3706"><a href="#maybe_parse-3706"><span class="linenos">3706</span></a> <span class="n">prefix</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="maybe_parse-3707"><a href="#maybe_parse-3707"><span class="linenos">3707</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="maybe_parse-3708"><a href="#maybe_parse-3708"><span class="linenos">3708</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="maybe_parse-3709"><a href="#maybe_parse-3709"><span class="linenos">3709</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="maybe_parse-3710"><a href="#maybe_parse-3710"><span class="linenos">3710</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> -</span><span id="maybe_parse-3711"><a href="#maybe_parse-3711"><span class="linenos">3711</span></a> -</span><span id="maybe_parse-3712"><a href="#maybe_parse-3712"><span class="linenos">3712</span></a><span class="sd"> Example:</span> -</span><span id="maybe_parse-3713"><a href="#maybe_parse-3713"><span class="linenos">3713</span></a><span class="sd"> >>> maybe_parse("1")</span> -</span><span id="maybe_parse-3714"><a href="#maybe_parse-3714"><span class="linenos">3714</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> -</span><span id="maybe_parse-3715"><a href="#maybe_parse-3715"><span class="linenos">3715</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> -</span><span id="maybe_parse-3716"><a href="#maybe_parse-3716"><span class="linenos">3716</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> -</span><span id="maybe_parse-3717"><a href="#maybe_parse-3717"><span class="linenos">3717</span></a> -</span><span id="maybe_parse-3718"><a href="#maybe_parse-3718"><span class="linenos">3718</span></a><span class="sd"> Args:</span> -</span><span id="maybe_parse-3719"><a href="#maybe_parse-3719"><span class="linenos">3719</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> -</span><span id="maybe_parse-3720"><a href="#maybe_parse-3720"><span class="linenos">3720</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> -</span><span id="maybe_parse-3721"><a href="#maybe_parse-3721"><span class="linenos">3721</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="maybe_parse-3722"><a href="#maybe_parse-3722"><span class="linenos">3722</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="maybe_parse-3723"><a href="#maybe_parse-3723"><span class="linenos">3723</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> -</span><span id="maybe_parse-3724"><a href="#maybe_parse-3724"><span class="linenos">3724</span></a><span class="sd"> (automatically includes a space)</span> -</span><span id="maybe_parse-3725"><a href="#maybe_parse-3725"><span class="linenos">3725</span></a><span class="sd"> copy: whether or not to copy the expression.</span> -</span><span id="maybe_parse-3726"><a href="#maybe_parse-3726"><span class="linenos">3726</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="maybe_parse-3727"><a href="#maybe_parse-3727"><span class="linenos">3727</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="maybe_parse-3728"><a href="#maybe_parse-3728"><span class="linenos">3728</span></a> -</span><span id="maybe_parse-3729"><a href="#maybe_parse-3729"><span class="linenos">3729</span></a><span class="sd"> Returns:</span> -</span><span id="maybe_parse-3730"><a href="#maybe_parse-3730"><span class="linenos">3730</span></a><span class="sd"> Expression: the parsed or given expression.</span> -</span><span id="maybe_parse-3731"><a href="#maybe_parse-3731"><span class="linenos">3731</span></a><span class="sd"> """</span> -</span><span id="maybe_parse-3732"><a href="#maybe_parse-3732"><span class="linenos">3732</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="maybe_parse-3733"><a href="#maybe_parse-3733"><span class="linenos">3733</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> -</span><span id="maybe_parse-3734"><a href="#maybe_parse-3734"><span class="linenos">3734</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="maybe_parse-3735"><a href="#maybe_parse-3735"><span class="linenos">3735</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> -</span><span id="maybe_parse-3736"><a href="#maybe_parse-3736"><span class="linenos">3736</span></a> -</span><span id="maybe_parse-3737"><a href="#maybe_parse-3737"><span class="linenos">3737</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> -</span><span id="maybe_parse-3738"><a href="#maybe_parse-3738"><span class="linenos">3738</span></a> -</span><span id="maybe_parse-3739"><a href="#maybe_parse-3739"><span class="linenos">3739</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">)</span> -</span><span id="maybe_parse-3740"><a href="#maybe_parse-3740"><span class="linenos">3740</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> -</span><span id="maybe_parse-3741"><a href="#maybe_parse-3741"><span class="linenos">3741</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">prefix</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">sql</span><span class="si">}</span><span class="s2">"</span> -</span><span id="maybe_parse-3742"><a href="#maybe_parse-3742"><span class="linenos">3742</span></a> <span class="k">return</span> <span class="n">sqlglot</span><span class="o">.</span><span class="n">parse_one</span><span class="p">(</span><span class="n">sql</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="maybe_parse-3759"><a href="#maybe_parse-3759"><span class="linenos">3759</span></a><span class="k">def</span> <span class="nf">maybe_parse</span><span class="p">(</span> +</span><span id="maybe_parse-3760"><a href="#maybe_parse-3760"><span class="linenos">3760</span></a> <span class="n">sql_or_expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="maybe_parse-3761"><a href="#maybe_parse-3761"><span class="linenos">3761</span></a> <span class="o">*</span><span class="p">,</span> +</span><span id="maybe_parse-3762"><a href="#maybe_parse-3762"><span class="linenos">3762</span></a> <span class="n">into</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">IntoType</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="maybe_parse-3763"><a href="#maybe_parse-3763"><span class="linenos">3763</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="maybe_parse-3764"><a href="#maybe_parse-3764"><span class="linenos">3764</span></a> <span class="n">prefix</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="maybe_parse-3765"><a href="#maybe_parse-3765"><span class="linenos">3765</span></a> <span class="n">copy</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="maybe_parse-3766"><a href="#maybe_parse-3766"><span class="linenos">3766</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="maybe_parse-3767"><a href="#maybe_parse-3767"><span class="linenos">3767</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="maybe_parse-3768"><a href="#maybe_parse-3768"><span class="linenos">3768</span></a><span class="w"> </span><span class="sd">"""Gracefully handle a possible string or expression.</span> +</span><span id="maybe_parse-3769"><a href="#maybe_parse-3769"><span class="linenos">3769</span></a> +</span><span id="maybe_parse-3770"><a href="#maybe_parse-3770"><span class="linenos">3770</span></a><span class="sd"> Example:</span> +</span><span id="maybe_parse-3771"><a href="#maybe_parse-3771"><span class="linenos">3771</span></a><span class="sd"> >>> maybe_parse("1")</span> +</span><span id="maybe_parse-3772"><a href="#maybe_parse-3772"><span class="linenos">3772</span></a><span class="sd"> (LITERAL this: 1, is_string: False)</span> +</span><span id="maybe_parse-3773"><a href="#maybe_parse-3773"><span class="linenos">3773</span></a><span class="sd"> >>> maybe_parse(to_identifier("x"))</span> +</span><span id="maybe_parse-3774"><a href="#maybe_parse-3774"><span class="linenos">3774</span></a><span class="sd"> (IDENTIFIER this: x, quoted: False)</span> +</span><span id="maybe_parse-3775"><a href="#maybe_parse-3775"><span class="linenos">3775</span></a> +</span><span id="maybe_parse-3776"><a href="#maybe_parse-3776"><span class="linenos">3776</span></a><span class="sd"> Args:</span> +</span><span id="maybe_parse-3777"><a href="#maybe_parse-3777"><span class="linenos">3777</span></a><span class="sd"> sql_or_expression: the SQL code string or an expression</span> +</span><span id="maybe_parse-3778"><a href="#maybe_parse-3778"><span class="linenos">3778</span></a><span class="sd"> into: the SQLGlot Expression to parse into</span> +</span><span id="maybe_parse-3779"><a href="#maybe_parse-3779"><span class="linenos">3779</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="maybe_parse-3780"><a href="#maybe_parse-3780"><span class="linenos">3780</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="maybe_parse-3781"><a href="#maybe_parse-3781"><span class="linenos">3781</span></a><span class="sd"> prefix: a string to prefix the sql with before it gets parsed</span> +</span><span id="maybe_parse-3782"><a href="#maybe_parse-3782"><span class="linenos">3782</span></a><span class="sd"> (automatically includes a space)</span> +</span><span id="maybe_parse-3783"><a href="#maybe_parse-3783"><span class="linenos">3783</span></a><span class="sd"> copy: whether or not to copy the expression.</span> +</span><span id="maybe_parse-3784"><a href="#maybe_parse-3784"><span class="linenos">3784</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="maybe_parse-3785"><a href="#maybe_parse-3785"><span class="linenos">3785</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="maybe_parse-3786"><a href="#maybe_parse-3786"><span class="linenos">3786</span></a> +</span><span id="maybe_parse-3787"><a href="#maybe_parse-3787"><span class="linenos">3787</span></a><span class="sd"> Returns:</span> +</span><span id="maybe_parse-3788"><a href="#maybe_parse-3788"><span class="linenos">3788</span></a><span class="sd"> Expression: the parsed or given expression.</span> +</span><span id="maybe_parse-3789"><a href="#maybe_parse-3789"><span class="linenos">3789</span></a><span class="sd"> """</span> +</span><span id="maybe_parse-3790"><a href="#maybe_parse-3790"><span class="linenos">3790</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="maybe_parse-3791"><a href="#maybe_parse-3791"><span class="linenos">3791</span></a> <span class="k">if</span> <span class="n">copy</span><span class="p">:</span> +</span><span id="maybe_parse-3792"><a href="#maybe_parse-3792"><span class="linenos">3792</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="maybe_parse-3793"><a href="#maybe_parse-3793"><span class="linenos">3793</span></a> <span class="k">return</span> <span class="n">sql_or_expression</span> +</span><span id="maybe_parse-3794"><a href="#maybe_parse-3794"><span class="linenos">3794</span></a> +</span><span id="maybe_parse-3795"><a href="#maybe_parse-3795"><span class="linenos">3795</span></a> <span class="kn">import</span> <span class="nn">sqlglot</span> +</span><span id="maybe_parse-3796"><a href="#maybe_parse-3796"><span class="linenos">3796</span></a> +</span><span id="maybe_parse-3797"><a href="#maybe_parse-3797"><span class="linenos">3797</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="p">)</span> +</span><span id="maybe_parse-3798"><a href="#maybe_parse-3798"><span class="linenos">3798</span></a> <span class="k">if</span> <span class="n">prefix</span><span class="p">:</span> +</span><span id="maybe_parse-3799"><a href="#maybe_parse-3799"><span class="linenos">3799</span></a> <span class="n">sql</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">prefix</span><span class="si">}</span><span class="s2"> </span><span class="si">{</span><span class="n">sql</span><span class="si">}</span><span class="s2">"</span> +</span><span id="maybe_parse-3800"><a href="#maybe_parse-3800"><span class="linenos">3800</span></a> <span class="k">return</span> <span class="n">sqlglot</span><span class="o">.</span><span class="n">parse_one</span><span class="p">(</span><span class="n">sql</span><span class="p">,</span> <span class="n">read</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">into</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -38688,29 +39570,29 @@ that an input expression is a SQL string).</li> </div> <a class="headerlink" href="#union"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="union-3888"><a href="#union-3888"><span class="linenos">3888</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="union-3889"><a href="#union-3889"><span class="linenos">3889</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="union-3890"><a href="#union-3890"><span class="linenos">3890</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> -</span><span id="union-3891"><a href="#union-3891"><span class="linenos">3891</span></a> -</span><span id="union-3892"><a href="#union-3892"><span class="linenos">3892</span></a><span class="sd"> Example:</span> -</span><span id="union-3893"><a href="#union-3893"><span class="linenos">3893</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="union-3894"><a href="#union-3894"><span class="linenos">3894</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> -</span><span id="union-3895"><a href="#union-3895"><span class="linenos">3895</span></a> -</span><span id="union-3896"><a href="#union-3896"><span class="linenos">3896</span></a><span class="sd"> Args:</span> -</span><span id="union-3897"><a href="#union-3897"><span class="linenos">3897</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="union-3898"><a href="#union-3898"><span class="linenos">3898</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="union-3899"><a href="#union-3899"><span class="linenos">3899</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="union-3900"><a href="#union-3900"><span class="linenos">3900</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="union-3901"><a href="#union-3901"><span class="linenos">3901</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="union-3902"><a href="#union-3902"><span class="linenos">3902</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="union-3903"><a href="#union-3903"><span class="linenos">3903</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="union-3904"><a href="#union-3904"><span class="linenos">3904</span></a><span class="sd"> Returns:</span> -</span><span id="union-3905"><a href="#union-3905"><span class="linenos">3905</span></a><span class="sd"> Union: the syntax tree for the UNION expression.</span> -</span><span id="union-3906"><a href="#union-3906"><span class="linenos">3906</span></a><span class="sd"> """</span> -</span><span id="union-3907"><a href="#union-3907"><span class="linenos">3907</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="union-3908"><a href="#union-3908"><span class="linenos">3908</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="union-3909"><a href="#union-3909"><span class="linenos">3909</span></a> -</span><span id="union-3910"><a href="#union-3910"><span class="linenos">3910</span></a> <span class="k">return</span> <span class="n">Union</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="union-3946"><a href="#union-3946"><span class="linenos">3946</span></a><span class="k">def</span> <span class="nf">union</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="union-3947"><a href="#union-3947"><span class="linenos">3947</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="union-3948"><a href="#union-3948"><span class="linenos">3948</span></a><span class="sd"> Initializes a syntax tree from one UNION expression.</span> +</span><span id="union-3949"><a href="#union-3949"><span class="linenos">3949</span></a> +</span><span id="union-3950"><a href="#union-3950"><span class="linenos">3950</span></a><span class="sd"> Example:</span> +</span><span id="union-3951"><a href="#union-3951"><span class="linenos">3951</span></a><span class="sd"> >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="union-3952"><a href="#union-3952"><span class="linenos">3952</span></a><span class="sd"> 'SELECT * FROM foo UNION SELECT * FROM bla'</span> +</span><span id="union-3953"><a href="#union-3953"><span class="linenos">3953</span></a> +</span><span id="union-3954"><a href="#union-3954"><span class="linenos">3954</span></a><span class="sd"> Args:</span> +</span><span id="union-3955"><a href="#union-3955"><span class="linenos">3955</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="union-3956"><a href="#union-3956"><span class="linenos">3956</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="union-3957"><a href="#union-3957"><span class="linenos">3957</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="union-3958"><a href="#union-3958"><span class="linenos">3958</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="union-3959"><a href="#union-3959"><span class="linenos">3959</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="union-3960"><a href="#union-3960"><span class="linenos">3960</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="union-3961"><a href="#union-3961"><span class="linenos">3961</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="union-3962"><a href="#union-3962"><span class="linenos">3962</span></a><span class="sd"> Returns:</span> +</span><span id="union-3963"><a href="#union-3963"><span class="linenos">3963</span></a><span class="sd"> Union: the syntax tree for the UNION expression.</span> +</span><span id="union-3964"><a href="#union-3964"><span class="linenos">3964</span></a><span class="sd"> """</span> +</span><span id="union-3965"><a href="#union-3965"><span class="linenos">3965</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="union-3966"><a href="#union-3966"><span class="linenos">3966</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="union-3967"><a href="#union-3967"><span class="linenos">3967</span></a> +</span><span id="union-3968"><a href="#union-3968"><span class="linenos">3968</span></a> <span class="k">return</span> <span class="n">Union</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> </span></pre></div> @@ -38758,29 +39640,29 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#intersect"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="intersect-3913"><a href="#intersect-3913"><span class="linenos">3913</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="intersect-3914"><a href="#intersect-3914"><span class="linenos">3914</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="intersect-3915"><a href="#intersect-3915"><span class="linenos">3915</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> -</span><span id="intersect-3916"><a href="#intersect-3916"><span class="linenos">3916</span></a> -</span><span id="intersect-3917"><a href="#intersect-3917"><span class="linenos">3917</span></a><span class="sd"> Example:</span> -</span><span id="intersect-3918"><a href="#intersect-3918"><span class="linenos">3918</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="intersect-3919"><a href="#intersect-3919"><span class="linenos">3919</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> -</span><span id="intersect-3920"><a href="#intersect-3920"><span class="linenos">3920</span></a> -</span><span id="intersect-3921"><a href="#intersect-3921"><span class="linenos">3921</span></a><span class="sd"> Args:</span> -</span><span id="intersect-3922"><a href="#intersect-3922"><span class="linenos">3922</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="intersect-3923"><a href="#intersect-3923"><span class="linenos">3923</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="intersect-3924"><a href="#intersect-3924"><span class="linenos">3924</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="intersect-3925"><a href="#intersect-3925"><span class="linenos">3925</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="intersect-3926"><a href="#intersect-3926"><span class="linenos">3926</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="intersect-3927"><a href="#intersect-3927"><span class="linenos">3927</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="intersect-3928"><a href="#intersect-3928"><span class="linenos">3928</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="intersect-3929"><a href="#intersect-3929"><span class="linenos">3929</span></a><span class="sd"> Returns:</span> -</span><span id="intersect-3930"><a href="#intersect-3930"><span class="linenos">3930</span></a><span class="sd"> Intersect: the syntax tree for the INTERSECT expression.</span> -</span><span id="intersect-3931"><a href="#intersect-3931"><span class="linenos">3931</span></a><span class="sd"> """</span> -</span><span id="intersect-3932"><a href="#intersect-3932"><span class="linenos">3932</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="intersect-3933"><a href="#intersect-3933"><span class="linenos">3933</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="intersect-3934"><a href="#intersect-3934"><span class="linenos">3934</span></a> -</span><span id="intersect-3935"><a href="#intersect-3935"><span class="linenos">3935</span></a> <span class="k">return</span> <span class="n">Intersect</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="intersect-3971"><a href="#intersect-3971"><span class="linenos">3971</span></a><span class="k">def</span> <span class="nf">intersect</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="intersect-3972"><a href="#intersect-3972"><span class="linenos">3972</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="intersect-3973"><a href="#intersect-3973"><span class="linenos">3973</span></a><span class="sd"> Initializes a syntax tree from one INTERSECT expression.</span> +</span><span id="intersect-3974"><a href="#intersect-3974"><span class="linenos">3974</span></a> +</span><span id="intersect-3975"><a href="#intersect-3975"><span class="linenos">3975</span></a><span class="sd"> Example:</span> +</span><span id="intersect-3976"><a href="#intersect-3976"><span class="linenos">3976</span></a><span class="sd"> >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="intersect-3977"><a href="#intersect-3977"><span class="linenos">3977</span></a><span class="sd"> 'SELECT * FROM foo INTERSECT SELECT * FROM bla'</span> +</span><span id="intersect-3978"><a href="#intersect-3978"><span class="linenos">3978</span></a> +</span><span id="intersect-3979"><a href="#intersect-3979"><span class="linenos">3979</span></a><span class="sd"> Args:</span> +</span><span id="intersect-3980"><a href="#intersect-3980"><span class="linenos">3980</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="intersect-3981"><a href="#intersect-3981"><span class="linenos">3981</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="intersect-3982"><a href="#intersect-3982"><span class="linenos">3982</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="intersect-3983"><a href="#intersect-3983"><span class="linenos">3983</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="intersect-3984"><a href="#intersect-3984"><span class="linenos">3984</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="intersect-3985"><a href="#intersect-3985"><span class="linenos">3985</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="intersect-3986"><a href="#intersect-3986"><span class="linenos">3986</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="intersect-3987"><a href="#intersect-3987"><span class="linenos">3987</span></a><span class="sd"> Returns:</span> +</span><span id="intersect-3988"><a href="#intersect-3988"><span class="linenos">3988</span></a><span class="sd"> Intersect: the syntax tree for the INTERSECT expression.</span> +</span><span id="intersect-3989"><a href="#intersect-3989"><span class="linenos">3989</span></a><span class="sd"> """</span> +</span><span id="intersect-3990"><a href="#intersect-3990"><span class="linenos">3990</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="intersect-3991"><a href="#intersect-3991"><span class="linenos">3991</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="intersect-3992"><a href="#intersect-3992"><span class="linenos">3992</span></a> +</span><span id="intersect-3993"><a href="#intersect-3993"><span class="linenos">3993</span></a> <span class="k">return</span> <span class="n">Intersect</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> </span></pre></div> @@ -38828,29 +39710,29 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#except_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="except_-3938"><a href="#except_-3938"><span class="linenos">3938</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="except_-3939"><a href="#except_-3939"><span class="linenos">3939</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="except_-3940"><a href="#except_-3940"><span class="linenos">3940</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> -</span><span id="except_-3941"><a href="#except_-3941"><span class="linenos">3941</span></a> -</span><span id="except_-3942"><a href="#except_-3942"><span class="linenos">3942</span></a><span class="sd"> Example:</span> -</span><span id="except_-3943"><a href="#except_-3943"><span class="linenos">3943</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> -</span><span id="except_-3944"><a href="#except_-3944"><span class="linenos">3944</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> -</span><span id="except_-3945"><a href="#except_-3945"><span class="linenos">3945</span></a> -</span><span id="except_-3946"><a href="#except_-3946"><span class="linenos">3946</span></a><span class="sd"> Args:</span> -</span><span id="except_-3947"><a href="#except_-3947"><span class="linenos">3947</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> -</span><span id="except_-3948"><a href="#except_-3948"><span class="linenos">3948</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="except_-3949"><a href="#except_-3949"><span class="linenos">3949</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> -</span><span id="except_-3950"><a href="#except_-3950"><span class="linenos">3950</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> -</span><span id="except_-3951"><a href="#except_-3951"><span class="linenos">3951</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> -</span><span id="except_-3952"><a href="#except_-3952"><span class="linenos">3952</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="except_-3953"><a href="#except_-3953"><span class="linenos">3953</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> -</span><span id="except_-3954"><a href="#except_-3954"><span class="linenos">3954</span></a><span class="sd"> Returns:</span> -</span><span id="except_-3955"><a href="#except_-3955"><span class="linenos">3955</span></a><span class="sd"> Except: the syntax tree for the EXCEPT statement.</span> -</span><span id="except_-3956"><a href="#except_-3956"><span class="linenos">3956</span></a><span class="sd"> """</span> -</span><span id="except_-3957"><a href="#except_-3957"><span class="linenos">3957</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="except_-3958"><a href="#except_-3958"><span class="linenos">3958</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="except_-3959"><a href="#except_-3959"><span class="linenos">3959</span></a> -</span><span id="except_-3960"><a href="#except_-3960"><span class="linenos">3960</span></a> <span class="k">return</span> <span class="n">Except</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="except_-3996"><a href="#except_-3996"><span class="linenos">3996</span></a><span class="k">def</span> <span class="nf">except_</span><span class="p">(</span><span class="n">left</span><span class="p">,</span> <span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="except_-3997"><a href="#except_-3997"><span class="linenos">3997</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="except_-3998"><a href="#except_-3998"><span class="linenos">3998</span></a><span class="sd"> Initializes a syntax tree from one EXCEPT expression.</span> +</span><span id="except_-3999"><a href="#except_-3999"><span class="linenos">3999</span></a> +</span><span id="except_-4000"><a href="#except_-4000"><span class="linenos">4000</span></a><span class="sd"> Example:</span> +</span><span id="except_-4001"><a href="#except_-4001"><span class="linenos">4001</span></a><span class="sd"> >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()</span> +</span><span id="except_-4002"><a href="#except_-4002"><span class="linenos">4002</span></a><span class="sd"> 'SELECT * FROM foo EXCEPT SELECT * FROM bla'</span> +</span><span id="except_-4003"><a href="#except_-4003"><span class="linenos">4003</span></a> +</span><span id="except_-4004"><a href="#except_-4004"><span class="linenos">4004</span></a><span class="sd"> Args:</span> +</span><span id="except_-4005"><a href="#except_-4005"><span class="linenos">4005</span></a><span class="sd"> left (str | Expression): the SQL code string corresponding to the left-hand side.</span> +</span><span id="except_-4006"><a href="#except_-4006"><span class="linenos">4006</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="except_-4007"><a href="#except_-4007"><span class="linenos">4007</span></a><span class="sd"> right (str | Expression): the SQL code string corresponding to the right-hand side.</span> +</span><span id="except_-4008"><a href="#except_-4008"><span class="linenos">4008</span></a><span class="sd"> If an `Expression` instance is passed, it will be used as-is.</span> +</span><span id="except_-4009"><a href="#except_-4009"><span class="linenos">4009</span></a><span class="sd"> distinct (bool): set the DISTINCT flag if and only if this is true.</span> +</span><span id="except_-4010"><a href="#except_-4010"><span class="linenos">4010</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="except_-4011"><a href="#except_-4011"><span class="linenos">4011</span></a><span class="sd"> opts (kwargs): other options to use to parse the input expressions.</span> +</span><span id="except_-4012"><a href="#except_-4012"><span class="linenos">4012</span></a><span class="sd"> Returns:</span> +</span><span id="except_-4013"><a href="#except_-4013"><span class="linenos">4013</span></a><span class="sd"> Except: the syntax tree for the EXCEPT statement.</span> +</span><span id="except_-4014"><a href="#except_-4014"><span class="linenos">4014</span></a><span class="sd"> """</span> +</span><span id="except_-4015"><a href="#except_-4015"><span class="linenos">4015</span></a> <span class="n">left</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="except_-4016"><a href="#except_-4016"><span class="linenos">4016</span></a> <span class="n">right</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">sql_or_expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="except_-4017"><a href="#except_-4017"><span class="linenos">4017</span></a> +</span><span id="except_-4018"><a href="#except_-4018"><span class="linenos">4018</span></a> <span class="k">return</span> <span class="n">Except</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">left</span><span class="p">,</span> <span class="n">expression</span><span class="o">=</span><span class="n">right</span><span class="p">,</span> <span class="n">distinct</span><span class="o">=</span><span class="n">distinct</span><span class="p">)</span> </span></pre></div> @@ -38898,26 +39780,26 @@ If an <code><a href="#Expression">Expression</a></code> instance is passed, it w </div> <a class="headerlink" href="#select"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="select-3963"><a href="#select-3963"><span class="linenos">3963</span></a><span class="k">def</span> <span class="nf">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="select-3964"><a href="#select-3964"><span class="linenos">3964</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="select-3965"><a href="#select-3965"><span class="linenos">3965</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> -</span><span id="select-3966"><a href="#select-3966"><span class="linenos">3966</span></a> -</span><span id="select-3967"><a href="#select-3967"><span class="linenos">3967</span></a><span class="sd"> Example:</span> -</span><span id="select-3968"><a href="#select-3968"><span class="linenos">3968</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> -</span><span id="select-3969"><a href="#select-3969"><span class="linenos">3969</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="select-3970"><a href="#select-3970"><span class="linenos">3970</span></a> -</span><span id="select-3971"><a href="#select-3971"><span class="linenos">3971</span></a><span class="sd"> Args:</span> -</span><span id="select-3972"><a href="#select-3972"><span class="linenos">3972</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> -</span><span id="select-3973"><a href="#select-3973"><span class="linenos">3973</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="select-3974"><a href="#select-3974"><span class="linenos">3974</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> -</span><span id="select-3975"><a href="#select-3975"><span class="linenos">3975</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="select-3976"><a href="#select-3976"><span class="linenos">3976</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="select-3977"><a href="#select-3977"><span class="linenos">3977</span></a><span class="sd"> that an input expression is a SQL string).</span> -</span><span id="select-3978"><a href="#select-3978"><span class="linenos">3978</span></a> -</span><span id="select-3979"><a href="#select-3979"><span class="linenos">3979</span></a><span class="sd"> Returns:</span> -</span><span id="select-3980"><a href="#select-3980"><span class="linenos">3980</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="select-3981"><a href="#select-3981"><span class="linenos">3981</span></a><span class="sd"> """</span> -</span><span id="select-3982"><a href="#select-3982"><span class="linenos">3982</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="select-4021"><a href="#select-4021"><span class="linenos">4021</span></a><span class="k">def</span> <span class="nf">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="select-4022"><a href="#select-4022"><span class="linenos">4022</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="select-4023"><a href="#select-4023"><span class="linenos">4023</span></a><span class="sd"> Initializes a syntax tree from one or multiple SELECT expressions.</span> +</span><span id="select-4024"><a href="#select-4024"><span class="linenos">4024</span></a> +</span><span id="select-4025"><a href="#select-4025"><span class="linenos">4025</span></a><span class="sd"> Example:</span> +</span><span id="select-4026"><a href="#select-4026"><span class="linenos">4026</span></a><span class="sd"> >>> select("col1", "col2").from_("tbl").sql()</span> +</span><span id="select-4027"><a href="#select-4027"><span class="linenos">4027</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="select-4028"><a href="#select-4028"><span class="linenos">4028</span></a> +</span><span id="select-4029"><a href="#select-4029"><span class="linenos">4029</span></a><span class="sd"> Args:</span> +</span><span id="select-4030"><a href="#select-4030"><span class="linenos">4030</span></a><span class="sd"> *expressions: the SQL code string to parse as the expressions of a</span> +</span><span id="select-4031"><a href="#select-4031"><span class="linenos">4031</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="select-4032"><a href="#select-4032"><span class="linenos">4032</span></a><span class="sd"> dialect: the dialect used to parse the input expressions (in the case that an</span> +</span><span id="select-4033"><a href="#select-4033"><span class="linenos">4033</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="select-4034"><a href="#select-4034"><span class="linenos">4034</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="select-4035"><a href="#select-4035"><span class="linenos">4035</span></a><span class="sd"> that an input expression is a SQL string).</span> +</span><span id="select-4036"><a href="#select-4036"><span class="linenos">4036</span></a> +</span><span id="select-4037"><a href="#select-4037"><span class="linenos">4037</span></a><span class="sd"> Returns:</span> +</span><span id="select-4038"><a href="#select-4038"><span class="linenos">4038</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="select-4039"><a href="#select-4039"><span class="linenos">4039</span></a><span class="sd"> """</span> +</span><span id="select-4040"><a href="#select-4040"><span class="linenos">4040</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">select</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -38964,26 +39846,26 @@ that an input expression is a SQL string).</li> </div> <a class="headerlink" href="#from_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="from_-3985"><a href="#from_-3985"><span class="linenos">3985</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> -</span><span id="from_-3986"><a href="#from_-3986"><span class="linenos">3986</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="from_-3987"><a href="#from_-3987"><span class="linenos">3987</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> -</span><span id="from_-3988"><a href="#from_-3988"><span class="linenos">3988</span></a> -</span><span id="from_-3989"><a href="#from_-3989"><span class="linenos">3989</span></a><span class="sd"> Example:</span> -</span><span id="from_-3990"><a href="#from_-3990"><span class="linenos">3990</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> -</span><span id="from_-3991"><a href="#from_-3991"><span class="linenos">3991</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> -</span><span id="from_-3992"><a href="#from_-3992"><span class="linenos">3992</span></a> -</span><span id="from_-3993"><a href="#from_-3993"><span class="linenos">3993</span></a><span class="sd"> Args:</span> -</span><span id="from_-3994"><a href="#from_-3994"><span class="linenos">3994</span></a><span class="sd"> *expressions (str | Expression): the SQL code string to parse as the FROM expressions of a</span> -</span><span id="from_-3995"><a href="#from_-3995"><span class="linenos">3995</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> -</span><span id="from_-3996"><a href="#from_-3996"><span class="linenos">3996</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> -</span><span id="from_-3997"><a href="#from_-3997"><span class="linenos">3997</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="from_-3998"><a href="#from_-3998"><span class="linenos">3998</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="from_-3999"><a href="#from_-3999"><span class="linenos">3999</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="from_-4000"><a href="#from_-4000"><span class="linenos">4000</span></a> -</span><span id="from_-4001"><a href="#from_-4001"><span class="linenos">4001</span></a><span class="sd"> Returns:</span> -</span><span id="from_-4002"><a href="#from_-4002"><span class="linenos">4002</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> -</span><span id="from_-4003"><a href="#from_-4003"><span class="linenos">4003</span></a><span class="sd"> """</span> -</span><span id="from_-4004"><a href="#from_-4004"><span class="linenos">4004</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="from_-4043"><a href="#from_-4043"><span class="linenos">4043</span></a><span class="k">def</span> <span class="nf">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Select</span><span class="p">:</span> +</span><span id="from_-4044"><a href="#from_-4044"><span class="linenos">4044</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="from_-4045"><a href="#from_-4045"><span class="linenos">4045</span></a><span class="sd"> Initializes a syntax tree from a FROM expression.</span> +</span><span id="from_-4046"><a href="#from_-4046"><span class="linenos">4046</span></a> +</span><span id="from_-4047"><a href="#from_-4047"><span class="linenos">4047</span></a><span class="sd"> Example:</span> +</span><span id="from_-4048"><a href="#from_-4048"><span class="linenos">4048</span></a><span class="sd"> >>> from_("tbl").select("col1", "col2").sql()</span> +</span><span id="from_-4049"><a href="#from_-4049"><span class="linenos">4049</span></a><span class="sd"> 'SELECT col1, col2 FROM tbl'</span> +</span><span id="from_-4050"><a href="#from_-4050"><span class="linenos">4050</span></a> +</span><span id="from_-4051"><a href="#from_-4051"><span class="linenos">4051</span></a><span class="sd"> Args:</span> +</span><span id="from_-4052"><a href="#from_-4052"><span class="linenos">4052</span></a><span class="sd"> *expressions (str | Expression): the SQL code string to parse as the FROM expressions of a</span> +</span><span id="from_-4053"><a href="#from_-4053"><span class="linenos">4053</span></a><span class="sd"> SELECT statement. If an Expression instance is passed, this is used as-is.</span> +</span><span id="from_-4054"><a href="#from_-4054"><span class="linenos">4054</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> +</span><span id="from_-4055"><a href="#from_-4055"><span class="linenos">4055</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="from_-4056"><a href="#from_-4056"><span class="linenos">4056</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="from_-4057"><a href="#from_-4057"><span class="linenos">4057</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="from_-4058"><a href="#from_-4058"><span class="linenos">4058</span></a> +</span><span id="from_-4059"><a href="#from_-4059"><span class="linenos">4059</span></a><span class="sd"> Returns:</span> +</span><span id="from_-4060"><a href="#from_-4060"><span class="linenos">4060</span></a><span class="sd"> Select: the syntax tree for the SELECT statement.</span> +</span><span id="from_-4061"><a href="#from_-4061"><span class="linenos">4061</span></a><span class="sd"> """</span> +</span><span id="from_-4062"><a href="#from_-4062"><span class="linenos">4062</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -39030,46 +39912,46 @@ that the input expression is a SQL string).</li> </div> <a class="headerlink" href="#update"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="update-4007"><a href="#update-4007"><span class="linenos">4007</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">from_</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> -</span><span id="update-4008"><a href="#update-4008"><span class="linenos">4008</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="update-4009"><a href="#update-4009"><span class="linenos">4009</span></a><span class="sd"> Creates an update statement.</span> -</span><span id="update-4010"><a href="#update-4010"><span class="linenos">4010</span></a> -</span><span id="update-4011"><a href="#update-4011"><span class="linenos">4011</span></a><span class="sd"> Example:</span> -</span><span id="update-4012"><a href="#update-4012"><span class="linenos">4012</span></a><span class="sd"> >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz", where="id > 1").sql()</span> -</span><span id="update-4013"><a href="#update-4013"><span class="linenos">4013</span></a><span class="sd"> "UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz WHERE id > 1"</span> -</span><span id="update-4014"><a href="#update-4014"><span class="linenos">4014</span></a> -</span><span id="update-4015"><a href="#update-4015"><span class="linenos">4015</span></a><span class="sd"> Args:</span> -</span><span id="update-4016"><a href="#update-4016"><span class="linenos">4016</span></a><span class="sd"> *properties (Dict[str, Any]): dictionary of properties to set which are</span> -</span><span id="update-4017"><a href="#update-4017"><span class="linenos">4017</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> -</span><span id="update-4018"><a href="#update-4018"><span class="linenos">4018</span></a><span class="sd"> where (str): sql conditional parsed into a WHERE statement</span> -</span><span id="update-4019"><a href="#update-4019"><span class="linenos">4019</span></a><span class="sd"> from_ (str): sql statement parsed into a FROM statement</span> -</span><span id="update-4020"><a href="#update-4020"><span class="linenos">4020</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="update-4021"><a href="#update-4021"><span class="linenos">4021</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="update-4022"><a href="#update-4022"><span class="linenos">4022</span></a> -</span><span id="update-4023"><a href="#update-4023"><span class="linenos">4023</span></a><span class="sd"> Returns:</span> -</span><span id="update-4024"><a href="#update-4024"><span class="linenos">4024</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> -</span><span id="update-4025"><a href="#update-4025"><span class="linenos">4025</span></a><span class="sd"> """</span> -</span><span id="update-4026"><a href="#update-4026"><span class="linenos">4026</span></a> <span class="n">update</span> <span class="o">=</span> <span class="n">Update</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">))</span> -</span><span id="update-4027"><a href="#update-4027"><span class="linenos">4027</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-4028"><a href="#update-4028"><span class="linenos">4028</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="update-4029"><a href="#update-4029"><span class="linenos">4029</span></a> <span class="p">[</span> -</span><span id="update-4030"><a href="#update-4030"><span class="linenos">4030</span></a> <span class="n">EQ</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> -</span><span id="update-4031"><a href="#update-4031"><span class="linenos">4031</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> -</span><span id="update-4032"><a href="#update-4032"><span class="linenos">4032</span></a> <span class="p">],</span> -</span><span id="update-4033"><a href="#update-4033"><span class="linenos">4033</span></a> <span class="p">)</span> -</span><span id="update-4034"><a href="#update-4034"><span class="linenos">4034</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> -</span><span id="update-4035"><a href="#update-4035"><span class="linenos">4035</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-4036"><a href="#update-4036"><span class="linenos">4036</span></a> <span class="s2">"from"</span><span class="p">,</span> -</span><span id="update-4037"><a href="#update-4037"><span class="linenos">4037</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">from_</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="update-4038"><a href="#update-4038"><span class="linenos">4038</span></a> <span class="p">)</span> -</span><span id="update-4039"><a href="#update-4039"><span class="linenos">4039</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> -</span><span id="update-4040"><a href="#update-4040"><span class="linenos">4040</span></a> <span class="n">where</span> <span class="o">=</span> <span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> -</span><span id="update-4041"><a href="#update-4041"><span class="linenos">4041</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> -</span><span id="update-4042"><a href="#update-4042"><span class="linenos">4042</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="update-4043"><a href="#update-4043"><span class="linenos">4043</span></a> <span class="s2">"where"</span><span class="p">,</span> -</span><span id="update-4044"><a href="#update-4044"><span class="linenos">4044</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="update-4045"><a href="#update-4045"><span class="linenos">4045</span></a> <span class="p">)</span> -</span><span id="update-4046"><a href="#update-4046"><span class="linenos">4046</span></a> <span class="k">return</span> <span class="n">update</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="update-4065"><a href="#update-4065"><span class="linenos">4065</span></a><span class="k">def</span> <span class="nf">update</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">properties</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">from_</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Update</span><span class="p">:</span> +</span><span id="update-4066"><a href="#update-4066"><span class="linenos">4066</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="update-4067"><a href="#update-4067"><span class="linenos">4067</span></a><span class="sd"> Creates an update statement.</span> +</span><span id="update-4068"><a href="#update-4068"><span class="linenos">4068</span></a> +</span><span id="update-4069"><a href="#update-4069"><span class="linenos">4069</span></a><span class="sd"> Example:</span> +</span><span id="update-4070"><a href="#update-4070"><span class="linenos">4070</span></a><span class="sd"> >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz", where="id > 1").sql()</span> +</span><span id="update-4071"><a href="#update-4071"><span class="linenos">4071</span></a><span class="sd"> "UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz WHERE id > 1"</span> +</span><span id="update-4072"><a href="#update-4072"><span class="linenos">4072</span></a> +</span><span id="update-4073"><a href="#update-4073"><span class="linenos">4073</span></a><span class="sd"> Args:</span> +</span><span id="update-4074"><a href="#update-4074"><span class="linenos">4074</span></a><span class="sd"> *properties (Dict[str, Any]): dictionary of properties to set which are</span> +</span><span id="update-4075"><a href="#update-4075"><span class="linenos">4075</span></a><span class="sd"> auto converted to sql objects eg None -> NULL</span> +</span><span id="update-4076"><a href="#update-4076"><span class="linenos">4076</span></a><span class="sd"> where (str): sql conditional parsed into a WHERE statement</span> +</span><span id="update-4077"><a href="#update-4077"><span class="linenos">4077</span></a><span class="sd"> from_ (str): sql statement parsed into a FROM statement</span> +</span><span id="update-4078"><a href="#update-4078"><span class="linenos">4078</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="update-4079"><a href="#update-4079"><span class="linenos">4079</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="update-4080"><a href="#update-4080"><span class="linenos">4080</span></a> +</span><span id="update-4081"><a href="#update-4081"><span class="linenos">4081</span></a><span class="sd"> Returns:</span> +</span><span id="update-4082"><a href="#update-4082"><span class="linenos">4082</span></a><span class="sd"> Update: the syntax tree for the UPDATE statement.</span> +</span><span id="update-4083"><a href="#update-4083"><span class="linenos">4083</span></a><span class="sd"> """</span> +</span><span id="update-4084"><a href="#update-4084"><span class="linenos">4084</span></a> <span class="n">update</span> <span class="o">=</span> <span class="n">Update</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">))</span> +</span><span id="update-4085"><a href="#update-4085"><span class="linenos">4085</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-4086"><a href="#update-4086"><span class="linenos">4086</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="update-4087"><a href="#update-4087"><span class="linenos">4087</span></a> <span class="p">[</span> +</span><span id="update-4088"><a href="#update-4088"><span class="linenos">4088</span></a> <span class="n">EQ</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> <span class="n">expression</span><span class="o">=</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">))</span> +</span><span id="update-4089"><a href="#update-4089"><span class="linenos">4089</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">properties</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> +</span><span id="update-4090"><a href="#update-4090"><span class="linenos">4090</span></a> <span class="p">],</span> +</span><span id="update-4091"><a href="#update-4091"><span class="linenos">4091</span></a> <span class="p">)</span> +</span><span id="update-4092"><a href="#update-4092"><span class="linenos">4092</span></a> <span class="k">if</span> <span class="n">from_</span><span class="p">:</span> +</span><span id="update-4093"><a href="#update-4093"><span class="linenos">4093</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-4094"><a href="#update-4094"><span class="linenos">4094</span></a> <span class="s2">"from"</span><span class="p">,</span> +</span><span id="update-4095"><a href="#update-4095"><span class="linenos">4095</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">from_</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">From</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"FROM"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="update-4096"><a href="#update-4096"><span class="linenos">4096</span></a> <span class="p">)</span> +</span><span id="update-4097"><a href="#update-4097"><span class="linenos">4097</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">):</span> +</span><span id="update-4098"><a href="#update-4098"><span class="linenos">4098</span></a> <span class="n">where</span> <span class="o">=</span> <span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> +</span><span id="update-4099"><a href="#update-4099"><span class="linenos">4099</span></a> <span class="k">if</span> <span class="n">where</span><span class="p">:</span> +</span><span id="update-4100"><a href="#update-4100"><span class="linenos">4100</span></a> <span class="n">update</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="update-4101"><a href="#update-4101"><span class="linenos">4101</span></a> <span class="s2">"where"</span><span class="p">,</span> +</span><span id="update-4102"><a href="#update-4102"><span class="linenos">4102</span></a> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="update-4103"><a href="#update-4103"><span class="linenos">4103</span></a> <span class="p">)</span> +</span><span id="update-4104"><a href="#update-4104"><span class="linenos">4104</span></a> <span class="k">return</span> <span class="n">update</span> </span></pre></div> @@ -39116,28 +39998,28 @@ auto converted to sql objects eg None -> NULL</li> </div> <a class="headerlink" href="#delete"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="delete-4049"><a href="#delete-4049"><span class="linenos">4049</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> -</span><span id="delete-4050"><a href="#delete-4050"><span class="linenos">4050</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="delete-4051"><a href="#delete-4051"><span class="linenos">4051</span></a><span class="sd"> Builds a delete statement.</span> -</span><span id="delete-4052"><a href="#delete-4052"><span class="linenos">4052</span></a> -</span><span id="delete-4053"><a href="#delete-4053"><span class="linenos">4053</span></a><span class="sd"> Example:</span> -</span><span id="delete-4054"><a href="#delete-4054"><span class="linenos">4054</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> -</span><span id="delete-4055"><a href="#delete-4055"><span class="linenos">4055</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> -</span><span id="delete-4056"><a href="#delete-4056"><span class="linenos">4056</span></a> -</span><span id="delete-4057"><a href="#delete-4057"><span class="linenos">4057</span></a><span class="sd"> Args:</span> -</span><span id="delete-4058"><a href="#delete-4058"><span class="linenos">4058</span></a><span class="sd"> where (str|Condition): sql conditional parsed into a WHERE statement</span> -</span><span id="delete-4059"><a href="#delete-4059"><span class="linenos">4059</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> -</span><span id="delete-4060"><a href="#delete-4060"><span class="linenos">4060</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="delete-4061"><a href="#delete-4061"><span class="linenos">4061</span></a> -</span><span id="delete-4062"><a href="#delete-4062"><span class="linenos">4062</span></a><span class="sd"> Returns:</span> -</span><span id="delete-4063"><a href="#delete-4063"><span class="linenos">4063</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> -</span><span id="delete-4064"><a href="#delete-4064"><span class="linenos">4064</span></a><span class="sd"> """</span> -</span><span id="delete-4065"><a href="#delete-4065"><span class="linenos">4065</span></a> <span class="k">return</span> <span class="n">Delete</span><span class="p">(</span> -</span><span id="delete-4066"><a href="#delete-4066"><span class="linenos">4066</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="delete-4067"><a href="#delete-4067"><span class="linenos">4067</span></a> <span class="n">where</span><span class="o">=</span><span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> -</span><span id="delete-4068"><a href="#delete-4068"><span class="linenos">4068</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">)</span> -</span><span id="delete-4069"><a href="#delete-4069"><span class="linenos">4069</span></a> <span class="k">else</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> -</span><span id="delete-4070"><a href="#delete-4070"><span class="linenos">4070</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="delete-4107"><a href="#delete-4107"><span class="linenos">4107</span></a><span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">where</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Delete</span><span class="p">:</span> +</span><span id="delete-4108"><a href="#delete-4108"><span class="linenos">4108</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="delete-4109"><a href="#delete-4109"><span class="linenos">4109</span></a><span class="sd"> Builds a delete statement.</span> +</span><span id="delete-4110"><a href="#delete-4110"><span class="linenos">4110</span></a> +</span><span id="delete-4111"><a href="#delete-4111"><span class="linenos">4111</span></a><span class="sd"> Example:</span> +</span><span id="delete-4112"><a href="#delete-4112"><span class="linenos">4112</span></a><span class="sd"> >>> delete("my_table", where="id > 1").sql()</span> +</span><span id="delete-4113"><a href="#delete-4113"><span class="linenos">4113</span></a><span class="sd"> 'DELETE FROM my_table WHERE id > 1'</span> +</span><span id="delete-4114"><a href="#delete-4114"><span class="linenos">4114</span></a> +</span><span id="delete-4115"><a href="#delete-4115"><span class="linenos">4115</span></a><span class="sd"> Args:</span> +</span><span id="delete-4116"><a href="#delete-4116"><span class="linenos">4116</span></a><span class="sd"> where (str|Condition): sql conditional parsed into a WHERE statement</span> +</span><span id="delete-4117"><a href="#delete-4117"><span class="linenos">4117</span></a><span class="sd"> dialect (str): the dialect used to parse the input expressions.</span> +</span><span id="delete-4118"><a href="#delete-4118"><span class="linenos">4118</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="delete-4119"><a href="#delete-4119"><span class="linenos">4119</span></a> +</span><span id="delete-4120"><a href="#delete-4120"><span class="linenos">4120</span></a><span class="sd"> Returns:</span> +</span><span id="delete-4121"><a href="#delete-4121"><span class="linenos">4121</span></a><span class="sd"> Delete: the syntax tree for the DELETE statement.</span> +</span><span id="delete-4122"><a href="#delete-4122"><span class="linenos">4122</span></a><span class="sd"> """</span> +</span><span id="delete-4123"><a href="#delete-4123"><span class="linenos">4123</span></a> <span class="k">return</span> <span class="n">Delete</span><span class="p">(</span> +</span><span id="delete-4124"><a href="#delete-4124"><span class="linenos">4124</span></a> <span class="n">this</span><span class="o">=</span><span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="delete-4125"><a href="#delete-4125"><span class="linenos">4125</span></a> <span class="n">where</span><span class="o">=</span><span class="n">Where</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">where</span><span class="p">)</span> +</span><span id="delete-4126"><a href="#delete-4126"><span class="linenos">4126</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">Condition</span><span class="p">)</span> +</span><span id="delete-4127"><a href="#delete-4127"><span class="linenos">4127</span></a> <span class="k">else</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">where</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Where</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="n">prefix</span><span class="o">=</span><span class="s2">"WHERE"</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">),</span> +</span><span id="delete-4128"><a href="#delete-4128"><span class="linenos">4128</span></a> <span class="p">)</span> </span></pre></div> @@ -39181,37 +40063,37 @@ auto converted to sql objects eg None -> NULL</li> </div> <a class="headerlink" href="#condition"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="condition-4073"><a href="#condition-4073"><span class="linenos">4073</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> -</span><span id="condition-4074"><a href="#condition-4074"><span class="linenos">4074</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="condition-4075"><a href="#condition-4075"><span class="linenos">4075</span></a><span class="sd"> Initialize a logical condition expression.</span> -</span><span id="condition-4076"><a href="#condition-4076"><span class="linenos">4076</span></a> -</span><span id="condition-4077"><a href="#condition-4077"><span class="linenos">4077</span></a><span class="sd"> Example:</span> -</span><span id="condition-4078"><a href="#condition-4078"><span class="linenos">4078</span></a><span class="sd"> >>> condition("x=1").sql()</span> -</span><span id="condition-4079"><a href="#condition-4079"><span class="linenos">4079</span></a><span class="sd"> 'x = 1'</span> -</span><span id="condition-4080"><a href="#condition-4080"><span class="linenos">4080</span></a> -</span><span id="condition-4081"><a href="#condition-4081"><span class="linenos">4081</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> -</span><span id="condition-4082"><a href="#condition-4082"><span class="linenos">4082</span></a><span class="sd"> >>> where = condition("x=1")</span> -</span><span id="condition-4083"><a href="#condition-4083"><span class="linenos">4083</span></a><span class="sd"> >>> where = where.and_("y=1")</span> -</span><span id="condition-4084"><a href="#condition-4084"><span class="linenos">4084</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> -</span><span id="condition-4085"><a href="#condition-4085"><span class="linenos">4085</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> -</span><span id="condition-4086"><a href="#condition-4086"><span class="linenos">4086</span></a> -</span><span id="condition-4087"><a href="#condition-4087"><span class="linenos">4087</span></a><span class="sd"> Args:</span> -</span><span id="condition-4088"><a href="#condition-4088"><span class="linenos">4088</span></a><span class="sd"> *expression (str | Expression): the SQL code string to parse.</span> -</span><span id="condition-4089"><a href="#condition-4089"><span class="linenos">4089</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="condition-4090"><a href="#condition-4090"><span class="linenos">4090</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> -</span><span id="condition-4091"><a href="#condition-4091"><span class="linenos">4091</span></a><span class="sd"> input expression is a SQL string).</span> -</span><span id="condition-4092"><a href="#condition-4092"><span class="linenos">4092</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> -</span><span id="condition-4093"><a href="#condition-4093"><span class="linenos">4093</span></a><span class="sd"> that the input expression is a SQL string).</span> -</span><span id="condition-4094"><a href="#condition-4094"><span class="linenos">4094</span></a> -</span><span id="condition-4095"><a href="#condition-4095"><span class="linenos">4095</span></a><span class="sd"> Returns:</span> -</span><span id="condition-4096"><a href="#condition-4096"><span class="linenos">4096</span></a><span class="sd"> Condition: the expression</span> -</span><span id="condition-4097"><a href="#condition-4097"><span class="linenos">4097</span></a><span class="sd"> """</span> -</span><span id="condition-4098"><a href="#condition-4098"><span class="linenos">4098</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> <span class="c1"># type: ignore</span> -</span><span id="condition-4099"><a href="#condition-4099"><span class="linenos">4099</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="condition-4100"><a href="#condition-4100"><span class="linenos">4100</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> -</span><span id="condition-4101"><a href="#condition-4101"><span class="linenos">4101</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="condition-4102"><a href="#condition-4102"><span class="linenos">4102</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="condition-4103"><a href="#condition-4103"><span class="linenos">4103</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="condition-4131"><a href="#condition-4131"><span class="linenos">4131</span></a><span class="k">def</span> <span class="nf">condition</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Condition</span><span class="p">:</span> +</span><span id="condition-4132"><a href="#condition-4132"><span class="linenos">4132</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="condition-4133"><a href="#condition-4133"><span class="linenos">4133</span></a><span class="sd"> Initialize a logical condition expression.</span> +</span><span id="condition-4134"><a href="#condition-4134"><span class="linenos">4134</span></a> +</span><span id="condition-4135"><a href="#condition-4135"><span class="linenos">4135</span></a><span class="sd"> Example:</span> +</span><span id="condition-4136"><a href="#condition-4136"><span class="linenos">4136</span></a><span class="sd"> >>> condition("x=1").sql()</span> +</span><span id="condition-4137"><a href="#condition-4137"><span class="linenos">4137</span></a><span class="sd"> 'x = 1'</span> +</span><span id="condition-4138"><a href="#condition-4138"><span class="linenos">4138</span></a> +</span><span id="condition-4139"><a href="#condition-4139"><span class="linenos">4139</span></a><span class="sd"> This is helpful for composing larger logical syntax trees:</span> +</span><span id="condition-4140"><a href="#condition-4140"><span class="linenos">4140</span></a><span class="sd"> >>> where = condition("x=1")</span> +</span><span id="condition-4141"><a href="#condition-4141"><span class="linenos">4141</span></a><span class="sd"> >>> where = where.and_("y=1")</span> +</span><span id="condition-4142"><a href="#condition-4142"><span class="linenos">4142</span></a><span class="sd"> >>> Select().from_("tbl").select("*").where(where).sql()</span> +</span><span id="condition-4143"><a href="#condition-4143"><span class="linenos">4143</span></a><span class="sd"> 'SELECT * FROM tbl WHERE x = 1 AND y = 1'</span> +</span><span id="condition-4144"><a href="#condition-4144"><span class="linenos">4144</span></a> +</span><span id="condition-4145"><a href="#condition-4145"><span class="linenos">4145</span></a><span class="sd"> Args:</span> +</span><span id="condition-4146"><a href="#condition-4146"><span class="linenos">4146</span></a><span class="sd"> *expression (str | Expression): the SQL code string to parse.</span> +</span><span id="condition-4147"><a href="#condition-4147"><span class="linenos">4147</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="condition-4148"><a href="#condition-4148"><span class="linenos">4148</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression (in the case that the</span> +</span><span id="condition-4149"><a href="#condition-4149"><span class="linenos">4149</span></a><span class="sd"> input expression is a SQL string).</span> +</span><span id="condition-4150"><a href="#condition-4150"><span class="linenos">4150</span></a><span class="sd"> **opts: other options to use to parse the input expressions (again, in the case</span> +</span><span id="condition-4151"><a href="#condition-4151"><span class="linenos">4151</span></a><span class="sd"> that the input expression is a SQL string).</span> +</span><span id="condition-4152"><a href="#condition-4152"><span class="linenos">4152</span></a> +</span><span id="condition-4153"><a href="#condition-4153"><span class="linenos">4153</span></a><span class="sd"> Returns:</span> +</span><span id="condition-4154"><a href="#condition-4154"><span class="linenos">4154</span></a><span class="sd"> Condition: the expression</span> +</span><span id="condition-4155"><a href="#condition-4155"><span class="linenos">4155</span></a><span class="sd"> """</span> +</span><span id="condition-4156"><a href="#condition-4156"><span class="linenos">4156</span></a> <span class="k">return</span> <span class="n">maybe_parse</span><span class="p">(</span> <span class="c1"># type: ignore</span> +</span><span id="condition-4157"><a href="#condition-4157"><span class="linenos">4157</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="condition-4158"><a href="#condition-4158"><span class="linenos">4158</span></a> <span class="n">into</span><span class="o">=</span><span class="n">Condition</span><span class="p">,</span> +</span><span id="condition-4159"><a href="#condition-4159"><span class="linenos">4159</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="condition-4160"><a href="#condition-4160"><span class="linenos">4160</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="condition-4161"><a href="#condition-4161"><span class="linenos">4161</span></a> <span class="p">)</span> </span></pre></div> @@ -39268,24 +40150,24 @@ that the input expression is a SQL string).</li> </div> <a class="headerlink" href="#and_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="and_-4106"><a href="#and_-4106"><span class="linenos">4106</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> -</span><span id="and_-4107"><a href="#and_-4107"><span class="linenos">4107</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="and_-4108"><a href="#and_-4108"><span class="linenos">4108</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> -</span><span id="and_-4109"><a href="#and_-4109"><span class="linenos">4109</span></a> -</span><span id="and_-4110"><a href="#and_-4110"><span class="linenos">4110</span></a><span class="sd"> Example:</span> -</span><span id="and_-4111"><a href="#and_-4111"><span class="linenos">4111</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> -</span><span id="and_-4112"><a href="#and_-4112"><span class="linenos">4112</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> -</span><span id="and_-4113"><a href="#and_-4113"><span class="linenos">4113</span></a> -</span><span id="and_-4114"><a href="#and_-4114"><span class="linenos">4114</span></a><span class="sd"> Args:</span> -</span><span id="and_-4115"><a href="#and_-4115"><span class="linenos">4115</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="and_-4116"><a href="#and_-4116"><span class="linenos">4116</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="and_-4117"><a href="#and_-4117"><span class="linenos">4117</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="and_-4118"><a href="#and_-4118"><span class="linenos">4118</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="and_-4119"><a href="#and_-4119"><span class="linenos">4119</span></a> -</span><span id="and_-4120"><a href="#and_-4120"><span class="linenos">4120</span></a><span class="sd"> Returns:</span> -</span><span id="and_-4121"><a href="#and_-4121"><span class="linenos">4121</span></a><span class="sd"> And: the new condition</span> -</span><span id="and_-4122"><a href="#and_-4122"><span class="linenos">4122</span></a><span class="sd"> """</span> -</span><span id="and_-4123"><a href="#and_-4123"><span class="linenos">4123</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">And</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="and_-4164"><a href="#and_-4164"><span class="linenos">4164</span></a><span class="k">def</span> <span class="nf">and_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">And</span><span class="p">:</span> +</span><span id="and_-4165"><a href="#and_-4165"><span class="linenos">4165</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="and_-4166"><a href="#and_-4166"><span class="linenos">4166</span></a><span class="sd"> Combine multiple conditions with an AND logical operator.</span> +</span><span id="and_-4167"><a href="#and_-4167"><span class="linenos">4167</span></a> +</span><span id="and_-4168"><a href="#and_-4168"><span class="linenos">4168</span></a><span class="sd"> Example:</span> +</span><span id="and_-4169"><a href="#and_-4169"><span class="linenos">4169</span></a><span class="sd"> >>> and_("x=1", and_("y=1", "z=1")).sql()</span> +</span><span id="and_-4170"><a href="#and_-4170"><span class="linenos">4170</span></a><span class="sd"> 'x = 1 AND (y = 1 AND z = 1)'</span> +</span><span id="and_-4171"><a href="#and_-4171"><span class="linenos">4171</span></a> +</span><span id="and_-4172"><a href="#and_-4172"><span class="linenos">4172</span></a><span class="sd"> Args:</span> +</span><span id="and_-4173"><a href="#and_-4173"><span class="linenos">4173</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="and_-4174"><a href="#and_-4174"><span class="linenos">4174</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="and_-4175"><a href="#and_-4175"><span class="linenos">4175</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="and_-4176"><a href="#and_-4176"><span class="linenos">4176</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="and_-4177"><a href="#and_-4177"><span class="linenos">4177</span></a> +</span><span id="and_-4178"><a href="#and_-4178"><span class="linenos">4178</span></a><span class="sd"> Returns:</span> +</span><span id="and_-4179"><a href="#and_-4179"><span class="linenos">4179</span></a><span class="sd"> And: the new condition</span> +</span><span id="and_-4180"><a href="#and_-4180"><span class="linenos">4180</span></a><span class="sd"> """</span> +</span><span id="and_-4181"><a href="#and_-4181"><span class="linenos">4181</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">And</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -39330,24 +40212,24 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#or_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="or_-4126"><a href="#or_-4126"><span class="linenos">4126</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> -</span><span id="or_-4127"><a href="#or_-4127"><span class="linenos">4127</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="or_-4128"><a href="#or_-4128"><span class="linenos">4128</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> -</span><span id="or_-4129"><a href="#or_-4129"><span class="linenos">4129</span></a> -</span><span id="or_-4130"><a href="#or_-4130"><span class="linenos">4130</span></a><span class="sd"> Example:</span> -</span><span id="or_-4131"><a href="#or_-4131"><span class="linenos">4131</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> -</span><span id="or_-4132"><a href="#or_-4132"><span class="linenos">4132</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> -</span><span id="or_-4133"><a href="#or_-4133"><span class="linenos">4133</span></a> -</span><span id="or_-4134"><a href="#or_-4134"><span class="linenos">4134</span></a><span class="sd"> Args:</span> -</span><span id="or_-4135"><a href="#or_-4135"><span class="linenos">4135</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> -</span><span id="or_-4136"><a href="#or_-4136"><span class="linenos">4136</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="or_-4137"><a href="#or_-4137"><span class="linenos">4137</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="or_-4138"><a href="#or_-4138"><span class="linenos">4138</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="or_-4139"><a href="#or_-4139"><span class="linenos">4139</span></a> -</span><span id="or_-4140"><a href="#or_-4140"><span class="linenos">4140</span></a><span class="sd"> Returns:</span> -</span><span id="or_-4141"><a href="#or_-4141"><span class="linenos">4141</span></a><span class="sd"> Or: the new condition</span> -</span><span id="or_-4142"><a href="#or_-4142"><span class="linenos">4142</span></a><span class="sd"> """</span> -</span><span id="or_-4143"><a href="#or_-4143"><span class="linenos">4143</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="or_-4184"><a href="#or_-4184"><span class="linenos">4184</span></a><span class="k">def</span> <span class="nf">or_</span><span class="p">(</span><span class="o">*</span><span class="n">expressions</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Or</span><span class="p">:</span> +</span><span id="or_-4185"><a href="#or_-4185"><span class="linenos">4185</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="or_-4186"><a href="#or_-4186"><span class="linenos">4186</span></a><span class="sd"> Combine multiple conditions with an OR logical operator.</span> +</span><span id="or_-4187"><a href="#or_-4187"><span class="linenos">4187</span></a> +</span><span id="or_-4188"><a href="#or_-4188"><span class="linenos">4188</span></a><span class="sd"> Example:</span> +</span><span id="or_-4189"><a href="#or_-4189"><span class="linenos">4189</span></a><span class="sd"> >>> or_("x=1", or_("y=1", "z=1")).sql()</span> +</span><span id="or_-4190"><a href="#or_-4190"><span class="linenos">4190</span></a><span class="sd"> 'x = 1 OR (y = 1 OR z = 1)'</span> +</span><span id="or_-4191"><a href="#or_-4191"><span class="linenos">4191</span></a> +</span><span id="or_-4192"><a href="#or_-4192"><span class="linenos">4192</span></a><span class="sd"> Args:</span> +</span><span id="or_-4193"><a href="#or_-4193"><span class="linenos">4193</span></a><span class="sd"> *expressions (str | Expression): the SQL code strings to parse.</span> +</span><span id="or_-4194"><a href="#or_-4194"><span class="linenos">4194</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="or_-4195"><a href="#or_-4195"><span class="linenos">4195</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="or_-4196"><a href="#or_-4196"><span class="linenos">4196</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="or_-4197"><a href="#or_-4197"><span class="linenos">4197</span></a> +</span><span id="or_-4198"><a href="#or_-4198"><span class="linenos">4198</span></a><span class="sd"> Returns:</span> +</span><span id="or_-4199"><a href="#or_-4199"><span class="linenos">4199</span></a><span class="sd"> Or: the new condition</span> +</span><span id="or_-4200"><a href="#or_-4200"><span class="linenos">4200</span></a><span class="sd"> """</span> +</span><span id="or_-4201"><a href="#or_-4201"><span class="linenos">4201</span></a> <span class="k">return</span> <span class="n">_combine</span><span class="p">(</span><span class="n">expressions</span><span class="p">,</span> <span class="n">Or</span><span class="p">,</span> <span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -39392,29 +40274,29 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#not_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="not_-4146"><a href="#not_-4146"><span class="linenos">4146</span></a><span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> -</span><span id="not_-4147"><a href="#not_-4147"><span class="linenos">4147</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="not_-4148"><a href="#not_-4148"><span class="linenos">4148</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> -</span><span id="not_-4149"><a href="#not_-4149"><span class="linenos">4149</span></a> -</span><span id="not_-4150"><a href="#not_-4150"><span class="linenos">4150</span></a><span class="sd"> Example:</span> -</span><span id="not_-4151"><a href="#not_-4151"><span class="linenos">4151</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> -</span><span id="not_-4152"><a href="#not_-4152"><span class="linenos">4152</span></a><span class="sd"> "NOT this_suit = 'black'"</span> -</span><span id="not_-4153"><a href="#not_-4153"><span class="linenos">4153</span></a> -</span><span id="not_-4154"><a href="#not_-4154"><span class="linenos">4154</span></a><span class="sd"> Args:</span> -</span><span id="not_-4155"><a href="#not_-4155"><span class="linenos">4155</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> -</span><span id="not_-4156"><a href="#not_-4156"><span class="linenos">4156</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="not_-4157"><a href="#not_-4157"><span class="linenos">4157</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="not_-4158"><a href="#not_-4158"><span class="linenos">4158</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="not_-4159"><a href="#not_-4159"><span class="linenos">4159</span></a> -</span><span id="not_-4160"><a href="#not_-4160"><span class="linenos">4160</span></a><span class="sd"> Returns:</span> -</span><span id="not_-4161"><a href="#not_-4161"><span class="linenos">4161</span></a><span class="sd"> Not: the new condition</span> -</span><span id="not_-4162"><a href="#not_-4162"><span class="linenos">4162</span></a><span class="sd"> """</span> -</span><span id="not_-4163"><a href="#not_-4163"><span class="linenos">4163</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> -</span><span id="not_-4164"><a href="#not_-4164"><span class="linenos">4164</span></a> <span class="n">expression</span><span class="p">,</span> -</span><span id="not_-4165"><a href="#not_-4165"><span class="linenos">4165</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> -</span><span id="not_-4166"><a href="#not_-4166"><span class="linenos">4166</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="not_-4167"><a href="#not_-4167"><span class="linenos">4167</span></a> <span class="p">)</span> -</span><span id="not_-4168"><a href="#not_-4168"><span class="linenos">4168</span></a> <span class="k">return</span> <span class="n">Not</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="not_-4204"><a href="#not_-4204"><span class="linenos">4204</span></a><span class="k">def</span> <span class="nf">not_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Not</span><span class="p">:</span> +</span><span id="not_-4205"><a href="#not_-4205"><span class="linenos">4205</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="not_-4206"><a href="#not_-4206"><span class="linenos">4206</span></a><span class="sd"> Wrap a condition with a NOT operator.</span> +</span><span id="not_-4207"><a href="#not_-4207"><span class="linenos">4207</span></a> +</span><span id="not_-4208"><a href="#not_-4208"><span class="linenos">4208</span></a><span class="sd"> Example:</span> +</span><span id="not_-4209"><a href="#not_-4209"><span class="linenos">4209</span></a><span class="sd"> >>> not_("this_suit='black'").sql()</span> +</span><span id="not_-4210"><a href="#not_-4210"><span class="linenos">4210</span></a><span class="sd"> "NOT this_suit = 'black'"</span> +</span><span id="not_-4211"><a href="#not_-4211"><span class="linenos">4211</span></a> +</span><span id="not_-4212"><a href="#not_-4212"><span class="linenos">4212</span></a><span class="sd"> Args:</span> +</span><span id="not_-4213"><a href="#not_-4213"><span class="linenos">4213</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> +</span><span id="not_-4214"><a href="#not_-4214"><span class="linenos">4214</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="not_-4215"><a href="#not_-4215"><span class="linenos">4215</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="not_-4216"><a href="#not_-4216"><span class="linenos">4216</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="not_-4217"><a href="#not_-4217"><span class="linenos">4217</span></a> +</span><span id="not_-4218"><a href="#not_-4218"><span class="linenos">4218</span></a><span class="sd"> Returns:</span> +</span><span id="not_-4219"><a href="#not_-4219"><span class="linenos">4219</span></a><span class="sd"> Not: the new condition</span> +</span><span id="not_-4220"><a href="#not_-4220"><span class="linenos">4220</span></a><span class="sd"> """</span> +</span><span id="not_-4221"><a href="#not_-4221"><span class="linenos">4221</span></a> <span class="n">this</span> <span class="o">=</span> <span class="n">condition</span><span class="p">(</span> +</span><span id="not_-4222"><a href="#not_-4222"><span class="linenos">4222</span></a> <span class="n">expression</span><span class="p">,</span> +</span><span id="not_-4223"><a href="#not_-4223"><span class="linenos">4223</span></a> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> +</span><span id="not_-4224"><a href="#not_-4224"><span class="linenos">4224</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="not_-4225"><a href="#not_-4225"><span class="linenos">4225</span></a> <span class="p">)</span> +</span><span id="not_-4226"><a href="#not_-4226"><span class="linenos">4226</span></a> <span class="k">return</span> <span class="n">Not</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">_wrap_operator</span><span class="p">(</span><span class="n">this</span><span class="p">))</span> </span></pre></div> @@ -39459,8 +40341,8 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#paren"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="paren-4171"><a href="#paren-4171"><span class="linenos">4171</span></a><span class="k">def</span> <span class="nf">paren</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Paren</span><span class="p">:</span> -</span><span id="paren-4172"><a href="#paren-4172"><span class="linenos">4172</span></a> <span class="k">return</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="paren-4229"><a href="#paren-4229"><span class="linenos">4229</span></a><span class="k">def</span> <span class="nf">paren</span><span class="p">(</span><span class="n">expression</span><span class="p">)</span> <span class="o">-></span> <span class="n">Paren</span><span class="p">:</span> +</span><span id="paren-4230"><a href="#paren-4230"><span class="linenos">4230</span></a> <span class="k">return</span> <span class="n">Paren</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">)</span> </span></pre></div> @@ -39478,30 +40360,30 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#to_identifier"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="to_identifier-4188"><a href="#to_identifier-4188"><span class="linenos">4188</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> -</span><span id="to_identifier-4189"><a href="#to_identifier-4189"><span class="linenos">4189</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> -</span><span id="to_identifier-4190"><a href="#to_identifier-4190"><span class="linenos">4190</span></a> -</span><span id="to_identifier-4191"><a href="#to_identifier-4191"><span class="linenos">4191</span></a><span class="sd"> Args:</span> -</span><span id="to_identifier-4192"><a href="#to_identifier-4192"><span class="linenos">4192</span></a><span class="sd"> name: The name to turn into an identifier.</span> -</span><span id="to_identifier-4193"><a href="#to_identifier-4193"><span class="linenos">4193</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> -</span><span id="to_identifier-4194"><a href="#to_identifier-4194"><span class="linenos">4194</span></a> -</span><span id="to_identifier-4195"><a href="#to_identifier-4195"><span class="linenos">4195</span></a><span class="sd"> Returns:</span> -</span><span id="to_identifier-4196"><a href="#to_identifier-4196"><span class="linenos">4196</span></a><span class="sd"> The identifier ast node.</span> -</span><span id="to_identifier-4197"><a href="#to_identifier-4197"><span class="linenos">4197</span></a><span class="sd"> """</span> -</span><span id="to_identifier-4198"><a href="#to_identifier-4198"><span class="linenos">4198</span></a> -</span><span id="to_identifier-4199"><a href="#to_identifier-4199"><span class="linenos">4199</span></a> <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="to_identifier-4200"><a href="#to_identifier-4200"><span class="linenos">4200</span></a> <span class="k">return</span> <span class="kc">None</span> -</span><span id="to_identifier-4201"><a href="#to_identifier-4201"><span class="linenos">4201</span></a> -</span><span id="to_identifier-4202"><a href="#to_identifier-4202"><span class="linenos">4202</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Identifier</span><span class="p">):</span> -</span><span id="to_identifier-4203"><a href="#to_identifier-4203"><span class="linenos">4203</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">name</span> -</span><span id="to_identifier-4204"><a href="#to_identifier-4204"><span class="linenos">4204</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="to_identifier-4205"><a href="#to_identifier-4205"><span class="linenos">4205</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> -</span><span id="to_identifier-4206"><a href="#to_identifier-4206"><span class="linenos">4206</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> -</span><span id="to_identifier-4207"><a href="#to_identifier-4207"><span class="linenos">4207</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">SAFE_IDENTIFIER_RE</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">quoted</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">quoted</span><span class="p">,</span> -</span><span id="to_identifier-4208"><a href="#to_identifier-4208"><span class="linenos">4208</span></a> <span class="p">)</span> -</span><span id="to_identifier-4209"><a href="#to_identifier-4209"><span class="linenos">4209</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="to_identifier-4210"><a href="#to_identifier-4210"><span class="linenos">4210</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Name needs to be a string or an Identifier, got: </span><span class="si">{</span><span class="n">name</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="to_identifier-4211"><a href="#to_identifier-4211"><span class="linenos">4211</span></a> <span class="k">return</span> <span class="n">identifier</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_identifier-4246"><a href="#to_identifier-4246"><span class="linenos">4246</span></a><span class="k">def</span> <span class="nf">to_identifier</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +</span><span id="to_identifier-4247"><a href="#to_identifier-4247"><span class="linenos">4247</span></a><span class="w"> </span><span class="sd">"""Builds an identifier.</span> +</span><span id="to_identifier-4248"><a href="#to_identifier-4248"><span class="linenos">4248</span></a> +</span><span id="to_identifier-4249"><a href="#to_identifier-4249"><span class="linenos">4249</span></a><span class="sd"> Args:</span> +</span><span id="to_identifier-4250"><a href="#to_identifier-4250"><span class="linenos">4250</span></a><span class="sd"> name: The name to turn into an identifier.</span> +</span><span id="to_identifier-4251"><a href="#to_identifier-4251"><span class="linenos">4251</span></a><span class="sd"> quoted: Whether or not force quote the identifier.</span> +</span><span id="to_identifier-4252"><a href="#to_identifier-4252"><span class="linenos">4252</span></a> +</span><span id="to_identifier-4253"><a href="#to_identifier-4253"><span class="linenos">4253</span></a><span class="sd"> Returns:</span> +</span><span id="to_identifier-4254"><a href="#to_identifier-4254"><span class="linenos">4254</span></a><span class="sd"> The identifier ast node.</span> +</span><span id="to_identifier-4255"><a href="#to_identifier-4255"><span class="linenos">4255</span></a><span class="sd"> """</span> +</span><span id="to_identifier-4256"><a href="#to_identifier-4256"><span class="linenos">4256</span></a> +</span><span id="to_identifier-4257"><a href="#to_identifier-4257"><span class="linenos">4257</span></a> <span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="to_identifier-4258"><a href="#to_identifier-4258"><span class="linenos">4258</span></a> <span class="k">return</span> <span class="kc">None</span> +</span><span id="to_identifier-4259"><a href="#to_identifier-4259"><span class="linenos">4259</span></a> +</span><span id="to_identifier-4260"><a href="#to_identifier-4260"><span class="linenos">4260</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Identifier</span><span class="p">):</span> +</span><span id="to_identifier-4261"><a href="#to_identifier-4261"><span class="linenos">4261</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">name</span> +</span><span id="to_identifier-4262"><a href="#to_identifier-4262"><span class="linenos">4262</span></a> <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="to_identifier-4263"><a href="#to_identifier-4263"><span class="linenos">4263</span></a> <span class="n">identifier</span> <span class="o">=</span> <span class="n">Identifier</span><span class="p">(</span> +</span><span id="to_identifier-4264"><a href="#to_identifier-4264"><span class="linenos">4264</span></a> <span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> +</span><span id="to_identifier-4265"><a href="#to_identifier-4265"><span class="linenos">4265</span></a> <span class="n">quoted</span><span class="o">=</span><span class="ow">not</span> <span class="n">re</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">SAFE_IDENTIFIER_RE</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span> <span class="k">if</span> <span class="n">quoted</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">quoted</span><span class="p">,</span> +</span><span id="to_identifier-4266"><a href="#to_identifier-4266"><span class="linenos">4266</span></a> <span class="p">)</span> +</span><span id="to_identifier-4267"><a href="#to_identifier-4267"><span class="linenos">4267</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="to_identifier-4268"><a href="#to_identifier-4268"><span class="linenos">4268</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Name needs to be a string or an Identifier, got: </span><span class="si">{</span><span class="n">name</span><span class="o">.</span><span class="vm">__class__</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="to_identifier-4269"><a href="#to_identifier-4269"><span class="linenos">4269</span></a> <span class="k">return</span> <span class="n">identifier</span> </span></pre></div> @@ -39534,23 +40416,23 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#to_interval"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="to_interval-4217"><a href="#to_interval-4217"><span class="linenos">4217</span></a><span class="k">def</span> <span class="nf">to_interval</span><span class="p">(</span><span class="n">interval</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Literal</span><span class="p">)</span> <span class="o">-></span> <span class="n">Interval</span><span class="p">:</span> -</span><span id="to_interval-4218"><a href="#to_interval-4218"><span class="linenos">4218</span></a><span class="w"> </span><span class="sd">"""Builds an interval expression from a string like '1 day' or '5 months'."""</span> -</span><span id="to_interval-4219"><a href="#to_interval-4219"><span class="linenos">4219</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">interval</span><span class="p">,</span> <span class="n">Literal</span><span class="p">):</span> -</span><span id="to_interval-4220"><a href="#to_interval-4220"><span class="linenos">4220</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval</span><span class="o">.</span><span class="n">is_string</span><span class="p">:</span> -</span><span id="to_interval-4221"><a href="#to_interval-4221"><span class="linenos">4221</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> -</span><span id="to_interval-4222"><a href="#to_interval-4222"><span class="linenos">4222</span></a> -</span><span id="to_interval-4223"><a href="#to_interval-4223"><span class="linenos">4223</span></a> <span class="n">interval</span> <span class="o">=</span> <span class="n">interval</span><span class="o">.</span><span class="n">this</span> -</span><span id="to_interval-4224"><a href="#to_interval-4224"><span class="linenos">4224</span></a> -</span><span id="to_interval-4225"><a href="#to_interval-4225"><span class="linenos">4225</span></a> <span class="n">interval_parts</span> <span class="o">=</span> <span class="n">INTERVAL_STRING_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span> <span class="c1"># type: ignore</span> -</span><span id="to_interval-4226"><a href="#to_interval-4226"><span class="linenos">4226</span></a> -</span><span id="to_interval-4227"><a href="#to_interval-4227"><span class="linenos">4227</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval_parts</span><span class="p">:</span> -</span><span id="to_interval-4228"><a href="#to_interval-4228"><span class="linenos">4228</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> -</span><span id="to_interval-4229"><a href="#to_interval-4229"><span class="linenos">4229</span></a> -</span><span id="to_interval-4230"><a href="#to_interval-4230"><span class="linenos">4230</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> -</span><span id="to_interval-4231"><a href="#to_interval-4231"><span class="linenos">4231</span></a> <span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span> -</span><span id="to_interval-4232"><a href="#to_interval-4232"><span class="linenos">4232</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> -</span><span id="to_interval-4233"><a href="#to_interval-4233"><span class="linenos">4233</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_interval-4275"><a href="#to_interval-4275"><span class="linenos">4275</span></a><span class="k">def</span> <span class="nf">to_interval</span><span class="p">(</span><span class="n">interval</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Literal</span><span class="p">)</span> <span class="o">-></span> <span class="n">Interval</span><span class="p">:</span> +</span><span id="to_interval-4276"><a href="#to_interval-4276"><span class="linenos">4276</span></a><span class="w"> </span><span class="sd">"""Builds an interval expression from a string like '1 day' or '5 months'."""</span> +</span><span id="to_interval-4277"><a href="#to_interval-4277"><span class="linenos">4277</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">interval</span><span class="p">,</span> <span class="n">Literal</span><span class="p">):</span> +</span><span id="to_interval-4278"><a href="#to_interval-4278"><span class="linenos">4278</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval</span><span class="o">.</span><span class="n">is_string</span><span class="p">:</span> +</span><span id="to_interval-4279"><a href="#to_interval-4279"><span class="linenos">4279</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> +</span><span id="to_interval-4280"><a href="#to_interval-4280"><span class="linenos">4280</span></a> +</span><span id="to_interval-4281"><a href="#to_interval-4281"><span class="linenos">4281</span></a> <span class="n">interval</span> <span class="o">=</span> <span class="n">interval</span><span class="o">.</span><span class="n">this</span> +</span><span id="to_interval-4282"><a href="#to_interval-4282"><span class="linenos">4282</span></a> +</span><span id="to_interval-4283"><a href="#to_interval-4283"><span class="linenos">4283</span></a> <span class="n">interval_parts</span> <span class="o">=</span> <span class="n">INTERVAL_STRING_RE</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">interval</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="to_interval-4284"><a href="#to_interval-4284"><span class="linenos">4284</span></a> +</span><span id="to_interval-4285"><a href="#to_interval-4285"><span class="linenos">4285</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">interval_parts</span><span class="p">:</span> +</span><span id="to_interval-4286"><a href="#to_interval-4286"><span class="linenos">4286</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Invalid interval string."</span><span class="p">)</span> +</span><span id="to_interval-4287"><a href="#to_interval-4287"><span class="linenos">4287</span></a> +</span><span id="to_interval-4288"><a href="#to_interval-4288"><span class="linenos">4288</span></a> <span class="k">return</span> <span class="n">Interval</span><span class="p">(</span> +</span><span id="to_interval-4289"><a href="#to_interval-4289"><span class="linenos">4289</span></a> <span class="n">this</span><span class="o">=</span><span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span> +</span><span id="to_interval-4290"><a href="#to_interval-4290"><span class="linenos">4290</span></a> <span class="n">unit</span><span class="o">=</span><span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">interval_parts</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">)),</span> +</span><span id="to_interval-4291"><a href="#to_interval-4291"><span class="linenos">4291</span></a> <span class="p">)</span> </span></pre></div> @@ -39570,24 +40452,24 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#to_table"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="to_table-4246"><a href="#to_table-4246"><span class="linenos">4246</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Table</span><span class="p">]:</span> -</span><span id="to_table-4247"><a href="#to_table-4247"><span class="linenos">4247</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="to_table-4248"><a href="#to_table-4248"><span class="linenos">4248</span></a><span class="sd"> Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.</span> -</span><span id="to_table-4249"><a href="#to_table-4249"><span class="linenos">4249</span></a><span class="sd"> If a table is passed in then that table is returned.</span> -</span><span id="to_table-4250"><a href="#to_table-4250"><span class="linenos">4250</span></a> -</span><span id="to_table-4251"><a href="#to_table-4251"><span class="linenos">4251</span></a><span class="sd"> Args:</span> -</span><span id="to_table-4252"><a href="#to_table-4252"><span class="linenos">4252</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> -</span><span id="to_table-4253"><a href="#to_table-4253"><span class="linenos">4253</span></a> -</span><span id="to_table-4254"><a href="#to_table-4254"><span class="linenos">4254</span></a><span class="sd"> Returns:</span> -</span><span id="to_table-4255"><a href="#to_table-4255"><span class="linenos">4255</span></a><span class="sd"> A table expression.</span> -</span><span id="to_table-4256"><a href="#to_table-4256"><span class="linenos">4256</span></a><span class="sd"> """</span> -</span><span id="to_table-4257"><a href="#to_table-4257"><span class="linenos">4257</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="to_table-4258"><a href="#to_table-4258"><span class="linenos">4258</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="to_table-4259"><a href="#to_table-4259"><span class="linenos">4259</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="to_table-4260"><a href="#to_table-4260"><span class="linenos">4260</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for a table: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="to_table-4261"><a href="#to_table-4261"><span class="linenos">4261</span></a> -</span><span id="to_table-4262"><a href="#to_table-4262"><span class="linenos">4262</span></a> <span class="n">catalog</span><span class="p">,</span> <span class="n">db</span><span class="p">,</span> <span class="n">table_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> -</span><span id="to_table-4263"><a href="#to_table-4263"><span class="linenos">4263</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="n">catalog</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_table-4304"><a href="#to_table-4304"><span class="linenos">4304</span></a><span class="k">def</span> <span class="nf">to_table</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">Table</span><span class="p">]:</span> +</span><span id="to_table-4305"><a href="#to_table-4305"><span class="linenos">4305</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="to_table-4306"><a href="#to_table-4306"><span class="linenos">4306</span></a><span class="sd"> Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.</span> +</span><span id="to_table-4307"><a href="#to_table-4307"><span class="linenos">4307</span></a><span class="sd"> If a table is passed in then that table is returned.</span> +</span><span id="to_table-4308"><a href="#to_table-4308"><span class="linenos">4308</span></a> +</span><span id="to_table-4309"><a href="#to_table-4309"><span class="linenos">4309</span></a><span class="sd"> Args:</span> +</span><span id="to_table-4310"><a href="#to_table-4310"><span class="linenos">4310</span></a><span class="sd"> sql_path: a `[catalog].[schema].[table]` string.</span> +</span><span id="to_table-4311"><a href="#to_table-4311"><span class="linenos">4311</span></a> +</span><span id="to_table-4312"><a href="#to_table-4312"><span class="linenos">4312</span></a><span class="sd"> Returns:</span> +</span><span id="to_table-4313"><a href="#to_table-4313"><span class="linenos">4313</span></a><span class="sd"> A table expression.</span> +</span><span id="to_table-4314"><a href="#to_table-4314"><span class="linenos">4314</span></a><span class="sd"> """</span> +</span><span id="to_table-4315"><a href="#to_table-4315"><span class="linenos">4315</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="to_table-4316"><a href="#to_table-4316"><span class="linenos">4316</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="to_table-4317"><a href="#to_table-4317"><span class="linenos">4317</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="to_table-4318"><a href="#to_table-4318"><span class="linenos">4318</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for a table: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="to_table-4319"><a href="#to_table-4319"><span class="linenos">4319</span></a> +</span><span id="to_table-4320"><a href="#to_table-4320"><span class="linenos">4320</span></a> <span class="n">catalog</span><span class="p">,</span> <span class="n">db</span><span class="p">,</span> <span class="n">table_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> +</span><span id="to_table-4321"><a href="#to_table-4321"><span class="linenos">4321</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="n">db</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="n">catalog</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> </span></pre></div> @@ -39620,23 +40502,23 @@ If a table is passed in then that table is returned.</p> </div> <a class="headerlink" href="#to_column"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="to_column-4266"><a href="#to_column-4266"><span class="linenos">4266</span></a><span class="k">def</span> <span class="nf">to_column</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Column</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="to_column-4267"><a href="#to_column-4267"><span class="linenos">4267</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="to_column-4268"><a href="#to_column-4268"><span class="linenos">4268</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> -</span><span id="to_column-4269"><a href="#to_column-4269"><span class="linenos">4269</span></a> -</span><span id="to_column-4270"><a href="#to_column-4270"><span class="linenos">4270</span></a><span class="sd"> If a column is passed in then that column is returned.</span> -</span><span id="to_column-4271"><a href="#to_column-4271"><span class="linenos">4271</span></a> -</span><span id="to_column-4272"><a href="#to_column-4272"><span class="linenos">4272</span></a><span class="sd"> Args:</span> -</span><span id="to_column-4273"><a href="#to_column-4273"><span class="linenos">4273</span></a><span class="sd"> sql_path: `[table].[column]` string</span> -</span><span id="to_column-4274"><a href="#to_column-4274"><span class="linenos">4274</span></a><span class="sd"> Returns:</span> -</span><span id="to_column-4275"><a href="#to_column-4275"><span class="linenos">4275</span></a><span class="sd"> Table: A column expression</span> -</span><span id="to_column-4276"><a href="#to_column-4276"><span class="linenos">4276</span></a><span class="sd"> """</span> -</span><span id="to_column-4277"><a href="#to_column-4277"><span class="linenos">4277</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> -</span><span id="to_column-4278"><a href="#to_column-4278"><span class="linenos">4278</span></a> <span class="k">return</span> <span class="n">sql_path</span> -</span><span id="to_column-4279"><a href="#to_column-4279"><span class="linenos">4279</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="to_column-4280"><a href="#to_column-4280"><span class="linenos">4280</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for column: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="to_column-4281"><a href="#to_column-4281"><span class="linenos">4281</span></a> <span class="n">table_name</span><span class="p">,</span> <span class="n">column_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> -</span><span id="to_column-4282"><a href="#to_column-4282"><span class="linenos">4282</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">column_name</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="to_column-4324"><a href="#to_column-4324"><span class="linenos">4324</span></a><span class="k">def</span> <span class="nf">to_column</span><span class="p">(</span><span class="n">sql_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Column</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="to_column-4325"><a href="#to_column-4325"><span class="linenos">4325</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="to_column-4326"><a href="#to_column-4326"><span class="linenos">4326</span></a><span class="sd"> Create a column from a `[table].[column]` sql path. Schema is optional.</span> +</span><span id="to_column-4327"><a href="#to_column-4327"><span class="linenos">4327</span></a> +</span><span id="to_column-4328"><a href="#to_column-4328"><span class="linenos">4328</span></a><span class="sd"> If a column is passed in then that column is returned.</span> +</span><span id="to_column-4329"><a href="#to_column-4329"><span class="linenos">4329</span></a> +</span><span id="to_column-4330"><a href="#to_column-4330"><span class="linenos">4330</span></a><span class="sd"> Args:</span> +</span><span id="to_column-4331"><a href="#to_column-4331"><span class="linenos">4331</span></a><span class="sd"> sql_path: `[table].[column]` string</span> +</span><span id="to_column-4332"><a href="#to_column-4332"><span class="linenos">4332</span></a><span class="sd"> Returns:</span> +</span><span id="to_column-4333"><a href="#to_column-4333"><span class="linenos">4333</span></a><span class="sd"> Table: A column expression</span> +</span><span id="to_column-4334"><a href="#to_column-4334"><span class="linenos">4334</span></a><span class="sd"> """</span> +</span><span id="to_column-4335"><a href="#to_column-4335"><span class="linenos">4335</span></a> <span class="k">if</span> <span class="n">sql_path</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="n">Column</span><span class="p">):</span> +</span><span id="to_column-4336"><a href="#to_column-4336"><span class="linenos">4336</span></a> <span class="k">return</span> <span class="n">sql_path</span> +</span><span id="to_column-4337"><a href="#to_column-4337"><span class="linenos">4337</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="to_column-4338"><a href="#to_column-4338"><span class="linenos">4338</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Invalid type provided for column: </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">sql_path</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="to_column-4339"><a href="#to_column-4339"><span class="linenos">4339</span></a> <span class="n">table_name</span><span class="p">,</span> <span class="n">column_name</span> <span class="o">=</span> <span class="p">(</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">split_num_words</span><span class="p">(</span><span class="n">sql_path</span><span class="p">,</span> <span class="s2">"."</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> +</span><span id="to_column-4340"><a href="#to_column-4340"><span class="linenos">4340</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">column_name</span><span class="p">,</span> <span class="n">table</span><span class="o">=</span><span class="n">table_name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> </span></pre></div> @@ -39670,60 +40552,60 @@ If a table is passed in then that table is returned.</p> </div> <a class="headerlink" href="#alias_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="alias_-4285"><a href="#alias_-4285"><span class="linenos">4285</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> -</span><span id="alias_-4286"><a href="#alias_-4286"><span class="linenos">4286</span></a> <span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> -</span><span id="alias_-4287"><a href="#alias_-4287"><span class="linenos">4287</span></a> <span class="n">alias</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> -</span><span id="alias_-4288"><a href="#alias_-4288"><span class="linenos">4288</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> -</span><span id="alias_-4289"><a href="#alias_-4289"><span class="linenos">4289</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="alias_-4290"><a href="#alias_-4290"><span class="linenos">4290</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="alias_-4291"><a href="#alias_-4291"><span class="linenos">4291</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> -</span><span id="alias_-4292"><a href="#alias_-4292"><span class="linenos">4292</span></a><span class="p">):</span> -</span><span id="alias_-4293"><a href="#alias_-4293"><span class="linenos">4293</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> -</span><span id="alias_-4294"><a href="#alias_-4294"><span class="linenos">4294</span></a> -</span><span id="alias_-4295"><a href="#alias_-4295"><span class="linenos">4295</span></a><span class="sd"> Example:</span> -</span><span id="alias_-4296"><a href="#alias_-4296"><span class="linenos">4296</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> -</span><span id="alias_-4297"><a href="#alias_-4297"><span class="linenos">4297</span></a><span class="sd"> 'foo AS bar'</span> -</span><span id="alias_-4298"><a href="#alias_-4298"><span class="linenos">4298</span></a> -</span><span id="alias_-4299"><a href="#alias_-4299"><span class="linenos">4299</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> -</span><span id="alias_-4300"><a href="#alias_-4300"><span class="linenos">4300</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> -</span><span id="alias_-4301"><a href="#alias_-4301"><span class="linenos">4301</span></a> -</span><span id="alias_-4302"><a href="#alias_-4302"><span class="linenos">4302</span></a><span class="sd"> Args:</span> -</span><span id="alias_-4303"><a href="#alias_-4303"><span class="linenos">4303</span></a><span class="sd"> expression: the SQL code strings to parse.</span> -</span><span id="alias_-4304"><a href="#alias_-4304"><span class="linenos">4304</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="alias_-4305"><a href="#alias_-4305"><span class="linenos">4305</span></a><span class="sd"> alias: the alias name to use. If the name has</span> -</span><span id="alias_-4306"><a href="#alias_-4306"><span class="linenos">4306</span></a><span class="sd"> special characters it is quoted.</span> -</span><span id="alias_-4307"><a href="#alias_-4307"><span class="linenos">4307</span></a><span class="sd"> table: Whether or not to create a table alias, can also be a list of columns.</span> -</span><span id="alias_-4308"><a href="#alias_-4308"><span class="linenos">4308</span></a><span class="sd"> quoted: whether or not to quote the alias</span> -</span><span id="alias_-4309"><a href="#alias_-4309"><span class="linenos">4309</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> -</span><span id="alias_-4310"><a href="#alias_-4310"><span class="linenos">4310</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="alias_-4311"><a href="#alias_-4311"><span class="linenos">4311</span></a> -</span><span id="alias_-4312"><a href="#alias_-4312"><span class="linenos">4312</span></a><span class="sd"> Returns:</span> -</span><span id="alias_-4313"><a href="#alias_-4313"><span class="linenos">4313</span></a><span class="sd"> Alias: the aliased expression</span> -</span><span id="alias_-4314"><a href="#alias_-4314"><span class="linenos">4314</span></a><span class="sd"> """</span> -</span><span id="alias_-4315"><a href="#alias_-4315"><span class="linenos">4315</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="alias_-4316"><a href="#alias_-4316"><span class="linenos">4316</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">)</span> -</span><span id="alias_-4317"><a href="#alias_-4317"><span class="linenos">4317</span></a> -</span><span id="alias_-4318"><a href="#alias_-4318"><span class="linenos">4318</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> -</span><span id="alias_-4319"><a href="#alias_-4319"><span class="linenos">4319</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> -</span><span id="alias_-4320"><a href="#alias_-4320"><span class="linenos">4320</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">table_alias</span><span class="p">)</span> -</span><span id="alias_-4321"><a href="#alias_-4321"><span class="linenos">4321</span></a> -</span><span id="alias_-4322"><a href="#alias_-4322"><span class="linenos">4322</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> -</span><span id="alias_-4323"><a href="#alias_-4323"><span class="linenos">4323</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">table</span><span class="p">:</span> -</span><span id="alias_-4324"><a href="#alias_-4324"><span class="linenos">4324</span></a> <span class="n">table_alias</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">,</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">column</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">))</span> -</span><span id="alias_-4325"><a href="#alias_-4325"><span class="linenos">4325</span></a> -</span><span id="alias_-4326"><a href="#alias_-4326"><span class="linenos">4326</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="alias_-4327"><a href="#alias_-4327"><span class="linenos">4327</span></a> -</span><span id="alias_-4328"><a href="#alias_-4328"><span class="linenos">4328</span></a> <span class="c1"># We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in</span> -</span><span id="alias_-4329"><a href="#alias_-4329"><span class="linenos">4329</span></a> <span class="c1"># the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node</span> -</span><span id="alias_-4330"><a href="#alias_-4330"><span class="linenos">4330</span></a> <span class="c1"># for the complete Window expression.</span> -</span><span id="alias_-4331"><a href="#alias_-4331"><span class="linenos">4331</span></a> <span class="c1">#</span> -</span><span id="alias_-4332"><a href="#alias_-4332"><span class="linenos">4332</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> -</span><span id="alias_-4333"><a href="#alias_-4333"><span class="linenos">4333</span></a> -</span><span id="alias_-4334"><a href="#alias_-4334"><span class="linenos">4334</span></a> <span class="k">if</span> <span class="s2">"alias"</span> <span class="ow">in</span> <span class="n">exp</span><span class="o">.</span><span class="n">arg_types</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">exp</span><span class="p">,</span> <span class="n">Window</span><span class="p">):</span> -</span><span id="alias_-4335"><a href="#alias_-4335"><span class="linenos">4335</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">exp</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> -</span><span id="alias_-4336"><a href="#alias_-4336"><span class="linenos">4336</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">alias</span><span class="p">)</span> -</span><span id="alias_-4337"><a href="#alias_-4337"><span class="linenos">4337</span></a> <span class="k">return</span> <span class="n">exp</span> -</span><span id="alias_-4338"><a href="#alias_-4338"><span class="linenos">4338</span></a> <span class="k">return</span> <span class="n">Alias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="alias_-4343"><a href="#alias_-4343"><span class="linenos">4343</span></a><span class="k">def</span> <span class="nf">alias_</span><span class="p">(</span> +</span><span id="alias_-4344"><a href="#alias_-4344"><span class="linenos">4344</span></a> <span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> +</span><span id="alias_-4345"><a href="#alias_-4345"><span class="linenos">4345</span></a> <span class="n">alias</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> +</span><span id="alias_-4346"><a href="#alias_-4346"><span class="linenos">4346</span></a> <span class="n">table</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Sequence</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span> +</span><span id="alias_-4347"><a href="#alias_-4347"><span class="linenos">4347</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="alias_-4348"><a href="#alias_-4348"><span class="linenos">4348</span></a> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="alias_-4349"><a href="#alias_-4349"><span class="linenos">4349</span></a> <span class="o">**</span><span class="n">opts</span><span class="p">,</span> +</span><span id="alias_-4350"><a href="#alias_-4350"><span class="linenos">4350</span></a><span class="p">):</span> +</span><span id="alias_-4351"><a href="#alias_-4351"><span class="linenos">4351</span></a><span class="w"> </span><span class="sd">"""Create an Alias expression.</span> +</span><span id="alias_-4352"><a href="#alias_-4352"><span class="linenos">4352</span></a> +</span><span id="alias_-4353"><a href="#alias_-4353"><span class="linenos">4353</span></a><span class="sd"> Example:</span> +</span><span id="alias_-4354"><a href="#alias_-4354"><span class="linenos">4354</span></a><span class="sd"> >>> alias_('foo', 'bar').sql()</span> +</span><span id="alias_-4355"><a href="#alias_-4355"><span class="linenos">4355</span></a><span class="sd"> 'foo AS bar'</span> +</span><span id="alias_-4356"><a href="#alias_-4356"><span class="linenos">4356</span></a> +</span><span id="alias_-4357"><a href="#alias_-4357"><span class="linenos">4357</span></a><span class="sd"> >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()</span> +</span><span id="alias_-4358"><a href="#alias_-4358"><span class="linenos">4358</span></a><span class="sd"> '(SELECT 1, 2) AS bar(a, b)'</span> +</span><span id="alias_-4359"><a href="#alias_-4359"><span class="linenos">4359</span></a> +</span><span id="alias_-4360"><a href="#alias_-4360"><span class="linenos">4360</span></a><span class="sd"> Args:</span> +</span><span id="alias_-4361"><a href="#alias_-4361"><span class="linenos">4361</span></a><span class="sd"> expression: the SQL code strings to parse.</span> +</span><span id="alias_-4362"><a href="#alias_-4362"><span class="linenos">4362</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="alias_-4363"><a href="#alias_-4363"><span class="linenos">4363</span></a><span class="sd"> alias: the alias name to use. If the name has</span> +</span><span id="alias_-4364"><a href="#alias_-4364"><span class="linenos">4364</span></a><span class="sd"> special characters it is quoted.</span> +</span><span id="alias_-4365"><a href="#alias_-4365"><span class="linenos">4365</span></a><span class="sd"> table: Whether or not to create a table alias, can also be a list of columns.</span> +</span><span id="alias_-4366"><a href="#alias_-4366"><span class="linenos">4366</span></a><span class="sd"> quoted: whether or not to quote the alias</span> +</span><span id="alias_-4367"><a href="#alias_-4367"><span class="linenos">4367</span></a><span class="sd"> dialect: the dialect used to parse the input expression.</span> +</span><span id="alias_-4368"><a href="#alias_-4368"><span class="linenos">4368</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="alias_-4369"><a href="#alias_-4369"><span class="linenos">4369</span></a> +</span><span id="alias_-4370"><a href="#alias_-4370"><span class="linenos">4370</span></a><span class="sd"> Returns:</span> +</span><span id="alias_-4371"><a href="#alias_-4371"><span class="linenos">4371</span></a><span class="sd"> Alias: the aliased expression</span> +</span><span id="alias_-4372"><a href="#alias_-4372"><span class="linenos">4372</span></a><span class="sd"> """</span> +</span><span id="alias_-4373"><a href="#alias_-4373"><span class="linenos">4373</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="alias_-4374"><a href="#alias_-4374"><span class="linenos">4374</span></a> <span class="n">alias</span> <span class="o">=</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">)</span> +</span><span id="alias_-4375"><a href="#alias_-4375"><span class="linenos">4375</span></a> +</span><span id="alias_-4376"><a href="#alias_-4376"><span class="linenos">4376</span></a> <span class="k">if</span> <span class="n">table</span><span class="p">:</span> +</span><span id="alias_-4377"><a href="#alias_-4377"><span class="linenos">4377</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> +</span><span id="alias_-4378"><a href="#alias_-4378"><span class="linenos">4378</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">table_alias</span><span class="p">)</span> +</span><span id="alias_-4379"><a href="#alias_-4379"><span class="linenos">4379</span></a> +</span><span id="alias_-4380"><a href="#alias_-4380"><span class="linenos">4380</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> +</span><span id="alias_-4381"><a href="#alias_-4381"><span class="linenos">4381</span></a> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">table</span><span class="p">:</span> +</span><span id="alias_-4382"><a href="#alias_-4382"><span class="linenos">4382</span></a> <span class="n">table_alias</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">"columns"</span><span class="p">,</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">column</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">))</span> +</span><span id="alias_-4383"><a href="#alias_-4383"><span class="linenos">4383</span></a> +</span><span id="alias_-4384"><a href="#alias_-4384"><span class="linenos">4384</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="alias_-4385"><a href="#alias_-4385"><span class="linenos">4385</span></a> +</span><span id="alias_-4386"><a href="#alias_-4386"><span class="linenos">4386</span></a> <span class="c1"># We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in</span> +</span><span id="alias_-4387"><a href="#alias_-4387"><span class="linenos">4387</span></a> <span class="c1"># the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node</span> +</span><span id="alias_-4388"><a href="#alias_-4388"><span class="linenos">4388</span></a> <span class="c1"># for the complete Window expression.</span> +</span><span id="alias_-4389"><a href="#alias_-4389"><span class="linenos">4389</span></a> <span class="c1">#</span> +</span><span id="alias_-4390"><a href="#alias_-4390"><span class="linenos">4390</span></a> <span class="c1"># [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls</span> +</span><span id="alias_-4391"><a href="#alias_-4391"><span class="linenos">4391</span></a> +</span><span id="alias_-4392"><a href="#alias_-4392"><span class="linenos">4392</span></a> <span class="k">if</span> <span class="s2">"alias"</span> <span class="ow">in</span> <span class="n">exp</span><span class="o">.</span><span class="n">arg_types</span> <span class="ow">and</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">exp</span><span class="p">,</span> <span class="n">Window</span><span class="p">):</span> +</span><span id="alias_-4393"><a href="#alias_-4393"><span class="linenos">4393</span></a> <span class="n">exp</span> <span class="o">=</span> <span class="n">exp</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span> +</span><span id="alias_-4394"><a href="#alias_-4394"><span class="linenos">4394</span></a> <span class="n">exp</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">"alias"</span><span class="p">,</span> <span class="n">alias</span><span class="p">)</span> +</span><span id="alias_-4395"><a href="#alias_-4395"><span class="linenos">4395</span></a> <span class="k">return</span> <span class="n">exp</span> +</span><span id="alias_-4396"><a href="#alias_-4396"><span class="linenos">4396</span></a> <span class="k">return</span> <span class="n">Alias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">exp</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="n">alias</span><span class="p">)</span> </span></pre></div> @@ -39778,27 +40660,27 @@ special characters it is quoted.</li> </div> <a class="headerlink" href="#subquery"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="subquery-4341"><a href="#subquery-4341"><span class="linenos">4341</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> -</span><span id="subquery-4342"><a href="#subquery-4342"><span class="linenos">4342</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="subquery-4343"><a href="#subquery-4343"><span class="linenos">4343</span></a><span class="sd"> Build a subquery expression.</span> -</span><span id="subquery-4344"><a href="#subquery-4344"><span class="linenos">4344</span></a> -</span><span id="subquery-4345"><a href="#subquery-4345"><span class="linenos">4345</span></a><span class="sd"> Example:</span> -</span><span id="subquery-4346"><a href="#subquery-4346"><span class="linenos">4346</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> -</span><span id="subquery-4347"><a href="#subquery-4347"><span class="linenos">4347</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> -</span><span id="subquery-4348"><a href="#subquery-4348"><span class="linenos">4348</span></a> -</span><span id="subquery-4349"><a href="#subquery-4349"><span class="linenos">4349</span></a><span class="sd"> Args:</span> -</span><span id="subquery-4350"><a href="#subquery-4350"><span class="linenos">4350</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> -</span><span id="subquery-4351"><a href="#subquery-4351"><span class="linenos">4351</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> -</span><span id="subquery-4352"><a href="#subquery-4352"><span class="linenos">4352</span></a><span class="sd"> alias (str | Expression): the alias name to use.</span> -</span><span id="subquery-4353"><a href="#subquery-4353"><span class="linenos">4353</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> -</span><span id="subquery-4354"><a href="#subquery-4354"><span class="linenos">4354</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> -</span><span id="subquery-4355"><a href="#subquery-4355"><span class="linenos">4355</span></a> -</span><span id="subquery-4356"><a href="#subquery-4356"><span class="linenos">4356</span></a><span class="sd"> Returns:</span> -</span><span id="subquery-4357"><a href="#subquery-4357"><span class="linenos">4357</span></a><span class="sd"> Select: a new select with the subquery expression included</span> -</span><span id="subquery-4358"><a href="#subquery-4358"><span class="linenos">4358</span></a><span class="sd"> """</span> -</span><span id="subquery-4359"><a href="#subquery-4359"><span class="linenos">4359</span></a> -</span><span id="subquery-4360"><a href="#subquery-4360"><span class="linenos">4360</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> -</span><span id="subquery-4361"><a href="#subquery-4361"><span class="linenos">4361</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="subquery-4399"><a href="#subquery-4399"><span class="linenos">4399</span></a><span class="k">def</span> <span class="nf">subquery</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">):</span> +</span><span id="subquery-4400"><a href="#subquery-4400"><span class="linenos">4400</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="subquery-4401"><a href="#subquery-4401"><span class="linenos">4401</span></a><span class="sd"> Build a subquery expression.</span> +</span><span id="subquery-4402"><a href="#subquery-4402"><span class="linenos">4402</span></a> +</span><span id="subquery-4403"><a href="#subquery-4403"><span class="linenos">4403</span></a><span class="sd"> Example:</span> +</span><span id="subquery-4404"><a href="#subquery-4404"><span class="linenos">4404</span></a><span class="sd"> >>> subquery('select x from tbl', 'bar').select('x').sql()</span> +</span><span id="subquery-4405"><a href="#subquery-4405"><span class="linenos">4405</span></a><span class="sd"> 'SELECT x FROM (SELECT x FROM tbl) AS bar'</span> +</span><span id="subquery-4406"><a href="#subquery-4406"><span class="linenos">4406</span></a> +</span><span id="subquery-4407"><a href="#subquery-4407"><span class="linenos">4407</span></a><span class="sd"> Args:</span> +</span><span id="subquery-4408"><a href="#subquery-4408"><span class="linenos">4408</span></a><span class="sd"> expression (str | Expression): the SQL code strings to parse.</span> +</span><span id="subquery-4409"><a href="#subquery-4409"><span class="linenos">4409</span></a><span class="sd"> If an Expression instance is passed, this is used as-is.</span> +</span><span id="subquery-4410"><a href="#subquery-4410"><span class="linenos">4410</span></a><span class="sd"> alias (str | Expression): the alias name to use.</span> +</span><span id="subquery-4411"><a href="#subquery-4411"><span class="linenos">4411</span></a><span class="sd"> dialect (str): the dialect used to parse the input expression.</span> +</span><span id="subquery-4412"><a href="#subquery-4412"><span class="linenos">4412</span></a><span class="sd"> **opts: other options to use to parse the input expressions.</span> +</span><span id="subquery-4413"><a href="#subquery-4413"><span class="linenos">4413</span></a> +</span><span id="subquery-4414"><a href="#subquery-4414"><span class="linenos">4414</span></a><span class="sd"> Returns:</span> +</span><span id="subquery-4415"><a href="#subquery-4415"><span class="linenos">4415</span></a><span class="sd"> Select: a new select with the subquery expression included</span> +</span><span id="subquery-4416"><a href="#subquery-4416"><span class="linenos">4416</span></a><span class="sd"> """</span> +</span><span id="subquery-4417"><a href="#subquery-4417"><span class="linenos">4417</span></a> +</span><span id="subquery-4418"><a href="#subquery-4418"><span class="linenos">4418</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> +</span><span id="subquery-4419"><a href="#subquery-4419"><span class="linenos">4419</span></a> <span class="k">return</span> <span class="n">Select</span><span class="p">()</span><span class="o">.</span><span class="n">from_</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">dialect</span><span class="o">=</span><span class="n">dialect</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> </span></pre></div> @@ -39844,28 +40726,28 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#column"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="column-4364"><a href="#column-4364"><span class="linenos">4364</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> -</span><span id="column-4365"><a href="#column-4365"><span class="linenos">4365</span></a> <span class="n">col</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> -</span><span id="column-4366"><a href="#column-4366"><span class="linenos">4366</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="column-4367"><a href="#column-4367"><span class="linenos">4367</span></a> <span class="n">schema</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="column-4368"><a href="#column-4368"><span class="linenos">4368</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="column-4369"><a href="#column-4369"><span class="linenos">4369</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> -</span><span id="column-4370"><a href="#column-4370"><span class="linenos">4370</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="column-4371"><a href="#column-4371"><span class="linenos">4371</span></a><span class="sd"> Build a Column.</span> -</span><span id="column-4372"><a href="#column-4372"><span class="linenos">4372</span></a> -</span><span id="column-4373"><a href="#column-4373"><span class="linenos">4373</span></a><span class="sd"> Args:</span> -</span><span id="column-4374"><a href="#column-4374"><span class="linenos">4374</span></a><span class="sd"> col: column name</span> -</span><span id="column-4375"><a href="#column-4375"><span class="linenos">4375</span></a><span class="sd"> table: table name</span> -</span><span id="column-4376"><a href="#column-4376"><span class="linenos">4376</span></a><span class="sd"> schema: schema name</span> -</span><span id="column-4377"><a href="#column-4377"><span class="linenos">4377</span></a><span class="sd"> quoted: whether or not to force quote each part</span> -</span><span id="column-4378"><a href="#column-4378"><span class="linenos">4378</span></a><span class="sd"> Returns:</span> -</span><span id="column-4379"><a href="#column-4379"><span class="linenos">4379</span></a><span class="sd"> Column: column instance</span> -</span><span id="column-4380"><a href="#column-4380"><span class="linenos">4380</span></a><span class="sd"> """</span> -</span><span id="column-4381"><a href="#column-4381"><span class="linenos">4381</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> -</span><span id="column-4382"><a href="#column-4382"><span class="linenos">4382</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">col</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="column-4383"><a href="#column-4383"><span class="linenos">4383</span></a> <span class="n">table</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="column-4384"><a href="#column-4384"><span class="linenos">4384</span></a> <span class="n">schema</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="column-4385"><a href="#column-4385"><span class="linenos">4385</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="column-4422"><a href="#column-4422"><span class="linenos">4422</span></a><span class="k">def</span> <span class="nf">column</span><span class="p">(</span> +</span><span id="column-4423"><a href="#column-4423"><span class="linenos">4423</span></a> <span class="n">col</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">,</span> +</span><span id="column-4424"><a href="#column-4424"><span class="linenos">4424</span></a> <span class="n">table</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="column-4425"><a href="#column-4425"><span class="linenos">4425</span></a> <span class="n">schema</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Identifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="column-4426"><a href="#column-4426"><span class="linenos">4426</span></a> <span class="n">quoted</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="column-4427"><a href="#column-4427"><span class="linenos">4427</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Column</span><span class="p">:</span> +</span><span id="column-4428"><a href="#column-4428"><span class="linenos">4428</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="column-4429"><a href="#column-4429"><span class="linenos">4429</span></a><span class="sd"> Build a Column.</span> +</span><span id="column-4430"><a href="#column-4430"><span class="linenos">4430</span></a> +</span><span id="column-4431"><a href="#column-4431"><span class="linenos">4431</span></a><span class="sd"> Args:</span> +</span><span id="column-4432"><a href="#column-4432"><span class="linenos">4432</span></a><span class="sd"> col: column name</span> +</span><span id="column-4433"><a href="#column-4433"><span class="linenos">4433</span></a><span class="sd"> table: table name</span> +</span><span id="column-4434"><a href="#column-4434"><span class="linenos">4434</span></a><span class="sd"> schema: schema name</span> +</span><span id="column-4435"><a href="#column-4435"><span class="linenos">4435</span></a><span class="sd"> quoted: whether or not to force quote each part</span> +</span><span id="column-4436"><a href="#column-4436"><span class="linenos">4436</span></a><span class="sd"> Returns:</span> +</span><span id="column-4437"><a href="#column-4437"><span class="linenos">4437</span></a><span class="sd"> Column: column instance</span> +</span><span id="column-4438"><a href="#column-4438"><span class="linenos">4438</span></a><span class="sd"> """</span> +</span><span id="column-4439"><a href="#column-4439"><span class="linenos">4439</span></a> <span class="k">return</span> <span class="n">Column</span><span class="p">(</span> +</span><span id="column-4440"><a href="#column-4440"><span class="linenos">4440</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">col</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="column-4441"><a href="#column-4441"><span class="linenos">4441</span></a> <span class="n">table</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="column-4442"><a href="#column-4442"><span class="linenos">4442</span></a> <span class="n">schema</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">schema</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="column-4443"><a href="#column-4443"><span class="linenos">4443</span></a> <span class="p">)</span> </span></pre></div> @@ -39900,22 +40782,22 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#cast"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="cast-4388"><a href="#cast-4388"><span class="linenos">4388</span></a><span class="k">def</span> <span class="nf">cast</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">to</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Cast</span><span class="p">:</span> -</span><span id="cast-4389"><a href="#cast-4389"><span class="linenos">4389</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> -</span><span id="cast-4390"><a href="#cast-4390"><span class="linenos">4390</span></a> -</span><span id="cast-4391"><a href="#cast-4391"><span class="linenos">4391</span></a><span class="sd"> Example:</span> -</span><span id="cast-4392"><a href="#cast-4392"><span class="linenos">4392</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> -</span><span id="cast-4393"><a href="#cast-4393"><span class="linenos">4393</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> -</span><span id="cast-4394"><a href="#cast-4394"><span class="linenos">4394</span></a> -</span><span id="cast-4395"><a href="#cast-4395"><span class="linenos">4395</span></a><span class="sd"> Args:</span> -</span><span id="cast-4396"><a href="#cast-4396"><span class="linenos">4396</span></a><span class="sd"> expression: The expression to cast.</span> -</span><span id="cast-4397"><a href="#cast-4397"><span class="linenos">4397</span></a><span class="sd"> to: The datatype to cast to.</span> -</span><span id="cast-4398"><a href="#cast-4398"><span class="linenos">4398</span></a> -</span><span id="cast-4399"><a href="#cast-4399"><span class="linenos">4399</span></a><span class="sd"> Returns:</span> -</span><span id="cast-4400"><a href="#cast-4400"><span class="linenos">4400</span></a><span class="sd"> A cast node.</span> -</span><span id="cast-4401"><a href="#cast-4401"><span class="linenos">4401</span></a><span class="sd"> """</span> -</span><span id="cast-4402"><a href="#cast-4402"><span class="linenos">4402</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> -</span><span id="cast-4403"><a href="#cast-4403"><span class="linenos">4403</span></a> <span class="k">return</span> <span class="n">Cast</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">to</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="cast-4446"><a href="#cast-4446"><span class="linenos">4446</span></a><span class="k">def</span> <span class="nf">cast</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">to</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">DataType</span> <span class="o">|</span> <span class="n">DataType</span><span class="o">.</span><span class="n">Type</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> <span class="o">-></span> <span class="n">Cast</span><span class="p">:</span> +</span><span id="cast-4447"><a href="#cast-4447"><span class="linenos">4447</span></a><span class="w"> </span><span class="sd">"""Cast an expression to a data type.</span> +</span><span id="cast-4448"><a href="#cast-4448"><span class="linenos">4448</span></a> +</span><span id="cast-4449"><a href="#cast-4449"><span class="linenos">4449</span></a><span class="sd"> Example:</span> +</span><span id="cast-4450"><a href="#cast-4450"><span class="linenos">4450</span></a><span class="sd"> >>> cast('x + 1', 'int').sql()</span> +</span><span id="cast-4451"><a href="#cast-4451"><span class="linenos">4451</span></a><span class="sd"> 'CAST(x + 1 AS INT)'</span> +</span><span id="cast-4452"><a href="#cast-4452"><span class="linenos">4452</span></a> +</span><span id="cast-4453"><a href="#cast-4453"><span class="linenos">4453</span></a><span class="sd"> Args:</span> +</span><span id="cast-4454"><a href="#cast-4454"><span class="linenos">4454</span></a><span class="sd"> expression: The expression to cast.</span> +</span><span id="cast-4455"><a href="#cast-4455"><span class="linenos">4455</span></a><span class="sd"> to: The datatype to cast to.</span> +</span><span id="cast-4456"><a href="#cast-4456"><span class="linenos">4456</span></a> +</span><span id="cast-4457"><a href="#cast-4457"><span class="linenos">4457</span></a><span class="sd"> Returns:</span> +</span><span id="cast-4458"><a href="#cast-4458"><span class="linenos">4458</span></a><span class="sd"> A cast node.</span> +</span><span id="cast-4459"><a href="#cast-4459"><span class="linenos">4459</span></a><span class="sd"> """</span> +</span><span id="cast-4460"><a href="#cast-4460"><span class="linenos">4460</span></a> <span class="n">expression</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">)</span> +</span><span id="cast-4461"><a href="#cast-4461"><span class="linenos">4461</span></a> <span class="k">return</span> <span class="n">Cast</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">expression</span><span class="p">,</span> <span class="n">to</span><span class="o">=</span><span class="n">DataType</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">to</span><span class="p">,</span> <span class="o">**</span><span class="n">opts</span><span class="p">))</span> </span></pre></div> @@ -39958,23 +40840,23 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#table_"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="table_-4406"><a href="#table_-4406"><span class="linenos">4406</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> -</span><span id="table_-4407"><a href="#table_-4407"><span class="linenos">4407</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> -</span><span id="table_-4408"><a href="#table_-4408"><span class="linenos">4408</span></a> -</span><span id="table_-4409"><a href="#table_-4409"><span class="linenos">4409</span></a><span class="sd"> Args:</span> -</span><span id="table_-4410"><a href="#table_-4410"><span class="linenos">4410</span></a><span class="sd"> table (str | Expression): column name</span> -</span><span id="table_-4411"><a href="#table_-4411"><span class="linenos">4411</span></a><span class="sd"> db (str | Expression): db name</span> -</span><span id="table_-4412"><a href="#table_-4412"><span class="linenos">4412</span></a><span class="sd"> catalog (str | Expression): catalog name</span> -</span><span id="table_-4413"><a href="#table_-4413"><span class="linenos">4413</span></a> -</span><span id="table_-4414"><a href="#table_-4414"><span class="linenos">4414</span></a><span class="sd"> Returns:</span> -</span><span id="table_-4415"><a href="#table_-4415"><span class="linenos">4415</span></a><span class="sd"> Table: table instance</span> -</span><span id="table_-4416"><a href="#table_-4416"><span class="linenos">4416</span></a><span class="sd"> """</span> -</span><span id="table_-4417"><a href="#table_-4417"><span class="linenos">4417</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> -</span><span id="table_-4418"><a href="#table_-4418"><span class="linenos">4418</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="table_-4419"><a href="#table_-4419"><span class="linenos">4419</span></a> <span class="n">db</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="table_-4420"><a href="#table_-4420"><span class="linenos">4420</span></a> <span class="n">catalog</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">catalog</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> -</span><span id="table_-4421"><a href="#table_-4421"><span class="linenos">4421</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">))</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="table_-4422"><a href="#table_-4422"><span class="linenos">4422</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="table_-4464"><a href="#table_-4464"><span class="linenos">4464</span></a><span class="k">def</span> <span class="nf">table_</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">db</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">catalog</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alias</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">Table</span><span class="p">:</span> +</span><span id="table_-4465"><a href="#table_-4465"><span class="linenos">4465</span></a><span class="w"> </span><span class="sd">"""Build a Table.</span> +</span><span id="table_-4466"><a href="#table_-4466"><span class="linenos">4466</span></a> +</span><span id="table_-4467"><a href="#table_-4467"><span class="linenos">4467</span></a><span class="sd"> Args:</span> +</span><span id="table_-4468"><a href="#table_-4468"><span class="linenos">4468</span></a><span class="sd"> table (str | Expression): column name</span> +</span><span id="table_-4469"><a href="#table_-4469"><span class="linenos">4469</span></a><span class="sd"> db (str | Expression): db name</span> +</span><span id="table_-4470"><a href="#table_-4470"><span class="linenos">4470</span></a><span class="sd"> catalog (str | Expression): catalog name</span> +</span><span id="table_-4471"><a href="#table_-4471"><span class="linenos">4471</span></a> +</span><span id="table_-4472"><a href="#table_-4472"><span class="linenos">4472</span></a><span class="sd"> Returns:</span> +</span><span id="table_-4473"><a href="#table_-4473"><span class="linenos">4473</span></a><span class="sd"> Table: table instance</span> +</span><span id="table_-4474"><a href="#table_-4474"><span class="linenos">4474</span></a><span class="sd"> """</span> +</span><span id="table_-4475"><a href="#table_-4475"><span class="linenos">4475</span></a> <span class="k">return</span> <span class="n">Table</span><span class="p">(</span> +</span><span id="table_-4476"><a href="#table_-4476"><span class="linenos">4476</span></a> <span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="table_-4477"><a href="#table_-4477"><span class="linenos">4477</span></a> <span class="n">db</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">db</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="table_-4478"><a href="#table_-4478"><span class="linenos">4478</span></a> <span class="n">catalog</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">catalog</span><span class="p">,</span> <span class="n">quoted</span><span class="o">=</span><span class="n">quoted</span><span class="p">),</span> +</span><span id="table_-4479"><a href="#table_-4479"><span class="linenos">4479</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">))</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="table_-4480"><a href="#table_-4480"><span class="linenos">4480</span></a> <span class="p">)</span> </span></pre></div> @@ -40008,46 +40890,46 @@ If an Expression instance is passed, this is used as-is.</li> </div> <a class="headerlink" href="#values"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="values-4425"><a href="#values-4425"><span class="linenos">4425</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> -</span><span id="values-4426"><a href="#values-4426"><span class="linenos">4426</span></a> <span class="n">values</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="o">...</span><span class="p">]],</span> -</span><span id="values-4427"><a href="#values-4427"><span class="linenos">4427</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="values-4428"><a href="#values-4428"><span class="linenos">4428</span></a> <span class="n">columns</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">DataType</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> -</span><span id="values-4429"><a href="#values-4429"><span class="linenos">4429</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> -</span><span id="values-4430"><a href="#values-4430"><span class="linenos">4430</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> -</span><span id="values-4431"><a href="#values-4431"><span class="linenos">4431</span></a> -</span><span id="values-4432"><a href="#values-4432"><span class="linenos">4432</span></a><span class="sd"> Example:</span> -</span><span id="values-4433"><a href="#values-4433"><span class="linenos">4433</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> -</span><span id="values-4434"><a href="#values-4434"><span class="linenos">4434</span></a><span class="sd"> "VALUES (1, '2')"</span> -</span><span id="values-4435"><a href="#values-4435"><span class="linenos">4435</span></a> -</span><span id="values-4436"><a href="#values-4436"><span class="linenos">4436</span></a><span class="sd"> Args:</span> -</span><span id="values-4437"><a href="#values-4437"><span class="linenos">4437</span></a><span class="sd"> values: values statements that will be converted to SQL</span> -</span><span id="values-4438"><a href="#values-4438"><span class="linenos">4438</span></a><span class="sd"> alias: optional alias</span> -</span><span id="values-4439"><a href="#values-4439"><span class="linenos">4439</span></a><span class="sd"> columns: Optional list of ordered column names or ordered dictionary of column names to types.</span> -</span><span id="values-4440"><a href="#values-4440"><span class="linenos">4440</span></a><span class="sd"> If either are provided then an alias is also required.</span> -</span><span id="values-4441"><a href="#values-4441"><span class="linenos">4441</span></a><span class="sd"> If a dictionary is provided then the first column of the values will be casted to the expected type</span> -</span><span id="values-4442"><a href="#values-4442"><span class="linenos">4442</span></a><span class="sd"> in order to help with type inference.</span> -</span><span id="values-4443"><a href="#values-4443"><span class="linenos">4443</span></a> -</span><span id="values-4444"><a href="#values-4444"><span class="linenos">4444</span></a><span class="sd"> Returns:</span> -</span><span id="values-4445"><a href="#values-4445"><span class="linenos">4445</span></a><span class="sd"> Values: the Values expression object</span> -</span><span id="values-4446"><a href="#values-4446"><span class="linenos">4446</span></a><span class="sd"> """</span> -</span><span id="values-4447"><a href="#values-4447"><span class="linenos">4447</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">alias</span><span class="p">:</span> -</span><span id="values-4448"><a href="#values-4448"><span class="linenos">4448</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Alias is required when providing columns"</span><span class="p">)</span> -</span><span id="values-4449"><a href="#values-4449"><span class="linenos">4449</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="p">(</span> -</span><span id="values-4450"><a href="#values-4450"><span class="linenos">4450</span></a> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">),</span> <span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">columns</span><span class="p">])</span> -</span><span id="values-4451"><a href="#values-4451"><span class="linenos">4451</span></a> <span class="k">if</span> <span class="n">columns</span> -</span><span id="values-4452"><a href="#values-4452"><span class="linenos">4452</span></a> <span class="k">else</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> -</span><span id="values-4453"><a href="#values-4453"><span class="linenos">4453</span></a> <span class="p">)</span> -</span><span id="values-4454"><a href="#values-4454"><span class="linenos">4454</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">tup</span><span class="p">)</span> <span class="k">for</span> <span class="n">tup</span> <span class="ow">in</span> <span class="n">values</span><span class="p">]</span> -</span><span id="values-4455"><a href="#values-4455"><span class="linenos">4455</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">columns</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> -</span><span id="values-4456"><a href="#values-4456"><span class="linenos">4456</span></a> <span class="n">types</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">columns</span><span class="o">.</span><span class="n">values</span><span class="p">())</span> -</span><span id="values-4457"><a href="#values-4457"><span class="linenos">4457</span></a> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> -</span><span id="values-4458"><a href="#values-4458"><span class="linenos">4458</span></a> <span class="s2">"expressions"</span><span class="p">,</span> -</span><span id="values-4459"><a href="#values-4459"><span class="linenos">4459</span></a> <span class="p">[</span><span class="n">cast</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">types</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span><span class="p">)],</span> -</span><span id="values-4460"><a href="#values-4460"><span class="linenos">4460</span></a> <span class="p">)</span> -</span><span id="values-4461"><a href="#values-4461"><span class="linenos">4461</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> -</span><span id="values-4462"><a href="#values-4462"><span class="linenos">4462</span></a> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> -</span><span id="values-4463"><a href="#values-4463"><span class="linenos">4463</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">table_alias</span><span class="p">,</span> -</span><span id="values-4464"><a href="#values-4464"><span class="linenos">4464</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="values-4483"><a href="#values-4483"><span class="linenos">4483</span></a><span class="k">def</span> <span class="nf">values</span><span class="p">(</span> +</span><span id="values-4484"><a href="#values-4484"><span class="linenos">4484</span></a> <span class="n">values</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Tuple</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Any</span><span class="p">,</span> <span class="o">...</span><span class="p">]],</span> +</span><span id="values-4485"><a href="#values-4485"><span class="linenos">4485</span></a> <span class="n">alias</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="values-4486"><a href="#values-4486"><span class="linenos">4486</span></a> <span class="n">columns</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="n">t</span><span class="o">.</span><span class="n">Iterable</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">|</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">DataType</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> +</span><span id="values-4487"><a href="#values-4487"><span class="linenos">4487</span></a><span class="p">)</span> <span class="o">-></span> <span class="n">Values</span><span class="p">:</span> +</span><span id="values-4488"><a href="#values-4488"><span class="linenos">4488</span></a><span class="w"> </span><span class="sd">"""Build VALUES statement.</span> +</span><span id="values-4489"><a href="#values-4489"><span class="linenos">4489</span></a> +</span><span id="values-4490"><a href="#values-4490"><span class="linenos">4490</span></a><span class="sd"> Example:</span> +</span><span id="values-4491"><a href="#values-4491"><span class="linenos">4491</span></a><span class="sd"> >>> values([(1, '2')]).sql()</span> +</span><span id="values-4492"><a href="#values-4492"><span class="linenos">4492</span></a><span class="sd"> "VALUES (1, '2')"</span> +</span><span id="values-4493"><a href="#values-4493"><span class="linenos">4493</span></a> +</span><span id="values-4494"><a href="#values-4494"><span class="linenos">4494</span></a><span class="sd"> Args:</span> +</span><span id="values-4495"><a href="#values-4495"><span class="linenos">4495</span></a><span class="sd"> values: values statements that will be converted to SQL</span> +</span><span id="values-4496"><a href="#values-4496"><span class="linenos">4496</span></a><span class="sd"> alias: optional alias</span> +</span><span id="values-4497"><a href="#values-4497"><span class="linenos">4497</span></a><span class="sd"> columns: Optional list of ordered column names or ordered dictionary of column names to types.</span> +</span><span id="values-4498"><a href="#values-4498"><span class="linenos">4498</span></a><span class="sd"> If either are provided then an alias is also required.</span> +</span><span id="values-4499"><a href="#values-4499"><span class="linenos">4499</span></a><span class="sd"> If a dictionary is provided then the first column of the values will be casted to the expected type</span> +</span><span id="values-4500"><a href="#values-4500"><span class="linenos">4500</span></a><span class="sd"> in order to help with type inference.</span> +</span><span id="values-4501"><a href="#values-4501"><span class="linenos">4501</span></a> +</span><span id="values-4502"><a href="#values-4502"><span class="linenos">4502</span></a><span class="sd"> Returns:</span> +</span><span id="values-4503"><a href="#values-4503"><span class="linenos">4503</span></a><span class="sd"> Values: the Values expression object</span> +</span><span id="values-4504"><a href="#values-4504"><span class="linenos">4504</span></a><span class="sd"> """</span> +</span><span id="values-4505"><a href="#values-4505"><span class="linenos">4505</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">alias</span><span class="p">:</span> +</span><span id="values-4506"><a href="#values-4506"><span class="linenos">4506</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Alias is required when providing columns"</span><span class="p">)</span> +</span><span id="values-4507"><a href="#values-4507"><span class="linenos">4507</span></a> <span class="n">table_alias</span> <span class="o">=</span> <span class="p">(</span> +</span><span id="values-4508"><a href="#values-4508"><span class="linenos">4508</span></a> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">),</span> <span class="n">columns</span><span class="o">=</span><span class="p">[</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">columns</span><span class="p">])</span> +</span><span id="values-4509"><a href="#values-4509"><span class="linenos">4509</span></a> <span class="k">if</span> <span class="n">columns</span> +</span><span id="values-4510"><a href="#values-4510"><span class="linenos">4510</span></a> <span class="k">else</span> <span class="n">TableAlias</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">to_identifier</span><span class="p">(</span><span class="n">alias</span><span class="p">)</span> <span class="k">if</span> <span class="n">alias</span> <span class="k">else</span> <span class="kc">None</span><span class="p">)</span> +</span><span id="values-4511"><a href="#values-4511"><span class="linenos">4511</span></a> <span class="p">)</span> +</span><span id="values-4512"><a href="#values-4512"><span class="linenos">4512</span></a> <span class="n">expressions</span> <span class="o">=</span> <span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">tup</span><span class="p">)</span> <span class="k">for</span> <span class="n">tup</span> <span class="ow">in</span> <span class="n">values</span><span class="p">]</span> +</span><span id="values-4513"><a href="#values-4513"><span class="linenos">4513</span></a> <span class="k">if</span> <span class="n">columns</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">columns</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> +</span><span id="values-4514"><a href="#values-4514"><span class="linenos">4514</span></a> <span class="n">types</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">columns</span><span class="o">.</span><span class="n">values</span><span class="p">())</span> +</span><span id="values-4515"><a href="#values-4515"><span class="linenos">4515</span></a> <span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">set</span><span class="p">(</span> +</span><span id="values-4516"><a href="#values-4516"><span class="linenos">4516</span></a> <span class="s2">"expressions"</span><span class="p">,</span> +</span><span id="values-4517"><a href="#values-4517"><span class="linenos">4517</span></a> <span class="p">[</span><span class="n">cast</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">types</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">expressions</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">expressions</span><span class="p">)],</span> +</span><span id="values-4518"><a href="#values-4518"><span class="linenos">4518</span></a> <span class="p">)</span> +</span><span id="values-4519"><a href="#values-4519"><span class="linenos">4519</span></a> <span class="k">return</span> <span class="n">Values</span><span class="p">(</span> +</span><span id="values-4520"><a href="#values-4520"><span class="linenos">4520</span></a> <span class="n">expressions</span><span class="o">=</span><span class="n">expressions</span><span class="p">,</span> +</span><span id="values-4521"><a href="#values-4521"><span class="linenos">4521</span></a> <span class="n">alias</span><span class="o">=</span><span class="n">table_alias</span><span class="p">,</span> +</span><span id="values-4522"><a href="#values-4522"><span class="linenos">4522</span></a> <span class="p">)</span> </span></pre></div> @@ -40094,28 +40976,28 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#var"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="var-4467"><a href="#var-4467"><span class="linenos">4467</span></a><span class="k">def</span> <span class="nf">var</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> -</span><span id="var-4468"><a href="#var-4468"><span class="linenos">4468</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> -</span><span id="var-4469"><a href="#var-4469"><span class="linenos">4469</span></a> -</span><span id="var-4470"><a href="#var-4470"><span class="linenos">4470</span></a><span class="sd"> Example:</span> -</span><span id="var-4471"><a href="#var-4471"><span class="linenos">4471</span></a><span class="sd"> >>> repr(var('x'))</span> -</span><span id="var-4472"><a href="#var-4472"><span class="linenos">4472</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="var-4473"><a href="#var-4473"><span class="linenos">4473</span></a> -</span><span id="var-4474"><a href="#var-4474"><span class="linenos">4474</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> -</span><span id="var-4475"><a href="#var-4475"><span class="linenos">4475</span></a><span class="sd"> '(VAR this: x)'</span> -</span><span id="var-4476"><a href="#var-4476"><span class="linenos">4476</span></a> -</span><span id="var-4477"><a href="#var-4477"><span class="linenos">4477</span></a><span class="sd"> Args:</span> -</span><span id="var-4478"><a href="#var-4478"><span class="linenos">4478</span></a><span class="sd"> name: The name of the var or an expression who's name will become the var.</span> -</span><span id="var-4479"><a href="#var-4479"><span class="linenos">4479</span></a> -</span><span id="var-4480"><a href="#var-4480"><span class="linenos">4480</span></a><span class="sd"> Returns:</span> -</span><span id="var-4481"><a href="#var-4481"><span class="linenos">4481</span></a><span class="sd"> The new variable node.</span> -</span><span id="var-4482"><a href="#var-4482"><span class="linenos">4482</span></a><span class="sd"> """</span> -</span><span id="var-4483"><a href="#var-4483"><span class="linenos">4483</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">name</span><span class="p">:</span> -</span><span id="var-4484"><a href="#var-4484"><span class="linenos">4484</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> -</span><span id="var-4485"><a href="#var-4485"><span class="linenos">4485</span></a> -</span><span id="var-4486"><a href="#var-4486"><span class="linenos">4486</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="var-4487"><a href="#var-4487"><span class="linenos">4487</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">name</span> -</span><span id="var-4488"><a href="#var-4488"><span class="linenos">4488</span></a> <span class="k">return</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="var-4525"><a href="#var-4525"><span class="linenos">4525</span></a><span class="k">def</span> <span class="nf">var</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Optional</span><span class="p">[</span><span class="nb">str</span> <span class="o">|</span> <span class="n">Expression</span><span class="p">])</span> <span class="o">-></span> <span class="n">Var</span><span class="p">:</span> +</span><span id="var-4526"><a href="#var-4526"><span class="linenos">4526</span></a><span class="w"> </span><span class="sd">"""Build a SQL variable.</span> +</span><span id="var-4527"><a href="#var-4527"><span class="linenos">4527</span></a> +</span><span id="var-4528"><a href="#var-4528"><span class="linenos">4528</span></a><span class="sd"> Example:</span> +</span><span id="var-4529"><a href="#var-4529"><span class="linenos">4529</span></a><span class="sd"> >>> repr(var('x'))</span> +</span><span id="var-4530"><a href="#var-4530"><span class="linenos">4530</span></a><span class="sd"> '(VAR this: x)'</span> +</span><span id="var-4531"><a href="#var-4531"><span class="linenos">4531</span></a> +</span><span id="var-4532"><a href="#var-4532"><span class="linenos">4532</span></a><span class="sd"> >>> repr(var(column('x', table='y')))</span> +</span><span id="var-4533"><a href="#var-4533"><span class="linenos">4533</span></a><span class="sd"> '(VAR this: x)'</span> +</span><span id="var-4534"><a href="#var-4534"><span class="linenos">4534</span></a> +</span><span id="var-4535"><a href="#var-4535"><span class="linenos">4535</span></a><span class="sd"> Args:</span> +</span><span id="var-4536"><a href="#var-4536"><span class="linenos">4536</span></a><span class="sd"> name: The name of the var or an expression who's name will become the var.</span> +</span><span id="var-4537"><a href="#var-4537"><span class="linenos">4537</span></a> +</span><span id="var-4538"><a href="#var-4538"><span class="linenos">4538</span></a><span class="sd"> Returns:</span> +</span><span id="var-4539"><a href="#var-4539"><span class="linenos">4539</span></a><span class="sd"> The new variable node.</span> +</span><span id="var-4540"><a href="#var-4540"><span class="linenos">4540</span></a><span class="sd"> """</span> +</span><span id="var-4541"><a href="#var-4541"><span class="linenos">4541</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">name</span><span class="p">:</span> +</span><span id="var-4542"><a href="#var-4542"><span class="linenos">4542</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert empty name into var."</span><span class="p">)</span> +</span><span id="var-4543"><a href="#var-4543"><span class="linenos">4543</span></a> +</span><span id="var-4544"><a href="#var-4544"><span class="linenos">4544</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="var-4545"><a href="#var-4545"><span class="linenos">4545</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">name</span><span class="o">.</span><span class="n">name</span> +</span><span id="var-4546"><a href="#var-4546"><span class="linenos">4546</span></a> <span class="k">return</span> <span class="n">Var</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">)</span> </span></pre></div> @@ -40163,24 +41045,24 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#rename_table"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="rename_table-4491"><a href="#rename_table-4491"><span class="linenos">4491</span></a><span class="k">def</span> <span class="nf">rename_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="n">new_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">)</span> <span class="o">-></span> <span class="n">AlterTable</span><span class="p">:</span> -</span><span id="rename_table-4492"><a href="#rename_table-4492"><span class="linenos">4492</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> -</span><span id="rename_table-4493"><a href="#rename_table-4493"><span class="linenos">4493</span></a> -</span><span id="rename_table-4494"><a href="#rename_table-4494"><span class="linenos">4494</span></a><span class="sd"> Args:</span> -</span><span id="rename_table-4495"><a href="#rename_table-4495"><span class="linenos">4495</span></a><span class="sd"> old_name: The old name of the table</span> -</span><span id="rename_table-4496"><a href="#rename_table-4496"><span class="linenos">4496</span></a><span class="sd"> new_name: The new name of the table</span> -</span><span id="rename_table-4497"><a href="#rename_table-4497"><span class="linenos">4497</span></a> -</span><span id="rename_table-4498"><a href="#rename_table-4498"><span class="linenos">4498</span></a><span class="sd"> Returns:</span> -</span><span id="rename_table-4499"><a href="#rename_table-4499"><span class="linenos">4499</span></a><span class="sd"> Alter table expression</span> -</span><span id="rename_table-4500"><a href="#rename_table-4500"><span class="linenos">4500</span></a><span class="sd"> """</span> -</span><span id="rename_table-4501"><a href="#rename_table-4501"><span class="linenos">4501</span></a> <span class="n">old_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">)</span> -</span><span id="rename_table-4502"><a href="#rename_table-4502"><span class="linenos">4502</span></a> <span class="n">new_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="rename_table-4503"><a href="#rename_table-4503"><span class="linenos">4503</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> -</span><span id="rename_table-4504"><a href="#rename_table-4504"><span class="linenos">4504</span></a> <span class="n">this</span><span class="o">=</span><span class="n">old_table</span><span class="p">,</span> -</span><span id="rename_table-4505"><a href="#rename_table-4505"><span class="linenos">4505</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> -</span><span id="rename_table-4506"><a href="#rename_table-4506"><span class="linenos">4506</span></a> <span class="n">RenameTable</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">new_table</span><span class="p">),</span> -</span><span id="rename_table-4507"><a href="#rename_table-4507"><span class="linenos">4507</span></a> <span class="p">],</span> -</span><span id="rename_table-4508"><a href="#rename_table-4508"><span class="linenos">4508</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="rename_table-4549"><a href="#rename_table-4549"><span class="linenos">4549</span></a><span class="k">def</span> <span class="nf">rename_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">,</span> <span class="n">new_name</span><span class="p">:</span> <span class="nb">str</span> <span class="o">|</span> <span class="n">Table</span><span class="p">)</span> <span class="o">-></span> <span class="n">AlterTable</span><span class="p">:</span> +</span><span id="rename_table-4550"><a href="#rename_table-4550"><span class="linenos">4550</span></a><span class="w"> </span><span class="sd">"""Build ALTER TABLE... RENAME... expression</span> +</span><span id="rename_table-4551"><a href="#rename_table-4551"><span class="linenos">4551</span></a> +</span><span id="rename_table-4552"><a href="#rename_table-4552"><span class="linenos">4552</span></a><span class="sd"> Args:</span> +</span><span id="rename_table-4553"><a href="#rename_table-4553"><span class="linenos">4553</span></a><span class="sd"> old_name: The old name of the table</span> +</span><span id="rename_table-4554"><a href="#rename_table-4554"><span class="linenos">4554</span></a><span class="sd"> new_name: The new name of the table</span> +</span><span id="rename_table-4555"><a href="#rename_table-4555"><span class="linenos">4555</span></a> +</span><span id="rename_table-4556"><a href="#rename_table-4556"><span class="linenos">4556</span></a><span class="sd"> Returns:</span> +</span><span id="rename_table-4557"><a href="#rename_table-4557"><span class="linenos">4557</span></a><span class="sd"> Alter table expression</span> +</span><span id="rename_table-4558"><a href="#rename_table-4558"><span class="linenos">4558</span></a><span class="sd"> """</span> +</span><span id="rename_table-4559"><a href="#rename_table-4559"><span class="linenos">4559</span></a> <span class="n">old_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">old_name</span><span class="p">)</span> +</span><span id="rename_table-4560"><a href="#rename_table-4560"><span class="linenos">4560</span></a> <span class="n">new_table</span> <span class="o">=</span> <span class="n">to_table</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="rename_table-4561"><a href="#rename_table-4561"><span class="linenos">4561</span></a> <span class="k">return</span> <span class="n">AlterTable</span><span class="p">(</span> +</span><span id="rename_table-4562"><a href="#rename_table-4562"><span class="linenos">4562</span></a> <span class="n">this</span><span class="o">=</span><span class="n">old_table</span><span class="p">,</span> +</span><span id="rename_table-4563"><a href="#rename_table-4563"><span class="linenos">4563</span></a> <span class="n">actions</span><span class="o">=</span><span class="p">[</span> +</span><span id="rename_table-4564"><a href="#rename_table-4564"><span class="linenos">4564</span></a> <span class="n">RenameTable</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">new_table</span><span class="p">),</span> +</span><span id="rename_table-4565"><a href="#rename_table-4565"><span class="linenos">4565</span></a> <span class="p">],</span> +</span><span id="rename_table-4566"><a href="#rename_table-4566"><span class="linenos">4566</span></a> <span class="p">)</span> </span></pre></div> @@ -40213,47 +41095,47 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#convert"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="convert-4511"><a href="#convert-4511"><span class="linenos">4511</span></a><span class="k">def</span> <span class="nf">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="convert-4512"><a href="#convert-4512"><span class="linenos">4512</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> -</span><span id="convert-4513"><a href="#convert-4513"><span class="linenos">4513</span></a> -</span><span id="convert-4514"><a href="#convert-4514"><span class="linenos">4514</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> -</span><span id="convert-4515"><a href="#convert-4515"><span class="linenos">4515</span></a> -</span><span id="convert-4516"><a href="#convert-4516"><span class="linenos">4516</span></a><span class="sd"> Args:</span> -</span><span id="convert-4517"><a href="#convert-4517"><span class="linenos">4517</span></a><span class="sd"> value (Any): a python object</span> -</span><span id="convert-4518"><a href="#convert-4518"><span class="linenos">4518</span></a> -</span><span id="convert-4519"><a href="#convert-4519"><span class="linenos">4519</span></a><span class="sd"> Returns:</span> -</span><span id="convert-4520"><a href="#convert-4520"><span class="linenos">4520</span></a><span class="sd"> Expression: the equivalent expression object</span> -</span><span id="convert-4521"><a href="#convert-4521"><span class="linenos">4521</span></a><span class="sd"> """</span> -</span><span id="convert-4522"><a href="#convert-4522"><span class="linenos">4522</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="convert-4523"><a href="#convert-4523"><span class="linenos">4523</span></a> <span class="k">return</span> <span class="n">value</span> -</span><span id="convert-4524"><a href="#convert-4524"><span class="linenos">4524</span></a> <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> -</span><span id="convert-4525"><a href="#convert-4525"><span class="linenos">4525</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="convert-4526"><a href="#convert-4526"><span class="linenos">4526</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> -</span><span id="convert-4527"><a href="#convert-4527"><span class="linenos">4527</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">value</span><span class="p">)</span> -</span><span id="convert-4528"><a href="#convert-4528"><span class="linenos">4528</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> -</span><span id="convert-4529"><a href="#convert-4529"><span class="linenos">4529</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="convert-4530"><a href="#convert-4530"><span class="linenos">4530</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">float</span><span class="p">)</span> <span class="ow">and</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">value</span><span class="p">):</span> -</span><span id="convert-4531"><a href="#convert-4531"><span class="linenos">4531</span></a> <span class="k">return</span> <span class="n">NULL</span> -</span><span id="convert-4532"><a href="#convert-4532"><span class="linenos">4532</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">numbers</span><span class="o">.</span><span class="n">Number</span><span class="p">):</span> -</span><span id="convert-4533"><a href="#convert-4533"><span class="linenos">4533</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> -</span><span id="convert-4534"><a href="#convert-4534"><span class="linenos">4534</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span> -</span><span id="convert-4535"><a href="#convert-4535"><span class="linenos">4535</span></a> <span class="k">return</span> <span class="n">Tuple</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> -</span><span id="convert-4536"><a href="#convert-4536"><span class="linenos">4536</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> -</span><span id="convert-4537"><a href="#convert-4537"><span class="linenos">4537</span></a> <span class="k">return</span> <span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> -</span><span id="convert-4538"><a href="#convert-4538"><span class="linenos">4538</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> -</span><span id="convert-4539"><a href="#convert-4539"><span class="linenos">4539</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> -</span><span id="convert-4540"><a href="#convert-4540"><span class="linenos">4540</span></a> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">value</span><span class="p">],</span> -</span><span id="convert-4541"><a href="#convert-4541"><span class="linenos">4541</span></a> <span class="n">values</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">values</span><span class="p">()],</span> -</span><span id="convert-4542"><a href="#convert-4542"><span class="linenos">4542</span></a> <span class="p">)</span> -</span><span id="convert-4543"><a href="#convert-4543"><span class="linenos">4543</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">):</span> -</span><span id="convert-4544"><a href="#convert-4544"><span class="linenos">4544</span></a> <span class="n">datetime_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span> -</span><span id="convert-4545"><a href="#convert-4545"><span class="linenos">4545</span></a> <span class="p">(</span><span class="n">value</span> <span class="k">if</span> <span class="n">value</span><span class="o">.</span><span class="n">tzinfo</span> <span class="k">else</span> <span class="n">value</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">tzinfo</span><span class="o">=</span><span class="n">datetime</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()</span> -</span><span id="convert-4546"><a href="#convert-4546"><span class="linenos">4546</span></a> <span class="p">)</span> -</span><span id="convert-4547"><a href="#convert-4547"><span class="linenos">4547</span></a> <span class="k">return</span> <span class="n">TimeStrToTime</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">datetime_literal</span><span class="p">)</span> -</span><span id="convert-4548"><a href="#convert-4548"><span class="linenos">4548</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="p">):</span> -</span><span id="convert-4549"><a href="#convert-4549"><span class="linenos">4549</span></a> <span class="n">date_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">))</span> -</span><span id="convert-4550"><a href="#convert-4550"><span class="linenos">4550</span></a> <span class="k">return</span> <span class="n">DateStrToDate</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">date_literal</span><span class="p">)</span> -</span><span id="convert-4551"><a href="#convert-4551"><span class="linenos">4551</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="convert-4569"><a href="#convert-4569"><span class="linenos">4569</span></a><span class="k">def</span> <span class="nf">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="convert-4570"><a href="#convert-4570"><span class="linenos">4570</span></a><span class="w"> </span><span class="sd">"""Convert a python value into an expression object.</span> +</span><span id="convert-4571"><a href="#convert-4571"><span class="linenos">4571</span></a> +</span><span id="convert-4572"><a href="#convert-4572"><span class="linenos">4572</span></a><span class="sd"> Raises an error if a conversion is not possible.</span> +</span><span id="convert-4573"><a href="#convert-4573"><span class="linenos">4573</span></a> +</span><span id="convert-4574"><a href="#convert-4574"><span class="linenos">4574</span></a><span class="sd"> Args:</span> +</span><span id="convert-4575"><a href="#convert-4575"><span class="linenos">4575</span></a><span class="sd"> value (Any): a python object</span> +</span><span id="convert-4576"><a href="#convert-4576"><span class="linenos">4576</span></a> +</span><span id="convert-4577"><a href="#convert-4577"><span class="linenos">4577</span></a><span class="sd"> Returns:</span> +</span><span id="convert-4578"><a href="#convert-4578"><span class="linenos">4578</span></a><span class="sd"> Expression: the equivalent expression object</span> +</span><span id="convert-4579"><a href="#convert-4579"><span class="linenos">4579</span></a><span class="sd"> """</span> +</span><span id="convert-4580"><a href="#convert-4580"><span class="linenos">4580</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="convert-4581"><a href="#convert-4581"><span class="linenos">4581</span></a> <span class="k">return</span> <span class="n">value</span> +</span><span id="convert-4582"><a href="#convert-4582"><span class="linenos">4582</span></a> <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> +</span><span id="convert-4583"><a href="#convert-4583"><span class="linenos">4583</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="convert-4584"><a href="#convert-4584"><span class="linenos">4584</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">bool</span><span class="p">):</span> +</span><span id="convert-4585"><a href="#convert-4585"><span class="linenos">4585</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">value</span><span class="p">)</span> +</span><span id="convert-4586"><a href="#convert-4586"><span class="linenos">4586</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span> +</span><span id="convert-4587"><a href="#convert-4587"><span class="linenos">4587</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="convert-4588"><a href="#convert-4588"><span class="linenos">4588</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">float</span><span class="p">)</span> <span class="ow">and</span> <span class="n">math</span><span class="o">.</span><span class="n">isnan</span><span class="p">(</span><span class="n">value</span><span class="p">):</span> +</span><span id="convert-4589"><a href="#convert-4589"><span class="linenos">4589</span></a> <span class="k">return</span> <span class="n">NULL</span> +</span><span id="convert-4590"><a href="#convert-4590"><span class="linenos">4590</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">numbers</span><span class="o">.</span><span class="n">Number</span><span class="p">):</span> +</span><span id="convert-4591"><a href="#convert-4591"><span class="linenos">4591</span></a> <span class="k">return</span> <span class="n">Literal</span><span class="o">.</span><span class="n">number</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> +</span><span id="convert-4592"><a href="#convert-4592"><span class="linenos">4592</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">):</span> +</span><span id="convert-4593"><a href="#convert-4593"><span class="linenos">4593</span></a> <span class="k">return</span> <span class="n">Tuple</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> +</span><span id="convert-4594"><a href="#convert-4594"><span class="linenos">4594</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span> +</span><span id="convert-4595"><a href="#convert-4595"><span class="linenos">4595</span></a> <span class="k">return</span> <span class="n">Array</span><span class="p">(</span><span class="n">expressions</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="p">])</span> +</span><span id="convert-4596"><a href="#convert-4596"><span class="linenos">4596</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span> +</span><span id="convert-4597"><a href="#convert-4597"><span class="linenos">4597</span></a> <span class="k">return</span> <span class="n">Map</span><span class="p">(</span> +</span><span id="convert-4598"><a href="#convert-4598"><span class="linenos">4598</span></a> <span class="n">keys</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">k</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">value</span><span class="p">],</span> +</span><span id="convert-4599"><a href="#convert-4599"><span class="linenos">4599</span></a> <span class="n">values</span><span class="o">=</span><span class="p">[</span><span class="n">convert</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">values</span><span class="p">()],</span> +</span><span id="convert-4600"><a href="#convert-4600"><span class="linenos">4600</span></a> <span class="p">)</span> +</span><span id="convert-4601"><a href="#convert-4601"><span class="linenos">4601</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">):</span> +</span><span id="convert-4602"><a href="#convert-4602"><span class="linenos">4602</span></a> <span class="n">datetime_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span> +</span><span id="convert-4603"><a href="#convert-4603"><span class="linenos">4603</span></a> <span class="p">(</span><span class="n">value</span> <span class="k">if</span> <span class="n">value</span><span class="o">.</span><span class="n">tzinfo</span> <span class="k">else</span> <span class="n">value</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">tzinfo</span><span class="o">=</span><span class="n">datetime</span><span class="o">.</span><span class="n">timezone</span><span class="o">.</span><span class="n">utc</span><span class="p">))</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()</span> +</span><span id="convert-4604"><a href="#convert-4604"><span class="linenos">4604</span></a> <span class="p">)</span> +</span><span id="convert-4605"><a href="#convert-4605"><span class="linenos">4605</span></a> <span class="k">return</span> <span class="n">TimeStrToTime</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">datetime_literal</span><span class="p">)</span> +</span><span id="convert-4606"><a href="#convert-4606"><span class="linenos">4606</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="p">):</span> +</span><span id="convert-4607"><a href="#convert-4607"><span class="linenos">4607</span></a> <span class="n">date_literal</span> <span class="o">=</span> <span class="n">Literal</span><span class="o">.</span><span class="n">string</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">"%Y-%m-</span><span class="si">%d</span><span class="s2">"</span><span class="p">))</span> +</span><span id="convert-4608"><a href="#convert-4608"><span class="linenos">4608</span></a> <span class="k">return</span> <span class="n">DateStrToDate</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">date_literal</span><span class="p">)</span> +</span><span id="convert-4609"><a href="#convert-4609"><span class="linenos">4609</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot convert </span><span class="si">{</span><span class="n">value</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> </span></pre></div> @@ -40287,26 +41169,26 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#replace_children"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_children-4554"><a href="#replace_children-4554"><span class="linenos">4554</span></a><span class="k">def</span> <span class="nf">replace_children</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">):</span> -</span><span id="replace_children-4555"><a href="#replace_children-4555"><span class="linenos">4555</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="replace_children-4556"><a href="#replace_children-4556"><span class="linenos">4556</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> -</span><span id="replace_children-4557"><a href="#replace_children-4557"><span class="linenos">4557</span></a><span class="sd"> """</span> -</span><span id="replace_children-4558"><a href="#replace_children-4558"><span class="linenos">4558</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> -</span><span id="replace_children-4559"><a href="#replace_children-4559"><span class="linenos">4559</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> -</span><span id="replace_children-4560"><a href="#replace_children-4560"><span class="linenos">4560</span></a> -</span><span id="replace_children-4561"><a href="#replace_children-4561"><span class="linenos">4561</span></a> <span class="n">child_nodes</span> <span class="o">=</span> <span class="n">v</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="p">[</span><span class="n">v</span><span class="p">]</span> -</span><span id="replace_children-4562"><a href="#replace_children-4562"><span class="linenos">4562</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> -</span><span id="replace_children-4563"><a href="#replace_children-4563"><span class="linenos">4563</span></a> -</span><span id="replace_children-4564"><a href="#replace_children-4564"><span class="linenos">4564</span></a> <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="n">child_nodes</span><span class="p">:</span> -</span><span id="replace_children-4565"><a href="#replace_children-4565"><span class="linenos">4565</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="replace_children-4566"><a href="#replace_children-4566"><span class="linenos">4566</span></a> <span class="k">for</span> <span class="n">child_node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">fun</span><span class="p">(</span><span class="n">cn</span><span class="p">)):</span> -</span><span id="replace_children-4567"><a href="#replace_children-4567"><span class="linenos">4567</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">child_node</span><span class="p">)</span> -</span><span id="replace_children-4568"><a href="#replace_children-4568"><span class="linenos">4568</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">expression</span> -</span><span id="replace_children-4569"><a href="#replace_children-4569"><span class="linenos">4569</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">k</span> -</span><span id="replace_children-4570"><a href="#replace_children-4570"><span class="linenos">4570</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="replace_children-4571"><a href="#replace_children-4571"><span class="linenos">4571</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cn</span><span class="p">)</span> -</span><span id="replace_children-4572"><a href="#replace_children-4572"><span class="linenos">4572</span></a> -</span><span id="replace_children-4573"><a href="#replace_children-4573"><span class="linenos">4573</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_child_nodes</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">new_child_nodes</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="replace_children-4612"><a href="#replace_children-4612"><span class="linenos">4612</span></a><span class="k">def</span> <span class="nf">replace_children</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">fun</span><span class="p">):</span> +</span><span id="replace_children-4613"><a href="#replace_children-4613"><span class="linenos">4613</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="replace_children-4614"><a href="#replace_children-4614"><span class="linenos">4614</span></a><span class="sd"> Replace children of an expression with the result of a lambda fun(child) -> exp.</span> +</span><span id="replace_children-4615"><a href="#replace_children-4615"><span class="linenos">4615</span></a><span class="sd"> """</span> +</span><span id="replace_children-4616"><a href="#replace_children-4616"><span class="linenos">4616</span></a> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">():</span> +</span><span id="replace_children-4617"><a href="#replace_children-4617"><span class="linenos">4617</span></a> <span class="n">is_list_arg</span> <span class="o">=</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">v</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> +</span><span id="replace_children-4618"><a href="#replace_children-4618"><span class="linenos">4618</span></a> +</span><span id="replace_children-4619"><a href="#replace_children-4619"><span class="linenos">4619</span></a> <span class="n">child_nodes</span> <span class="o">=</span> <span class="n">v</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="p">[</span><span class="n">v</span><span class="p">]</span> +</span><span id="replace_children-4620"><a href="#replace_children-4620"><span class="linenos">4620</span></a> <span class="n">new_child_nodes</span> <span class="o">=</span> <span class="p">[]</span> +</span><span id="replace_children-4621"><a href="#replace_children-4621"><span class="linenos">4621</span></a> +</span><span id="replace_children-4622"><a href="#replace_children-4622"><span class="linenos">4622</span></a> <span class="k">for</span> <span class="n">cn</span> <span class="ow">in</span> <span class="n">child_nodes</span><span class="p">:</span> +</span><span id="replace_children-4623"><a href="#replace_children-4623"><span class="linenos">4623</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">cn</span><span class="p">,</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="replace_children-4624"><a href="#replace_children-4624"><span class="linenos">4624</span></a> <span class="k">for</span> <span class="n">child_node</span> <span class="ow">in</span> <span class="n">ensure_collection</span><span class="p">(</span><span class="n">fun</span><span class="p">(</span><span class="n">cn</span><span class="p">)):</span> +</span><span id="replace_children-4625"><a href="#replace_children-4625"><span class="linenos">4625</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">child_node</span><span class="p">)</span> +</span><span id="replace_children-4626"><a href="#replace_children-4626"><span class="linenos">4626</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="n">expression</span> +</span><span id="replace_children-4627"><a href="#replace_children-4627"><span class="linenos">4627</span></a> <span class="n">child_node</span><span class="o">.</span><span class="n">arg_key</span> <span class="o">=</span> <span class="n">k</span> +</span><span id="replace_children-4628"><a href="#replace_children-4628"><span class="linenos">4628</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="replace_children-4629"><a href="#replace_children-4629"><span class="linenos">4629</span></a> <span class="n">new_child_nodes</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">cn</span><span class="p">)</span> +</span><span id="replace_children-4630"><a href="#replace_children-4630"><span class="linenos">4630</span></a> +</span><span id="replace_children-4631"><a href="#replace_children-4631"><span class="linenos">4631</span></a> <span class="n">expression</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">new_child_nodes</span> <span class="k">if</span> <span class="n">is_list_arg</span> <span class="k">else</span> <span class="n">seq_get</span><span class="p">(</span><span class="n">new_child_nodes</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> </span></pre></div> @@ -40326,22 +41208,22 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#column_table_names"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="column_table_names-4576"><a href="#column_table_names-4576"><span class="linenos">4576</span></a><span class="k">def</span> <span class="nf">column_table_names</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> -</span><span id="column_table_names-4577"><a href="#column_table_names-4577"><span class="linenos">4577</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="column_table_names-4578"><a href="#column_table_names-4578"><span class="linenos">4578</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> -</span><span id="column_table_names-4579"><a href="#column_table_names-4579"><span class="linenos">4579</span></a> -</span><span id="column_table_names-4580"><a href="#column_table_names-4580"><span class="linenos">4580</span></a><span class="sd"> Example:</span> -</span><span id="column_table_names-4581"><a href="#column_table_names-4581"><span class="linenos">4581</span></a><span class="sd"> >>> import sqlglot</span> -</span><span id="column_table_names-4582"><a href="#column_table_names-4582"><span class="linenos">4582</span></a><span class="sd"> >>> column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e"))</span> -</span><span id="column_table_names-4583"><a href="#column_table_names-4583"><span class="linenos">4583</span></a><span class="sd"> ['c', 'a']</span> -</span><span id="column_table_names-4584"><a href="#column_table_names-4584"><span class="linenos">4584</span></a> -</span><span id="column_table_names-4585"><a href="#column_table_names-4585"><span class="linenos">4585</span></a><span class="sd"> Args:</span> -</span><span id="column_table_names-4586"><a href="#column_table_names-4586"><span class="linenos">4586</span></a><span class="sd"> expression (sqlglot.Expression): expression to find table names</span> -</span><span id="column_table_names-4587"><a href="#column_table_names-4587"><span class="linenos">4587</span></a> -</span><span id="column_table_names-4588"><a href="#column_table_names-4588"><span class="linenos">4588</span></a><span class="sd"> Returns:</span> -</span><span id="column_table_names-4589"><a href="#column_table_names-4589"><span class="linenos">4589</span></a><span class="sd"> list: A list of unique names</span> -</span><span id="column_table_names-4590"><a href="#column_table_names-4590"><span class="linenos">4590</span></a><span class="sd"> """</span> -</span><span id="column_table_names-4591"><a href="#column_table_names-4591"><span class="linenos">4591</span></a> <span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">dict</span><span class="o">.</span><span class="n">fromkeys</span><span class="p">(</span><span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">Column</span><span class="p">)))</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="column_table_names-4634"><a href="#column_table_names-4634"><span class="linenos">4634</span></a><span class="k">def</span> <span class="nf">column_table_names</span><span class="p">(</span><span class="n">expression</span><span class="p">):</span> +</span><span id="column_table_names-4635"><a href="#column_table_names-4635"><span class="linenos">4635</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="column_table_names-4636"><a href="#column_table_names-4636"><span class="linenos">4636</span></a><span class="sd"> Return all table names referenced through columns in an expression.</span> +</span><span id="column_table_names-4637"><a href="#column_table_names-4637"><span class="linenos">4637</span></a> +</span><span id="column_table_names-4638"><a href="#column_table_names-4638"><span class="linenos">4638</span></a><span class="sd"> Example:</span> +</span><span id="column_table_names-4639"><a href="#column_table_names-4639"><span class="linenos">4639</span></a><span class="sd"> >>> import sqlglot</span> +</span><span id="column_table_names-4640"><a href="#column_table_names-4640"><span class="linenos">4640</span></a><span class="sd"> >>> column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e"))</span> +</span><span id="column_table_names-4641"><a href="#column_table_names-4641"><span class="linenos">4641</span></a><span class="sd"> ['c', 'a']</span> +</span><span id="column_table_names-4642"><a href="#column_table_names-4642"><span class="linenos">4642</span></a> +</span><span id="column_table_names-4643"><a href="#column_table_names-4643"><span class="linenos">4643</span></a><span class="sd"> Args:</span> +</span><span id="column_table_names-4644"><a href="#column_table_names-4644"><span class="linenos">4644</span></a><span class="sd"> expression (sqlglot.Expression): expression to find table names</span> +</span><span id="column_table_names-4645"><a href="#column_table_names-4645"><span class="linenos">4645</span></a> +</span><span id="column_table_names-4646"><a href="#column_table_names-4646"><span class="linenos">4646</span></a><span class="sd"> Returns:</span> +</span><span id="column_table_names-4647"><a href="#column_table_names-4647"><span class="linenos">4647</span></a><span class="sd"> list: A list of unique names</span> +</span><span id="column_table_names-4648"><a href="#column_table_names-4648"><span class="linenos">4648</span></a><span class="sd"> """</span> +</span><span id="column_table_names-4649"><a href="#column_table_names-4649"><span class="linenos">4649</span></a> <span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="nb">dict</span><span class="o">.</span><span class="n">fromkeys</span><span class="p">(</span><span class="n">column</span><span class="o">.</span><span class="n">table</span> <span class="k">for</span> <span class="n">column</span> <span class="ow">in</span> <span class="n">expression</span><span class="o">.</span><span class="n">find_all</span><span class="p">(</span><span class="n">Column</span><span class="p">)))</span> </span></pre></div> @@ -40384,35 +41266,35 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#table_name"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="table_name-4594"><a href="#table_name-4594"><span class="linenos">4594</span></a><span class="k">def</span> <span class="nf">table_name</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> -</span><span id="table_name-4595"><a href="#table_name-4595"><span class="linenos">4595</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> -</span><span id="table_name-4596"><a href="#table_name-4596"><span class="linenos">4596</span></a> -</span><span id="table_name-4597"><a href="#table_name-4597"><span class="linenos">4597</span></a><span class="sd"> Args:</span> -</span><span id="table_name-4598"><a href="#table_name-4598"><span class="linenos">4598</span></a><span class="sd"> table (exp.Table | str): table expression node or string.</span> -</span><span id="table_name-4599"><a href="#table_name-4599"><span class="linenos">4599</span></a> -</span><span id="table_name-4600"><a href="#table_name-4600"><span class="linenos">4600</span></a><span class="sd"> Examples:</span> -</span><span id="table_name-4601"><a href="#table_name-4601"><span class="linenos">4601</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="table_name-4602"><a href="#table_name-4602"><span class="linenos">4602</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> -</span><span id="table_name-4603"><a href="#table_name-4603"><span class="linenos">4603</span></a><span class="sd"> 'a.b.c'</span> -</span><span id="table_name-4604"><a href="#table_name-4604"><span class="linenos">4604</span></a> -</span><span id="table_name-4605"><a href="#table_name-4605"><span class="linenos">4605</span></a><span class="sd"> Returns:</span> -</span><span id="table_name-4606"><a href="#table_name-4606"><span class="linenos">4606</span></a><span class="sd"> The table name.</span> -</span><span id="table_name-4607"><a href="#table_name-4607"><span class="linenos">4607</span></a><span class="sd"> """</span> -</span><span id="table_name-4608"><a href="#table_name-4608"><span class="linenos">4608</span></a> -</span><span id="table_name-4609"><a href="#table_name-4609"><span class="linenos">4609</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">)</span> -</span><span id="table_name-4610"><a href="#table_name-4610"><span class="linenos">4610</span></a> -</span><span id="table_name-4611"><a href="#table_name-4611"><span class="linenos">4611</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table</span><span class="p">:</span> -</span><span id="table_name-4612"><a href="#table_name-4612"><span class="linenos">4612</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot parse </span><span class="si">{</span><span class="n">table</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> -</span><span id="table_name-4613"><a href="#table_name-4613"><span class="linenos">4613</span></a> -</span><span id="table_name-4614"><a href="#table_name-4614"><span class="linenos">4614</span></a> <span class="k">return</span> <span class="s2">"."</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> -</span><span id="table_name-4615"><a href="#table_name-4615"><span class="linenos">4615</span></a> <span class="n">part</span> -</span><span id="table_name-4616"><a href="#table_name-4616"><span class="linenos">4616</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span> -</span><span id="table_name-4617"><a href="#table_name-4617"><span class="linenos">4617</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">),</span> -</span><span id="table_name-4618"><a href="#table_name-4618"><span class="linenos">4618</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">),</span> -</span><span id="table_name-4619"><a href="#table_name-4619"><span class="linenos">4619</span></a> <span class="n">table</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> -</span><span id="table_name-4620"><a href="#table_name-4620"><span class="linenos">4620</span></a> <span class="p">)</span> -</span><span id="table_name-4621"><a href="#table_name-4621"><span class="linenos">4621</span></a> <span class="k">if</span> <span class="n">part</span> -</span><span id="table_name-4622"><a href="#table_name-4622"><span class="linenos">4622</span></a> <span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="table_name-4652"><a href="#table_name-4652"><span class="linenos">4652</span></a><span class="k">def</span> <span class="nf">table_name</span><span class="p">(</span><span class="n">table</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span> +</span><span id="table_name-4653"><a href="#table_name-4653"><span class="linenos">4653</span></a><span class="w"> </span><span class="sd">"""Get the full name of a table as a string.</span> +</span><span id="table_name-4654"><a href="#table_name-4654"><span class="linenos">4654</span></a> +</span><span id="table_name-4655"><a href="#table_name-4655"><span class="linenos">4655</span></a><span class="sd"> Args:</span> +</span><span id="table_name-4656"><a href="#table_name-4656"><span class="linenos">4656</span></a><span class="sd"> table (exp.Table | str): table expression node or string.</span> +</span><span id="table_name-4657"><a href="#table_name-4657"><span class="linenos">4657</span></a> +</span><span id="table_name-4658"><a href="#table_name-4658"><span class="linenos">4658</span></a><span class="sd"> Examples:</span> +</span><span id="table_name-4659"><a href="#table_name-4659"><span class="linenos">4659</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="table_name-4660"><a href="#table_name-4660"><span class="linenos">4660</span></a><span class="sd"> >>> table_name(parse_one("select * from a.b.c").find(exp.Table))</span> +</span><span id="table_name-4661"><a href="#table_name-4661"><span class="linenos">4661</span></a><span class="sd"> 'a.b.c'</span> +</span><span id="table_name-4662"><a href="#table_name-4662"><span class="linenos">4662</span></a> +</span><span id="table_name-4663"><a href="#table_name-4663"><span class="linenos">4663</span></a><span class="sd"> Returns:</span> +</span><span id="table_name-4664"><a href="#table_name-4664"><span class="linenos">4664</span></a><span class="sd"> The table name.</span> +</span><span id="table_name-4665"><a href="#table_name-4665"><span class="linenos">4665</span></a><span class="sd"> """</span> +</span><span id="table_name-4666"><a href="#table_name-4666"><span class="linenos">4666</span></a> +</span><span id="table_name-4667"><a href="#table_name-4667"><span class="linenos">4667</span></a> <span class="n">table</span> <span class="o">=</span> <span class="n">maybe_parse</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">into</span><span class="o">=</span><span class="n">Table</span><span class="p">)</span> +</span><span id="table_name-4668"><a href="#table_name-4668"><span class="linenos">4668</span></a> +</span><span id="table_name-4669"><a href="#table_name-4669"><span class="linenos">4669</span></a> <span class="k">if</span> <span class="ow">not</span> <span class="n">table</span><span class="p">:</span> +</span><span id="table_name-4670"><a href="#table_name-4670"><span class="linenos">4670</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Cannot parse </span><span class="si">{</span><span class="n">table</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> +</span><span id="table_name-4671"><a href="#table_name-4671"><span class="linenos">4671</span></a> +</span><span id="table_name-4672"><a href="#table_name-4672"><span class="linenos">4672</span></a> <span class="k">return</span> <span class="s2">"."</span><span class="o">.</span><span class="n">join</span><span class="p">(</span> +</span><span id="table_name-4673"><a href="#table_name-4673"><span class="linenos">4673</span></a> <span class="n">part</span> +</span><span id="table_name-4674"><a href="#table_name-4674"><span class="linenos">4674</span></a> <span class="k">for</span> <span class="n">part</span> <span class="ow">in</span> <span class="p">(</span> +</span><span id="table_name-4675"><a href="#table_name-4675"><span class="linenos">4675</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"catalog"</span><span class="p">),</span> +</span><span id="table_name-4676"><a href="#table_name-4676"><span class="linenos">4676</span></a> <span class="n">table</span><span class="o">.</span><span class="n">text</span><span class="p">(</span><span class="s2">"db"</span><span class="p">),</span> +</span><span id="table_name-4677"><a href="#table_name-4677"><span class="linenos">4677</span></a> <span class="n">table</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> +</span><span id="table_name-4678"><a href="#table_name-4678"><span class="linenos">4678</span></a> <span class="p">)</span> +</span><span id="table_name-4679"><a href="#table_name-4679"><span class="linenos">4679</span></a> <span class="k">if</span> <span class="n">part</span> +</span><span id="table_name-4680"><a href="#table_name-4680"><span class="linenos">4680</span></a> <span class="p">)</span> </span></pre></div> @@ -40455,33 +41337,33 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#replace_tables"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_tables-4625"><a href="#replace_tables-4625"><span class="linenos">4625</span></a><span class="k">def</span> <span class="nf">replace_tables</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">mapping</span><span class="p">):</span> -</span><span id="replace_tables-4626"><a href="#replace_tables-4626"><span class="linenos">4626</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> -</span><span id="replace_tables-4627"><a href="#replace_tables-4627"><span class="linenos">4627</span></a> -</span><span id="replace_tables-4628"><a href="#replace_tables-4628"><span class="linenos">4628</span></a><span class="sd"> Args:</span> -</span><span id="replace_tables-4629"><a href="#replace_tables-4629"><span class="linenos">4629</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> -</span><span id="replace_tables-4630"><a href="#replace_tables-4630"><span class="linenos">4630</span></a><span class="sd"> mapping (Dict[str, str]): mapping of table names.</span> -</span><span id="replace_tables-4631"><a href="#replace_tables-4631"><span class="linenos">4631</span></a> -</span><span id="replace_tables-4632"><a href="#replace_tables-4632"><span class="linenos">4632</span></a><span class="sd"> Examples:</span> -</span><span id="replace_tables-4633"><a href="#replace_tables-4633"><span class="linenos">4633</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="replace_tables-4634"><a href="#replace_tables-4634"><span class="linenos">4634</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> -</span><span id="replace_tables-4635"><a href="#replace_tables-4635"><span class="linenos">4635</span></a><span class="sd"> 'SELECT * FROM c'</span> -</span><span id="replace_tables-4636"><a href="#replace_tables-4636"><span class="linenos">4636</span></a> -</span><span id="replace_tables-4637"><a href="#replace_tables-4637"><span class="linenos">4637</span></a><span class="sd"> Returns:</span> -</span><span id="replace_tables-4638"><a href="#replace_tables-4638"><span class="linenos">4638</span></a><span class="sd"> The mapped expression.</span> -</span><span id="replace_tables-4639"><a href="#replace_tables-4639"><span class="linenos">4639</span></a><span class="sd"> """</span> -</span><span id="replace_tables-4640"><a href="#replace_tables-4640"><span class="linenos">4640</span></a> -</span><span id="replace_tables-4641"><a href="#replace_tables-4641"><span class="linenos">4641</span></a> <span class="k">def</span> <span class="nf">_replace_tables</span><span class="p">(</span><span class="n">node</span><span class="p">):</span> -</span><span id="replace_tables-4642"><a href="#replace_tables-4642"><span class="linenos">4642</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="replace_tables-4643"><a href="#replace_tables-4643"><span class="linenos">4643</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">mapping</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">))</span> -</span><span id="replace_tables-4644"><a href="#replace_tables-4644"><span class="linenos">4644</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="replace_tables-4645"><a href="#replace_tables-4645"><span class="linenos">4645</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> -</span><span id="replace_tables-4646"><a href="#replace_tables-4646"><span class="linenos">4646</span></a> <span class="n">new_name</span><span class="p">,</span> -</span><span id="replace_tables-4647"><a href="#replace_tables-4647"><span class="linenos">4647</span></a> <span class="o">**</span><span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">node</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">)},</span> -</span><span id="replace_tables-4648"><a href="#replace_tables-4648"><span class="linenos">4648</span></a> <span class="p">)</span> -</span><span id="replace_tables-4649"><a href="#replace_tables-4649"><span class="linenos">4649</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="replace_tables-4650"><a href="#replace_tables-4650"><span class="linenos">4650</span></a> -</span><span id="replace_tables-4651"><a href="#replace_tables-4651"><span class="linenos">4651</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_tables</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="replace_tables-4683"><a href="#replace_tables-4683"><span class="linenos">4683</span></a><span class="k">def</span> <span class="nf">replace_tables</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">mapping</span><span class="p">):</span> +</span><span id="replace_tables-4684"><a href="#replace_tables-4684"><span class="linenos">4684</span></a><span class="w"> </span><span class="sd">"""Replace all tables in expression according to the mapping.</span> +</span><span id="replace_tables-4685"><a href="#replace_tables-4685"><span class="linenos">4685</span></a> +</span><span id="replace_tables-4686"><a href="#replace_tables-4686"><span class="linenos">4686</span></a><span class="sd"> Args:</span> +</span><span id="replace_tables-4687"><a href="#replace_tables-4687"><span class="linenos">4687</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> +</span><span id="replace_tables-4688"><a href="#replace_tables-4688"><span class="linenos">4688</span></a><span class="sd"> mapping (Dict[str, str]): mapping of table names.</span> +</span><span id="replace_tables-4689"><a href="#replace_tables-4689"><span class="linenos">4689</span></a> +</span><span id="replace_tables-4690"><a href="#replace_tables-4690"><span class="linenos">4690</span></a><span class="sd"> Examples:</span> +</span><span id="replace_tables-4691"><a href="#replace_tables-4691"><span class="linenos">4691</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="replace_tables-4692"><a href="#replace_tables-4692"><span class="linenos">4692</span></a><span class="sd"> >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()</span> +</span><span id="replace_tables-4693"><a href="#replace_tables-4693"><span class="linenos">4693</span></a><span class="sd"> 'SELECT * FROM c'</span> +</span><span id="replace_tables-4694"><a href="#replace_tables-4694"><span class="linenos">4694</span></a> +</span><span id="replace_tables-4695"><a href="#replace_tables-4695"><span class="linenos">4695</span></a><span class="sd"> Returns:</span> +</span><span id="replace_tables-4696"><a href="#replace_tables-4696"><span class="linenos">4696</span></a><span class="sd"> The mapped expression.</span> +</span><span id="replace_tables-4697"><a href="#replace_tables-4697"><span class="linenos">4697</span></a><span class="sd"> """</span> +</span><span id="replace_tables-4698"><a href="#replace_tables-4698"><span class="linenos">4698</span></a> +</span><span id="replace_tables-4699"><a href="#replace_tables-4699"><span class="linenos">4699</span></a> <span class="k">def</span> <span class="nf">_replace_tables</span><span class="p">(</span><span class="n">node</span><span class="p">):</span> +</span><span id="replace_tables-4700"><a href="#replace_tables-4700"><span class="linenos">4700</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="replace_tables-4701"><a href="#replace_tables-4701"><span class="linenos">4701</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">mapping</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">))</span> +</span><span id="replace_tables-4702"><a href="#replace_tables-4702"><span class="linenos">4702</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="replace_tables-4703"><a href="#replace_tables-4703"><span class="linenos">4703</span></a> <span class="k">return</span> <span class="n">to_table</span><span class="p">(</span> +</span><span id="replace_tables-4704"><a href="#replace_tables-4704"><span class="linenos">4704</span></a> <span class="n">new_name</span><span class="p">,</span> +</span><span id="replace_tables-4705"><a href="#replace_tables-4705"><span class="linenos">4705</span></a> <span class="o">**</span><span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">node</span><span class="o">.</span><span class="n">args</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">k</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">"this"</span><span class="p">,</span> <span class="s2">"db"</span><span class="p">,</span> <span class="s2">"catalog"</span><span class="p">)},</span> +</span><span id="replace_tables-4706"><a href="#replace_tables-4706"><span class="linenos">4706</span></a> <span class="p">)</span> +</span><span id="replace_tables-4707"><a href="#replace_tables-4707"><span class="linenos">4707</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="replace_tables-4708"><a href="#replace_tables-4708"><span class="linenos">4708</span></a> +</span><span id="replace_tables-4709"><a href="#replace_tables-4709"><span class="linenos">4709</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_tables</span><span class="p">)</span> </span></pre></div> @@ -40525,39 +41407,39 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#replace_placeholders"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="replace_placeholders-4654"><a href="#replace_placeholders-4654"><span class="linenos">4654</span></a><span class="k">def</span> <span class="nf">replace_placeholders</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="replace_placeholders-4655"><a href="#replace_placeholders-4655"><span class="linenos">4655</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> -</span><span id="replace_placeholders-4656"><a href="#replace_placeholders-4656"><span class="linenos">4656</span></a> -</span><span id="replace_placeholders-4657"><a href="#replace_placeholders-4657"><span class="linenos">4657</span></a><span class="sd"> Args:</span> -</span><span id="replace_placeholders-4658"><a href="#replace_placeholders-4658"><span class="linenos">4658</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> -</span><span id="replace_placeholders-4659"><a href="#replace_placeholders-4659"><span class="linenos">4659</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> -</span><span id="replace_placeholders-4660"><a href="#replace_placeholders-4660"><span class="linenos">4660</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> -</span><span id="replace_placeholders-4661"><a href="#replace_placeholders-4661"><span class="linenos">4661</span></a> -</span><span id="replace_placeholders-4662"><a href="#replace_placeholders-4662"><span class="linenos">4662</span></a><span class="sd"> Examples:</span> -</span><span id="replace_placeholders-4663"><a href="#replace_placeholders-4663"><span class="linenos">4663</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> -</span><span id="replace_placeholders-4664"><a href="#replace_placeholders-4664"><span class="linenos">4664</span></a><span class="sd"> >>> replace_placeholders(</span> -</span><span id="replace_placeholders-4665"><a href="#replace_placeholders-4665"><span class="linenos">4665</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"), "a", "b", tbl="foo"</span> -</span><span id="replace_placeholders-4666"><a href="#replace_placeholders-4666"><span class="linenos">4666</span></a><span class="sd"> ... ).sql()</span> -</span><span id="replace_placeholders-4667"><a href="#replace_placeholders-4667"><span class="linenos">4667</span></a><span class="sd"> 'SELECT * FROM foo WHERE a = b'</span> -</span><span id="replace_placeholders-4668"><a href="#replace_placeholders-4668"><span class="linenos">4668</span></a> -</span><span id="replace_placeholders-4669"><a href="#replace_placeholders-4669"><span class="linenos">4669</span></a><span class="sd"> Returns:</span> -</span><span id="replace_placeholders-4670"><a href="#replace_placeholders-4670"><span class="linenos">4670</span></a><span class="sd"> The mapped expression.</span> -</span><span id="replace_placeholders-4671"><a href="#replace_placeholders-4671"><span class="linenos">4671</span></a><span class="sd"> """</span> -</span><span id="replace_placeholders-4672"><a href="#replace_placeholders-4672"><span class="linenos">4672</span></a> -</span><span id="replace_placeholders-4673"><a href="#replace_placeholders-4673"><span class="linenos">4673</span></a> <span class="k">def</span> <span class="nf">_replace_placeholders</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> -</span><span id="replace_placeholders-4674"><a href="#replace_placeholders-4674"><span class="linenos">4674</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Placeholder</span><span class="p">):</span> -</span><span id="replace_placeholders-4675"><a href="#replace_placeholders-4675"><span class="linenos">4675</span></a> <span class="k">if</span> <span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">:</span> -</span><span id="replace_placeholders-4676"><a href="#replace_placeholders-4676"><span class="linenos">4676</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> -</span><span id="replace_placeholders-4677"><a href="#replace_placeholders-4677"><span class="linenos">4677</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> -</span><span id="replace_placeholders-4678"><a href="#replace_placeholders-4678"><span class="linenos">4678</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> -</span><span id="replace_placeholders-4679"><a href="#replace_placeholders-4679"><span class="linenos">4679</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="replace_placeholders-4680"><a href="#replace_placeholders-4680"><span class="linenos">4680</span></a> <span class="k">try</span><span class="p">:</span> -</span><span id="replace_placeholders-4681"><a href="#replace_placeholders-4681"><span class="linenos">4681</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="nb">next</span><span class="p">(</span><span class="n">args</span><span class="p">))</span> -</span><span id="replace_placeholders-4682"><a href="#replace_placeholders-4682"><span class="linenos">4682</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> -</span><span id="replace_placeholders-4683"><a href="#replace_placeholders-4683"><span class="linenos">4683</span></a> <span class="k">pass</span> -</span><span id="replace_placeholders-4684"><a href="#replace_placeholders-4684"><span class="linenos">4684</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="replace_placeholders-4685"><a href="#replace_placeholders-4685"><span class="linenos">4685</span></a> -</span><span id="replace_placeholders-4686"><a href="#replace_placeholders-4686"><span class="linenos">4686</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_placeholders</span><span class="p">,</span> <span class="nb">iter</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="replace_placeholders-4712"><a href="#replace_placeholders-4712"><span class="linenos">4712</span></a><span class="k">def</span> <span class="nf">replace_placeholders</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="replace_placeholders-4713"><a href="#replace_placeholders-4713"><span class="linenos">4713</span></a><span class="w"> </span><span class="sd">"""Replace placeholders in an expression.</span> +</span><span id="replace_placeholders-4714"><a href="#replace_placeholders-4714"><span class="linenos">4714</span></a> +</span><span id="replace_placeholders-4715"><a href="#replace_placeholders-4715"><span class="linenos">4715</span></a><span class="sd"> Args:</span> +</span><span id="replace_placeholders-4716"><a href="#replace_placeholders-4716"><span class="linenos">4716</span></a><span class="sd"> expression (sqlglot.Expression): expression node to be transformed and replaced.</span> +</span><span id="replace_placeholders-4717"><a href="#replace_placeholders-4717"><span class="linenos">4717</span></a><span class="sd"> args: positional names that will substitute unnamed placeholders in the given order.</span> +</span><span id="replace_placeholders-4718"><a href="#replace_placeholders-4718"><span class="linenos">4718</span></a><span class="sd"> kwargs: keyword arguments that will substitute named placeholders.</span> +</span><span id="replace_placeholders-4719"><a href="#replace_placeholders-4719"><span class="linenos">4719</span></a> +</span><span id="replace_placeholders-4720"><a href="#replace_placeholders-4720"><span class="linenos">4720</span></a><span class="sd"> Examples:</span> +</span><span id="replace_placeholders-4721"><a href="#replace_placeholders-4721"><span class="linenos">4721</span></a><span class="sd"> >>> from sqlglot import exp, parse_one</span> +</span><span id="replace_placeholders-4722"><a href="#replace_placeholders-4722"><span class="linenos">4722</span></a><span class="sd"> >>> replace_placeholders(</span> +</span><span id="replace_placeholders-4723"><a href="#replace_placeholders-4723"><span class="linenos">4723</span></a><span class="sd"> ... parse_one("select * from :tbl where ? = ?"), "a", "b", tbl="foo"</span> +</span><span id="replace_placeholders-4724"><a href="#replace_placeholders-4724"><span class="linenos">4724</span></a><span class="sd"> ... ).sql()</span> +</span><span id="replace_placeholders-4725"><a href="#replace_placeholders-4725"><span class="linenos">4725</span></a><span class="sd"> 'SELECT * FROM foo WHERE a = b'</span> +</span><span id="replace_placeholders-4726"><a href="#replace_placeholders-4726"><span class="linenos">4726</span></a> +</span><span id="replace_placeholders-4727"><a href="#replace_placeholders-4727"><span class="linenos">4727</span></a><span class="sd"> Returns:</span> +</span><span id="replace_placeholders-4728"><a href="#replace_placeholders-4728"><span class="linenos">4728</span></a><span class="sd"> The mapped expression.</span> +</span><span id="replace_placeholders-4729"><a href="#replace_placeholders-4729"><span class="linenos">4729</span></a><span class="sd"> """</span> +</span><span id="replace_placeholders-4730"><a href="#replace_placeholders-4730"><span class="linenos">4730</span></a> +</span><span id="replace_placeholders-4731"><a href="#replace_placeholders-4731"><span class="linenos">4731</span></a> <span class="k">def</span> <span class="nf">_replace_placeholders</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> +</span><span id="replace_placeholders-4732"><a href="#replace_placeholders-4732"><span class="linenos">4732</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Placeholder</span><span class="p">):</span> +</span><span id="replace_placeholders-4733"><a href="#replace_placeholders-4733"><span class="linenos">4733</span></a> <span class="k">if</span> <span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">:</span> +</span><span id="replace_placeholders-4734"><a href="#replace_placeholders-4734"><span class="linenos">4734</span></a> <span class="n">new_name</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> +</span><span id="replace_placeholders-4735"><a href="#replace_placeholders-4735"><span class="linenos">4735</span></a> <span class="k">if</span> <span class="n">new_name</span><span class="p">:</span> +</span><span id="replace_placeholders-4736"><a href="#replace_placeholders-4736"><span class="linenos">4736</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="n">new_name</span><span class="p">)</span> +</span><span id="replace_placeholders-4737"><a href="#replace_placeholders-4737"><span class="linenos">4737</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="replace_placeholders-4738"><a href="#replace_placeholders-4738"><span class="linenos">4738</span></a> <span class="k">try</span><span class="p">:</span> +</span><span id="replace_placeholders-4739"><a href="#replace_placeholders-4739"><span class="linenos">4739</span></a> <span class="k">return</span> <span class="n">to_identifier</span><span class="p">(</span><span class="nb">next</span><span class="p">(</span><span class="n">args</span><span class="p">))</span> +</span><span id="replace_placeholders-4740"><a href="#replace_placeholders-4740"><span class="linenos">4740</span></a> <span class="k">except</span> <span class="ne">StopIteration</span><span class="p">:</span> +</span><span id="replace_placeholders-4741"><a href="#replace_placeholders-4741"><span class="linenos">4741</span></a> <span class="k">pass</span> +</span><span id="replace_placeholders-4742"><a href="#replace_placeholders-4742"><span class="linenos">4742</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="replace_placeholders-4743"><a href="#replace_placeholders-4743"><span class="linenos">4743</span></a> +</span><span id="replace_placeholders-4744"><a href="#replace_placeholders-4744"><span class="linenos">4744</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_replace_placeholders</span><span class="p">,</span> <span class="nb">iter</span><span class="p">(</span><span class="n">args</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> </span></pre></div> @@ -40604,34 +41486,34 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#expand"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="expand-4689"><a href="#expand-4689"><span class="linenos">4689</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">sources</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">],</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> -</span><span id="expand-4690"><a href="#expand-4690"><span class="linenos">4690</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> -</span><span id="expand-4691"><a href="#expand-4691"><span class="linenos">4691</span></a> -</span><span id="expand-4692"><a href="#expand-4692"><span class="linenos">4692</span></a><span class="sd"> Examples:</span> -</span><span id="expand-4693"><a href="#expand-4693"><span class="linenos">4693</span></a><span class="sd"> >>> from sqlglot import parse_one</span> -</span><span id="expand-4694"><a href="#expand-4694"><span class="linenos">4694</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()</span> -</span><span id="expand-4695"><a href="#expand-4695"><span class="linenos">4695</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> -</span><span id="expand-4696"><a href="#expand-4696"><span class="linenos">4696</span></a> -</span><span id="expand-4697"><a href="#expand-4697"><span class="linenos">4697</span></a><span class="sd"> Args:</span> -</span><span id="expand-4698"><a href="#expand-4698"><span class="linenos">4698</span></a><span class="sd"> expression: The expression to expand.</span> -</span><span id="expand-4699"><a href="#expand-4699"><span class="linenos">4699</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> -</span><span id="expand-4700"><a href="#expand-4700"><span class="linenos">4700</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> -</span><span id="expand-4701"><a href="#expand-4701"><span class="linenos">4701</span></a> -</span><span id="expand-4702"><a href="#expand-4702"><span class="linenos">4702</span></a><span class="sd"> Returns:</span> -</span><span id="expand-4703"><a href="#expand-4703"><span class="linenos">4703</span></a><span class="sd"> The transformed expression.</span> -</span><span id="expand-4704"><a href="#expand-4704"><span class="linenos">4704</span></a><span class="sd"> """</span> -</span><span id="expand-4705"><a href="#expand-4705"><span class="linenos">4705</span></a> -</span><span id="expand-4706"><a href="#expand-4706"><span class="linenos">4706</span></a> <span class="k">def</span> <span class="nf">_expand</span><span class="p">(</span><span class="n">node</span><span class="p">:</span> <span class="n">Expression</span><span class="p">):</span> -</span><span id="expand-4707"><a href="#expand-4707"><span class="linenos">4707</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> -</span><span id="expand-4708"><a href="#expand-4708"><span class="linenos">4708</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> -</span><span id="expand-4709"><a href="#expand-4709"><span class="linenos">4709</span></a> <span class="n">source</span> <span class="o">=</span> <span class="n">sources</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> -</span><span id="expand-4710"><a href="#expand-4710"><span class="linenos">4710</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> -</span><span id="expand-4711"><a href="#expand-4711"><span class="linenos">4711</span></a> <span class="n">subquery</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="n">name</span><span class="p">)</span> -</span><span id="expand-4712"><a href="#expand-4712"><span class="linenos">4712</span></a> <span class="n">subquery</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[</span><span class="sa">f</span><span class="s2">"source: </span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">"</span><span class="p">]</span> -</span><span id="expand-4713"><a href="#expand-4713"><span class="linenos">4713</span></a> <span class="k">return</span> <span class="n">subquery</span> -</span><span id="expand-4714"><a href="#expand-4714"><span class="linenos">4714</span></a> <span class="k">return</span> <span class="n">node</span> -</span><span id="expand-4715"><a href="#expand-4715"><span class="linenos">4715</span></a> -</span><span id="expand-4716"><a href="#expand-4716"><span class="linenos">4716</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_expand</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="expand-4747"><a href="#expand-4747"><span class="linenos">4747</span></a><span class="k">def</span> <span class="nf">expand</span><span class="p">(</span><span class="n">expression</span><span class="p">:</span> <span class="n">Expression</span><span class="p">,</span> <span class="n">sources</span><span class="p">:</span> <span class="n">t</span><span class="o">.</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">Subqueryable</span><span class="p">],</span> <span class="n">copy</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="n">Expression</span><span class="p">:</span> +</span><span id="expand-4748"><a href="#expand-4748"><span class="linenos">4748</span></a><span class="w"> </span><span class="sd">"""Transforms an expression by expanding all referenced sources into subqueries.</span> +</span><span id="expand-4749"><a href="#expand-4749"><span class="linenos">4749</span></a> +</span><span id="expand-4750"><a href="#expand-4750"><span class="linenos">4750</span></a><span class="sd"> Examples:</span> +</span><span id="expand-4751"><a href="#expand-4751"><span class="linenos">4751</span></a><span class="sd"> >>> from sqlglot import parse_one</span> +</span><span id="expand-4752"><a href="#expand-4752"><span class="linenos">4752</span></a><span class="sd"> >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()</span> +</span><span id="expand-4753"><a href="#expand-4753"><span class="linenos">4753</span></a><span class="sd"> 'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'</span> +</span><span id="expand-4754"><a href="#expand-4754"><span class="linenos">4754</span></a> +</span><span id="expand-4755"><a href="#expand-4755"><span class="linenos">4755</span></a><span class="sd"> Args:</span> +</span><span id="expand-4756"><a href="#expand-4756"><span class="linenos">4756</span></a><span class="sd"> expression: The expression to expand.</span> +</span><span id="expand-4757"><a href="#expand-4757"><span class="linenos">4757</span></a><span class="sd"> sources: A dictionary of name to Subqueryables.</span> +</span><span id="expand-4758"><a href="#expand-4758"><span class="linenos">4758</span></a><span class="sd"> copy: Whether or not to copy the expression during transformation. Defaults to True.</span> +</span><span id="expand-4759"><a href="#expand-4759"><span class="linenos">4759</span></a> +</span><span id="expand-4760"><a href="#expand-4760"><span class="linenos">4760</span></a><span class="sd"> Returns:</span> +</span><span id="expand-4761"><a href="#expand-4761"><span class="linenos">4761</span></a><span class="sd"> The transformed expression.</span> +</span><span id="expand-4762"><a href="#expand-4762"><span class="linenos">4762</span></a><span class="sd"> """</span> +</span><span id="expand-4763"><a href="#expand-4763"><span class="linenos">4763</span></a> +</span><span id="expand-4764"><a href="#expand-4764"><span class="linenos">4764</span></a> <span class="k">def</span> <span class="nf">_expand</span><span class="p">(</span><span class="n">node</span><span class="p">:</span> <span class="n">Expression</span><span class="p">):</span> +</span><span id="expand-4765"><a href="#expand-4765"><span class="linenos">4765</span></a> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">node</span><span class="p">,</span> <span class="n">Table</span><span class="p">):</span> +</span><span id="expand-4766"><a href="#expand-4766"><span class="linenos">4766</span></a> <span class="n">name</span> <span class="o">=</span> <span class="n">table_name</span><span class="p">(</span><span class="n">node</span><span class="p">)</span> +</span><span id="expand-4767"><a href="#expand-4767"><span class="linenos">4767</span></a> <span class="n">source</span> <span class="o">=</span> <span class="n">sources</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> +</span><span id="expand-4768"><a href="#expand-4768"><span class="linenos">4768</span></a> <span class="k">if</span> <span class="n">source</span><span class="p">:</span> +</span><span id="expand-4769"><a href="#expand-4769"><span class="linenos">4769</span></a> <span class="n">subquery</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">subquery</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">alias</span> <span class="ow">or</span> <span class="n">name</span><span class="p">)</span> +</span><span id="expand-4770"><a href="#expand-4770"><span class="linenos">4770</span></a> <span class="n">subquery</span><span class="o">.</span><span class="n">comments</span> <span class="o">=</span> <span class="p">[</span><span class="sa">f</span><span class="s2">"source: </span><span class="si">{</span><span class="n">name</span><span class="si">}</span><span class="s2">"</span><span class="p">]</span> +</span><span id="expand-4771"><a href="#expand-4771"><span class="linenos">4771</span></a> <span class="k">return</span> <span class="n">subquery</span> +</span><span id="expand-4772"><a href="#expand-4772"><span class="linenos">4772</span></a> <span class="k">return</span> <span class="n">node</span> +</span><span id="expand-4773"><a href="#expand-4773"><span class="linenos">4773</span></a> +</span><span id="expand-4774"><a href="#expand-4774"><span class="linenos">4774</span></a> <span class="k">return</span> <span class="n">expression</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">_expand</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span> </span></pre></div> @@ -40676,51 +41558,51 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#func"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="func-4719"><a href="#func-4719"><span class="linenos">4719</span></a><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Func</span><span class="p">:</span> -</span><span id="func-4720"><a href="#func-4720"><span class="linenos">4720</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="func-4721"><a href="#func-4721"><span class="linenos">4721</span></a><span class="sd"> Returns a Func expression.</span> -</span><span id="func-4722"><a href="#func-4722"><span class="linenos">4722</span></a> -</span><span id="func-4723"><a href="#func-4723"><span class="linenos">4723</span></a><span class="sd"> Examples:</span> -</span><span id="func-4724"><a href="#func-4724"><span class="linenos">4724</span></a><span class="sd"> >>> func("abs", 5).sql()</span> -</span><span id="func-4725"><a href="#func-4725"><span class="linenos">4725</span></a><span class="sd"> 'ABS(5)'</span> -</span><span id="func-4726"><a href="#func-4726"><span class="linenos">4726</span></a> -</span><span id="func-4727"><a href="#func-4727"><span class="linenos">4727</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> -</span><span id="func-4728"><a href="#func-4728"><span class="linenos">4728</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> -</span><span id="func-4729"><a href="#func-4729"><span class="linenos">4729</span></a> -</span><span id="func-4730"><a href="#func-4730"><span class="linenos">4730</span></a><span class="sd"> Args:</span> -</span><span id="func-4731"><a href="#func-4731"><span class="linenos">4731</span></a><span class="sd"> name: the name of the function to build.</span> -</span><span id="func-4732"><a href="#func-4732"><span class="linenos">4732</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> -</span><span id="func-4733"><a href="#func-4733"><span class="linenos">4733</span></a><span class="sd"> dialect: the source dialect.</span> -</span><span id="func-4734"><a href="#func-4734"><span class="linenos">4734</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> -</span><span id="func-4735"><a href="#func-4735"><span class="linenos">4735</span></a> -</span><span id="func-4736"><a href="#func-4736"><span class="linenos">4736</span></a><span class="sd"> Note:</span> -</span><span id="func-4737"><a href="#func-4737"><span class="linenos">4737</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> -</span><span id="func-4738"><a href="#func-4738"><span class="linenos">4738</span></a> -</span><span id="func-4739"><a href="#func-4739"><span class="linenos">4739</span></a><span class="sd"> Returns:</span> -</span><span id="func-4740"><a href="#func-4740"><span class="linenos">4740</span></a><span class="sd"> An instance of the function of interest, or an anonymous function, if `name` doesn't</span> -</span><span id="func-4741"><a href="#func-4741"><span class="linenos">4741</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> -</span><span id="func-4742"><a href="#func-4742"><span class="linenos">4742</span></a><span class="sd"> """</span> -</span><span id="func-4743"><a href="#func-4743"><span class="linenos">4743</span></a> <span class="k">if</span> <span class="n">args</span> <span class="ow">and</span> <span class="n">kwargs</span><span class="p">:</span> -</span><span id="func-4744"><a href="#func-4744"><span class="linenos">4744</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Can't use both args and kwargs to instantiate a function."</span><span class="p">)</span> -</span><span id="func-4745"><a href="#func-4745"><span class="linenos">4745</span></a> -</span><span id="func-4746"><a href="#func-4746"><span class="linenos">4746</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects.dialect</span> <span class="kn">import</span> <span class="n">Dialect</span> -</span><span id="func-4747"><a href="#func-4747"><span class="linenos">4747</span></a> -</span><span id="func-4748"><a href="#func-4748"><span class="linenos">4748</span></a> <span class="n">args</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">convert</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">)</span> -</span><span id="func-4749"><a href="#func-4749"><span class="linenos">4749</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> -</span><span id="func-4750"><a href="#func-4750"><span class="linenos">4750</span></a> -</span><span id="func-4751"><a href="#func-4751"><span class="linenos">4751</span></a> <span class="n">parser</span> <span class="o">=</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">parser</span><span class="p">()</span> -</span><span id="func-4752"><a href="#func-4752"><span class="linenos">4752</span></a> <span class="n">from_args_list</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> -</span><span id="func-4753"><a href="#func-4753"><span class="linenos">4753</span></a> -</span><span id="func-4754"><a href="#func-4754"><span class="linenos">4754</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> -</span><span id="func-4755"><a href="#func-4755"><span class="linenos">4755</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">from_args_list</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="n">from_args_list</span><span class="o">.</span><span class="vm">__self__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="c1"># type: ignore</span> -</span><span id="func-4756"><a href="#func-4756"><span class="linenos">4756</span></a> <span class="k">else</span><span class="p">:</span> -</span><span id="func-4757"><a href="#func-4757"><span class="linenos">4757</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">kwargs</span> <span class="ow">or</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="n">args</span><span class="p">}</span> -</span><span id="func-4758"><a href="#func-4758"><span class="linenos">4758</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">Anonymous</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> -</span><span id="func-4759"><a href="#func-4759"><span class="linenos">4759</span></a> -</span><span id="func-4760"><a href="#func-4760"><span class="linenos">4760</span></a> <span class="k">for</span> <span class="n">error_message</span> <span class="ow">in</span> <span class="n">function</span><span class="o">.</span><span class="n">error_messages</span><span class="p">(</span><span class="n">args</span><span class="p">):</span> -</span><span id="func-4761"><a href="#func-4761"><span class="linenos">4761</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_message</span><span class="p">)</span> -</span><span id="func-4762"><a href="#func-4762"><span class="linenos">4762</span></a> -</span><span id="func-4763"><a href="#func-4763"><span class="linenos">4763</span></a> <span class="k">return</span> <span class="n">function</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="func-4777"><a href="#func-4777"><span class="linenos">4777</span></a><span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="n">dialect</span><span class="p">:</span> <span class="n">DialectType</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="o">-></span> <span class="n">Func</span><span class="p">:</span> +</span><span id="func-4778"><a href="#func-4778"><span class="linenos">4778</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="func-4779"><a href="#func-4779"><span class="linenos">4779</span></a><span class="sd"> Returns a Func expression.</span> +</span><span id="func-4780"><a href="#func-4780"><span class="linenos">4780</span></a> +</span><span id="func-4781"><a href="#func-4781"><span class="linenos">4781</span></a><span class="sd"> Examples:</span> +</span><span id="func-4782"><a href="#func-4782"><span class="linenos">4782</span></a><span class="sd"> >>> func("abs", 5).sql()</span> +</span><span id="func-4783"><a href="#func-4783"><span class="linenos">4783</span></a><span class="sd"> 'ABS(5)'</span> +</span><span id="func-4784"><a href="#func-4784"><span class="linenos">4784</span></a> +</span><span id="func-4785"><a href="#func-4785"><span class="linenos">4785</span></a><span class="sd"> >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()</span> +</span><span id="func-4786"><a href="#func-4786"><span class="linenos">4786</span></a><span class="sd"> 'CAST(5 AS DOUBLE)'</span> +</span><span id="func-4787"><a href="#func-4787"><span class="linenos">4787</span></a> +</span><span id="func-4788"><a href="#func-4788"><span class="linenos">4788</span></a><span class="sd"> Args:</span> +</span><span id="func-4789"><a href="#func-4789"><span class="linenos">4789</span></a><span class="sd"> name: the name of the function to build.</span> +</span><span id="func-4790"><a href="#func-4790"><span class="linenos">4790</span></a><span class="sd"> args: the args used to instantiate the function of interest.</span> +</span><span id="func-4791"><a href="#func-4791"><span class="linenos">4791</span></a><span class="sd"> dialect: the source dialect.</span> +</span><span id="func-4792"><a href="#func-4792"><span class="linenos">4792</span></a><span class="sd"> kwargs: the kwargs used to instantiate the function of interest.</span> +</span><span id="func-4793"><a href="#func-4793"><span class="linenos">4793</span></a> +</span><span id="func-4794"><a href="#func-4794"><span class="linenos">4794</span></a><span class="sd"> Note:</span> +</span><span id="func-4795"><a href="#func-4795"><span class="linenos">4795</span></a><span class="sd"> The arguments `args` and `kwargs` are mutually exclusive.</span> +</span><span id="func-4796"><a href="#func-4796"><span class="linenos">4796</span></a> +</span><span id="func-4797"><a href="#func-4797"><span class="linenos">4797</span></a><span class="sd"> Returns:</span> +</span><span id="func-4798"><a href="#func-4798"><span class="linenos">4798</span></a><span class="sd"> An instance of the function of interest, or an anonymous function, if `name` doesn't</span> +</span><span id="func-4799"><a href="#func-4799"><span class="linenos">4799</span></a><span class="sd"> correspond to an existing `sqlglot.expressions.Func` class.</span> +</span><span id="func-4800"><a href="#func-4800"><span class="linenos">4800</span></a><span class="sd"> """</span> +</span><span id="func-4801"><a href="#func-4801"><span class="linenos">4801</span></a> <span class="k">if</span> <span class="n">args</span> <span class="ow">and</span> <span class="n">kwargs</span><span class="p">:</span> +</span><span id="func-4802"><a href="#func-4802"><span class="linenos">4802</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Can't use both args and kwargs to instantiate a function."</span><span class="p">)</span> +</span><span id="func-4803"><a href="#func-4803"><span class="linenos">4803</span></a> +</span><span id="func-4804"><a href="#func-4804"><span class="linenos">4804</span></a> <span class="kn">from</span> <span class="nn">sqlglot.dialects.dialect</span> <span class="kn">import</span> <span class="n">Dialect</span> +</span><span id="func-4805"><a href="#func-4805"><span class="linenos">4805</span></a> +</span><span id="func-4806"><a href="#func-4806"><span class="linenos">4806</span></a> <span class="n">args</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="n">convert</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">)</span> +</span><span id="func-4807"><a href="#func-4807"><span class="linenos">4807</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span> <span class="n">convert</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span> +</span><span id="func-4808"><a href="#func-4808"><span class="linenos">4808</span></a> +</span><span id="func-4809"><a href="#func-4809"><span class="linenos">4809</span></a> <span class="n">parser</span> <span class="o">=</span> <span class="n">Dialect</span><span class="o">.</span><span class="n">get_or_raise</span><span class="p">(</span><span class="n">dialect</span><span class="p">)()</span><span class="o">.</span><span class="n">parser</span><span class="p">()</span> +</span><span id="func-4810"><a href="#func-4810"><span class="linenos">4810</span></a> <span class="n">from_args_list</span> <span class="o">=</span> <span class="n">parser</span><span class="o">.</span><span class="n">FUNCTIONS</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">name</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span> +</span><span id="func-4811"><a href="#func-4811"><span class="linenos">4811</span></a> +</span><span id="func-4812"><a href="#func-4812"><span class="linenos">4812</span></a> <span class="k">if</span> <span class="n">from_args_list</span><span class="p">:</span> +</span><span id="func-4813"><a href="#func-4813"><span class="linenos">4813</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">from_args_list</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="n">from_args_list</span><span class="o">.</span><span class="vm">__self__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="c1"># type: ignore</span> +</span><span id="func-4814"><a href="#func-4814"><span class="linenos">4814</span></a> <span class="k">else</span><span class="p">:</span> +</span><span id="func-4815"><a href="#func-4815"><span class="linenos">4815</span></a> <span class="n">kwargs</span> <span class="o">=</span> <span class="n">kwargs</span> <span class="ow">or</span> <span class="p">{</span><span class="s2">"expressions"</span><span class="p">:</span> <span class="n">args</span><span class="p">}</span> +</span><span id="func-4816"><a href="#func-4816"><span class="linenos">4816</span></a> <span class="n">function</span> <span class="o">=</span> <span class="n">Anonymous</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> +</span><span id="func-4817"><a href="#func-4817"><span class="linenos">4817</span></a> +</span><span id="func-4818"><a href="#func-4818"><span class="linenos">4818</span></a> <span class="k">for</span> <span class="n">error_message</span> <span class="ow">in</span> <span class="n">function</span><span class="o">.</span><span class="n">error_messages</span><span class="p">(</span><span class="n">args</span><span class="p">):</span> +</span><span id="func-4819"><a href="#func-4819"><span class="linenos">4819</span></a> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="n">error_message</span><span class="p">)</span> +</span><span id="func-4820"><a href="#func-4820"><span class="linenos">4820</span></a> +</span><span id="func-4821"><a href="#func-4821"><span class="linenos">4821</span></a> <span class="k">return</span> <span class="n">function</span> </span></pre></div> @@ -40778,11 +41660,11 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#true"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="true-4766"><a href="#true-4766"><span class="linenos">4766</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">():</span> -</span><span id="true-4767"><a href="#true-4767"><span class="linenos">4767</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="true-4768"><a href="#true-4768"><span class="linenos">4768</span></a><span class="sd"> Returns a true Boolean expression.</span> -</span><span id="true-4769"><a href="#true-4769"><span class="linenos">4769</span></a><span class="sd"> """</span> -</span><span id="true-4770"><a href="#true-4770"><span class="linenos">4770</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="true-4824"><a href="#true-4824"><span class="linenos">4824</span></a><span class="k">def</span> <span class="nf">true</span><span class="p">():</span> +</span><span id="true-4825"><a href="#true-4825"><span class="linenos">4825</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="true-4826"><a href="#true-4826"><span class="linenos">4826</span></a><span class="sd"> Returns a true Boolean expression.</span> +</span><span id="true-4827"><a href="#true-4827"><span class="linenos">4827</span></a><span class="sd"> """</span> +</span><span id="true-4828"><a href="#true-4828"><span class="linenos">4828</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> </span></pre></div> @@ -40802,11 +41684,11 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#false"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="false-4773"><a href="#false-4773"><span class="linenos">4773</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">():</span> -</span><span id="false-4774"><a href="#false-4774"><span class="linenos">4774</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="false-4775"><a href="#false-4775"><span class="linenos">4775</span></a><span class="sd"> Returns a false Boolean expression.</span> -</span><span id="false-4776"><a href="#false-4776"><span class="linenos">4776</span></a><span class="sd"> """</span> -</span><span id="false-4777"><a href="#false-4777"><span class="linenos">4777</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="false-4831"><a href="#false-4831"><span class="linenos">4831</span></a><span class="k">def</span> <span class="nf">false</span><span class="p">():</span> +</span><span id="false-4832"><a href="#false-4832"><span class="linenos">4832</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="false-4833"><a href="#false-4833"><span class="linenos">4833</span></a><span class="sd"> Returns a false Boolean expression.</span> +</span><span id="false-4834"><a href="#false-4834"><span class="linenos">4834</span></a><span class="sd"> """</span> +</span><span id="false-4835"><a href="#false-4835"><span class="linenos">4835</span></a> <span class="k">return</span> <span class="n">Boolean</span><span class="p">(</span><span class="n">this</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> </span></pre></div> @@ -40826,11 +41708,11 @@ in order to help with type inference.</li> </div> <a class="headerlink" href="#null"></a> - <div class="pdoc-code codehilite"><pre><span></span><span id="null-4780"><a href="#null-4780"><span class="linenos">4780</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">():</span> -</span><span id="null-4781"><a href="#null-4781"><span class="linenos">4781</span></a><span class="w"> </span><span class="sd">"""</span> -</span><span id="null-4782"><a href="#null-4782"><span class="linenos">4782</span></a><span class="sd"> Returns a Null expression.</span> -</span><span id="null-4783"><a href="#null-4783"><span class="linenos">4783</span></a><span class="sd"> """</span> -</span><span id="null-4784"><a href="#null-4784"><span class="linenos">4784</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> + <div class="pdoc-code codehilite"><pre><span></span><span id="null-4838"><a href="#null-4838"><span class="linenos">4838</span></a><span class="k">def</span> <span class="nf">null</span><span class="p">():</span> +</span><span id="null-4839"><a href="#null-4839"><span class="linenos">4839</span></a><span class="w"> </span><span class="sd">"""</span> +</span><span id="null-4840"><a href="#null-4840"><span class="linenos">4840</span></a><span class="sd"> Returns a Null expression.</span> +</span><span id="null-4841"><a href="#null-4841"><span class="linenos">4841</span></a><span class="sd"> """</span> +</span><span id="null-4842"><a href="#null-4842"><span class="linenos">4842</span></a> <span class="k">return</span> <span class="n">Null</span><span class="p">()</span> </span></pre></div> @@ -40959,7 +41841,7 @@ in order to help with type inference.</li> if (doc.annotation) heading += `<span class="annotation">${doc.annotation}</span>`; if (doc.default_value) - heading += `<span class="default_value">${doc.default_value}</span>`; + heading += `<span class="default_value"> = ${doc.default_value}</span>`; break; default: heading = `<span class="name">${doc.fullname}</span>`; |